Struct jcm::Message

source ·
#[repr(C)]
pub struct Message { /* private fields */ }
Expand description

Represents the generic message format for JCM host-device communication.

Message format:

Field nameIDLengthData
Size (byte)12Variable

Implementations§

source§

impl Message

source

pub const fn new() -> Self

Creates a new Message.

source

pub const fn id(&self) -> MessageId

Gets the MessageId of the Message.

source

pub const fn data(&self) -> &MessageData

Gets a reference to the MessageData of the Message.

source

pub fn set_data(&mut self, data: MessageData)

Sets the MessageData of the Message.

source

pub fn with_data(self, data: MessageData) -> Self

Builder function that sets the MessageData of the Message.

source

pub fn len(&self) -> usize

Gets the length of the Message.

source

pub fn is_empty(&self) -> bool

Gets whether the Message is empty.

source

pub fn to_bytes(&self, buf: &mut [u8]) -> Result<()>

Writes the Message to the provided byte buffer.

Trait Implementations§

source§

impl Clone for Message

source§

fn clone(&self) -> Message

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Message

source§

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

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

impl Default for Message

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Display for Message

source§

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

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

impl From<&EscrowEvent> for Message

source§

fn from(val: &EscrowEvent) -> Self

Converts to this type from the input type.
source§

impl From<&Event> for Message

source§

fn from(val: &Event) -> Self

Converts to this type from the input type.
source§

impl From<&IdleRequest> for Message

source§

fn from(val: &IdleRequest) -> Self

Converts to this type from the input type.
source§

impl From<&InhibitEvent> for Message

source§

fn from(val: &InhibitEvent) -> Self

Converts to this type from the input type.
source§

impl From<&InhibitRequest> for Message

source§

fn from(val: &InhibitRequest) -> Self

Converts to this type from the input type.
source§

impl From<&Message> for Vec<u8>

source§

fn from(val: &Message) -> Self

Converts to this type from the input type.
source§

impl From<&MessageData> for Message

source§

fn from(val: &MessageData) -> Self

Converts to this type from the input type.
source§

impl From<&RejectRequest> for Message

source§

fn from(val: &RejectRequest) -> Self

Converts to this type from the input type.
source§

impl From<&RejectedEvent> for Message

source§

fn from(val: &RejectedEvent) -> Self

Converts to this type from the input type.
source§

impl From<&Request> for Message

source§

fn from(val: &Request) -> Self

Converts to this type from the input type.
source§

impl From<&ResetRequest> for Message

source§

fn from(val: &ResetRequest) -> Self

Converts to this type from the input type.
source§

impl From<&StackRequest> for Message

source§

fn from(val: &StackRequest) -> Self

Converts to this type from the input type.
source§

impl From<&StatusRequest> for Message

source§

fn from(val: &StatusRequest) -> Self

Converts to this type from the input type.
source§

impl From<&UidRequest> for Message

source§

fn from(val: &UidRequest) -> Self

Converts to this type from the input type.
source§

impl From<EscrowEvent> for Message

source§

fn from(val: EscrowEvent) -> Self

Converts to this type from the input type.
source§

impl From<Event> for Message

source§

fn from(val: Event) -> Self

Converts to this type from the input type.
source§

impl From<IdleRequest> for Message

source§

fn from(val: IdleRequest) -> Self

Converts to this type from the input type.
source§

impl From<InhibitEvent> for Message

source§

fn from(val: InhibitEvent) -> Self

Converts to this type from the input type.
source§

impl From<InhibitRequest> for Message

source§

fn from(val: InhibitRequest) -> Self

Converts to this type from the input type.
source§

impl From<Message> for Vec<u8>

source§

fn from(val: Message) -> Self

Converts to this type from the input type.
source§

impl From<MessageData> for Message

source§

fn from(val: MessageData) -> Self

Converts to this type from the input type.
source§

impl From<RejectRequest> for Message

source§

fn from(val: RejectRequest) -> Self

Converts to this type from the input type.
source§

impl From<RejectedEvent> for Message

source§

fn from(val: RejectedEvent) -> Self

Converts to this type from the input type.
source§

impl From<Request> for Message

source§

fn from(val: Request) -> Self

Converts to this type from the input type.
source§

impl From<ResetRequest> for Message

source§

fn from(val: ResetRequest) -> Self

Converts to this type from the input type.
source§

impl From<StackRequest> for Message

source§

fn from(val: StackRequest) -> Self

Converts to this type from the input type.
source§

impl From<StatusRequest> for Message

source§

fn from(val: StatusRequest) -> Self

Converts to this type from the input type.
source§

impl From<UidRequest> for Message

source§

fn from(val: UidRequest) -> Self

Converts to this type from the input type.
source§

