[][src]Struct kompact::net::Bridge

pub struct Bridge { /* fields omitted */ }

Bridge to Network Threads. Routes outbound messages to the correct network thread. Single threaded for now.

Methods

impl Bridge[src]

pub fn new(
    lookup: Arc<ArcSwap<ActorStore>>,
    network_thread_log: KompactLogger,
    bridge_log: KompactLogger,
    addr: SocketAddr,
    dispatcher_ref: DispatcherRef
) -> (Self, SocketAddr)
[src]

Creates a new bridge

Returns

A tuple consisting of the new Bridge object and the network event receiver. The receiver will allow responding to NetworkEvents for external state management.

pub fn set_dispatcher(
    &mut self,
    dispatcher: DispatcherRef
) -> Option<DispatcherRef>
[src]

Sets the dispatcher reference, returning the previously stored one

pub fn stop(self) -> Result<(), NetworkBridgeErr>[src]

Stops the bridge

pub fn local_addr(&self) -> &Option<SocketAddr>[src]

Returns the local address if already bound

pub fn route(
    &self,
    addr: SocketAddr,
    serialized: SerialisedFrame
) -> Result<(), NetworkBridgeErr>
[src]

Forwards serialized to the NetworkThread and makes sure that it will wake up.

pub fn connect(
    &self,
    proto: Transport,
    addr: SocketAddr
) -> Result<(), NetworkBridgeErr>
[src]

Attempts to establish a TCP connection to the provided addr.

Side effects

When the connection is successul: - a ConnectionState::Connected is dispatched on the network bridge event queue

Errors

If the provided protocol is not supported

Auto Trait Implementations

impl !RefUnwindSafe for Bridge

impl Send for Bridge

impl !Sync for Bridge

impl Unpin for Bridge

impl !UnwindSafe for Bridge

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<T> From<T> for T[src]

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

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>,