Skip to main content

PathLike

Struct PathLike 

Source
pub struct PathLike<'a, R: Read + Seek> { /* private fields */ }
Expand description

A representation of a path within the archive.

Caution: do not attempt to push directory components manually but use PathLike::push() instead. The reason is that on Windows, backslash would be used to separate directories, but in a zip file, slashes are always used.

Implementations§

Source§

impl<'a, R: Read + Seek> PathLike<'a, R>

Source

pub fn push<P: AsRef<Path>>(&mut self, p: P)

Source

pub fn join<P: AsRef<Path>>(self, p: P) -> Self

Source

pub fn path(&mut self) -> &Path

Source

pub fn replace(&mut self, relname: PathBuf) -> PathBuf

Source

pub fn extension(&mut self) -> Option<&OsStr>

Source

pub fn set_extension(&mut self, e: &str) -> bool

Source

pub fn display(&self) -> Display<'_>

Source

pub fn exists(&mut self) -> bool

Source

pub fn open(self) -> Result<FileReader<'a>>

Source

pub fn is_file(&mut self) -> bool

Source

pub fn list_paths(&self) -> Result<Vec<PathBuf>>

Lists, non-recursively, the paths in this directory.

Trait Implementations§

Source§

impl<'a, R: Debug + Read + Seek> Debug for PathLike<'a, R>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a, R> Freeze for PathLike<'a, R>

§

impl<'a, R> RefUnwindSafe for PathLike<'a, R>
where R: RefUnwindSafe,

§

impl<'a, R> Send for PathLike<'a, R>
where R: Send,

§

impl<'a, R> Sync for PathLike<'a, R>
where R: Sync,

§

impl<'a, R> Unpin for PathLike<'a, R>

§

impl<'a, R> UnsafeUnpin for PathLike<'a, R>

§

impl<'a, R> !UnwindSafe for PathLike<'a, R>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.