Struct alpm_types::Filename
source · pub struct Filename {
inner: PathBuf,
}
Expand description
Represents a single (relative) filename, without any directories.
Fields§
§inner: PathBuf
Implementations§
source§impl Filename
impl Filename
sourcepub fn new(s: String) -> Result<Self, Error>
pub fn new(s: String) -> Result<Self, Error>
Checks that the given string is a single filename.
§Errors
Returns an error if the string contains directories, is absolute, or is otherwise an invalid path.
sourcepub fn into_string(self) -> String
pub fn into_string(self) -> String
Consumes the Filename
and returns the filename as a String
.
sourcepub fn into_inner(self) -> PathBuf
pub fn into_inner(self) -> PathBuf
Consumes the Filename
and returns the filename as a PathBuf
.
Trait Implementations§
source§impl PartialEq for Filename
impl PartialEq for Filename
impl Eq for Filename
impl StructuralPartialEq for Filename
Auto Trait Implementations§
impl Freeze for Filename
impl RefUnwindSafe for Filename
impl Send for Filename
impl Sync for Filename
impl Unpin for Filename
impl UnwindSafe for Filename
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