fuchsia_inspect::reader

Enum Property

Source
pub enum Property<Key = String> {
    String(Key, String),
    Bytes(Key, Vec<u8>),
    Int(Key, i64),
    Uint(Key, u64),
    Double(Key, f64),
    Bool(Key, bool),
    DoubleArray(Key, ArrayContent<f64>),
    IntArray(Key, ArrayContent<i64>),
    UintArray(Key, ArrayContent<u64>),
    StringList(Key, Vec<String>),
}
Expand description

A named property. Each of the fields consists of (name, value).

Key is the type of the property’s name and is typically a string. In cases where there are well known, common property names, an alternative may be used to reduce copies of the name.

Variants§

§

String(Key, String)

The value is a string.

§

Bytes(Key, Vec<u8>)

The value is a bytes vector.

§

Int(Key, i64)

The value is an integer.

§

Uint(Key, u64)

The value is an unsigned integer.

§

Double(Key, f64)

The value is a double.

§

Bool(Key, bool)

The value is a boolean.

§

DoubleArray(Key, ArrayContent<f64>)

The value is a double array.

§

IntArray(Key, ArrayContent<i64>)

The value is an integer array.

§

UintArray(Key, ArrayContent<u64>)

The value is an unsigned integer array.

§

StringList(Key, Vec<String>)

The value is a list of strings.

Implementations§

Source§

impl<Key> Property<Key>

Source

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

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

Source

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

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

Source

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

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

Source

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

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

Source§

impl<Key> Property<Key>

Source

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

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

Source

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

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

Source

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

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

Source

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

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

Source

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

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

Source

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

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

Source§

impl<K> Property<K>

Source

pub fn key(&self) -> &K

Returns the key of a property

Source

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

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

Source

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.

Source§

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

Source

pub fn name(&self) -> &str

Returns the key of a property.

Trait Implementations§

Source§

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

Source§

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
Source§

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

Source§

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

Formats the value using the given formatter. Read more
Source§

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

Source§

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

Formats the value using the given formatter. Read more
Source§

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

Source§

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.
Source§

impl<Key> StructuralPartialEq for Property<Key>

Auto Trait Implementations§

§

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

§

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

§

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

§

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

§

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

§

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

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<T, D> Encode<Ambiguous1, D> for T
where D: ResourceDialect,

§

unsafe fn encode( self, _encoder: &mut Encoder<'_, D>, _offset: usize, _depth: Depth, ) -> Result<(), Error>

Encodes the object into the encoder’s buffers. Any handles stored in the object are swapped for Handle::INVALID. Read more
§

impl<T, D> Encode<Ambiguous2, D> for T
where D: ResourceDialect,

§

unsafe fn encode( self, _encoder: &mut Encoder<'_, D>, _offset: usize, _depth: Depth, ) -> Result<(), Error>

Encodes the object into the encoder’s buffers. Any handles stored in the object are swapped for Handle::INVALID. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more