Skip to main content

Registration

Struct Registration 

Source
pub struct Registration(/* private fields */);
Expand description

Registration state for the VPP side of an API client

A &mut Registration corresponds to a C vl_api_registration *.

Use RegistrationScope::from_client_index to obtain a mutable reference.

Implementations§

Source§

impl Registration

Source

pub unsafe fn from_ptr_mut<'a>(ptr: *mut vl_api_registration_t) -> &'a mut Self

Construct a &mut Registration from a raw vl_api_registration_t pointer.

§Safety
  • ptr must be a valid, non-null pointer to a vl_api_registration_t.
  • The caller must ensure exclusive mutable access for the returned lifetime 'a (no other references or concurrent uses may alias the same underlying registration for the duration of the returned borrow).
  • The pointer must remain valid for the returned lifetime and must not be freed or invalidated while the borrow is active.
Source

pub fn as_ptr(&self) -> *mut vl_api_registration_t

Return the raw vl_api_registration_t pointer for this Registration.

Source

pub fn send_message<T>(&mut self, message: Message<T>)

Send a message to the registration.

This consumes message and transfers ownership of the underlying buffer to VPP.

Auto Trait Implementations§

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.