Struct rocket::fairing::Kind [−][src]
pub struct Kind(_);
Expand description
A bitset representing the kinds of callbacks a
Fairing wishes to receive.
A fairing can request any combination of any of the following kinds of callbacks:
- Attach
- Launch
- Request
- Response
Two Kind structures can be ord together to represent a combination. For
instance, to represent a fairing that is both a launch and request fairing,
use Kind::Launch | Kind::Request. Similarly, to represent a fairing that
is only an attach fairing, use Kind::Attach.
Implementations
impl Kind[src]
impl Kind[src]pub fn is(self, other: Kind) -> bool[src]
pub fn is(self, other: Kind) -> bool[src]Returns true if self is a superset of other. In other words,
returns true if all of the kinds in other are also in self.
Example
use rocket::fairing::Kind; let launch_and_req = Kind::Launch | Kind::Request; assert!(launch_and_req.is(Kind::Launch | Kind::Request)); assert!(launch_and_req.is(Kind::Launch)); assert!(launch_and_req.is(Kind::Request)); assert!(!launch_and_req.is(Kind::Response)); assert!(!launch_and_req.is(Kind::Launch | Kind::Response)); assert!(!launch_and_req.is(Kind::Launch | Kind::Request | Kind::Response));
pub fn is_exactly(self, other: Kind) -> bool[src]
pub fn is_exactly(self, other: Kind) -> bool[src]Returns true if self is exactly other.
Example
use rocket::fairing::Kind; let launch_and_req = Kind::Launch | Kind::Request; assert!(launch_and_req.is_exactly(Kind::Launch | Kind::Request)); assert!(!launch_and_req.is_exactly(Kind::Launch)); assert!(!launch_and_req.is_exactly(Kind::Request)); assert!(!launch_and_req.is_exactly(Kind::Response)); assert!(!launch_and_req.is_exactly(Kind::Launch | Kind::Response));
Trait Implementations
impl Copy for Kind[src]
Auto Trait Implementations
impl RefUnwindSafe for Kind
impl Send for Kind
impl Sync for Kind
impl Unpin for Kind
impl UnwindSafe for Kind
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]pub fn borrow_mut(&mut self) -> &mut T[src]
pub fn borrow_mut(&mut self) -> &mut T[src]Mutably borrows from an owned value. Read more
impl<T> IntoCollection<T> for T[src]
impl<T> IntoCollection<T> for T[src]pub fn into_collection<A>(self) -> SmallVec<A> where
A: Array<Item = T>, [src]
pub fn into_collection<A>(self) -> SmallVec<A> where
A: Array<Item = T>, [src]Converts self into a collection.
pub fn mapped<U, F, A>(self, f: F) -> SmallVec<A> where
F: FnMut(T) -> U,
A: Array<Item = U>, [src]
F: FnMut(T) -> U,
A: Array<Item = U>,
impl<T> Same<T> for T
impl<T> Same<T> for Ttype Output = T
type Output = TShould always be Self
impl<T> ToOwned for T where
T: Clone, [src]
impl<T> ToOwned for T where
T: Clone, [src]type Owned = T
type Owned = TThe resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn to_owned(&self) -> T[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)[src]
pub fn clone_into(&self, target: &mut T)[src]🔬 This is a nightly-only experimental API. (toowned_clone_into)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,