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 try_input_buffer(initial: usize, max: usize) -> AttributeResult<Self>
pub fn try_input_buffer(initial: usize, max: usize) -> AttributeResult<Self>
Fallible constructor for 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 batch_size(size: usize) -> Self
pub fn batch_size(size: usize) -> Self
A set holding a single Attribute::BatchSize hint.
A1 records this in execution reports; batch execution semantics are added by later M14 rungs.
Sourcepub fn try_batch_size(size: usize) -> AttributeResult<Self>
pub fn try_batch_size(size: usize) -> AttributeResult<Self>
Fallible constructor for a single Attribute::BatchSize hint.
Sourcepub fn parallelism(parallelism: usize) -> Self
pub fn parallelism(parallelism: usize) -> Self
A set holding a single Attribute::Parallelism hint.
A1 records this in execution reports; per-node parallel execution semantics are added by later M14 rungs.
Sourcepub fn try_parallelism(parallelism: usize) -> AttributeResult<Self>
pub fn try_parallelism(parallelism: usize) -> AttributeResult<Self>
Fallible constructor for a single Attribute::Parallelism hint.
Sourcepub fn fusion(fusion: Fusion) -> Self
pub fn fusion(fusion: Fusion) -> Self
A set holding a single Attribute::Fusion preference.
Sourcepub fn metrics_level(level: MetricsLevel) -> Self
pub fn metrics_level(level: MetricsLevel) -> Self
A set holding a single Attribute::MetricsLevel preference.
Sourcepub fn kernel_backend(backend: KernelBackend) -> Self
pub fn kernel_backend(backend: KernelBackend) -> Self
A set holding a single Attribute::KernelBackend preference.
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 validate(&self) -> AttributeResult<()>
pub fn validate(&self) -> AttributeResult<()>
Validate every attribute in this bag.
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 batch_size_hint(&self) -> Option<usize>
pub fn batch_size_hint(&self) -> Option<usize>
The first Attribute::BatchSize hint, if any.
Sourcepub fn parallelism_hint(&self) -> Option<usize>
pub fn parallelism_hint(&self) -> Option<usize>
The first Attribute::Parallelism hint, if any.
Sourcepub fn fusion_hint(&self) -> Option<Fusion>
pub fn fusion_hint(&self) -> Option<Fusion>
The first Attribute::Fusion preference, if any.
Sourcepub fn metrics_level_hint(&self) -> Option<MetricsLevel>
pub fn metrics_level_hint(&self) -> Option<MetricsLevel>
The first Attribute::MetricsLevel preference, if any.
Sourcepub fn kernel_backend_hint(&self) -> Option<KernelBackend>
pub fn kernel_backend_hint(&self) -> Option<KernelBackend>
The first Attribute::KernelBackend preference, 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
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more