[−][src]Struct sc_service::Roles
Bitmask of the roles that a node fulfills.
Methods
impl Roles
[src]
pub fn is_full(&self) -> bool
[src]
Does this role represents a client that holds full chain data locally?
pub fn is_authority(&self) -> bool
[src]
Does this role represents a client that does not participates in the consensus?
pub fn is_light(&self) -> bool
[src]
Does this role represents a client that does not hold full chain data locally?
impl Roles
[src]
pub const NONE: Roles
[src]
No network.
pub const FULL: Roles
[src]
Full node, does not participate in consensus.
pub const LIGHT: Roles
[src]
Light client node.
pub const AUTHORITY: Roles
[src]
Act as an authority
pub const fn empty() -> Roles
[src]
Returns an empty set of flags
pub const fn all() -> Roles
[src]
Returns the set containing all flags.
pub const fn bits(&self) -> u8
[src]
Returns the raw value of the flags currently stored.
pub fn from_bits(bits: u8) -> Option<Roles>
[src]
Convert from underlying bit representation, unless that representation contains bits that do not correspond to a flag.
pub const fn from_bits_truncate(bits: u8) -> Roles
[src]
Convert from underlying bit representation, dropping any bits that do not correspond to flags.
pub const unsafe fn from_bits_unchecked(bits: u8) -> Roles
[src]
Convert from underlying bit representation, preserving all bits (even those not corresponding to a defined flag).
pub const fn is_empty(&self) -> bool
[src]
Returns true
if no flags are currently stored.
pub const fn is_all(&self) -> bool
[src]
Returns true
if all flags are currently set.
pub const fn intersects(&self, other: Roles) -> bool
[src]
Returns true
if there are flags common to both self
and other
.
pub const fn contains(&self, other: Roles) -> bool
[src]
Returns true
all of the flags in other
are contained within self
.
pub fn insert(&mut self, other: Roles)
[src]
Inserts the specified flags in-place.
pub fn remove(&mut self, other: Roles)
[src]
Removes the specified flags in-place.
pub fn toggle(&mut self, other: Roles)
[src]
Toggles the specified flags in-place.
pub fn set(&mut self, other: Roles, value: bool)
[src]
Inserts or removes the specified flags depending on the passed value.
Trait Implementations
impl Binary for Roles
[src]
impl BitAnd<Roles> for Roles
[src]
type Output = Roles
The resulting type after applying the &
operator.
fn bitand(self, other: Roles) -> Roles
[src]
Returns the intersection between the two sets of flags.
impl BitAndAssign<Roles> for Roles
[src]
fn bitand_assign(&mut self, other: Roles)
[src]
Disables all flags disabled in the set.
impl BitOr<Roles> for Roles
[src]
type Output = Roles
The resulting type after applying the |
operator.
fn bitor(self, other: Roles) -> Roles
[src]
Returns the union of the two sets of flags.
impl BitOrAssign<Roles> for Roles
[src]
fn bitor_assign(&mut self, other: Roles)
[src]
Adds the set of flags.
impl BitXor<Roles> for Roles
[src]
type Output = Roles
The resulting type after applying the ^
operator.
fn bitxor(self, other: Roles) -> Roles
[src]
Returns the left flags, but with all the right flags toggled.
impl BitXorAssign<Roles> for Roles
[src]
fn bitxor_assign(&mut self, other: Roles)
[src]
Toggles the set of flags.
impl Clone for Roles
[src]
impl Copy for Roles
[src]
impl Debug for Roles
[src]
impl Decode for Roles
[src]
impl Display for Roles
[src]
impl Encode for Roles
[src]
fn encode_to<T>(&self, dest: &mut T) where
T: Output,
[src]
T: Output,
fn size_hint(&self) -> usize
[src]
fn encode(&self) -> Vec<u8>
[src]
fn using_encoded<R, F>(&self, f: F) -> R where
F: FnOnce(&[u8]) -> R,
[src]
F: FnOnce(&[u8]) -> R,
impl EncodeLike<Roles> for Roles
[src]
impl Eq for Roles
[src]
impl Extend<Roles> for Roles
[src]
fn extend<T>(&mut self, iterator: T) where
T: IntoIterator<Item = Roles>,
[src]
T: IntoIterator<Item = Roles>,
impl FromIterator<Roles> for Roles
[src]
fn from_iter<T>(iterator: T) -> Roles where
T: IntoIterator<Item = Roles>,
[src]
T: IntoIterator<Item = Roles>,
impl Hash for Roles
[src]
fn hash<__H>(&self, state: &mut __H) where
__H: Hasher,
[src]
__H: Hasher,
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl LowerHex for Roles
[src]
impl Not for Roles
[src]
type Output = Roles
The resulting type after applying the !
operator.
fn not(self) -> Roles
[src]
Returns the complement of this set of flags.
impl Octal for Roles
[src]
impl Ord for Roles
[src]
fn cmp(&self, other: &Roles) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<Roles> for Roles
[src]
impl PartialOrd<Roles> for Roles
[src]
fn partial_cmp(&self, other: &Roles) -> Option<Ordering>
[src]
fn lt(&self, other: &Roles) -> bool
[src]
fn le(&self, other: &Roles) -> bool
[src]
fn gt(&self, other: &Roles) -> bool
[src]
fn ge(&self, other: &Roles) -> bool
[src]
impl StructuralEq for Roles
[src]
impl StructuralPartialEq for Roles
[src]
impl Sub<Roles> for Roles
[src]
type Output = Roles
The resulting type after applying the -
operator.
fn sub(self, other: Roles) -> Roles
[src]
Returns the set difference of the two sets of flags.
impl SubAssign<Roles> for Roles
[src]
fn sub_assign(&mut self, other: Roles)
[src]
Disables all flags enabled in the set.
impl UpperHex for Roles
[src]
Auto Trait Implementations
impl RefUnwindSafe for Roles
impl Send for Roles
impl Sync for Roles
impl Unpin for Roles
impl UnwindSafe for Roles
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> CheckedConversion for T
[src]
fn checked_from<T>(t: T) -> Option<Self> where
Self: TryFrom<T>,
[src]
Self: TryFrom<T>,
fn checked_into<T>(self) -> Option<T> where
Self: TryInto<T>,
[src]
Self: TryInto<T>,
impl<S> Codec for S where
S: Encode + Decode,
[src]
S: Encode + Decode,
impl<T, X> Decode for X where
T: Decode + Into<X>,
X: WrapperTypeDecode<Wrapped = T>,
[src]
T: Decode + Into<X>,
X: WrapperTypeDecode<Wrapped = T>,
impl<T> DecodeAll for T where
T: Decode,
[src]
T: Decode,
impl<T, X> Encode for X where
T: Encode + ?Sized,
X: WrapperTypeEncode<Target = T>,
[src]
T: Encode + ?Sized,
X: WrapperTypeEncode<Target = T>,
fn size_hint(&self) -> usize
[src]
fn using_encoded<R, F>(&self, f: F) -> R where
F: FnOnce(&[u8]) -> R,
[src]
F: FnOnce(&[u8]) -> R,
fn encode(&self) -> Vec<u8>
[src]
fn encode_to<W>(&self, dest: &mut W) where
W: Output,
[src]
W: Output,
impl<'_, '_, T> EncodeLike<&'_ &'_ T> for T where
T: Encode,
[src]
T: Encode,
impl<'_, T> EncodeLike<&'_ T> for T where
T: Encode,
[src]
T: Encode,
impl<'_, T> EncodeLike<&'_ mut T> for T where
T: Encode,
[src]
T: Encode,
impl<T> EncodeLike<Arc<T>> for T where
T: Encode,
[src]
T: Encode,
impl<T> EncodeLike<Box<T>> for T where
T: Encode,
[src]
T: Encode,
impl<'a, T> EncodeLike<Cow<'a, T>> for T where
T: Encode + ToOwned,
[src]
T: Encode + ToOwned,
impl<T> EncodeLike<Rc<T>> for T where
T: Encode,
[src]
T: Encode,
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
fn equivalent(&self, key: &K) -> bool
[src]
impl<T> Erased for T
impl<T> Error for T where
T: 'static + Send + Debug + Display,
T: 'static + Send + Debug + Display,
impl<T> ExHashT for T where
T: Hash + Eq + Debug + Clone + Send + Sync + 'static,
[src]
T: Hash + Eq + Debug + Clone + Send + Sync + 'static,
impl<T> From<T> for T
[src]
impl<S> FullCodec for S where
S: Decode + FullEncode,
[src]
S: Decode + FullEncode,
impl<S> FullEncode for S where
S: Encode + EncodeLike<S>,
[src]
S: Encode + EncodeLike<S>,
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, Outer> IsWrappedBy<Outer> for T where
Outer: AsRef<T> + AsMut<T> + From<T>,
T: From<Outer>,
[src]
Outer: AsRef<T> + AsMut<T> + From<T>,
T: From<Outer>,
fn from_ref(outer: &Outer) -> &T
[src]
Get a reference to the inner from the outer.
fn from_mut(outer: &mut Outer) -> &mut T
[src]
Get a mutable reference to the inner from the outer.
impl<T> KeyedVec for T where
T: Codec,
[src]
T: Codec,
impl<T> MaybeDebug for T where
T: Debug,
T: Debug,
impl<T> MaybeDebug for T where
T: Debug,
T: Debug,
impl<T> MaybeDisplay for T where
T: Display,
[src]
T: Display,
impl<T> MaybeHash for T where
T: Hash,
[src]
T: Hash,
impl<T> MaybeHash for T where
T: Hash,
[src]
T: Hash,
impl<T> MaybeRefUnwindSafe for T where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Member for T where
T: 'static + Clone + PartialEq<T> + Eq + Send + Sync + Debug,
[src]
T: 'static + Clone + PartialEq<T> + Eq + Send + Sync + Debug,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> SaturatedConversion for T
fn saturated_from<T>(t: T) -> Self where
Self: UniqueSaturatedFrom<T>,
Self: UniqueSaturatedFrom<T>,
fn saturated_into<T>(self) -> T where
Self: UniqueSaturatedInto<T>,
Self: UniqueSaturatedInto<T>,
impl<T> SendSyncUnwindSafe for T where
T: Send + Sync + UnwindSafe + ?Sized,
[src]
T: Send + Sync + UnwindSafe + ?Sized,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<S, T> UncheckedInto<T> for S where
T: UncheckedFrom<S>,
[src]
T: UncheckedFrom<S>,
fn unchecked_into(self) -> T
[src]
impl<T, S> UniqueSaturatedInto<T> for S where
S: TryInto<T>,
T: Bounded,
S: TryInto<T>,
T: Bounded,
fn unique_saturated_into(self) -> T
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,