pub struct Rules { /* private fields */ }
Expand description
Struct which holds the rules for restrictions. For more information, see Ruleset
.
Example
let rules = Rules::new()
.add_read_only("/usr")
.add_read_only("/etc")
.add_read_only("/dev")
.add_read_only("/bin")
.add_read_write("/tmp/foo")
.add_bind_port(5050)
.add_connect_port(80)
.add_connect_port(443);
Implementations§
Source§impl Rules
impl Rules
Sourcepub fn add_read_only(self, p: impl Into<PathBuf>) -> Self
pub fn add_read_only(self, p: impl Into<PathBuf>) -> Self
Add a read-only path to the rules
Sourcepub fn add_read_write(self, p: impl Into<PathBuf>) -> Self
pub fn add_read_write(self, p: impl Into<PathBuf>) -> Self
Add a read/write path to the rules
Sourcepub fn add_write_only(self, p: impl Into<PathBuf>) -> Self
pub fn add_write_only(self, p: impl Into<PathBuf>) -> Self
Add a write-only path to the rules
Sourcepub fn add_connect_port(self, p: u16) -> Self
pub fn add_connect_port(self, p: u16) -> Self
Add a port to which the command can connect port to the rules
Sourcepub fn add_bind_port(self, p: u16) -> Self
pub fn add_bind_port(self, p: u16) -> Self
Add a port to which the command can bind to the rules
Trait Implementations§
impl Eq for Rules
impl StructuralPartialEq for Rules
Auto Trait Implementations§
impl Freeze for Rules
impl RefUnwindSafe for Rules
impl Send for Rules
impl Sync for Rules
impl Unpin for Rules
impl UnwindSafe for Rules
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