pub struct DiffSet<'a> { /* private fields */ }Implementations§
Source§impl<'a> DiffSet<'a>
impl<'a> DiffSet<'a>
pub fn try_new(diff: &'a [u8]) -> Result<Self, ProgramError>
pub fn try_new_from_borsh_vec( vec_buffer: &'a [u8], ) -> Result<Self, ProgramError>
pub fn raw_diff(&self) -> &'a [u8] ⓘ
Sourcepub fn changed_len(&self) -> usize
pub fn changed_len(&self) -> usize
Returns the length of the changed data (not diff) that is passed as the second argument to compute_diff()
Sourcepub fn segments_count(&self) -> usize
pub fn segments_count(&self) -> usize
Returns the number of segments which is same as number of offset pairs.
Sourcepub fn offset_pairs(&self) -> &'a [OffsetPair]
pub fn offset_pairs(&self) -> &'a [OffsetPair]
Returns the offset pairs
Sourcepub fn diff_segment_at(
&self,
index: usize,
) -> Result<Option<(&'a [u8], OffsetInData)>, ProgramError>
pub fn diff_segment_at( &self, index: usize, ) -> Result<Option<(&'a [u8], OffsetInData)>, ProgramError>
Given an index, returns a diff-segment and offset-range [start,end) where the returned diff-segment is to be applied in the original data.
Sourcepub fn iter(
&self,
) -> impl Iterator<Item = Result<(&'a [u8], OffsetInData), ProgramError>> + '_
pub fn iter( &self, ) -> impl Iterator<Item = Result<(&'a [u8], OffsetInData), ProgramError>> + '_
Iterates diff segments
Auto Trait Implementations§
impl<'a> Freeze for DiffSet<'a>
impl<'a> RefUnwindSafe for DiffSet<'a>
impl<'a> !Send for DiffSet<'a>
impl<'a> !Sync for DiffSet<'a>
impl<'a> Unpin for DiffSet<'a>
impl<'a> UnsafeUnpin for DiffSet<'a>
impl<'a> UnwindSafe for DiffSet<'a>
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
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