Struct gmt_dos_clients_transceiver::Transceiver

source ·
pub struct Transceiver<U: UniqueIdentifier, F = Unset, S = Off> {
    pub rx: Option<Receiver<Data<U>>>,
    /* private fields */
}
Expand description

Transmitter and receiver of gmt_dos-actors Data

Fields§

§rx: Option<Receiver<Data<U>>>

Implementations§

source§

impl<U: UniqueIdentifier> Transceiver<U>

source

pub fn receiver<S: Into<String>, C: Into<String>>( server_address: S, client_address: C ) -> Result<Transceiver<U, Receiver>>

Transceiver receiver functionality

A receiver is build from both the transmitter and the receiver internet socket addresses

§Examples
let tx_address = "127.0.0.1:5001";
let rx_address = "127.0.0.1:500";
let tx = Transceiver::<IO>::receiver(tx_address,rx_address).unwrap();
source

pub fn receiver_builder<S: Into<String>, C: Into<String>>( server_address: S, client_address: C ) -> ReceiverBuilder<U>

source§

impl<U: UniqueIdentifier> Transceiver<U, Receiver>

source

pub fn spawn<V: UniqueIdentifier, A: Into<String>>( &self, server_address: A ) -> Result<Transceiver<V, Receiver>>

Spawn a new Transceiver receiver

clone the receiver endpoint that will server_address to connect to

source§

impl<U: UniqueIdentifier + 'static> Transceiver<U, Receiver>

source

pub fn run(self, monitor: &mut Monitor) -> Transceiver<U, Receiver, On>
where <U as UniqueIdentifier>::DataType: Send + Sync + for<'a> Deserialize<'a>,

Receive data from the transmitter

Communication with the transmitter happens in a separate thread. The receiver will timed-out after 10s if no connection can be established with the transmitter

source§

impl<U: UniqueIdentifier> Transceiver<U>

source

pub fn transmitter<S: Into<String>>( address: S ) -> Result<Transceiver<U, Transmitter>>

Transceiver transmitter functionality

A transmitter is build from its internet socket address

§Examples
let address = "127.0.0.1:5001";
let tx = Transceiver::<IO>::transmitter(address).unwrap();
source

pub fn transmitter_builder<S: Into<String>>(address: S) -> TransmitterBuilder<U>

source§

impl<U: UniqueIdentifier + 'static> Transceiver<U, Transmitter>

source

pub fn run(self, monitor: &mut Monitor) -> Transceiver<U, Transmitter, On>

Send data to the receiver

Communication with the receiver happens in a separate thread. The transmitter will hold until the receiver calls in.

source§

impl<U: UniqueIdentifier, F> Transceiver<U, F>

source

pub fn new<S: Into<String>>( crypto: Crypto, server_address: S, endpoint: Endpoint, inner_channel: InnerChannel ) -> Self

source§

impl<U: UniqueIdentifier, F, S> Transceiver<U, F, S>

Trait Implementations§

source§

impl<U: UniqueIdentifier, F, S> Debug for Transceiver<U, F, S>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<U: UniqueIdentifier> From<&Transceiver<U, Receiver>> for CompactRecvr

source§

fn from(value: &Transceiver<U, Receiver>) -> Self

Converts to this type from the input type.
source§

impl<U: UniqueIdentifier> Read<U> for Transceiver<U, Transmitter, On>

source§

fn read(&mut self, data: Data<U>)

Read data from an input
source§

impl<U: UniqueIdentifier, F: RxOrTx + Send + Sync> Update for Transceiver<U, F, On>

source§

fn update(&mut self)

source§

impl<U: UniqueIdentifier> Write<U> for Transceiver<U, Receiver, On>

source§

fn write(&mut self) -> Option<Data<U>>

Auto Trait Implementations§

§

impl<U, F, S> Freeze for Transceiver<U, F, S>

§

impl<U, F = Unset, S = Off> !RefUnwindSafe for Transceiver<U, F, S>

§

impl<U, F, S> Send for Transceiver<U, F, S>
where F: Send, S: Send,

§

impl<U, F, S> Sync for Transceiver<U, F, S>
where F: Sync, S: Sync,

§

impl<U, F, S> Unpin for Transceiver<U, F, S>
where F: Unpin, S: Unpin,

§

impl<U, F = Unset, S = Off> !UnwindSafe for Transceiver<U, F, S>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

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

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more