Struct ComponentData
pub struct ComponentData {
pub namespace: Option<String>,
pub annotations: Option<Vec<Annotation>>,
/* private fields */
}
Expand description
Data known to a component, but not exposed to the platform, to attach to feedback reports.
Fields§
§namespace: Option<String>
The top-level namespace associated with the data:
- Is intended to group related data together and reduce data key collisions across namespaces.
- May be shared by multiple clients, e.g., there could be multiple clients within the same component or across components that want to expose related data and they would all use the same namespace.
- Will be prefixed to every data key passed within that namespace in all feedback reports, e.g., the annotation “version” would appear as “foo.version” in all feedback reports if the namespace is “foo”.
- Must match [a-z-]+, i.e. only lowercase letters and hyphens or this will result in a ZX_ERR_INVALID_ARGS epitaph.
- Must not match a reserved namespace used internally for platform data, e.g., “build”, or this will result in a ZX_ERR_INVALID_ARGS epitaph. The list of reserved namespaces is internal and subject to change for now.
annotations: Option<Vec<Annotation>>
A vector of key-value string pairs, e.g., <"version", "1.2.3.45">
.
Keys:
- Should be unique as only the latest value for a given key in the vector will be considered.
- Must match [a-z-.]+, i.e. only lowercase letters, hyphens and periods. Use periods for sub-namespacing, e.g., “build.label” and “build.type”, so that related annotations are grouped together (here related to “build”) when sorted lexicographically.
Trait Implementations§
§impl Clone for ComponentData
impl Clone for ComponentData
§fn clone(&self) -> ComponentData
fn clone(&self) -> ComponentData
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more§impl Debug for ComponentData
impl Debug for ComponentData
§impl<D> Decode<ComponentData, D> for ComponentDatawhere
D: ResourceDialect,
impl<D> Decode<ComponentData, D> for ComponentDatawhere
D: ResourceDialect,
§fn new_empty() -> ComponentData
fn new_empty() -> ComponentData
Creates a valid instance of
Self
. The specific value does not matter,
since it will be overwritten by decode
.§impl Default for ComponentData
impl Default for ComponentData
§fn default() -> ComponentData
fn default() -> ComponentData
Returns the “default value” for a type. Read more
§impl<D> Encode<ComponentData, D> for &ComponentDatawhere
D: ResourceDialect,
impl<D> Encode<ComponentData, D> for &ComponentDatawhere
D: ResourceDialect,
§impl PartialEq for ComponentData
impl PartialEq for ComponentData
§impl TypeMarker for ComponentData
impl TypeMarker for ComponentData
§type Owned = ComponentData
type Owned = ComponentData
The owned Rust type which this FIDL type decodes into.
§fn inline_align(_context: Context) -> usize
fn inline_align(_context: Context) -> usize
Returns the minimum required alignment of the inline portion of the
encoded object. It must be a (nonzero) power of two.
§fn inline_size(_context: Context) -> usize
fn inline_size(_context: Context) -> usize
Returns the size of the inline portion of the encoded object, including
padding for alignment. Must be a multiple of
inline_align
.§fn encode_is_copy() -> bool
fn encode_is_copy() -> bool
Returns true if the memory layout of
Self::Owned
matches the FIDL wire
format and encoding requires no validation. When true, we can optimize
encoding arrays and vectors of Self::Owned
to a single memcpy. Read more§fn decode_is_copy() -> bool
fn decode_is_copy() -> bool
Returns true if the memory layout of
Self::Owned
matches the FIDL wire
format and decoding requires no validation. When true, we can optimize
decoding arrays and vectors of Self::Owned
to a single memcpy.§impl ValueTypeMarker for ComponentData
impl ValueTypeMarker for ComponentData
§type Borrowed<'a> = &'a ComponentData
type Borrowed<'a> = &'a ComponentData
The Rust type to use for encoding. This is a particular
Encode<Self>
type cheaply obtainable from &Self::Owned
. There are three cases: Read more§fn borrow(
value: &<ComponentData as TypeMarker>::Owned,
) -> <ComponentData as ValueTypeMarker>::Borrowed<'_>
fn borrow( value: &<ComponentData as TypeMarker>::Owned, ) -> <ComponentData as ValueTypeMarker>::Borrowed<'_>
Cheaply converts from
&Self::Owned
to Self::Borrowed
.impl Persistable for ComponentData
impl StructuralPartialEq for ComponentData
Auto Trait Implementations§
impl Freeze for ComponentData
impl RefUnwindSafe for ComponentData
impl Send for ComponentData
impl Sync for ComponentData
impl Unpin for ComponentData
impl UnwindSafe for ComponentData
Blanket Implementations§
§impl<T> Body for Twhere
T: Persistable,
impl<T> Body for Twhere
T: Persistable,
§type MarkerAtTopLevel = T
type MarkerAtTopLevel = T
The marker type to use when the body is at the top-level.
§type MarkerInResultUnion = T
type MarkerInResultUnion = T
The marker type to use when the body is nested in a result union.
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