pub struct RarFileChunk {
pub start_offset: u64,
pub end_offset: u64,
/* private fields */
}Available on crate feature
async only.Expand description
A byte range within a single FileMedia (RAR volume).
Fields§
§start_offset: u64§end_offset: u64Implementations§
Source§impl RarFileChunk
impl RarFileChunk
pub fn new( file_media: Arc<dyn FileMedia>, start_offset: u64, end_offset: u64, ) -> Self
Sourcepub fn pad_start(&self, padding: u64) -> Self
pub fn pad_start(&self, padding: u64) -> Self
Create a new chunk with the start offset moved forward.
Sourcepub fn pad_end(&self, padding: u64) -> Self
pub fn pad_end(&self, padding: u64) -> Self
Create a new chunk with the end offset moved backward.
Sourcepub async fn read_range(&self, start: u64, end: u64) -> Result<Vec<u8>>
pub async fn read_range(&self, start: u64, end: u64) -> Result<Vec<u8>>
Read a portion of the chunk.
Sourcepub fn volume_name(&self) -> &str
pub fn volume_name(&self) -> &str
Get the name of the file media (volume) this chunk belongs to.
Trait Implementations§
Source§impl Clone for RarFileChunk
impl Clone for RarFileChunk
Source§fn clone(&self) -> RarFileChunk
fn clone(&self) -> RarFileChunk
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 moreAuto Trait Implementations§
impl Freeze for RarFileChunk
impl !RefUnwindSafe for RarFileChunk
impl Send for RarFileChunk
impl Sync for RarFileChunk
impl Unpin for RarFileChunk
impl !UnwindSafe for RarFileChunk
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