Struct gnunet_sys::GNUNET_MQ_MessageHandler[][src]

#[repr(C)]pub struct GNUNET_MQ_MessageHandler {
    pub mv: GNUNET_MQ_MessageValidationCallback,
    pub cb: GNUNET_MQ_MessageCallback,
    pub cls: *mut c_void,
    pub type_: u16,
    pub expected_size: u16,
}

Message handler for a specific message type.

Fields

mv: GNUNET_MQ_MessageValidationCallback

Callback to validate a message of the specified @e type. The closure given to @e mv will be this struct (not @e ctx). Using NULL means only size-validation using @e expected_size. In this case, @e expected_size must be non-zero.

cb: GNUNET_MQ_MessageCallback

Callback, called every time a new message of the specified @e type has been received. The closure given to @e mv will be this struct (not @e ctx).

cls: *mut c_void

Closure for @e mv and @e cb.

type_: u16

Type of the message this handler covers, in host byte order.

expected_size: u16

Expected size of messages of this type. Minimum size of the message if @e mv is non-NULL. Messages of the given type will be discarded (and the connection closed with an error reported to the application) if they do not have the right size.

Trait Implementations

impl Clone for GNUNET_MQ_MessageHandler[src]

impl Copy for GNUNET_MQ_MessageHandler[src]

impl Debug for GNUNET_MQ_MessageHandler[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.