Crate ockam_core

Source
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 or no_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§

route
Creates a new Route from a comma-delimited list of Addresses.

Structs§

Address
A generic address type.
AddressMetadata
Additional metadata for address
AddressParseError
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.
LocalInfoIdentifier
Copy of [ockam_identity::models::IDENTIFIER]. Copied for decoupling.
LocalMessage
A message type that is routed locally within a single node.
Mailbox
A Mailbox controls the dispatch of incoming messages for a particular Address Note that Worker, Processor and Context may have multiple Mailboxes (with different addresses), but they always have exactly one mpsc receiver (message queue)
Mailboxes
A collection of Mailboxes for a specific Worker, Processor or Context
NeutralMessage
A message type that is not subject to any encoding or decoding.
OpenTelemetryContext
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.
SecureChannelLocalInfo
SecureChannel LocalInfo used for LocalMessage
SecureChannelMetadata
SecureChannel Metadata used for Terminal Address
TransportMessage
A generic transport message type.
TransportMessageV1
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 uint type.

Enums§

AddressParseErrorKind
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 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.
ProtocolVersion
Version for transport messages
Result

Attribute Macros§

async_trait
processor
Mark an Ockam Processor implementation.
worker
Mark an Ockam Worker implementation.

Derive Macros§

Message
Implements the Message trait for a type.
TryClone
Implements the TryClone trait for a type.