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
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
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