Crate cm_types

Source
Expand description

A crate containing common Component Manager types used in Component Manifests (.cml files and binary .cm files). These types come with serde serialization and deserialization implementations that perform the required validation.

Macros§

symmetrical_enums
Generate impl From for two trivial enums with identical values, allowing converting to/from each other. This is useful if you have a FIDL-generated enum and a hand-rolled one that contain the same values.

Structs§

BorrowedSeparatedPath
Path that separates the dirname and basename as different variables (referencing type). Convenient for / path representations that split the dirname and basename, like Fuchsia component decl.
BoundedName
A BoundedName is a Name that can have a max length of N bytes.
NamespacePath
NamespacePath is the same as Path but accepts "/" (which is also a valid namespace path).
Path
A path type used throughout Component Framework, along with its variants NamespacePath and RelativePath. Examples of use:
RelativePath
Same as Path except the path does not begin with /.
SeparatedPath
Path that separates the dirname and basename as different variables (owned type). Convenient for path representations that split the dirname and basename, like Fuchsia component decl.
Url
A component URL. The URL is validated, but represented as a string to avoid normalization and retain the original representation.
UrlScheme
A URL scheme.

Enums§

AllowedOffers
The kinds of offers that can target components in a given collection. See AllowedOffers.
Availability
Capability availability. See Availability.
DeliveryType
Specifies when the framework will open the protocol from the provider component’s outgoing directory when someone requests the capability. See DeliveryType.
DependencyType
Offered dependency type. See DependencyType.
Durability
The duration of child components in a collection. See Durability.
OnTerminate
A component instance’s recovery policy. See OnTerminate.
ParseError
The error representing a failure to parse a type from string.
StartupMode
A component instance’s startup mode. See StartupMode.
StorageId

Constants§

FLAGS_MAX_POSSIBLE_RIGHTS
This asks for the maximum possible rights that the parent connection will allow; this will include the writable and executable rights if the parent connection has them, but won’t fail if it doesn’t.
MAX_LONG_NAME_LENGTH
MAX_NAME_LENGTH
MAX_PATH_LENGTH
MAX_URL_LENGTH

Traits§

IterablePath
Trait implemented by path types that provides an API to iterate over path segments.

Type Aliases§

LongName
A Name with a higher string capacity of MAX_LONG_NAME_LENGTH.
Name
A name that can refer to a component, collection, or other entity in the Component Manifest. Its length is bounded to MAX_NAME_LENGTH.