pub struct ProtocolContextMutRef<'a> {
    pub session: &'a SessionContext,
    /* private fields */
}
Expand description

Protocol handle context with session context

Use in the callback method with a clear source of the event means tentacle know the event product from which session

Fields

session: &'a SessionContext

Session context

Implementations

Send message to current protocol current session

Send message to current protocol current session on quick channel

Protocol id

Methods from Deref<Target = ServiceContext>

Create a new listener

Initiate a connection request to address

Disconnect a connection

Send message

Send message on quick channel

Send data to the specified protocol for the specified sessions.

Send data to the specified protocol for the specified sessions on quick channel.

Send a future task

Try open a protocol

If the protocol has been open, do nothing

Try open protocol

If the protocol has been open, do nothing

Try close a protocol

If the protocol has been closed, do nothing

Get the internal channel sender side handle

Get service protocol message, Map(ID, Name), but can’t modify

Get the key pair of self

Get service listen address list

Set a service notify token

Set a session notify token

Remove a service timer by a token

Remove a session timer by a token

Close service.

Order:

  1. close all listens
  2. try close all session’s protocol stream
  3. try close all session
  4. close service

Shutdown service, don’t care anything, may cause partial message loss

Trait Implementations

The resulting type after dereferencing.

Dereferences the value.

Mutably dereferences the value.

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

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

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.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more