pub trait RegularFileSource {
// Required methods
fn archive_path(&self) -> &str;
fn file_data_size(&self) -> u64;
fn mode(&self) -> u32;
fn mtime(&self) -> ArchiveTimestamp;
fn open(&self) -> Result<Box<dyn Read + '_>, ArchiveWriteError>;
// Provided methods
fn entry_kind(&self) -> SourceEntryKind { ... }
fn link_target(&self) -> Option<&[u8]> { ... }
fn sparse_extents(&self) -> Option<&[SparseExtent]> { ... }
fn portable_metadata(&self) -> PortableFileMetadata { ... }
fn open_auxiliary(
&self,
ordinal: usize,
) -> Result<Box<dyn Read + '_>, ArchiveWriteError> { ... }
}Expand description
Re-openable source for one primary archive member.
The writer may replan when options such as target volume sizing need another
pass, so implementations must return a fresh reader from each open call.
Directory sources return an empty reader and a zero file_data_size.
Required Methods§
fn archive_path(&self) -> &str
fn file_data_size(&self) -> u64
fn mode(&self) -> u32
fn mtime(&self) -> ArchiveTimestamp
fn open(&self) -> Result<Box<dyn Read + '_>, ArchiveWriteError>
Provided Methods§
fn entry_kind(&self) -> SourceEntryKind
Sourcefn link_target(&self) -> Option<&[u8]>
fn link_target(&self) -> Option<&[u8]>
Link target bytes for a symbolic-link or hardlink source.
Sourcefn sparse_extents(&self) -> Option<&[SparseExtent]>
fn sparse_extents(&self) -> Option<&[SparseExtent]>
Canonical allocated extents for a sparse regular file.
file_data_size remains the logical size. When this returns Some,
open must yield exactly the concatenated extent bytes in ascending map
order. Some(&[]) represents an all-hole sparse file.
fn portable_metadata(&self) -> PortableFileMetadata
Sourcefn open_auxiliary(
&self,
ordinal: usize,
) -> Result<Box<dyn Read + '_>, ArchiveWriteError>
fn open_auxiliary( &self, ordinal: usize, ) -> Result<Box<dyn Read + '_>, ArchiveWriteError>
Opens a streamed auxiliary payload by its canonical ordinal.
The default serves inline payloads. Sources using
NativeAuxiliaryMetadata::new_streamed must override this method and
return a fresh reader on every call.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".