pub enum AssetSource {
Path(PathBuf),
Symlink(PathBuf),
Data(Vec<u8>),
}Variants§
Path(PathBuf)
Copy file from the path (and strip binary if needed).
Symlink(PathBuf)
A symlink existing in the file system
Data(Vec<u8>)
Write data to destination as-is.
Implementations§
Source§impl AssetSource
impl AssetSource
Sourcepub fn from_path(
path: impl Into<PathBuf>,
preserve_existing_symlink: bool,
) -> Self
pub fn from_path( path: impl Into<PathBuf>, preserve_existing_symlink: bool, ) -> Self
Symlink must exist on disk to be preserved
pub fn path(&self) -> Option<&Path>
pub fn into_path(self) -> Option<PathBuf>
pub fn archive_as_symlink_only(&self) -> bool
pub fn file_size(&self) -> Option<u64>
pub fn data(&self) -> CDResult<Cow<'_, [u8]>>
Trait Implementations§
Source§impl Clone for AssetSource
impl Clone for AssetSource
Source§fn clone(&self) -> AssetSource
fn clone(&self) -> AssetSource
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 AssetSource
impl RefUnwindSafe for AssetSource
impl Send for AssetSource
impl Sync for AssetSource
impl Unpin for AssetSource
impl UnwindSafe for AssetSource
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<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