pub enum LlmpConnection<SP>
where SP: ShMemProvider + 'static,
{ IsBroker { broker: LlmpBroker<SP>, }, IsClient { client: LlmpClient<SP>, }, }
Expand description

An Llmp instance

Variants§

§

IsBroker

Fields

§broker: LlmpBroker<SP>

A broker and a thread using this tcp background thread

§

IsClient

Fields

§client: LlmpClient<SP>

A client, connected to the port

Implementations§

source§

impl<SP> LlmpConnection<SP>
where SP: ShMemProvider,

source

pub fn on_port(shmem_provider: SP, port: u16) -> Result<Self, Error>

Creates either a broker, if the tcp port is not bound, or a client, connected to this port.

source

pub fn broker_on_port(shmem_provider: SP, port: u16) -> Result<Self, Error>

Creates a new broker on the given port

source

pub fn client_on_port(shmem_provider: SP, port: u16) -> Result<Self, Error>

Creates a new client on the given port

source

pub fn describe(&self) -> Result<LlmpClientDescription, Error>

Describe this in a reproducable fashion, if it’s a client

source

pub fn existing_client_from_description( shmem_provider: SP, description: &LlmpClientDescription ) -> Result<LlmpConnection<SP>, Error>

Recreate an existing client from the stored description

source

pub fn send_buf(&mut self, tag: Tag, buf: &[u8]) -> Result<(), Error>

Sends the given buffer over this connection, no matter if client or broker.

source

pub fn send_buf_with_flags( &mut self, tag: Tag, buf: &[u8], flags: Flags ) -> Result<(), Error>

Send the buf with given flags.

Trait Implementations§

source§

impl<SP> Debug for LlmpConnection<SP>
where SP: ShMemProvider + 'static + Debug,

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<SP> RefUnwindSafe for LlmpConnection<SP>

§

impl<SP> !Send for LlmpConnection<SP>

§

impl<SP> !Sync for LlmpConnection<SP>

§

impl<SP> Unpin for LlmpConnection<SP>
where SP: Unpin, <SP as ShMemProvider>::ShMem: Unpin,

§

impl<SP> UnwindSafe for LlmpConnection<SP>

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, 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<Tail, T> Prepend<T> for Tail

§

type PreprendResult = Tail

The Resulting TupleList, of an Prepend::prepend() call, including the prepended entry.
source§

fn prepend(self, value: T) -> (T, <Tail as Prepend<T>>::PreprendResult)

Prepend a value to this tuple, returning a new tuple with prepended value.
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.