pub struct Attributes { /* private fields */ }Expand description
An ordered, immutable collection of Attributes.
Lookups return the first matching attribute; Attributes::and prepends the argument’s
attributes so the more specific bag wins. Construction never starts any work.
Implementations§
Source§impl Attributes
impl Attributes
Sourcepub fn named(name: impl Into<String>) -> Self
pub fn named(name: impl Into<String>) -> Self
A set holding a single Attribute::Name.
Sourcepub fn input_buffer(initial: usize, max: usize) -> Self
pub fn input_buffer(initial: usize, max: usize) -> Self
A set holding a single Attribute::InputBuffer hint.
Sourcepub fn dispatcher(name: impl Into<String>) -> Self
pub fn dispatcher(name: impl Into<String>) -> Self
A set holding a single Attribute::Dispatcher hint.
Sourcepub fn and(self, other: Self) -> Self
pub fn and(self, other: Self) -> Self
Combine two sets; the attributes of other take precedence on accessor lookups.
Sourcepub fn attribute_list(&self) -> &[Attribute]
pub fn attribute_list(&self) -> &[Attribute]
The underlying attributes, in lookup order (most specific first).
Sourcepub fn name(&self) -> Option<&str>
pub fn name(&self) -> Option<&str>
The first Attribute::Name, if any.
Sourcepub fn input_buffer_hint(&self) -> Option<(usize, usize)>
pub fn input_buffer_hint(&self) -> Option<(usize, usize)>
The first Attribute::InputBuffer hint as (initial, max), if any.
Sourcepub fn dispatcher_hint(&self) -> Option<&str>
pub fn dispatcher_hint(&self) -> Option<&str>
The first Attribute::Dispatcher hint, if any.
Sourcepub fn with_name(self, name: impl Into<String>) -> Self
pub fn with_name(self, name: impl Into<String>) -> Self
Return a copy with a Attribute::Name prepended so it wins Attributes::name.
Trait Implementations§
Source§impl Clone for Attributes
impl Clone for Attributes
Source§fn clone(&self) -> Attributes
fn clone(&self) -> Attributes
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Attributes
impl Debug for Attributes
Source§impl Default for Attributes
impl Default for Attributes
Source§fn default() -> Attributes
fn default() -> Attributes
Returns the “default value” for a type. Read more
impl Eq for Attributes
Source§impl PartialEq for Attributes
impl PartialEq for Attributes
Source§fn eq(&self, other: &Attributes) -> bool
fn eq(&self, other: &Attributes) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for Attributes
Auto Trait Implementations§
impl Freeze for Attributes
impl RefUnwindSafe for Attributes
impl Send for Attributes
impl Sync for Attributes
impl Unpin for Attributes
impl UnsafeUnpin for Attributes
impl UnwindSafe for Attributes
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Message for T
impl<T> Message for T
Source§fn from_boxed(m: BoxedMessage) -> Result<Self, BoxedDowncastErr>
fn from_boxed(m: BoxedMessage) -> Result<Self, BoxedDowncastErr>
Convert a BoxedMessage to this concrete type
Source§fn box_message(self, pid: &ActorId) -> Result<BoxedMessage, BoxedDowncastErr>
fn box_message(self, pid: &ActorId) -> Result<BoxedMessage, BoxedDowncastErr>
Convert this message to a BoxedMessage