Struct libpijul_compat::FileMetadata
source · pub struct FileMetadata(_);
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<FileMetadata> for FileMetadata
impl PartialEq<FileMetadata> for FileMetadata
source§fn eq(&self, other: &FileMetadata) -> bool
fn eq(&self, other: &FileMetadata) -> bool
source§impl PartialOrd<FileMetadata> for FileMetadata
impl PartialOrd<FileMetadata> for FileMetadata
source§fn partial_cmp(&self, other: &FileMetadata) -> Option<Ordering>
fn partial_cmp(&self, other: &FileMetadata) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read more