Struct Collection
pub struct Collection {
pub name: Option<String>,
pub durability: Option<Durability>,
pub environment: Option<String>,
pub allowed_offers: Option<AllowedOffers>,
pub allow_long_names: Option<bool>,
pub persistent_storage: Option<bool>,
/* private fields */
}
Expand description
Statically declares a component instance collection.
Fields§
§name: Option<String>
(Required) The name of the collection. Instances created in the collection are scoped to this name.
durability: Option<Durability>
(Required) The durability of instances in the collection.
environment: Option<String>
(Optional) The environment assigned to child instances in this collection.
May be unset, in which case children in this collection will inherit the
parent component’s environment. If set, the name must reference an
environment defined in the ComponentDecl
and it must contain only the
following characters: [a-z0-9-_.].
allowed_offers: Option<AllowedOffers>
(Optional, defaults to STATIC_ONLY
) The kinds of offers that can
target the child instances in this collection.
Only components using the dynamic_offers
restricted feature may set
this field.
allow_long_names: Option<bool>
(Optional, defaults to false
) Whether child instances in this
collection can have names longer than the default length limit of 100.
Only components using the allow_long_names
restricted feature may set
this field.
persistent_storage: Option<bool>
(Optional) Whether the data in isolated storage used by dynamic child instances and their descendants will persist after the instances are destroyed. New dynamic instances inherit the previous instances’ data stores.
This setting can be overridden by a lower-level collection that is a descendant of a collection that enables/disables this setting.
This setting applies to all storage capabilities consumed by the collection components and their descendants.
The default is the value inherited from an ancestral collection if set,
otherwise false
.
Trait Implementations§
§impl Clone for Collection
impl Clone for Collection
§fn clone(&self) -> Collection
fn clone(&self) -> Collection
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more§impl Debug for Collection
impl Debug for Collection
§impl<D> Decode<Collection, D> for Collectionwhere
D: ResourceDialect,
impl<D> Decode<Collection, D> for Collectionwhere
D: ResourceDialect,
§fn new_empty() -> Collection
fn new_empty() -> Collection
Self
. The specific value does not matter,
since it will be overwritten by decode
.§impl Default for Collection
impl Default for Collection
§fn default() -> Collection
fn default() -> Collection
§impl<D> Encode<Collection, D> for &Collectionwhere
D: ResourceDialect,
impl<D> Encode<Collection, D> for &Collectionwhere
D: ResourceDialect,
§impl PartialEq for Collection
impl PartialEq for Collection
§impl TypeMarker for Collection
impl TypeMarker for Collection
§type Owned = Collection
type Owned = Collection
§fn inline_align(_context: Context) -> usize
fn inline_align(_context: Context) -> usize
§fn inline_size(_context: Context) -> usize
fn inline_size(_context: Context) -> usize
inline_align
.§fn encode_is_copy() -> bool
fn encode_is_copy() -> bool
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
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 Collection
impl ValueTypeMarker for Collection
§type Borrowed<'a> = &'a Collection
type Borrowed<'a> = &'a Collection
Encode<Self>
type cheaply obtainable from &Self::Owned
. There are three cases: Read more§fn borrow(
value: &<Collection as TypeMarker>::Owned,
) -> <Collection as ValueTypeMarker>::Borrowed<'_>
fn borrow( value: &<Collection as TypeMarker>::Owned, ) -> <Collection as ValueTypeMarker>::Borrowed<'_>
&Self::Owned
to Self::Borrowed
.