pub struct FileReadPolicy { /* private fields */ }Expand description
Closed read policy for one filesystem inspector.
Implementations§
Source§impl FileReadPolicy
impl FileReadPolicy
Sourcepub fn new<I, P>(roots: I) -> InfraResult<Self>
pub fn new<I, P>(roots: I) -> InfraResult<Self>
Creates a read policy with absolute normalized roots.
Sourcepub fn with_preview_limit(self, bytes: usize) -> InfraResult<Self>
pub fn with_preview_limit(self, bytes: usize) -> InfraResult<Self>
Sets the maximum preview bytes retained in memory.
Sourcepub fn with_hash_limit(self, bytes: u64) -> InfraResult<Self>
pub fn with_hash_limit(self, bytes: u64) -> InfraResult<Self>
Sets the maximum file size admitted for hashing.
Sourcepub fn roots(&self) -> impl Iterator<Item = &Path>
pub fn roots(&self) -> impl Iterator<Item = &Path>
Returns admitted roots in deterministic order.
Sourcepub const fn max_preview_bytes(&self) -> usize
pub const fn max_preview_bytes(&self) -> usize
Returns the preview byte limit.
Sourcepub const fn max_hash_bytes(&self) -> u64
pub const fn max_hash_bytes(&self) -> u64
Returns the hash byte limit.
Trait Implementations§
Source§impl Clone for FileReadPolicy
impl Clone for FileReadPolicy
Source§fn clone(&self) -> FileReadPolicy
fn clone(&self) -> FileReadPolicy
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 FileReadPolicy
impl Debug for FileReadPolicy
Source§impl PartialEq for FileReadPolicy
impl PartialEq for FileReadPolicy
Source§fn eq(&self, other: &FileReadPolicy) -> bool
fn eq(&self, other: &FileReadPolicy) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for FileReadPolicy
impl StructuralPartialEq for FileReadPolicy
Auto Trait Implementations§
impl Freeze for FileReadPolicy
impl RefUnwindSafe for FileReadPolicy
impl Send for FileReadPolicy
impl Sync for FileReadPolicy
impl Unpin for FileReadPolicy
impl UnsafeUnpin for FileReadPolicy
impl UnwindSafe for FileReadPolicy
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.