Type Alias LogsProperty

Source
pub type LogsProperty = Property<LogsField>;
Expand description

A diagnostics hierarchy property keyed by LogsField.

Aliased Type§

enum LogsProperty {
    String(LogsField, String),
    Bytes(LogsField, Vec<u8>),
    Int(LogsField, i64),
    Uint(LogsField, u64),
    Double(LogsField, f64),
    Bool(LogsField, bool),
    DoubleArray(LogsField, ArrayContent<f64>),
    IntArray(LogsField, ArrayContent<i64>),
    UintArray(LogsField, ArrayContent<u64>),
    StringList(LogsField, Vec<String>),
}

Variants§

§

String(LogsField, String)

The value is a string.

§

Bytes(LogsField, Vec<u8>)

The value is a bytes vector.

§

Int(LogsField, i64)

The value is an integer.

§

Uint(LogsField, u64)

The value is an unsigned integer.

§

Double(LogsField, f64)

The value is a double.

§

Bool(LogsField, bool)

The value is a boolean.

§

DoubleArray(LogsField, ArrayContent<f64>)

The value is a double array.

§

IntArray(LogsField, ArrayContent<i64>)

The value is an integer array.

§

UintArray(LogsField, ArrayContent<u64>)

The value is an unsigned integer array.

§

StringList(LogsField, Vec<String>)

The value is a list of strings.

Implementations

§

impl<K> Property<K>

pub fn key(&self) -> &K

Returns the key of a property

pub fn discriminant_name(&self) -> &'static str

Returns a string indicating which variant of property this is, useful for printing debug values.

pub fn number_as_int(&self) -> Option<i64>

Return a a numeric property as a signed integer. Useful for having a single function to call when a property has been passed through JSON, potentially losing its original signedness.

Note: unsigned integers larger than isize::MAX will be returned as None. If you expect values that high, consider calling Property::int() and Property::uint() directly.

§

impl<Key> Property<Key>

pub fn int(&self) -> Option<i64>

Returns the Int value or None if the property isn’t of that type

pub fn uint(&self) -> Option<u64>

Returns the Uint value or None if the property isn’t of that type

pub fn double(&self) -> Option<f64>

Returns the Double value or None if the property isn’t of that type

pub fn boolean(&self) -> Option<bool>

Returns the Bool value or None if the property isn’t of that type

§

impl<Key> Property<Key>

pub fn string(&self) -> Option<&str>

Returns the String value or None if the property isn’t of that type

pub fn bytes(&self) -> Option<&[u8]>

Returns the Bytes value or None if the property isn’t of that type

pub fn double_array(&self) -> Option<&ArrayContent<f64>>

Returns the DoubleArray value or None if the property isn’t of that type

pub fn int_array(&self) -> Option<&ArrayContent<i64>>

Returns the IntArray value or None if the property isn’t of that type

pub fn uint_array(&self) -> Option<&ArrayContent<u64>>

Returns the UintArray value or None if the property isn’t of that type

pub fn string_list(&self) -> Option<&[String]>

Returns the StringList value or None if the property isn’t of that type

§

impl<Key> Property<Key>
where Key: AsRef<str>,

pub fn name(&self) -> &str

Returns the key of a property.

Trait Implementations

§

impl<Key> Clone for Property<Key>
where Key: Clone,

§

fn clone(&self) -> Property<Key>

Returns a copy of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
§

impl<Key> Debug for Property<Key>
where Key: Debug,

§

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

Formats the value using the given formatter. Read more
§

impl<K> Display for Property<K>
where K: AsRef<str>,

§

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

Formats the value using the given formatter. Read more
§

impl<Key> PartialEq for Property<Key>
where Key: PartialEq,

§

fn eq(&self, other: &Property<Key>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl<Key> StructuralPartialEq for Property<Key>