Struct Scope Attributes

View as Markdown

Generated from cargo doc --no-deps -p nemo-relay -p nemo-relay-adaptive -p nemo-relay-pii-redaction -p nemo-relay-ffi.

1pub struct ScopeAttributes(/* private fields */);

Bitflags that modify scope behavior and observability.

Implementations

impl ScopeAttributes

impl ScopeAttributes

PARALLEL

pub const PARALLEL: Self

Marks the scope as running in parallel with sibling work.

RELOCATABLE

pub const RELOCATABLE: Self

Marks the scope as safe to move across execution contexts.

impl ScopeAttributes

impl ScopeAttributes

empty

pub const fn empty() -> Self

Get a flags value with all bits unset.

all

pub const fn all() -> Self

Get a flags value with all known bits set.

bits

pub const fn bits(&self) -> u32

Get the underlying bits value.

The returned value is exactly the bits set in this flags value.

from_bits

pub const fn from_bits(bits: u32) -> Option<Self>

Convert from a bits value.

This method will return None if any unknown bits are set.

from_bits_truncate

pub const fn from_bits_truncate(bits: u32) -> Self

Convert from a bits value, unsetting any unknown bits.

from_bits_retain

pub const fn from_bits_retain(bits: u32) -> Self

Convert from a bits value exactly.

from_name

pub fn from_name(name: &str) -> Option<Self>

Get a flags value with the bits of a flag with the given name set.

This method will return None if name is empty or doesn’t correspond to any named flag.

is_empty

pub const fn is_empty(&self) -> bool

Whether all bits in this flags value are unset.

is_all

pub const fn is_all(&self) -> bool

Whether all known bits in this flags value are set.

intersects

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

Whether any set bits in a source flags value are also set in a target flags value.

contains

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

Whether all set bits in a source flags value are also set in a target flags value.

insert

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

The bitwise or (|) of the bits in two flags values.

remove

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

The intersection of a source flags value with the complement of a target flags value (&!).

This method is not equivalent to self & !other when other has unknown bits set. remove won’t truncate other, but the ! operator will.

toggle

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

The bitwise exclusive-or (^) of the bits in two flags values.

set

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

Call insert when value is true or remove when value is false.

intersection

pub const fn intersection(self, other: Self) -> Self

The bitwise and (&) of the bits in two flags values.

union

pub const fn union(self, other: Self) -> Self

The bitwise or (|) of the bits in two flags values.

difference

pub const fn difference(self, other: Self) -> Self

The intersection of a source flags value with the complement of a target flags value (&!).

This method is not equivalent to self & !other when other has unknown bits set. difference won’t truncate other, but the ! operator will.

symmetric_difference

pub const fn symmetric_difference(self, other: Self) -> Self

The bitwise exclusive-or (^) of the bits in two flags values.

complement

pub const fn complement(self) -> Self

The bitwise negation (!) of the bits in a flags value, truncating the result.

impl ScopeAttributes

impl ScopeAttributes

iter

pub const fn iter(&self) -> Iter<ScopeAttributes>

Yield a set of contained flags values.

Each yielded flags value will correspond to a defined named flag. Any unknown bits will be yielded together as a final flags value.

iter_names

pub const fn iter_names(&self) -> IterNames<ScopeAttributes>

Yield a set of contained named flags values.

This method is like iter, except only yields bits in contained named flags. Any unknown bits, or bits not corresponding to a contained flag will not be yielded.

Trait Implementations

impl Binary for ScopeAttributes

impl Binary for ScopeAttributes

fmt

