pub struct PackageEntry { /* private fields */ }
Expand description
Represents a file entry in a Package
.
These entries consist basically only of the file’s path within the package (here called an
inner_path
), and a reference to the file’s content.
Implementations§
Source§impl PackageEntry
impl PackageEntry
Sourcepub fn from_file<S: AsRef<str>, P: AsRef<Path>>(
inner_path: S,
path: P,
) -> PackageEntry
pub fn from_file<S: AsRef<str>, P: AsRef<Path>>( inner_path: S, path: P, ) -> PackageEntry
Constructs an PackageEntry
from the given inner_path
and file at the specified path
.
inner_path
- path under which the file will be stored within thePackage
.path
- path to the file that will be read to populate this entry’s content.
Sourcepub fn from_memory_mapped_file<S: AsRef<str>>(
inner_path: S,
mmap: Rc<Mmap>,
offset: u64,
length: u64,
) -> PackageEntry
pub fn from_memory_mapped_file<S: AsRef<str>>( inner_path: S, mmap: Rc<Mmap>, offset: u64, length: u64, ) -> PackageEntry
Constructs an PackageEntry
from the given inner_path
, memory map, offset and length
inner_path
- path under which the file will be stored within thePackage
.mmap
- memory map of the file from which the file’s content will be read.offset
- offset to the file’s content within the memory mapped file.length
- length of the file’s content within the memory mapped file.
Sourcepub fn from_string<S: AsRef<str>, C: AsRef<str> + Into<Vec<u8>>>(
inner_path: S,
content: C,
) -> PackageEntry
pub fn from_string<S: AsRef<str>, C: AsRef<str> + Into<Vec<u8>>>( inner_path: S, content: C, ) -> PackageEntry
Constructs an PackageEntry
from the given inner_path
and text content
.
inner_path
- path under which the file will be stored within thePackage
.content
- textual content of the file.
Sourcepub fn from_byte_array<S: AsRef<str>>(
inner_path: S,
content: Vec<u8>,
) -> PackageEntry
pub fn from_byte_array<S: AsRef<str>>( inner_path: S, content: Vec<u8>, ) -> PackageEntry
Constructs an PackageEntry
from the given inner_path
and binary content
.
inner_path
- path under which the file will be stored within thePackage
.content
- binary content of the file.
Sourcepub fn inner_path(&self) -> &str
pub fn inner_path(&self) -> &str
Returns the inner_path
of this entry.
Trait Implementations§
Source§impl Debug for PackageEntry
impl Debug for PackageEntry
Auto Trait Implementations§
impl Freeze for PackageEntry
impl RefUnwindSafe for PackageEntry
impl !Send for PackageEntry
impl !Sync for PackageEntry
impl Unpin for PackageEntry
impl UnwindSafe for PackageEntry
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