pub struct Props { /* private fields */ }
Expand description
This struct is the one that gives you the desired behaviour.
It implements the following traits:
- Display for Props
- From
for Props - From
for u32 - TryFrom
for Props - TryFrom<&Pathbuf> for Props
- 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
impl Props
Sourcepub fn is_read_only(&self) -> Result<bool>
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));
Sourcepub fn read_only(&mut self, read_only: bool) -> Result<()>
pub fn read_only(&mut self, read_only: bool) -> Result<()>
Allows to change the read_only state. Not available on folder.
Returns true if the element is hidden.
use keypropdecode::props::*;
let mut props = Props::default();
props.hidden(true);
assert_eq!(props.is_hidden(), true);
Allows to change the hidden state.
Sourcepub fn is_system(&self) -> bool
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);
Sourcepub fn is_archive(&self) -> bool
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);
Sourcepub fn is_directory(&self) -> bool
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);
Sourcepub fn change_element_type(&mut self, element_type: ArcDir)
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.
Sourcepub fn is_device(&self) -> bool
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);
Sourcepub fn is_normal(&self) -> Result<bool>
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));
Sourcepub fn is_temporary(&self) -> Result<bool>
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));
Sourcepub fn temporary(&mut self, temporary: bool) -> Result<()>
pub fn temporary(&mut self, temporary: bool) -> Result<()>
Allows to change the temporary state
Sourcepub fn is_sparse(&self) -> Result<bool>
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));
Sourcepub fn is_reparse(&self) -> bool
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);
Sourcepub fn is_compressed(&self) -> bool
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);
Sourcepub fn compressed(&mut self, compressed: bool)
pub fn compressed(&mut self, compressed: bool)
Allows to change the compressed state
Sourcepub fn is_offline(&self) -> Result<bool>
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));
Sourcepub fn is_not_content_indexed(&self) -> bool
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);
Sourcepub fn not_content_indexed(&mut self, not_content_indexed: bool)
pub fn not_content_indexed(&mut self, not_content_indexed: bool)
Allows to change the not_content_indexed state
Sourcepub fn is_encrypted(&self) -> bool
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);
Sourcepub fn is_integrity_stream(&self) -> bool
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);
Sourcepub fn integrity_stream(&mut self, integrity_stream: bool)
pub fn integrity_stream(&mut self, integrity_stream: bool)
Allows to change the integrity_stream state
Sourcepub fn is_virtual_file(&self) -> bool
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);
Sourcepub fn is_no_scrub_data(&self) -> bool
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);
Sourcepub fn no_scrub_data(&mut self, no_scrub_data: bool)
pub fn no_scrub_data(&mut self, no_scrub_data: bool)
Allows to change the virtual_file state
Sourcepub fn is_extended_attributes(&self) -> bool
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);
Sourcepub fn is_pinned(&self) -> bool
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);
Sourcepub fn is_unpinned(&self) -> bool
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);
Sourcepub fn is_recall_on_open(&self) -> bool
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);
Sourcepub fn recall_on_open(&mut self, recall_on_open: bool)
pub fn recall_on_open(&mut self, recall_on_open: bool)
Allows to change the recall_on_open state
Sourcepub fn is_recall_on_data_access(&self) -> bool
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);
Sourcepub fn recall_on_data_access(&mut self, recall_on_data_access: bool)
pub fn recall_on_data_access(&mut self, recall_on_data_access: bool)
Allows to change the recall_on_data_access state