Struct jcm::StatusResponse
source · #[repr(C)]pub struct StatusResponse { /* private fields */ }Implementations§
source§impl StatusResponse
impl StatusResponse
sourcepub const fn new() -> Self
pub const fn new() -> Self
Creates a new StatusResponse.
sourcepub const fn code(&self) -> ResponseCode
pub const fn code(&self) -> ResponseCode
Gets the ResponseCode for the StatusResponse.
sourcepub fn set_code(&mut self, code: ResponseCode)
pub fn set_code(&mut self, code: ResponseCode)
Sets the ResponseCode for the StatusResponse.
sourcepub fn with_code(self, code: ResponseCode) -> Self
pub fn with_code(self, code: ResponseCode) -> Self
Builder function that sets the ResponseCode for the StatusResponse.
sourcepub const fn status(&self) -> DeviceStatus
pub const fn status(&self) -> DeviceStatus
Gets the DeviceStatus for the StatusResponse.
sourcepub fn set_status(&mut self, status: DeviceStatus)
pub fn set_status(&mut self, status: DeviceStatus)
Sets the DeviceStatus for the StatusResponse.
sourcepub fn with_status(self, status: DeviceStatus) -> Self
pub fn with_status(self, status: DeviceStatus) -> Self
Builder function that sets the DeviceStatus for the StatusResponse.
sourcepub fn unit_status(&self) -> &[UnitStatus]
pub fn unit_status(&self) -> &[UnitStatus]
Gets a reference to the list of UnitStatus items.
sourcepub fn set_unit_status(&mut self, status: &[UnitStatus])
pub fn set_unit_status(&mut self, status: &[UnitStatus])
Sets the list of UnitStatus items.
NOTE A maximum of MAX_UNIT_STATUS_LEN items will be set.
sourcepub fn with_unit_status(self, status: &[UnitStatus]) -> Self
pub fn with_unit_status(self, status: &[UnitStatus]) -> Self
Builder function that sets the list of UnitStatus items.
NOTE A maximum of MAX_UNIT_STATUS_LEN items will be set.
sourcepub const fn meta_len() -> usize
pub const fn meta_len() -> usize
Gets the length of the StatusResponse metadata.
sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
Gets the full length of the StatusResponse.
sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Gets whether the StatusResponse is empty.
sourcepub fn to_bytes(&self, buf: &mut [u8]) -> Result<()>
pub fn to_bytes(&self, buf: &mut [u8]) -> Result<()>
Converts a StatusResponse into a byte buffer.
sourcepub fn from_bytes(buf: &[u8]) -> Result<Self>
pub fn from_bytes(buf: &[u8]) -> Result<Self>
Converts a byte buffer into a StatusResponse.
Trait Implementations§
source§impl Clone for StatusResponse
impl Clone for StatusResponse
source§fn clone(&self) -> StatusResponse
fn clone(&self) -> StatusResponse
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for StatusResponse
impl Debug for StatusResponse
source§impl Default for StatusResponse
impl Default for StatusResponse
source§impl Display for StatusResponse
impl Display for StatusResponse
source§impl From<&StatusResponse> for Response
impl From<&StatusResponse> for Response
source§fn from(val: &StatusResponse) -> Self
fn from(val: &StatusResponse) -> Self
source§impl From<StatusResponse> for Response
impl From<StatusResponse> for Response
source§fn from(val: StatusResponse) -> Self
fn from(val: StatusResponse) -> Self
source§impl PartialEq for StatusResponse
impl PartialEq for StatusResponse
source§fn eq(&self, other: &StatusResponse) -> bool
fn eq(&self, other: &StatusResponse) -> bool
self and other values to be equal, and is used
by ==.