pub struct NatNet { /* private fields */ }
Expand description
Parser for NatNet
data
This is the main entry point to unpack/parse NatNet
data.
Implementations§
Source§impl NatNet
impl NatNet
Sourcepub fn new<V: Into<Version>>(ver: V) -> NatNet
pub fn new<V: Into<Version>>(ver: V) -> NatNet
Create a new NatNet
parser with the given version
This will create a new parser that utilizes the given version
for subsequent unpack
calls
Sourcepub fn unpack_with<B: BufRead>(
ver: &Version,
bytes: &mut B,
) -> Result<NatNetResponse>
pub fn unpack_with<B: BufRead>( ver: &Version, bytes: &mut B, ) -> Result<NatNetResponse>
Unpack a message from NatNet
using a specified version
This will try to unpack a message coming from a NatNet application assuming the message uses the given version
Sourcepub fn unpack_type_with<B: BufRead>(
t: NatNetMsgType,
ver: &Version,
bytes: &mut B,
) -> Option<Result<NatNetResponse>>
pub fn unpack_type_with<B: BufRead>( t: NatNetMsgType, ver: &Version, bytes: &mut B, ) -> Option<Result<NatNetResponse>>
Unpack only NatNetMsgType
messages
This method unpacks only messages of the requested type. The function
will consume the header of any NatNet
message to check if it is the
correct message and unpack only if it is. This method can be useful when
needing to unpack only sender messages if NatNet
version is unknown.
Sourcepub fn unpack<B: BufRead>(&self, bytes: &mut B) -> Result<NatNetResponse>
pub fn unpack<B: BufRead>(&self, bytes: &mut B) -> Result<NatNetResponse>
Unpack a message from NatNet
Sourcepub fn unpack_type<B: BufRead>(
&self,
t: NatNetMsgType,
bytes: &mut B,
) -> Option<Result<NatNetResponse>>
pub fn unpack_type<B: BufRead>( &self, t: NatNetMsgType, bytes: &mut B, ) -> Option<Result<NatNetResponse>>
Unpack only NatNetMsgType
messages
This method unpacks only messages of the requested type. The function
will consume the header of any NatNet
message to check if it is the
correct message and unpack only if it is. This method can be useful when
needing to unpack only sender messages if NatNet
version is unknown.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for NatNet
impl RefUnwindSafe for NatNet
impl Send for NatNet
impl Sync for NatNet
impl Unpin for NatNet
impl UnwindSafe for NatNet
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)