pub struct ExternalOperation(/* private fields */);Expand description
A static, low-cardinality label for an operation owned outside this crate.
A crate built on the runtime reports failures of its own operations with
RuntimeOperation::External, so this crate does not need a variant for
every consumer. A label is a string literal in lowercase kebab case: it stays
aggregatable and cannot carry request, path, or configuration text.
Implementations§
Source§impl ExternalOperation
impl ExternalOperation
Sourcepub const MAX_LABEL_BYTES: usize = 64
pub const MAX_LABEL_BYTES: usize = 64
The longest accepted label, in bytes.
Sourcepub const fn new(label: &'static str) -> Self
pub const fn new(label: &'static str) -> Self
Creates a label for an operation owned outside this crate.
Define the result as a constant so an invalid label fails compilation instead of panicking at run time.
§Panics
Panics when label is empty, longer than Self::MAX_LABEL_BYTES,
starts or ends with a hyphen, or contains anything other than lowercase
ASCII letters, digits, and hyphens. Labels are programmer-owned static
identifiers, not runtime input.