pub struct CmdHeader<LEN, CMD> { /* private fields */ }Implementations§
Source§impl<LEN: RawEncode + for<'a> RawDecode<'a> + Copy + Send + Sync + 'static + FromPrimitive + ToPrimitive, CMD: RawEncode + for<'a> RawDecode<'a> + Copy + Send + Sync + 'static> CmdHeader<LEN, CMD>
impl<LEN: RawEncode + for<'a> RawDecode<'a> + Copy + Send + Sync + 'static + FromPrimitive + ToPrimitive, CMD: RawEncode + for<'a> RawDecode<'a> + Copy + Send + Sync + 'static> CmdHeader<LEN, CMD>
pub fn new( version: u8, is_resp: bool, seq: Option<u32>, cmd_code: CMD, pkg_len: LEN, ) -> Self
pub fn pkg_len(&self) -> LEN
pub fn version(&self) -> u8
pub fn seq(&self) -> Option<u32>
pub fn is_resp(&self) -> bool
pub fn cmd_code(&self) -> CMD
pub fn set_pkg_len(&mut self, pkg_len: LEN)
Trait Implementations§
Source§impl<'__de__, LEN: RawDecode<'__de__>, CMD: RawDecode<'__de__>> RawDecode<'__de__> for CmdHeader<LEN, CMD>
impl<'__de__, LEN: RawDecode<'__de__>, CMD: RawDecode<'__de__>> RawDecode<'__de__> for CmdHeader<LEN, CMD>
fn raw_decode(__buf__: &'__de__ [u8]) -> CodecResult<(Self, &'__de__ [u8])>
fn raw_decode_with_option( buf: &'de [u8], _opt: &RawDecodeOption, ) -> Result<(Self, &'de [u8]), BuckyError>
Source§impl<LEN: RawEncode, CMD: RawEncode> RawEncode for CmdHeader<LEN, CMD>
impl<LEN: RawEncode, CMD: RawEncode> RawEncode for CmdHeader<LEN, CMD>
fn raw_encode<'__de__>( &self, __buf__: &'__de__ mut [u8], __purpose__: &Option<RawEncodePurpose>, ) -> CodecResult<&'__de__ mut [u8]>
fn raw_measure( &self, __purpose__: &Option<RawEncodePurpose>, ) -> CodecResult<usize>
fn raw_tail_encode<'a>( &self, buf: &'a mut [u8], purpose: &Option<RawEncodePurpose>, ) -> Result<&'a [u8], BuckyError>
fn raw_encode_to_buffer(&self) -> Result<Vec<u8>, BuckyError>
fn raw_hash_encode(&self) -> Result<Vec<u8>, BuckyError>
Auto Trait Implementations§
impl<LEN, CMD> Freeze for CmdHeader<LEN, CMD>
impl<LEN, CMD> RefUnwindSafe for CmdHeader<LEN, CMD>where
LEN: RefUnwindSafe,
CMD: RefUnwindSafe,
impl<LEN, CMD> Send for CmdHeader<LEN, CMD>
impl<LEN, CMD> Sync for CmdHeader<LEN, CMD>
impl<LEN, CMD> Unpin for CmdHeader<LEN, CMD>
impl<LEN, CMD> UnwindSafe for CmdHeader<LEN, CMD>where
LEN: UnwindSafe,
CMD: UnwindSafe,
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