pub struct IndexEntry {
blob_type: BlobType,
pub pack: PackId,
pub offset: u32,
pub length: u32,
pub uncompressed_length: Option<NonZeroU32>,
}
Expand description
An entry in the index
Fields§
§blob_type: BlobType
The type of the blob
pack: PackId
The pack the blob is in
offset: u32
The offset of the blob in the pack
length: u32
The length of the blob in the pack
uncompressed_length: Option<NonZeroU32>
The uncompressed length of the blob
Implementations§
Source§impl IndexEntry
impl IndexEntry
pub const fn new( blob_type: BlobType, pack: PackId, offset: u32, length: u32, uncompressed_length: Option<NonZeroU32>, ) -> IndexEntry
Source§impl IndexEntry
impl IndexEntry
Sourcepub const fn from_index_blob(blob: &IndexBlob, pack: PackId) -> Self
pub const fn from_index_blob(blob: &IndexBlob, pack: PackId) -> Self
Create an IndexEntry
from an IndexBlob
§Arguments
blob
- TheIndexBlob
to create theIndexEntry
frompack
- The pack the blob is in
Sourcepub fn read_data<B: DecryptReadBackend>(&self, be: &B) -> RusticResult<Bytes>
pub fn read_data<B: DecryptReadBackend>(&self, be: &B) -> RusticResult<Bytes>
Get a blob described by IndexEntry
from the backend
§Arguments
be
- The backend to read from
§Errors
Sourcepub const fn data_length(&self) -> u32
pub const fn data_length(&self) -> u32
Get the length of the data described by the IndexEntry
Trait Implementations§
Source§impl Clone for IndexEntry
impl Clone for IndexEntry
Source§fn clone(&self) -> IndexEntry
fn clone(&self) -> IndexEntry
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 IndexEntry
impl Debug for IndexEntry
Source§impl PartialEq for IndexEntry
impl PartialEq for IndexEntry
impl Copy for IndexEntry
impl Eq for IndexEntry
impl StructuralPartialEq for IndexEntry
Auto Trait Implementations§
impl Freeze for IndexEntry
impl RefUnwindSafe for IndexEntry
impl Send for IndexEntry
impl Sync for IndexEntry
impl Unpin for IndexEntry
impl UnwindSafe for IndexEntry
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.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