Struct tentacle::service::ServiceControl [−][src]
pub struct ServiceControl { /* fields omitted */ }
Expand description
Service control, used to send commands externally at runtime
Implementations
Get service protocol message, Map(ID, Name), but can’t modify
Initiate a connection request to address
Disconnect a connection
pub fn send_message_to(
&self,
session_id: SessionId,
proto_id: ProtocolId,
data: Bytes
) -> Result<(), SendErrorKind>
pub fn send_message_to(
&self,
session_id: SessionId,
proto_id: ProtocolId,
data: Bytes
) -> Result<(), SendErrorKind>
Send message
pub fn quick_send_message_to(
&self,
session_id: SessionId,
proto_id: ProtocolId,
data: Bytes
) -> Result<(), SendErrorKind>
pub fn quick_send_message_to(
&self,
session_id: SessionId,
proto_id: ProtocolId,
data: Bytes
) -> Result<(), SendErrorKind>
Send message on quick channel
pub fn filter_broadcast(
&self,
target: TargetSession,
proto_id: ProtocolId,
data: Bytes
) -> Result<(), SendErrorKind>
pub fn filter_broadcast(
&self,
target: TargetSession,
proto_id: ProtocolId,
data: Bytes
) -> Result<(), SendErrorKind>
Send data to the specified protocol for the specified sessions.
pub fn quick_filter_broadcast(
&self,
target: TargetSession,
proto_id: ProtocolId,
data: Bytes
) -> Result<(), SendErrorKind>
pub fn quick_filter_broadcast(
&self,
target: TargetSession,
proto_id: ProtocolId,
data: Bytes
) -> Result<(), SendErrorKind>
Send data to the specified protocol for the specified sessions on quick channel.
pub fn future_task<T>(&self, task: T) -> Result<(), SendErrorKind> where
T: Future<Output = ()> + 'static + Send,
pub fn future_task<T>(&self, task: T) -> Result<(), SendErrorKind> where
T: Future<Output = ()> + 'static + Send,
Send a future task
pub fn open_protocol(
&self,
session_id: SessionId,
proto_id: ProtocolId
) -> Result<(), SendErrorKind>
pub fn open_protocol(
&self,
session_id: SessionId,
proto_id: ProtocolId
) -> Result<(), SendErrorKind>
Try open a protocol
If the protocol has been open, do nothing
pub fn open_protocols(
&self,
session_id: SessionId,
target: TargetProtocol
) -> Result<(), SendErrorKind>
pub fn open_protocols(
&self,
session_id: SessionId,
target: TargetProtocol
) -> Result<(), SendErrorKind>
Try open protocol
If the protocol has been open, do nothing
pub fn close_protocol(
&self,
session_id: SessionId,
proto_id: ProtocolId
) -> Result<(), SendErrorKind>
pub fn close_protocol(
&self,
session_id: SessionId,
proto_id: ProtocolId
) -> Result<(), SendErrorKind>
Try close a protocol
If the protocol has been closed, do nothing
pub fn set_service_notify(
&self,
proto_id: ProtocolId,
interval: Duration,
token: u64
) -> Result<(), SendErrorKind>
pub fn set_service_notify(
&self,
proto_id: ProtocolId,
interval: Duration,
token: u64
) -> Result<(), SendErrorKind>
Set a service notify token
pub fn remove_service_notify(
&self,
proto_id: ProtocolId,
token: u64
) -> Result<(), SendErrorKind>
pub fn remove_service_notify(
&self,
proto_id: ProtocolId,
token: u64
) -> Result<(), SendErrorKind>
remove a service notify token
pub fn set_session_notify(
&self,
session_id: SessionId,
proto_id: ProtocolId,
interval: Duration,
token: u64
) -> Result<(), SendErrorKind>
pub fn set_session_notify(
&self,
session_id: SessionId,
proto_id: ProtocolId,
interval: Duration,
token: u64
) -> Result<(), SendErrorKind>
Set a session notify token
pub fn remove_session_notify(
&self,
session_id: SessionId,
proto_id: ProtocolId,
token: u64
) -> Result<(), SendErrorKind>
pub fn remove_session_notify(
&self,
session_id: SessionId,
proto_id: ProtocolId,
token: u64
) -> Result<(), SendErrorKind>
Remove a session notify token
Close service
Order:
- close all listens
- try close all session’s protocol stream
- try close all session
- close service
Shutdown service, don’t care anything, may cause partial message loss
Trait Implementations
Performs the conversion.
Performs the conversion.
Auto Trait Implementations
impl !RefUnwindSafe for ServiceControl
impl Send for ServiceControl
impl Sync for ServiceControl
impl Unpin for ServiceControl
impl !UnwindSafe for ServiceControl
Blanket Implementations
Mutably borrows from an owned value. Read more