pub struct PolicyCursor { /* private fields */ }Implementations§
Source§impl PolicyCursor
 
impl PolicyCursor
Sourcepub fn new(data: PolicyData) -> Self
 
pub fn new(data: PolicyData) -> Self
Returns a new PolicyCursor that wraps data in a [Cursor] for parsing.
Sourcepub fn new_at(data: PolicyData, offset: PolicyOffset) -> Self
 
pub fn new_at(data: PolicyData, offset: PolicyOffset) -> Self
Returns a new PolicyCursor that wraps data in a [Cursor] for parsing at offset.
Sourcepub fn parse<P: Clone + Debug + FromBytes + KnownLayout + Immutable + PartialEq + Unaligned>(
    self,
) -> Option<(P, Self)>
 
pub fn parse<P: Clone + Debug + FromBytes + KnownLayout + Immutable + PartialEq + Unaligned>( self, ) -> Option<(P, Self)>
Returns an P as the parsed output of the next bytes in the underlying [Cursor] data.
Sourcepub fn parse_slice<PS: Clone + Debug + FromBytes + Immutable + PartialEq + Unaligned>(
    self,
    count: usize,
) -> Option<(Vec<PS>, Self)>
 
pub fn parse_slice<PS: Clone + Debug + FromBytes + Immutable + PartialEq + Unaligned>( self, count: usize, ) -> Option<(Vec<PS>, Self)>
Returns a Vec<T> of count items as the parsed output of the next bytes in the underlying
[Cursor] data.
pub fn offset(&self) -> PolicyOffset
pub fn len(&self) -> usize
Sourcepub fn seek_forward(&mut self, num_bytes: usize) -> Result<(), Error>
 
pub fn seek_forward(&mut self, num_bytes: usize) -> Result<(), Error>
Seeks forward by num_bytes, returning a std::io::Error if seeking fails.
pub fn data(&self) -> &PolicyData
Trait Implementations§
Source§impl Clone for PolicyCursor
 
impl Clone for PolicyCursor
Source§fn clone(&self) -> PolicyCursor
 
fn clone(&self) -> PolicyCursor
Returns a duplicate 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 moreSource§impl Debug for PolicyCursor
 
impl Debug for PolicyCursor
Source§impl PartialEq for PolicyCursor
 
impl PartialEq for PolicyCursor
impl StructuralPartialEq for PolicyCursor
Auto Trait Implementations§
impl Freeze for PolicyCursor
impl RefUnwindSafe for PolicyCursor
impl Send for PolicyCursor
impl Sync for PolicyCursor
impl Unpin for PolicyCursor
impl UnwindSafe for PolicyCursor
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