Struct tentacle::builder::MetaBuilder[][src]

pub struct MetaBuilder { /* fields omitted */ }
Expand description

Builder for protocol meta

Implementations

New a default builder

Define protocol id

It is just an internal index of the system that identifies the open/close and message transfer for the specified protocol.

Define protocol name, default is “/p2p/protocol_id”

Used to interact with the remote service to determine whether the protocol is supported.

If not found, the protocol connection(not session just sub stream) will be closed, and return a ProtocolSelectError event.

Define protocol support versions, default is vec!["0.0.1".to_owned()]

Used to interact with the remote service to confirm that both parties open the same version of the protocol.

If not found, the protocol connection(not session just sub stream) will be closed, and return a ProtocolSelectError event.

Define protocol codec, default is LengthDelimitedCodec

Define protocol service handle, default is neither

Define protocol session handle, default is neither

Define the spawn process of the protocol read part

Mutually exclusive with protocol handle

Protocol version selection rule, default is select_version

Unified processing of messages before they are sent

Unified processing of messages before user received

Set a flag to control function behavior

Combine the configuration of this builder to create a ProtocolMeta

Trait Implementations

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.