pub struct ParserConfig {
pub header: &'static [u8],
pub length_strategy: PacketLengthStrategy,
}Expand description
Configuration complète d’un protocole UART.
Cette structure est Copy afin de pouvoir être stockée statiquement ou
dupliquée sans coût mémoire significatif.
§Exemple
use uart_proto_detector::{ParserConfig, PacketLengthStrategy};
const MY_PROTOCOL: ParserConfig = ParserConfig {
header: &[0xFF, 0xAA],
length_strategy: PacketLengthStrategy::LengthByte { index: 2, offset: 4 },
};Fields§
§header: &'static [u8]Séquence d’octets d’en-tête identifiant le début d’une trame valide.
Tous les octets reçus avant que l’en-tête complet soit reconnu sont ignorés.
length_strategy: PacketLengthStrategyMéthode utilisée pour déterminer la longueur totale de la trame.
Trait Implementations§
Source§impl Clone for ParserConfig
impl Clone for ParserConfig
Source§fn clone(&self) -> ParserConfig
fn clone(&self) -> ParserConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ParserConfig
Auto Trait Implementations§
impl Freeze for ParserConfig
impl RefUnwindSafe for ParserConfig
impl Send for ParserConfig
impl Sync for ParserConfig
impl Unpin for ParserConfig
impl UnsafeUnpin for ParserConfig
impl UnwindSafe for ParserConfig
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