pub struct FileMetadata(/* private fields */);
Expand description
File metadata, essentially flags to indicate permissions and nature of a file tracked by Pijul.
Implementations§
Source§impl FileMetadata
impl FileMetadata
Sourcepub fn from_contents(p: &[u8]) -> Self
pub fn from_contents(p: &[u8]) -> Self
Read the file metadata from the file name encoded in the repository.
Sourcepub fn new(perm: usize, is_dir: bool) -> Self
pub fn new(perm: usize, is_dir: bool) -> Self
Create a new file metadata with the given Unix permissions, and “is directory” bit.
Sourcepub fn permissions(&self) -> u16
pub fn permissions(&self) -> u16
Permissions of this file (as in Unix).
Sourcepub fn set_permissions(&mut self, perm: u16)
pub fn set_permissions(&mut self, perm: u16)
Set permissions of this file to the supplied parameters.
Trait Implementations§
Source§impl Clone for FileMetadata
impl Clone for FileMetadata
Source§fn clone(&self) -> FileMetadata
fn clone(&self) -> FileMetadata
Returns a copy 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 moreSource§impl Debug for FileMetadata
impl Debug for FileMetadata
Source§impl Hash for FileMetadata
impl Hash for FileMetadata
Source§impl Ord for FileMetadata
impl Ord for FileMetadata
Source§fn cmp(&self, other: &FileMetadata) -> Ordering
fn cmp(&self, other: &FileMetadata) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for FileMetadata
impl PartialEq for FileMetadata
Source§impl PartialOrd for FileMetadata
impl PartialOrd for FileMetadata
impl Copy for FileMetadata
impl Eq for FileMetadata
impl StructuralPartialEq for FileMetadata
Auto Trait Implementations§
impl Freeze for FileMetadata
impl RefUnwindSafe for FileMetadata
impl Send for FileMetadata
impl Sync for FileMetadata
impl Unpin for FileMetadata
impl UnwindSafe for FileMetadata
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