pub enum FieldValue {
U64(u64),
I64(i64),
F64(f64),
Bool(bool),
Str(&'static str),
SmallString(CompactString),
SharedString(Arc<String>),
String(String),
}Expand description
Each captured field value. Str keeps a &'static str (zero-copy
for literal field arguments), SmallString keeps the
stack-inline-up-to-24-byte CompactString (no heap for short
dynamic strings), SharedString keeps an Arc<String> for callers
that want sharing, and String is the unrestricted owned fallback.
Variants§
Implementations§
Source§impl FieldValue
impl FieldValue
Sourcepub fn to_display_string(&self) -> CompactString
pub fn to_display_string(&self) -> CompactString
Return a &str view of the value. Numeric / bool variants
format into a fresh CompactString (cheap, usually inline).
Callers that want a stable borrow should match on the variant
directly.
Trait Implementations§
Source§impl Clone for FieldValue
impl Clone for FieldValue
Source§fn clone(&self) -> FieldValue
fn clone(&self) -> FieldValue
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 moreAuto Trait Implementations§
impl Freeze for FieldValue
impl RefUnwindSafe for FieldValue
impl Send for FieldValue
impl Sync for FieldValue
impl Unpin for FieldValue
impl UnsafeUnpin for FieldValue
impl UnwindSafe for FieldValue
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