fn fmt(&self, f: &mut Formatter<'_>) -> Result

impl BitAnd for ScopeAttributes

impl BitAnd for ScopeAttributes

bitand

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

The bitwise and (&) of the bits in two flags values.

Output

type Output = ScopeAttributes

impl BitAndAssign for ScopeAttributes

impl BitAndAssign for ScopeAttributes

bitand_assign

fn bitand_assign(&mut self, other: Self)

The bitwise and (&) of the bits in two flags values.

impl BitOr for ScopeAttributes

impl BitOr for ScopeAttributes

bitor

fn bitor(self, other: ScopeAttributes) -> Self

The bitwise or (|) of the bits in two flags values.

Output

type Output = ScopeAttributes

impl BitOrAssign for ScopeAttributes

impl BitOrAssign for ScopeAttributes

bitor_assign

fn bitor_assign(&mut self, other: Self)

The bitwise or (|) of the bits in two flags values.

impl BitXor for ScopeAttributes

impl BitXor for ScopeAttributes

bitxor

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

The bitwise exclusive-or (^) of the bits in two flags values.

Output

type Output = ScopeAttributes

impl BitXorAssign for ScopeAttributes

impl BitXorAssign for ScopeAttributes

bitxor_assign

fn bitxor_assign(&mut self, other: Self)

The bitwise exclusive-or (^) of the bits in two flags values.

impl Clone for ScopeAttributes

impl Clone for ScopeAttributes

clone

fn clone(&self) -> ScopeAttributes

clone_from

fn clone_from(&mut self, source: &Self)

impl Debug for ScopeAttributes

impl Debug for ScopeAttributes

fmt

fn fmt(&self, f: &mut Formatter<'_>) -> Result

impl<'de> Deserialize<'de> for ScopeAttributes

impl<'de> Deserialize<'de> for ScopeAttributes

deserialize

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
    __D: Deserializer<'de>,

impl Extend<ScopeAttributes> for ScopeAttributes

impl Extend<ScopeAttributes> for ScopeAttributes

extend

fn extend<T: IntoIterator<Item = Self>>(&mut self, iterator: T)

The bitwise or (|) of the bits in each flags value.

extend_one

fn extend_one(&mut self, item: A)

extend_reserve

fn extend_reserve(&mut self, additional: usize)

impl Flags for ScopeAttributes

impl Flags for ScopeAttributes

FLAGS

const FLAGS: &'static [Flag<ScopeAttributes>]

Bits

type Bits = u32

bits

fn bits(&self) -> u32

from_bits_retain

fn from_bits_retain(bits: u32) -> ScopeAttributes

empty

fn empty() -> Self

all

fn all() -> Self

known_bits

fn known_bits(&self) -> Self::Bits

unknown_bits

fn unknown_bits(&self) -> Self::Bits

contains_unknown_bits

fn contains_unknown_bits(&self) -> bool

from_bits

fn from_bits(bits: Self::Bits) -> Option<Self>

from_bits_truncate

fn from_bits_truncate(bits: Self::Bits) -> Self

from_name

fn from_name(name: &str) -> Option<Self>

iter

fn iter(&self) -> Iter<Self>

iter_names

fn iter_names(&self) -> IterNames<Self>

iter_defined_names

fn iter_defined_names() -> IterDefinedNames<Self>

is_empty

fn is_empty(&self) -> bool

is_all

fn is_all(&self) -> bool

intersects

fn intersects(&self, other: Self) -> boolwhere
    Self: Sized,

contains

fn contains(&self, other: Self) -> boolwhere
    Self: Sized,

truncate

fn truncate(&mut self)where
    Self: Sized,

insert

fn insert(&mut self, other: Self)where
    Self: Sized,

remove

fn remove(&mut self, other: Self)where
    Self: Sized,

toggle

fn toggle(&mut self, other: Self)where
    Self: Sized,

set

fn set(&mut self, other: Self, value: bool)where
    Self: Sized,

clear

fn clear(&mut self)where
    Self: Sized,

intersection

fn intersection(self, other: Self) -> Self

union

fn union(self, other: Self) -> Self

difference

fn difference(self, other: Self) -> Self

symmetric_difference

fn symmetric_difference(self, other: Self) -> Self

complement

fn complement(self) -> Self

impl FromIterator<ScopeAttributes> for ScopeAttributes

impl FromIterator<ScopeAttributes> for ScopeAttributes

from_iter

fn from_iter<T: IntoIterator<Item = Self>>(iterator: T) -> Self

The bitwise or (|) of the bits in each flags value.

impl Hash for ScopeAttributes

impl Hash for ScopeAttributes

hash

fn hash<__H: Hasher>(&self, state: &mut __H)

hash_slice

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

impl IntoIterator for ScopeAttributes

impl IntoIterator for ScopeAttributes

Item

type Item = ScopeAttributes

IntoIter

type IntoIter = Iter<ScopeAttributes>

into_iter

fn into_iter(self) -> Self::IntoIter

impl LowerHex for ScopeAttributes

impl LowerHex for ScopeAttributes

fmt

fn fmt(&self, f: &mut Formatter<'_>) -> Result

impl Not for ScopeAttributes

impl Not for ScopeAttributes

not

fn not(self) -> Self

The bitwise negation (!) of the bits in a flags value, truncating the result.

Output

type Output = ScopeAttributes

impl Octal for ScopeAttributes

impl Octal for ScopeAttributes

fmt

fn fmt(&self, f: &mut Formatter<'_>) -> Result

impl PartialEq for ScopeAttributes

impl PartialEq for ScopeAttributes

eq

fn eq(&self, other: &ScopeAttributes) -> bool

ne

fn ne(&self, other: &Rhs) -> bool

impl PublicFlags for ScopeAttributes

impl PublicFlags for ScopeAttributes

Primitive

type Primitive = u32

Internal

type Internal = InternalBitFlags

impl Serialize for ScopeAttributes

impl Serialize for ScopeAttributes

serialize

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where
    __S: Serializer,

impl Sub for ScopeAttributes

impl Sub for ScopeAttributes

sub

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

The intersection of a source flags value with the complement of a target flags value (&!).

This method is not equivalent to self & !other when other has unknown bits set. difference won’t truncate other, but the ! operator will.

Output

type Output = ScopeAttributes

impl SubAssign for ScopeAttributes

impl SubAssign for ScopeAttributes

sub_assign

fn sub_assign(&mut self, other: Self)

The intersection of a source flags value with the complement of a target flags value (&!).

This method is not equivalent to self & !other when other has unknown bits set. difference won’t truncate other, but the ! operator will.

impl UpperHex for ScopeAttributes

impl UpperHex for ScopeAttributes

fmt

fn fmt(&self, f: &mut Formatter<'_>) -> Result

impl Copy for ScopeAttributes

impl Copy for ScopeAttributes

impl Eq for ScopeAttributes

impl Eq for ScopeAttributes

impl StructuralPartialEq for ScopeAttributes

impl StructuralPartialEq for ScopeAttributes