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
fn is_ref(&self) -> Result<bool>
Check whether the underlying object is actually a ref
fn get_path_hash(&self) -> Result<String>
Get the hash from the path of the ref
fn get_stored_hash(&self) -> Result<String>
Get the hash of the link target which is stored in the ref object
fn get_stored_hash_with_hasher<H: Hasher>(&self, h: &H) -> Result<String>
Get the hahs of the link target which is stored in the ref object, which is hashed with a custom Hasher instance.
fn get_current_hash(&self) -> Result<String>
Get the hash of the link target by reading the link target and hashing the contents
fn get_current_hash_with_hasher<H: Hasher>(&self, h: H) -> Result<String>
Get the hash of the link target by reading the link target and hashing the contents with the custom hasher
fn fs_link_exists(&self) -> Result<bool>
check whether the pointer the Ref represents still points to a file which exists
fn is_ref_to_file(&self) -> Result<bool>
Alias for r.fs_link_exists() && r.deref().is_file()
fn is_ref_to_dir(&self) -> Result<bool>
Alias for r.fs_link_exists() && r.deref().is_dir()
fn is_dangling(&self) -> Result<bool>
Alias for !Ref::fs_link_exists()
fn fs_link_valid(&self) -> Result<bool>
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
fn fs_link_valid_permissions(&self) -> Result<bool>
Check whether the file permissions of the referenced file are equal to the stored permissions
fn fs_link_valid_hash(&self) -> Result<bool>
Check whether the Hashsum of the referenced file is equal to the stored hashsum
fn update_ref(&mut self) -> Result<()>
Update the Ref by re-checking the file from FS This errors if the file is not present or cannot be read()
fn update_ref_with_hasher<H: Hasher>(&mut self, h: &H) -> Result<()>
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()
fn fs_file(&self) -> Result<PathBuf>
Get the path of the file which is reffered to by this Ref
fn refind(&self, search_roots: Option<Vec<PathBuf>>) -> Result<PathBuf>
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.
fn refind_with_hasher<H: Hasher>(
&self,
search_roots: Option<Vec<PathBuf>>,
h: H
) -> Result<PathBuf>
&self,
search_roots: Option<Vec<PathBuf>>,
h: H
) -> Result<PathBuf>
See documentation of Ref::refind()
fn get_current_permissions(&self) -> Result<Permissions>
Get the permissions of the file which are present
Implementations on Foreign Types
impl Ref for Entry
[src]
fn is_ref(&self) -> Result<bool>
[src]
Check whether the underlying object is actually a ref
fn get_path_hash(&self) -> Result<String>
[src]
Get the hash from the path of the ref
fn get_stored_hash(&self) -> Result<String>
[src]
Get the hash of the link target which is stored in the ref object
fn get_stored_hash_with_hasher<H: Hasher>(&self, h: &H) -> Result<String>
[src]
Get the hahs of the link target which is stored in the ref object, which is hashed with a custom Hasher instance.
fn get_current_hash(&self) -> Result<String>
[src]
Get the hash of the link target by reading the link target and hashing the contents
fn get_current_hash_with_hasher<H: Hasher>(&self, h: H) -> Result<String>
[src]
Get the hash of the link target by reading the link target and hashing the contents with the custom hasher
fn fs_link_exists(&self) -> Result<bool>
[src]
check whether the pointer the Ref represents still points to a file which exists
fn is_ref_to_file(&self) -> Result<bool>
[src]
Alias for r.fs_link_exists() && r.deref().is_file()
fn is_ref_to_dir(&self) -> Result<bool>
[src]
Alias for r.fs_link_exists() && r.deref().is_dir()
fn is_dangling(&self) -> Result<bool>
[src]
Alias for !Ref::fs_link_exists()
fn fs_link_valid(&self) -> Result<bool>
[src]
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
fn fs_link_valid_permissions(&self) -> Result<bool>
[src]
Check whether the file permissions of the referenced file are equal to the stored permissions
fn fs_link_valid_hash(&self) -> Result<bool>
[src]
Check whether the Hashsum of the referenced file is equal to the stored hashsum
fn update_ref(&mut self) -> Result<()>
[src]
Update the Ref by re-checking the file from FS This errors if the file is not present or cannot be read()
fn update_ref_with_hasher<H: Hasher>(&mut self, h: &H) -> Result<()>
[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()
fn fs_file(&self) -> Result<PathBuf>
[src]
Get the path of the file which is reffered to by this Ref
fn refind(&self, search_roots: Option<Vec<PathBuf>>) -> Result<PathBuf>
[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.
fn refind_with_hasher<H: Hasher>(
&self,
search_roots: Option<Vec<PathBuf>>,
h: H
) -> Result<PathBuf>
[src]
&self,
search_roots: Option<Vec<PathBuf>>,
h: H
) -> Result<PathBuf>
See documentation of Ref::refind()
fn get_current_permissions(&self) -> Result<Permissions>
[src]
Get the permissions of the file which are present