pub struct PolicyCursor<'a> { /* private fields */ }Implementations§
Source§impl<'a> PolicyCursor<'a>
impl<'a> PolicyCursor<'a>
Sourcepub fn new(data: &'a PolicyData) -> Self
pub fn new(data: &'a PolicyData) -> Self
Returns a new PolicyCursor that wraps data in a [Cursor] for parsing.
Sourcepub fn new_at(data: &'a PolicyData, offset: PolicyOffset) -> Self
pub fn new_at(data: &'a 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,
) -> Result<(P, Self), ParseError>
pub fn parse<P: Clone + Debug + FromBytes + KnownLayout + Immutable + PartialEq + Unaligned>( self, ) -> Result<(P, Self), ParseError>
Returns an P as the parsed output of the next bytes in the underlying [Cursor] data.
pub fn offset(&self) -> PolicyOffset
pub fn data(&self) -> &'a PolicyData
Trait Implementations§
Source§impl<'a> Clone for PolicyCursor<'a>
impl<'a> Clone for PolicyCursor<'a>
Source§fn clone(&self) -> PolicyCursor<'a>
fn clone(&self) -> PolicyCursor<'a>
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<'a> Debug for PolicyCursor<'a>
impl<'a> Debug for PolicyCursor<'a>
Source§impl<'a> PartialEq for PolicyCursor<'a>
impl<'a> PartialEq for PolicyCursor<'a>
impl<'a> StructuralPartialEq for PolicyCursor<'a>
Auto Trait Implementations§
impl<'a> Freeze for PolicyCursor<'a>
impl<'a> RefUnwindSafe for PolicyCursor<'a>
impl<'a> Send for PolicyCursor<'a>
impl<'a> Sync for PolicyCursor<'a>
impl<'a> Unpin for PolicyCursor<'a>
impl<'a> UnsafeUnpin for PolicyCursor<'a>
impl<'a> UnwindSafe for PolicyCursor<'a>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more