Struct Props

Source
pub struct Props { /* private fields */ }
Expand description

This struct is the one that gives you the desired behaviour.

It implements the following traits:

  1. Display for Props
  2. From for Props
  3. From for u32
  4. TryFrom for Props
  5. TryFrom<&Pathbuf> for Props
  6. TryFrom<&str> for Props
    (The TryFrom ones won’t appear in the documentation because they use Windows specific behaviour and it is put behind a conditional flag because docs.rs only uses a Linux container)

Implementations§

Source§

impl Props

Source

pub fn is_read_only(&self) -> Result<bool>

Returns true if the element is read_only. Not available on folders.

use keypropdecode::props::*;
let mut props = Props::default();
props.change_element_type(ArcDir::Archive(ArchiveProps::default()));
props.read_only(true).unwrap();

assert_eq!(props.is_read_only(), Ok(true));
Source

pub fn read_only(&mut self, read_only: bool) -> Result<()>

Allows to change the read_only state. Not available on folder.

Source

pub fn is_hidden(&self) -> bool

Returns true if the element is hidden.

use keypropdecode::props::*;
let mut props = Props::default();
props.hidden(true);

assert_eq!(props.is_hidden(), true);
Source

pub fn hidden(&mut self, hidden: bool)

Allows to change the hidden state.

Source

pub fn is_system(&self) -> bool

Returns true if the element is used for system purposes.

use keypropdecode::props::*;
let mut props = Props::from(0x4);

assert_eq!(props.is_system(), true);
Source

pub fn is_archive(&self) -> bool

Returns true if the element is a file.

use keypropdecode::props::*;
let mut props = Props::default();
props.change_element_type(ArcDir::Archive(ArchiveProps::default()));

assert_eq!(props.is_archive(), true);
Source

pub fn is_directory(&self) -> bool

Returns true if the element is a folder.

use keypropdecode::props::*;
let mut props = Props::default();
props.change_element_type(ArcDir::Directory);

assert_eq!(props.is_directory(), true);
Source

pub fn change_element_type(&mut self, element_type: ArcDir)

Allows to change the state archive state. You give the enum with the properties neccesary, no error checking neccesary.

Source

pub fn is_device(&self) -> bool

Returns true if the element represents a physical device in the file system. Reserved for system use

use keypropdecode::props::*;
let mut props = Props::from(0x40);

assert_eq!(props.is_device(), true);
Source

pub fn is_normal(&self) -> Result<bool>

Returns true if the element represents a normal file (a file that doesn’t have any properties except being a file(check docs for more info)).

use keypropdecode::props::*;
let mut props = Props::default();
props.change_element_type(ArcDir::Archive(ArchiveProps::default()));
props.normal(true);

assert_eq!(props.is_normal(), Ok(true));
Source

pub fn normal(&mut self, normal: bool) -> Result<()>

Allows to change the normal state.

Source

pub fn is_temporary(&self) -> Result<bool>

Returns true if the element represents a temporary file.

use keypropdecode::props::*;
let mut props = Props::default();
props.change_element_type(ArcDir::Archive(ArchiveProps::default()));
props.temporary(true).unwrap();

assert_eq!(props.is_temporary(), Ok(true));
Source

pub fn temporary(&mut self, temporary: bool) -> Result<()>

Allows to change the temporary state

Source

pub fn is_sparse(&self) -> Result<bool>

Returns true if the element represents a sparse file (made small for space saving purposes).

use keypropdecode::props::*;
let mut props = Props::default();
props.change_element_type(ArcDir::Archive(ArchiveProps::default()));
props.sparse(true).unwrap();

assert_eq!(props.is_sparse(), Ok(true));
Source

pub fn sparse(&mut self, sparse: bool) -> Result<()>

Allows to change the sparse state.

Source

pub fn is_reparse(&self) -> bool

Returns true if the element represents a reparse point in the file system (e.g. a symbolic link).

use keypropdecode::props::*;
let mut props = Props::default();
props.reparse(true);

assert_eq!(props.is_reparse(), true);
Source

pub fn reparse(&mut self, reparse: bool)

Allows to change the reparse state.

Source

pub fn is_compressed(&self) -> bool

Returns true if the element represents a compressed file

use keypropdecode::props::*;
let mut props = Props::default();
props.compressed(true);

assert_eq!(props.is_compressed(), true);
Source

pub fn compressed(&mut self, compressed: bool)

Allows to change the compressed state

Source

pub fn is_offline(&self) -> Result<bool>

Returns true if the element is not available inmediately. Aplications should not change this value in an arbitrary way.

use keypropdecode::props::*;
let mut props = Props::default();
props.change_element_type(ArcDir::Archive(ArchiveProps::default()));
props.offline(true).unwrap();

