[−][src]Struct splinter::network::connection_manager::Connector
Methods
impl Connector
[src]
pub fn request_connection(
&self,
endpoint: &str,
id: &str
) -> Result<(), ConnectionManagerError>
[src]
&self,
endpoint: &str,
id: &str
) -> Result<(), ConnectionManagerError>
Request a connection to the given endpoint.
This operation is idempotent: if a connection to that endpoint already exists, a new connection is not created.
Errors
An error is returned if the connection cannot be created
pub fn remove_connection(
&self,
endpoint: &str
) -> Result<Option<String>, ConnectionManagerError>
[src]
&self,
endpoint: &str
) -> Result<Option<String>, ConnectionManagerError>
Removes a connection
Returns
The endpoint, if the connection exists; None, otherwise.
Errors
Returns a ConnectionManagerError if the query cannot be performed.
pub fn subscription_iter(
&self
) -> Result<NotificationIter, ConnectionManagerError>
[src]
&self
) -> Result<NotificationIter, ConnectionManagerError>
Create an iterator over ConnectionManagerNotification events.
Errors
Return a ConnectionManagerError if the notification iterator cannot be created.
pub fn subscribe<T>(
&self,
subscriber: Sender<T>
) -> Result<SubscriberId, ConnectionManagerError> where
T: From<ConnectionManagerNotification> + Send + 'static,
[src]
&self,
subscriber: Sender<T>
) -> Result<SubscriberId, ConnectionManagerError> where
T: From<ConnectionManagerNotification> + Send + 'static,
Subscribe to notifications for connection events.
ConnectionManagerNotification instances will be transformed via type T
's implementation
of From<ConnectionManagerNotification>
and passed to the given sender.
Returns
The subscriber id that can be used for unsubscribing the given sender.
Errors
Return a ConnectionManagerError if the subscriber cannot be registered via the Connector instance.
pub fn unsubscribe(
&self,
subscriber_id: SubscriberId
) -> Result<(), ConnectionManagerError>
[src]
&self,
subscriber_id: SubscriberId
) -> Result<(), ConnectionManagerError>
pub fn list_connections(&self) -> Result<Vec<String>, ConnectionManagerError>
[src]
List the connections available to this Connector instance.
Returns
Returns a vector of connection endpoints.
Errors
Returns a ConnectionManagerError if the connections cannot be queried.
pub fn add_inbound_connection(
&self,
connection: Box<dyn Connection>
) -> Result<(), ConnectionManagerError>
[src]
&self,
connection: Box<dyn Connection>
) -> Result<(), ConnectionManagerError>
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Connector
impl Send for Connector
impl !Sync for Connector
impl Unpin for Connector
impl !UnwindSafe for Connector
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,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<'a, T> DefaultFeatures<'a> for T where
T: 'a + Clone + Send + Sync,
T: 'a + Clone + Send + Sync,
fn clone_boxed(&self) -> Box<dyn DefaultFeatures<'a> + 'a>
fn self_address_mut(&mut self) -> *mut ()
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> IntoSql for T
fn into_sql<T>(self) -> Self::Expression where
Self: AsExpression<T>,
Self: AsExpression<T>,
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression where
&'a Self: AsExpression<T>,
&'a Self: AsExpression<T>,
impl<'a, T> NonSyncFeatures<'a> for T where
T: 'a + Clone,
T: 'a + Clone,
fn clone_boxed(&self) -> Box<dyn NonSyncFeatures<'a> + 'a>
fn self_address_mut(&mut self) -> *mut ()
impl<T> SafeBorrow<T> for T where
T: ?Sized,
T: ?Sized,
fn borrow_replacement(ptr: &T) -> &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.
fn to_owned(&self) -> T
[src]
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.
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.
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>,