impl PartialEq for Message

source§

fn eq(&self, other: &Message) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl TryFrom<&[u8]> for Message

§

type Error = Error

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

fn try_from(val: &[u8]) -> Result<Self>

Performs the conversion.
source§

impl TryFrom<&Message> for EscrowEvent

§

type Error = Error

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

fn try_from(val: &Message) -> Result<Self>

Performs the conversion.
source§

impl TryFrom<&Message> for Event

§

type Error = Error

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

fn try_from(val: &Message) -> Result<Self>

Performs the conversion.
source§

impl TryFrom<&Message> for IdleRequest

§

type Error = Error

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

fn try_from(val: &Message) -> Result<Self>

Performs the conversion.
source§

impl TryFrom<&Message> for InhibitEvent

§

type Error = Error

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

fn try_from(val: &Message) -> Result<Self>

Performs the conversion.
source§

impl TryFrom<&Message> for InhibitRequest

§

type Error = Error

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

fn try_from(val: &Message) -> Result<Self>

Performs the conversion.
source§

impl TryFrom<&Message> for RejectRequest

§

type Error = Error

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

fn try_from(val: &Message) -> Result<Self>

Performs the conversion.
source§

impl TryFrom<&Message> for RejectedEvent

§

type Error = Error

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

fn try_from(val: &Message) -> Result<Self>

Performs the conversion.
source§

impl TryFrom<&Message> for Request

§

type Error = Error

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

fn try_from(val: &Message) -> Result<Self>

Performs the conversion.
source§

impl TryFrom<&Message> for ResetRequest

§

type Error = Error

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

fn try_from(val: &Message) -> Result<Self>

Performs the conversion.
source§

impl TryFrom<&Message> for Response

§

type Error = Error

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

fn try_from(val: &Message) -> Result<Self>

Performs the conversion.
source§

impl TryFrom<&Message> for StackRequest

§

type Error = Error

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

fn try_from(val: &Message) -> Result<Self>

Performs the conversion.
source§

impl TryFrom<&Message> for StatusRequest

§

type Error = Error

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

fn try_from(val: &Message) -> Result<Self>

Performs the conversion.
source§

impl TryFrom<&Message> for StatusResponse

§

type Error = Error

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

fn try_from(val: &Message) -> Result<Self>

Performs the conversion.
source§

impl TryFrom<&Message> for UidRequest

§

type Error = Error

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

fn try_from(val: &Message) -> Result<Self>

Performs the conversion.
source§

impl TryFrom<Message> for EscrowEvent

§

type Error = Error

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

fn try_from(val: Message) -> Result<Self>

Performs the conversion.
source§

impl TryFrom<Message> for Event

§

type Error = Error

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

fn try_from(val: Message) -> Result<Self>

Performs the conversion.
source§

impl TryFrom<Message> for IdleRequest

§

type Error = Error

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

fn try_from(val: Message) -> Result<Self>

Performs the conversion.
source§

impl TryFrom<Message> for InhibitEvent

§

type Error = Error

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

fn try_from(val: Message) -> Result<Self>

Performs the conversion.
source§

impl TryFrom<Message> for InhibitRequest

§

type Error = Error

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

fn try_from(val: Message) -> Result<Self>

Performs the conversion.
source§

impl TryFrom<Message> for RejectRequest

§

type Error = Error

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

fn try_from(val: Message) -> Result<Self>

Performs the conversion.
source§

impl TryFrom<Message> for RejectedEvent

§

type Error = Error

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

fn try_from(val: Message) -> Result<Self>

Performs the conversion.
source§

impl TryFrom<Message> for Request

§

type Error = Error

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

fn try_from(val: Message) -> Result<Self>

Performs the conversion.
source§

impl TryFrom<Message> for ResetRequest

§

type Error = Error

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

fn try_from(val: Message) -> Result<Self>

Performs the conversion.
source§

impl TryFrom<Message> for Response

§

type Error = Error

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

fn try_from(val: Message) -> Result<Self>

Performs the conversion.
source§

impl TryFrom<Message> for StackRequest

§

type Error = Error

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

fn try_from(val: Message) -> Result<Self>

Performs the conversion.
source§

impl TryFrom<Message> for StatusRequest

§

type Error = Error

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

fn try_from(val: Message) -> Result<Self>

Performs the conversion.
source§

impl TryFrom<Message> for StatusResponse

§

type Error = Error

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

fn try_from(val: Message) -> Result<Self>

Performs the conversion.
source§

impl TryFrom<Message> for UidRequest

§

type Error = Error

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

fn try_from(val: Message) -> Result<Self>

Performs the conversion.
source§

impl Eq for Message

source§

impl StructuralPartialEq for Message

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> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
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.