Expand description
This crate contains the core types of the [Ockam][main-ockam-crate-link] library and is intended for use by crates that provide features and add-ons to the main [Ockam][main-ockam-crate-link] library.
The main [Ockam][main-ockam-crate-link] crate re-exports types defined in this crate.
§Crate Features
The ockam_core crate has a Cargo feature named "std" that is enabled by
default. In order to use this crate in a no_std context this feature can
be disabled as follows
[dependencies]
ockam_core = { version = "<current version>" , default-features = false }Please note that Cargo features are unioned across the entire dependency
graph of a project. If any other crate you depend on has not opted out of
ockam_core default features, Cargo will build ockam_core with the std
feature enabled whether or not your direct dependency on ockam_core
has default-features = false.
Re-exports§
- pub use access_control::*;
Modules§
- access_control 
- Access control
- api
- bare
- Primitives to encode and decode Binary Application Record Encoding (BARE).
- compat
- A facade around the various collections and primitives needed to
support std,no_std + allocorno_stdtargets.
- debugger
- Debugger
- env
- Environmental variables
- errcode
- A module to export the error code in a meaningful way
- flow_control 
- Flow Control
- hex_encoding 
- Encoding
Macros§
Structs§
- Address
- A generic address type.
- AddressMetadata 
- Additional metadata for address
- AddressParse Error 
- An error which is returned when address parsing from string fails.
- Any
- A passthrough marker message type.
- CowBytes
- A new type around Cow<'_, [u8]>that borrows from input.
- CowStr
- A new type around Cow<'_, str>that borrows from input.
- Error
- The type of errors returned by Ockam functions.
- LocalInfo 
- Contains metadata that will only be routed locally within the local Ockam Node.
- LocalInfo Identifier 
- Copy of [ockam_identity::models::IDENTIFIER]. Copied for decoupling.
- LocalMessage 
- A message type that is routed locally within a single node.
- Mailbox
- A Mailboxcontrols the dispatch of incoming messages for a particularAddressNote thatWorker,ProcessorandContextmay have multiple Mailboxes (with different addresses), but they always have exactly one mpsc receiver (message queue)
- Mailboxes
- A collection of Mailboxes for a specificWorker,ProcessororContext
- NeutralMessage 
- A message type that is not subject to any encoding or decoding.
- OpenTelemetry Context 
- Serializable data type to hold the opentelemetry propagation context.
- ProtocolId 
- A user-defined protocol identifier.
- RelayMessage 
- A message addressed to the relay responsible for delivery of the
wrapped LocalMessage
- Route
- A full route to a peer.
- RouteBuilder 
- A utility type for building and manipulating routes.
- Routed
- A message wrapper that provides message route information.
- SecureChannel Local Info 
- SecureChannel LocalInfo used for LocalMessage
- SecureChannel Metadata 
- SecureChannel Metadata used for Terminal Address
- TransportMessage 
- A generic transport message type.
- TransportMessage V1 
- This is version 1 of the transport message without a tracing_context field
- TransportType 
- The transport type of an Address.
- Uint
- Unsigned integer implementation that supports serde_bare
serialization as a 64 bit uinttype.
Enums§
- AddressParse Error Kind 
- Enum to store the cause of an address parsing failure.
- RouteError 
- A routing specific error type.
Constants§
- LATEST_PROTOCOL_ VERSION 
- Latest protocol version for transport messages
- LOCAL
- The local transport type.
- LOCAL_INFO_ IDENTIFIER_ LEN 
- Identifier LEN. Should be equal to [ockam_identity::models::IDENTIFIER_LEN]
- OCKAM_TRACER_ NAME 
- Name of the global Ockam tracer
- PROTOCOL_VERSION_ V1 
- Protocol version for transport messages. This version doesn’t have a tracing_context field
- SECURE_CHANNEL_ IDENTIFIER 
- Identity SecureChannel LocalInfo unique Identifier
Traits§
- Decodable
- Decode a slice.
- Encodable
- Encode the type into an Encodedtype.
- Message
- A user defined message that can be serialised and deserialized.
- Processor
- Defines an interface for Ockam Workers that need to continuously perform background operations.
- TryClone
- Clone trait when clone can fail.
- Worker
- Defines the core interface shared by all Ockam Workers.
Functions§
- allow
- Produces Ok(true) to avoid an ambiguous reading from using the unadorned value in auth code.
- cbor_encode_ preallocate 
- Encode a type implementing Encodeand return the encoded byte vector.
- deny
- Produces Ok(false) to avoid an ambiguous reading from using the unadorned value in auth code.
- deserialize
- Serialize a type using serde_bare
- opentelemetry_context_ parser 
- Parse the OpenTelemetry context from a String
- serialize
- Serialize a type using serde_bare
Type Aliases§
- Encoded
- Alias of the type used for encoded data.
- ProtocolVersion 
- Version for transport messages
- Result
Attribute Macros§
- async_trait 
- processor
- Mark an Ockam Processor implementation.
- worker
- Mark an Ockam Worker implementation.