[][src]Struct splinter::network::connection_manager::Connector

pub struct Connector { /* fields omitted */ }

Methods

impl Connector[src]

pub fn request_connection(
    &self,
    endpoint: &str,
    id: &str
) -> Result<(), ConnectionManagerError>
[src]

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]

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]

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]

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]

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]

Trait Implementations

impl Clone for Connector[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<'a, T> DefaultFeatures<'a> for T where
    T: 'a + Clone + Send + Sync

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> IntoSql for T

impl<'a, T> NonSyncFeatures<'a> for T where
    T: 'a + Clone

impl<T> SafeBorrow<T> for T where
    T: ?Sized

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,