assert_eq!(props.is_offline(), Ok(true));
Source

pub fn offline(&mut self, offline: bool) -> Result<()>

Allows to change the offline state

Source

pub fn is_not_content_indexed(&self) -> bool

Returns true if the element isn’t indexed by the content indexing service

use keypropdecode::props::*;
let mut props = Props::default();
props.not_content_indexed(true);

assert_eq!(props.is_not_content_indexed(), true);
Source

pub fn not_content_indexed(&mut self, not_content_indexed: bool)

Allows to change the not_content_indexed state

Source

pub fn is_encrypted(&self) -> bool

Returns true if the element is encrypted

use keypropdecode::props::*;
let mut props = Props::default();
props.encrypted(true);

assert_eq!(props.is_encrypted(), true);
Source

pub fn encrypted(&mut self, encrypted: bool)

Allows to change the encrypted state

Source

pub fn is_integrity_stream(&self) -> bool

Returns true if the directory or user data stream is configured with integrity

use keypropdecode::props::*;
let mut props = Props::default();
props.integrity_stream(true);

assert_eq!(props.is_integrity_stream(), true);
Source

pub fn integrity_stream(&mut self, integrity_stream: bool)

Allows to change the integrity_stream state

Source

pub fn is_virtual_file(&self) -> bool

Returns true if the element is a virtual file. This value is reserver for system use

use keypropdecode::props::*;
let mut props = Props::from(0x10000);

assert_eq!(props.is_virtual_file(), true);
Source

pub fn is_no_scrub_data(&self) -> bool

Returns true if the user data stream not to be read by the background data integrity scanner (AKA scrubber)

use keypropdecode::props::*;
let mut props = Props::default();
props.no_scrub_data(true);

assert_eq!(props.is_no_scrub_data(), true);
Source

pub fn no_scrub_data(&mut self, no_scrub_data: bool)

Allows to change the virtual_file state

Source

pub fn is_extended_attributes(&self) -> bool

Returns true if the element has got extended attributes. System internal use only.

use keypropdecode::props::*;
let mut props = Props::from(0x40000);

assert_eq!(props.is_extended_attributes(), true);
Source

pub fn is_pinned(&self) -> bool

Returns true if the element is indicated user intent that the file or directory should be kept fully present locally even when not being actively accessed.

use keypropdecode::props::*;
let mut props = Props::default();
props.pinned(true);

assert_eq!(props.is_pinned(), true);
Source

pub fn pinned(&mut self, pinned: bool)

Allows to change the pinned state

Source

pub fn is_unpinned(&self) -> bool

Returns true if the element is indicated user intent that the file or directory shouldn’t be kept fully present locally except when being actively accessed.

use keypropdecode::props::*;
let mut props = Props::default();
props.unpinned(true);

assert_eq!(props.is_unpinned(), true);
Source

pub fn unpinned(&mut self, unpinned: bool)

Allows to change the unpinned state

Source

pub fn is_recall_on_open(&self) -> bool

Returns true if the element hasn’t got any physical representation on the local system; the item is vitual. Opening the item will be more expensive than normal, e.g., a file in a remote storage

use keypropdecode::props::*;
let mut props = Props::default();
props.recall_on_open(true);

assert_eq!(props.is_recall_on_open(), true);
Source

pub fn recall_on_open(&mut self, recall_on_open: bool)

Allows to change the recall_on_open state

Source

pub fn is_recall_on_data_access(&self) -> bool

Returns true if the element isn’t fully present locally.

use keypropdecode::props::*;
let mut props = Props::default();
props.recall_on_data_access(true);

assert_eq!(props.is_recall_on_data_access(), true);
Source

pub fn recall_on_data_access(&mut self, recall_on_data_access: bool)

Allows to change the recall_on_data_access state

Trait Implementations§

Source§

impl Clone for Props

Source§

fn clone(&self) -> Props

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Props

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Props

Source§

fn default() -> Props

Returns the “default value” for a type. Read more
Source§

impl Display for Props

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<Props> for u32

Source§

fn from(value: Props) -> Self

Converts to this type from the input type.
Source§

impl From<u32> for Props

Source§

fn from(value: u32) -> Self

Converts to this type from the input type.
Source§

impl Ord for Props

Source§

fn cmp(&self, other: &Props) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for Props

Source§

fn eq(&self, other: &Props) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for Props

Source§

fn partial_cmp(&self, other: &Props) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Copy for Props

Source§

impl Eq for Props

Source§

impl StructuralPartialEq for Props

Auto Trait Implementations§

§

impl Freeze for Props

§

impl RefUnwindSafe for Props

§

impl Send for Props

§

impl Sync for Props

§

impl Unpin for Props

§

impl UnwindSafe for Props

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.