Struct tentacle::service::ServiceControl [−][src]
pub struct ServiceControl { /* fields omitted */ }
Service control, used to send commands externally at runtime
Implementations
impl ServiceControl
[src]
impl ServiceControl
[src]pub fn protocols(&self) -> &Arc<HashMap<ProtocolId, ProtocolInfo>>
[src]
pub fn protocols(&self) -> &Arc<HashMap<ProtocolId, ProtocolInfo>>
[src]Get service protocol message, Map(ID, Name), but can’t modify
pub fn dial(
&self,
address: Multiaddr,
target: TargetProtocol
) -> Result<(), SendErrorKind>
[src]
pub fn dial(
&self,
address: Multiaddr,
target: TargetProtocol
) -> Result<(), SendErrorKind>
[src]Initiate a connection request to address
pub fn disconnect(&self, session_id: SessionId) -> Result<(), SendErrorKind>
[src]
pub fn disconnect(&self, session_id: SessionId) -> Result<(), SendErrorKind>
[src]Disconnect a connection
pub fn send_message_to(
&self,
session_id: SessionId,
proto_id: ProtocolId,
data: Bytes
) -> Result<(), SendErrorKind>
[src]
pub fn send_message_to(
&self,
session_id: SessionId,
proto_id: ProtocolId,
data: Bytes
) -> Result<(), SendErrorKind>
[src]Send message
pub fn quick_send_message_to(
&self,
session_id: SessionId,
proto_id: ProtocolId,
data: Bytes
) -> Result<(), SendErrorKind>
[src]
pub fn quick_send_message_to(
&self,
session_id: SessionId,
proto_id: ProtocolId,
data: Bytes
) -> Result<(), SendErrorKind>
[src]Send message on quick channel
pub fn filter_broadcast(
&self,
target: TargetSession,
proto_id: ProtocolId,
data: Bytes
) -> Result<(), SendErrorKind>
[src]
pub fn filter_broadcast(
&self,
target: TargetSession,
proto_id: ProtocolId,
data: Bytes
) -> Result<(), SendErrorKind>
[src]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>
[src]
pub fn quick_filter_broadcast(
&self,
target: TargetSession,
proto_id: ProtocolId,
data: Bytes
) -> Result<(), SendErrorKind>
[src]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,
[src]
pub fn future_task<T>(&self, task: T) -> Result<(), SendErrorKind> where
T: Future<Output = ()> + 'static + Send,
[src]Send a future task
pub fn open_protocol(
&self,
session_id: SessionId,
proto_id: ProtocolId
) -> Result<(), SendErrorKind>
[src]
pub fn open_protocol(
&self,
session_id: SessionId,
proto_id: ProtocolId
) -> Result<(), SendErrorKind>
[src]Try open a protocol
If the protocol has been open, do nothing
pub fn open_protocols(
&self,
session_id: SessionId,
target: TargetProtocol
) -> Result<(), SendErrorKind>
[src]
pub fn open_protocols(
&self,
session_id: SessionId,
target: TargetProtocol
) -> Result<(), SendErrorKind>
[src]Try open protocol
If the protocol has been open, do nothing
pub fn close_protocol(
&self,
session_id: SessionId,
proto_id: ProtocolId
) -> Result<(), SendErrorKind>
[src]
pub fn close_protocol(
&self,
session_id: SessionId,
proto_id: ProtocolId
) -> Result<(), SendErrorKind>
[src]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>
[src]
pub fn set_service_notify(
&self,
proto_id: ProtocolId,
interval: Duration,
token: u64
) -> Result<(), SendErrorKind>
[src]Set a service notify token
pub fn remove_service_notify(
&self,
proto_id: ProtocolId,
token: u64
) -> Result<(), SendErrorKind>
[src]
pub fn remove_service_notify(
&self,
proto_id: ProtocolId,
token: u64
) -> Result<(), SendErrorKind>
[src]remove a service notify token
pub fn set_session_notify(
&self,
session_id: SessionId,
proto_id: ProtocolId,
interval: Duration,
token: u64
) -> Result<(), SendErrorKind>
[src]
pub fn set_session_notify(
&self,
session_id: SessionId,
proto_id: ProtocolId,
interval: Duration,
token: u64
) -> Result<(), SendErrorKind>
[src]Set a session notify token
pub fn remove_session_notify(
&self,
session_id: SessionId,
proto_id: ProtocolId,
token: u64
) -> Result<(), SendErrorKind>
[src]
pub fn remove_session_notify(
&self,
session_id: SessionId,
proto_id: ProtocolId,
token: u64
) -> Result<(), SendErrorKind>
[src]Remove a session notify token
pub fn close(&self) -> Result<(), SendErrorKind>
[src]
pub fn close(&self) -> Result<(), SendErrorKind>
[src]Close service
Order:
- close all listens
- try close all session’s protocol stream
- try close all session
- close service
pub fn shutdown(&self) -> Result<(), SendErrorKind>
[src]
pub fn shutdown(&self) -> Result<(), SendErrorKind>
[src]Shutdown service, don’t care anything, may cause partial message loss
Trait Implementations
impl Clone for ServiceControl
[src]
impl Clone for ServiceControl
[src]fn clone(&self) -> ServiceControl
[src]
fn clone(&self) -> ServiceControl
[src]Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]Performs copy-assignment from source
. Read more
impl From<ServiceAsyncControl> for ServiceControl
[src]
impl From<ServiceAsyncControl> for ServiceControl
[src]fn from(control: ServiceAsyncControl) -> Self
[src]
fn from(control: ServiceAsyncControl) -> Self
[src]Performs the conversion.
impl From<ServiceControl> for ServiceAsyncControl
[src]
impl From<ServiceControl> for ServiceAsyncControl
[src]fn from(control: ServiceControl) -> Self
[src]
fn from(control: ServiceControl) -> Self
[src]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
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,