[−][src]Struct kompact::net::Bridge
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]
lookup: Arc<ArcSwap<ActorStore>>,
network_thread_log: KompactLogger,
bridge_log: KompactLogger,
addr: SocketAddr,
dispatcher_ref: DispatcherRef
) -> (Self, SocketAddr)
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]
&mut self,
dispatcher: DispatcherRef
) -> Option<DispatcherRef>
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]
&self,
addr: SocketAddr,
serialized: SerialisedFrame
) -> Result<(), NetworkBridgeErr>
Forwards serialized
to the NetworkThread and makes sure that it will wake up.
pub fn connect(
&self,
proto: Transport,
addr: SocketAddr
) -> Result<(), NetworkBridgeErr>
[src]
&self,
proto: Transport,
addr: SocketAddr
) -> Result<(), NetworkBridgeErr>
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]
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<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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>,