Struct tentacle::service::ServiceAsyncControl [−][src]
Service control, used to send commands externally at runtime, All interfaces are async methods
Implementations
impl ServiceAsyncControl[src]
pub fn protocols(&self) -> &Arc<HashMap<ProtocolId, ProtocolInfo>>[src]
Get service protocol message, Map(ID, Name), but can't modify
pub async fn listen(&mut self, address: Multiaddr) -> Result<(), SendErrorKind>[src]
Create a new listener
pub async fn dial(
&mut self,
address: Multiaddr,
target: TargetProtocol
) -> Result<(), SendErrorKind>[src]
&mut self,
address: Multiaddr,
target: TargetProtocol
) -> Result<(), SendErrorKind>
Initiate a connection request to address
pub async fn disconnect(
&mut self,
session_id: SessionId
) -> Result<(), SendErrorKind>[src]
&mut self,
session_id: SessionId
) -> Result<(), SendErrorKind>
Disconnect a connection
pub async fn send_message_to(
&mut self,
session_id: SessionId,
proto_id: ProtocolId,
data: Bytes
) -> Result<(), SendErrorKind>[src]
&mut self,
session_id: SessionId,
proto_id: ProtocolId,
data: Bytes
) -> Result<(), SendErrorKind>
Send message
pub async fn quick_send_message_to(
&mut self,
session_id: SessionId,
proto_id: ProtocolId,
data: Bytes
) -> Result<(), SendErrorKind>[src]
&mut self,
session_id: SessionId,
proto_id: ProtocolId,
data: Bytes
) -> Result<(), SendErrorKind>
Send message on quick channel
pub async fn filter_broadcast(
&mut self,
target: TargetSession,
proto_id: ProtocolId,
data: Bytes
) -> Result<(), SendErrorKind>[src]
&mut self,
target: TargetSession,
proto_id: ProtocolId,
data: Bytes
) -> Result<(), SendErrorKind>
Send data to the specified protocol for the specified sessions.
pub async fn quick_filter_broadcast(
&mut self,
target: TargetSession,
proto_id: ProtocolId,
data: Bytes
) -> Result<(), SendErrorKind>[src]
&mut self,
target: TargetSession,
proto_id: ProtocolId,
data: Bytes
) -> Result<(), SendErrorKind>
Send data to the specified protocol for the specified sessions on quick channel.
pub async fn future_task<T>(&mut self, task: T) -> Result<(), SendErrorKind> where
T: Future<Output = ()> + 'static + Send, [src]
T: Future<Output = ()> + 'static + Send,
Send a future task
pub async fn open_protocol(
&mut self,
session_id: SessionId,
proto_id: ProtocolId
) -> Result<(), SendErrorKind>[src]
&mut self,
session_id: SessionId,
proto_id: ProtocolId
) -> Result<(), SendErrorKind>
Try open a protocol
If the protocol has been open, do nothing
pub async fn open_protocols(
&mut self,
session_id: SessionId,
target: TargetProtocol
) -> Result<(), SendErrorKind>[src]
&mut self,
session_id: SessionId,
target: TargetProtocol
) -> Result<(), SendErrorKind>
Try open protocol
If the protocol has been open, do nothing
pub async fn close_protocol(
&mut self,
session_id: SessionId,
proto_id: ProtocolId
) -> Result<(), SendErrorKind>[src]
&mut self,
session_id: SessionId,
proto_id: ProtocolId
) -> Result<(), SendErrorKind>
Try close a protocol
If the protocol has been closed, do nothing
pub async fn set_service_notify(
&mut self,
proto_id: ProtocolId,
interval: Duration,
token: u64
) -> Result<(), SendErrorKind>[src]
&mut self,
proto_id: ProtocolId,
interval: Duration,
token: u64
) -> Result<(), SendErrorKind>
Set a service notify token
pub async fn remove_service_notify(
&mut self,
proto_id: ProtocolId,
token: u64
) -> Result<(), SendErrorKind>[src]
&mut self,
proto_id: ProtocolId,
token: u64
) -> Result<(), SendErrorKind>
remove a service notify token
pub async fn set_session_notify(
&mut self,
session_id: SessionId,
proto_id: ProtocolId,
interval: Duration,
token: u64
) -> Result<(), SendErrorKind>[src]
&mut self,
session_id: SessionId,
proto_id: ProtocolId,
interval: Duration,
token: u64
) -> Result<(), SendErrorKind>
Set a session notify token
pub async fn remove_session_notify(
&mut self,
session_id: SessionId,
proto_id: ProtocolId,
token: u64
) -> Result<(), SendErrorKind>[src]
&mut self,
session_id: SessionId,
proto_id: ProtocolId,
token: u64
) -> Result<(), SendErrorKind>
Remove a session notify token
pub async fn close(&mut self) -> Result<(), SendErrorKind>[src]
Close service
Order:
- close all listens
- try close all session's protocol stream
- try close all session
- close service
pub async fn shutdown(&mut self) -> Result<(), SendErrorKind>[src]
Shutdown service, don't care anything, may cause partial message loss
Trait Implementations
impl Clone for ServiceAsyncControl[src]
fn clone(&self) -> ServiceAsyncControl[src]
pub fn clone_from(&mut self, source: &Self)1.0.0[src]
impl From<ServiceAsyncControl> for ServiceControl[src]
fn from(control: ServiceAsyncControl) -> Self[src]
impl From<ServiceControl> for ServiceAsyncControl[src]
fn from(control: ServiceControl) -> Self[src]
Auto Trait Implementations
impl !RefUnwindSafe for ServiceAsyncControl
impl Send for ServiceAsyncControl
impl Sync for ServiceAsyncControl
impl Unpin for ServiceAsyncControl
impl !UnwindSafe for ServiceAsyncControl
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,