Struct Client

Source
pub struct Client { /* private fields */ }
Expand description

Handle to the client side of an SHM communication file

Implementations§

Source§

impl Client

Source

pub fn init(file: Box<dyn ShmFileHandle>) -> LGMPResult<Client>

Initialises a handle to the client side of a LGMP connection given a handle to a memory mapped SHM file. The SHM file and memory mapped region must be large enough to handle all communications, as it cannot be resized during use.

Source

pub fn client_session_init(&mut self) -> LGMPResult<(Vec<u8>, u32)>

Initialises a client session on the already-initialised client.

This will return an error if a host has not already been initialised on the same SHM file. Returns both a copy of the udata byte array set by the host upon startup and the clientID assigned by the host.

Source

pub fn client_session_valid(&self) -> bool

Returns true if the session running on the current client is still valid.

This may return false if the host has been restarted or if the last heartbeat recieved from the host has passed the timout (1000ms).

Source

pub fn client_subscribe( &mut self, queue_id: u32, ) -> LGMPResult<ClientQueueHandle>

Subscribe to the queue indicated by the provided ID.

Returns a handle to the queue if it exists, may alternatively return LGMPErrNoSuchQueue if a queue does not exist at the provided ID.

Trait Implementations§

Source§

impl Drop for Client

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl Send for Client

Auto Trait Implementations§

§

impl Freeze for Client

§

impl !RefUnwindSafe for Client

§

impl !Sync for Client

§

impl Unpin for Client

§

impl !UnwindSafe for Client

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<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

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

Source§

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