[]Struct substrate_service::config::Roles

pub struct Roles { /* fields omitted */ }

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

pub const NONE: Roles

No network.

pub const FULL: Roles

Full node, does not participate in consensus.

pub const LIGHT: Roles

Light client node.

pub const AUTHORITY: Roles

Act as an authority

pub const fn empty() -> Roles

Returns an empty set of flags

pub const fn all() -> Roles

Returns the set containing all flags.

pub const fn bits(&self) -> u8

Returns the raw value of the flags currently stored.

pub fn from_bits(bits: u8) -> Option<Roles>

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

Convert from underlying bit representation, dropping any bits that do not correspond to flags.

pub const fn is_empty(&self) -> bool

Returns true if no flags are currently stored.

pub const fn is_all(&self) -> bool

Returns true if all flags are currently set.

pub const fn intersects(&self, other: Roles) -> bool

Returns true if there are flags common to both self and other.

pub const fn contains(&self, other: Roles) -> bool

Returns true all of the flags in other are contained within self.

pub fn insert(&mut self, other: Roles)

Inserts the specified flags in-place.

pub fn remove(&mut self, other: Roles)

Removes the specified flags in-place.

pub fn toggle(&mut self, other: Roles)

Toggles the specified flags in-place.

pub fn set(&mut self, other: Roles, value: bool)

Inserts or removes the specified flags depending on the passed value.

Trait Implementations

impl Ord for Roles

fn max(self, other: Self) -> Self1.21.0[src]

Compares and returns the maximum of two values. Read more

fn min(self, other: Self) -> Self1.21.0[src]

Compares and returns the minimum of two values. Read more

fn clamp(self, min: Self, max: Self) -> Self[src]

🔬 This is a nightly-only experimental API. (clamp)

Restrict a value to a certain interval. Read more

impl SubAssign<Roles> for Roles

fn sub_assign(&mut self, other: Roles)

Disables all flags enabled in the set.

impl PartialEq<Roles> for Roles

impl Not for Roles

type Output = Roles

The resulting type after applying the ! operator.

fn not(self) -> Roles

Returns the complement of this set of flags.

impl Encode for Roles[src]

fn size_hint(&self) -> usize[src]

If possible give a hint of expected size of the encoding. Read more

fn encode(&self) -> Vec<u8>[src]

Convert self to an owned vector.

fn using_encoded<R, F>(&self, f: F) -> R where
    F: FnOnce(&[u8]) -> R, 
[src]

Convert self to a slice and then invoke the given closure with it.

impl BitXor<Roles> for Roles

type Output = Roles

The resulting type after applying the ^ operator.

fn bitxor(self, other: Roles) -> Roles

Returns the left flags, but with all the right flags toggled.

impl BitAndAssign<Roles> for Roles

fn bitand_assign(&mut self, other: Roles)

Disables all flags disabled in the set.

impl UpperHex for Roles

impl Decode for Roles[src]

impl Eq for Roles

impl BitAnd<Roles> for Roles

type Output = Roles

The resulting type after applying the & operator.

fn bitand(self, other: Roles) -> Roles

Returns the intersection between the two sets of flags.

impl Copy for Roles

impl BitXorAssign<Roles> for Roles

fn bitxor_assign(&mut self, other: Roles)

Toggles the set of flags.

impl BitOrAssign<Roles> for Roles

fn bitor_assign(&mut self, other: Roles)

Adds the set of flags.

impl Extend<Roles> for Roles

impl BitOr<Roles> for Roles

type Output = Roles

The resulting type after applying the | operator.

fn bitor(self, other: Roles) -> Roles

Returns the union of the two sets of flags.

impl EncodeLike<Roles> for Roles[src]

impl Octal for Roles

impl Debug for Roles

impl PartialOrd<Roles> for Roles

impl Hash for Roles

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl Clone for Roles

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Sub<Roles> for Roles

type Output = Roles

The resulting type after applying the - operator.

fn sub(self, other: Roles) -> Roles

Returns the set difference of the two sets of flags.

impl FromIterator<Roles> for Roles

impl Binary for Roles

impl LowerHex for Roles

Auto Trait Implementations

impl Unpin for Roles

impl Send for Roles

impl Sync for Roles

impl UnwindSafe for Roles

impl RefUnwindSafe for Roles

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T, Outer> IsWrappedBy<Outer> for T where
    Outer: AsRef<T> + AsMut<T> + From<T>,
    T: From<Outer>, 
[src]

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<S, T> UncheckedInto<T> for S where
    T: UncheckedFrom<S>, 
[src]

impl<T, X> Decode for X where
    T: Decode + Into<X>,
    X: WrapperTypeDecode<Wrapped = T>, 
[src]

impl<T, X> Encode for X where
    T: Encode + ?Sized,
    X: WrapperTypeEncode<Target = T>, 
[src]

impl<S> Codec for S where
    S: Encode + Decode
[src]

impl<'_, T> EncodeLike<&'_ T> for T where
    T: Encode
[src]

impl<T> KeyedVec for T where
    T: Codec
[src]

impl<T> DecodeAll for T where
    T: Decode
[src]

impl<T> Same<T> for T[src]

type Output = T

Should always be Self

impl<T> Erased for T[src]

impl<T> MaybeDebug for T where
    T: Debug
[src]

impl<T> MaybeDebugHash for T where
    T: Hash + Debug
[src]

impl<T> MaybeDebug for T where
    T: Debug
[src]

impl<T> MaybeDebug for T where
    T: Debug
[src]

impl<T, S> UniqueSaturatedInto<T> for S where
    S: TryInto<T>,
    T: Bounded
[src]

impl<T> CheckedConversion for T[src]

fn checked_from<T>(t: T) -> Option<Self> where
    Self: TryFrom<T>, 
[src]

Convert from a value of T into an equivalent instance of Option<Self>. Read more

fn checked_into<T>(self) -> Option<T> where
    Self: TryInto<T>, 
[src]

Consume self to return Some equivalent value of Option<T>. Read more

impl<T> SaturatedConversion for T[src]

fn saturated_from<T>(t: T) -> Self where
    Self: UniqueSaturatedFrom<T>, 
[src]

Convert from a value of T into an equivalent instance of Self. Read more

fn saturated_into<T>(self) -> T where
    Self: UniqueSaturatedInto<T>, 
[src]

Consume self to return an equivalent value of T. Read more

impl<T> MaybeDebug for T where
    T: Debug
[src]

impl<T> MaybeHash for T where
    T: Hash
[src]

impl<T> Member for T where
    T: 'static + MaybeDebug + Send + Sync + PartialEq<T> + Eq + Clone
[src]

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]

impl<T> Erased for T[src]

impl<T> SendSyncUnwindSafe for T where
    T: Send + Sync + UnwindSafe + ?Sized
[src]

impl<T> ExHashT for T where
    T: Hash + Eq + Debug + Clone + Send + Sync + 'static, 
[src]

impl<T> Parameter for T where
    T: Codec + Clone + Eq + Debug
[src]

impl<T> Hashable for T where
    T: Codec
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> Typeable for T where
    T: Any
[src]

fn get_type(&self) -> TypeId[src]

Get the TypeId of this object.