Crate cml

Crate cml 

Source
Expand description

A library of common utilities used by cmc and related tools. To manually regenerate reference documentation from doc comments in this file, see the instructions at:

tools/lib/reference_doc/macro/derive-reference-doc-tests/src/test_data/README.md

Re-exports§

pub use crate::types::capability::Capability;
pub use crate::types::capability::CapabilityFromRef;
pub use crate::types::capability::SpannedCapability;
pub use crate::types::capability_id::CapabilityId;
pub use crate::types::child::Child;
pub use crate::types::child::SpannedChild;
pub use crate::types::collection::Collection;
pub use crate::types::document::Document;
pub use crate::types::document::SpannedDocument;
pub use crate::types::environment::Environment;
pub use crate::types::environment::ResolverRegistration;
pub use crate::types::expose::Expose;
pub use crate::types::expose::SpannedExpose;
pub use crate::types::offer::Offer;
pub use crate::types::offer::OfferFromRef;
pub use crate::types::offer::OfferToRef;
pub use crate::types::offer::SpannedOffer;
pub use crate::types::program::Program;
pub use crate::types::use::SpannedUse;
pub use crate::types::use::Use;
pub use crate::types::use::UseFromRef;
pub use crate::one_or_many::OneOrMany;
pub use crate::translate::CompileOptions;
pub use crate::translate::compile;

Modules§

error
features
one_or_many
translate
types

Structs§

BoundedName
A BoundedName is a Name that can have a max length of N bytes.
CapabilityRequirements
ConfigKey
DictionaryRef
A reference to a (possibly nested) dictionary.
HandleType
We can’t link the fuchsia-runtime crate because it’s target side only, but we don’t really need to – its HandleType is pretty much just a thin wrapper over u8.
NamespacePath
NamespacePath is the same as Path but accepts "/" (which is also a valid namespace path).
OneOrManyEventScope
Generates deserializer for OneOrMany<EventScope>.
OneOrManyNames
Generates deserializer for OneOrMany<Name>.
OneOrManyPaths
Generates deserializer for OneOrMany<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 /.
Url
A component URL. The URL is validated, but represented as a string to avoid normalization and retain the original representation.

Enums§

AllowedOffers
The kinds of offers that can target components in a given collection. See AllowedOffers.
AnyRef
A relative reference to another object. This is a generic type that can encode any supported reference subtype. For named references, it holds a reference to the name instead of the name itself.
Availability
Capability availability. See Availability.
ConfigNestedValueType
ConfigRuntimeSource
ConfigType
ConfigValueType
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.
EventScope
The scope of an event.
MustUseRequirement
OfferToAllCapability
OnTerminate
A component instance’s recovery policy. See OnTerminate.
ParseError
The error representing a failure to parse a type from string.
RootDictionaryRef
A reference to a root dictionary.
SourceAvailability
A reference in an offer to.
StartupMode
A component instance’s startup mode. See StartupMode.
StorageId

Traits§

AsClause
CapabilityClause
FilterClause
FromClause
PathClause
SpannedCapabilityClause

Functions§

alias_or_name
alias_or_path
byte_index_to_location
format_cml
offer_to_all_and_component_diff_capabilities_message
offer_to_all_and_component_diff_sources_message
offer_to_all_would_duplicate
Returns Ok(true) if desugaring the offer_to_all using name duplicates specific_offer. Returns Ok(false) if not a duplicate.
parse_many_documents
Parses a string buffer into a vector of Document. file is used for error reporting. Supports JSON encoded as an array of Document JSON objects.
parse_one_document
Parses a string buffer into a Document. file is used for error reporting.
parse_one_document_with_span
Parses a string buffer into a SpannedDocument. file is used for error reporting.

Type Aliases§

BorrowedName
Unowned variant of Name. Name for more details.
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.