#[repr(C)]pub struct Response { /* private fields */ }Expand description
Represents the generic response format for JCM host-device communication.
Response data is encoded in the Message format as additional data in MessageData.
Response format:
| Field name | Response Code | Data |
|---|---|---|
| Size (byte) | 1 | Variable |
Implementations§
source§impl Response
impl Response
sourcepub const fn code(&self) -> ResponseCode
pub const fn code(&self) -> ResponseCode
Gets the ResponseCode of the Response.
sourcepub fn set_code(&mut self, code: ResponseCode)
pub fn set_code(&mut self, code: ResponseCode)
Sets the ResponseCode of the Response.
sourcepub fn with_code(self, code: ResponseCode) -> Self
pub fn with_code(self, code: ResponseCode) -> Self
Builder function that sets the ResponseCode of the Response.
sourcepub fn additional(&self) -> &[u8] ⓘ
pub fn additional(&self) -> &[u8] ⓘ
Gets a reference to the additional data of the Response.
sourcepub fn set_additional(&mut self, additional: &[u8])
pub fn set_additional(&mut self, additional: &[u8])
Sets the additional data of the Response.
sourcepub fn with_additional(self, additional: &[u8]) -> Self
pub fn with_additional(self, additional: &[u8]) -> Self
Builder function that sets the additional data of the Response.
Trait Implementations§
source§impl From<&StatusResponse> for Response
impl From<&StatusResponse> for Response
source§fn from(val: &StatusResponse) -> Self
fn from(val: &StatusResponse) -> Self
Converts to this type from the input type.
source§impl From<&UidResponse> for Response
impl From<&UidResponse> for Response
source§fn from(val: &UidResponse) -> Self
fn from(val: &UidResponse) -> Self
Converts to this type from the input type.
source§impl From<StatusResponse> for Response
impl From<StatusResponse> for Response
source§fn from(val: StatusResponse) -> Self
fn from(val: StatusResponse) -> Self
Converts to this type from the input type.
source§impl From<UidResponse> for Response
impl From<UidResponse> for Response
source§fn from(val: UidResponse) -> Self
fn from(val: UidResponse) -> Self
Converts to this type from the input type.
source§impl PartialEq for Response
impl PartialEq for Response
source§impl TryFrom<&Response> for StatusResponse
impl TryFrom<&Response> for StatusResponse
source§impl TryFrom<&Response> for UidResponse
impl TryFrom<&Response> for UidResponse
source§impl TryFrom<Response> for StatusResponse
impl TryFrom<Response> for StatusResponse
source§impl TryFrom<Response> for UidResponse
impl TryFrom<Response> for UidResponse
impl Eq for Response
impl StructuralPartialEq for Response
Auto Trait Implementations§
impl Freeze for Response
impl RefUnwindSafe for Response
impl Send for Response
impl Sync for Response
impl Unpin for Response
impl UnwindSafe for Response
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more