pub struct UartRequest {
pub address: u8,
pub request_creation_time: Instant,
/* private fields */
}
Expand description
Структура отдельного запроса на коммуникацию по шине SPI
Fields§
§address: u8
Адрес подчиненного устройства
request_creation_time: Instant
Время создания запроса.
Можно контролировать время выполнения запросов
Implementations§
Source§impl UartRequest
impl UartRequest
Sourcepub fn get_payload<T>(&mut self) -> Result<T, Error>where
T: DeserializeOwned,
pub fn get_payload<T>(&mut self) -> Result<T, Error>where
T: DeserializeOwned,
Десериализация запроса
Sourcepub fn from_read_buffer(read_buf: &mut [u8]) -> Result<Self, Error>
pub fn from_read_buffer(read_buf: &mut [u8]) -> Result<Self, Error>
Восстановить запрос из буфера передачи по сети
Trait Implementations§
Source§impl Clone for UartRequest
impl Clone for UartRequest
Source§fn clone(&self) -> UartRequest
fn clone(&self) -> UartRequest
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for UartRequest
impl RefUnwindSafe for UartRequest
impl Send for UartRequest
impl Sync for UartRequest
impl Unpin for UartRequest
impl UnwindSafe for UartRequest
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