Trait libimagentryref::reference::Ref [] [src]

pub trait Ref {
    fn is_ref(&self) -> Result<bool>;
fn get_path_hash(&self) -> Result<String>;
fn get_stored_hash(&self) -> Result<String>;
fn get_stored_hash_with_hasher<H: Hasher>(&self, h: &H) -> Result<String>;
fn get_current_hash(&self) -> Result<String>;
fn get_current_hash_with_hasher<H: Hasher>(&self, h: H) -> Result<String>;
fn fs_link_exists(&self) -> Result<bool>;
fn is_ref_to_file(&self) -> Result<bool>;
fn is_ref_to_dir(&self) -> Result<bool>;
fn is_dangling(&self) -> Result<bool>;
fn fs_link_valid(&self) -> Result<bool>;
fn fs_link_valid_permissions(&self) -> Result<bool>;
fn fs_link_valid_hash(&self) -> Result<bool>;
fn update_ref(&mut self) -> Result<()>;
fn update_ref_with_hasher<H: Hasher>(&mut self, h: &H) -> Result<()>;
fn fs_file(&self) -> Result<PathBuf>;
fn refind(&self, search_roots: Option<Vec<PathBuf>>) -> Result<PathBuf>;
fn refind_with_hasher<H: Hasher>(
        &self,
        search_roots: Option<Vec<PathBuf>>,
        h: H
    ) -> Result<PathBuf>;
fn get_current_permissions(&self) -> Result<Permissions>; }

Required Methods

Check whether the underlying object is actually a ref

Get the hash from the path of the ref

Get the hash of the link target which is stored in the ref object

Get the hahs of the link target which is stored in the ref object, which is hashed with a custom Hasher instance.

Get the hash of the link target by reading the link target and hashing the contents

Get the hash of the link target by reading the link target and hashing the contents with the custom hasher

check whether the pointer the Ref represents still points to a file which exists

Alias for r.fs_link_exists() && r.deref().is_file()

Alias for r.fs_link_exists() && r.deref().is_dir()

Alias for !Ref::fs_link_exists()

check whether the pointer the Ref represents is valid This includes: - Hashsum of the file is still the same as stored in the Ref - file permissions are still valid

Check whether the file permissions of the referenced file are equal to the stored permissions

Check whether the Hashsum of the referenced file is equal to the stored hashsum

Update the Ref by re-checking the file from FS This errors if the file is not present or cannot be read()

Update the Ref by re-checking the file from FS using the passed Hasher instance This errors if the file is not present or cannot be read()

Get the path of the file which is reffered to by this Ref

Re-find a referenced file

This function tries to re-find a ref by searching all directories in search_roots recursively for a file which matches the hash of the Ref.

If search_roots is None, it starts at the filesystem root /.

If the target cannot be found, this yields a RefTargetDoesNotExist error kind.

Warning

This option causes heavy I/O as it recursively searches the Filesystem.

See documentation of Ref::refind()

Get the permissions of the file which are present

Implementations on Foreign Types

impl Ref for Entry
[src]

[src]

Check whether the underlying object is actually a ref

[src]

Get the hash from the path of the ref

[src]

Get the hash of the link target which is stored in the ref object

[src]

Get the hahs of the link target which is stored in the ref object, which is hashed with a custom Hasher instance.

[src]

Get the hash of the link target by reading the link target and hashing the contents

[src]

Get the hash of the link target by reading the link target and hashing the contents with the custom hasher

check whether the pointer the Ref represents still points to a file which exists

[src]

Alias for r.fs_link_exists() && r.deref().is_file()

[src]

Alias for r.fs_link_exists() && r.deref().is_dir()

[src]

Alias for !Ref::fs_link_exists()

check whether the pointer the Ref represents is valid This includes: - Hashsum of the file is still the same as stored in the Ref - file permissions are still valid

Check whether the file permissions of the referenced file are equal to the stored permissions

Check whether the Hashsum of the referenced file is equal to the stored hashsum

[src]

Update the Ref by re-checking the file from FS This errors if the file is not present or cannot be read()

[src]

Update the Ref by re-checking the file from FS using the passed Hasher instance This errors if the file is not present or cannot be read()

[src]

Get the path of the file which is reffered to by this Ref

[src]

Re-find a referenced file

This function tries to re-find a ref by searching all directories in search_roots recursively for a file which matches the hash of the Ref.

If search_roots is None, it starts at the filesystem root /.

If the target cannot be found, this yields a RefTargetDoesNotExist error kind.

Warning

This option causes heavy I/O as it recursively searches the Filesystem.

[src]

See documentation of Ref::refind()

[src]

Get the permissions of the file which are present

Implementors