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 + alloc
orno_std
targets. - 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.
- Address
Metadata - Additional metadata for address
- Address
Parse 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.
- Local
Info - Contains metadata that will only be routed locally within the local Ockam Node.
- Local
Info Identifier - Copy of [
ockam_identity::models::IDENTIFIER
]. Copied for decoupling. - Local
Message - A message type that is routed locally within a single node.
- Mailbox
- A
Mailbox
controls the dispatch of incoming messages for a particularAddress
Note thatWorker
,Processor
andContext
may have multiple Mailboxes (with different addresses), but they always have exactly one mpsc receiver (message queue) - Mailboxes
- A collection of
Mailbox
es for a specificWorker
,Processor
orContext
- Neutral
Message - A message type that is not subject to any encoding or decoding.
- Open
Telemetry Context - Serializable data type to hold the opentelemetry propagation context.
- Protocol
Id - A user-defined protocol identifier.
- Relay
Message - A message addressed to the relay responsible for delivery of the
wrapped
LocalMessage
- Route
- A full route to a peer.
- Route
Builder - A utility type for building and manipulating routes.
- Routed
- A message wrapper that provides message route information.
- Secure
Channel Local Info - SecureChannel LocalInfo used for LocalMessage
- Secure
Channel Metadata - SecureChannel Metadata used for Terminal Address
- Transport
Message - A generic transport message type.
- Transport
Message V1 - This is version 1 of the transport message without a tracing_context field
- Transport
Type - The transport type of an
Address
. - Uint
- Unsigned integer implementation that supports serde_bare
serialization as a 64 bit
uint
type.
Enums§
- Address
Parse Error Kind - Enum to store the cause of an address parsing failure.
- Route
Error - 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
Encoded
type. - 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
Encode
and 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.
- Protocol
Version - Version for transport messages
- Result
Attribute Macros§
- async_
trait - processor
- Mark an Ockam Processor implementation.
- worker
- Mark an Ockam Worker implementation.