Struct fs_mistrust::MistrustBuilder
source · [−]pub struct MistrustBuilder { /* private fields */ }
Expand description
Builder for Mistrust
.
Implementations
sourceimpl MistrustBuilder
impl MistrustBuilder
sourcepub fn ignore_prefix<VALUE: Into<PathBuf>>(&mut self, value: VALUE) -> &mut Self
pub fn ignore_prefix<VALUE: Into<PathBuf>>(&mut self, value: VALUE) -> &mut Self
If the user called MistrustBuilder::ignore_prefix
, what did they give us?
(This is stored in canonical form.)
sourcepub fn trust_user<VALUE: Into<TrustedUser>>(
&mut self,
value: VALUE
) -> &mut Self
pub fn trust_user<VALUE: Into<TrustedUser>>(
&mut self,
value: VALUE
) -> &mut Self
What user ID do we trust by default (if any?)
sourcepub fn trust_group<VALUE: Into<TrustedGroup>>(
&mut self,
value: VALUE
) -> &mut Self
pub fn trust_group<VALUE: Into<TrustedGroup>>(
&mut self,
value: VALUE
) -> &mut Self
What group ID do we trust by default (if any?)
sourceimpl MistrustBuilder
impl MistrustBuilder
sourcepub fn trust_admin_only(&mut self) -> &mut Self
pub fn trust_admin_only(&mut self) -> &mut Self
Configure this Mistrust
to trust only the admin (root) user.
By default, both the currently running user and the root user will be trusted.
This option disables the default group-trust behavior as well.
sourcepub fn trust_no_group_id(&mut self) -> &mut Self
pub fn trust_no_group_id(&mut self) -> &mut Self
Configure this Mistrust
to trust no groups at all.
By default, we trust the group (if any) with the same name as the current user if we are currently running as a member of that group.
With this option set, no group is trusted, and and any group-readable or group-writable objects are treated the same as world-readable and world-writable objects respectively.
sourcepub fn dangerously_trust_everyone(&mut self) -> &mut Self
pub fn dangerously_trust_everyone(&mut self) -> &mut Self
Configure this Mistrust
to trust every user and every group.
With this option set, every file and directory is treated as having valid permissions: even world-writeable files are allowed. File-type checks are still performed.
This option is mainly useful to handle cases where you want to make
these checks optional, and still use CheckedDir
without having to
implement separate code paths for the “checking on” and “checking off”
cases.
sourcepub fn remove_ignored_prefix(&mut self) -> &mut Self
pub fn remove_ignored_prefix(&mut self) -> &mut Self
Remove any ignored prefix, restoring this MistrustBuilder
to a state
as if MistrustBuilder::ignore_prefix
had not been called.
Trait Implementations
sourceimpl Clone for MistrustBuilder
impl Clone for MistrustBuilder
sourcefn clone(&self) -> MistrustBuilder
fn clone(&self) -> MistrustBuilder
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for MistrustBuilder
impl Debug for MistrustBuilder
sourceimpl Default for MistrustBuilder
impl Default for MistrustBuilder
sourceimpl<'de> Deserialize<'de> for MistrustBuilder where
MistrustBuilder: Default,
impl<'de> Deserialize<'de> for MistrustBuilder where
MistrustBuilder: Default,
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl Serialize for MistrustBuilder
impl Serialize for MistrustBuilder
Auto Trait Implementations
impl RefUnwindSafe for MistrustBuilder
impl Send for MistrustBuilder
impl Sync for MistrustBuilder
impl Unpin for MistrustBuilder
impl UnwindSafe for MistrustBuilder
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more