pub struct NetPort { /* private fields */ }
Expand description
Landlock rule for a network port.
§Example
use landlock::{AccessNet, NetPort};
fn bind_http() -> NetPort {
NetPort::new(80, AccessNet::BindTcp)
}
Implementations§
Trait Implementations§
source§impl Compatible for &mut NetPort
impl Compatible for &mut NetPort
source§fn set_compatibility(self, level: CompatLevel) -> Self
fn set_compatibility(self, level: CompatLevel) -> Self
To enable a best-effort security approach,
Landlock features that are not supported by the running system
are silently ignored by default,
which is a sane choice for most use cases.
However, on some rare circumstances,
developers may want to have some guarantees that their applications
will not run if a certain level of sandboxing is not possible.
If we really want to error out when not all our requested requirements are met,
then we can configure it with
set_compatibility()
. Read moresource§fn set_best_effort(self, best_effort: bool) -> Selfwhere
Self: Sized,
fn set_best_effort(self, best_effort: bool) -> Selfwhere
Self: Sized,
👎Deprecated: Use set_compatibility() instead
source§impl Compatible for NetPort
impl Compatible for NetPort
source§fn set_compatibility(self, level: CompatLevel) -> Self
fn set_compatibility(self, level: CompatLevel) -> Self
To enable a best-effort security approach,
Landlock features that are not supported by the running system
are silently ignored by default,
which is a sane choice for most use cases.
However, on some rare circumstances,
developers may want to have some guarantees that their applications
will not run if a certain level of sandboxing is not possible.
If we really want to error out when not all our requested requirements are met,
then we can configure it with
set_compatibility()
. Read moresource§fn set_best_effort(self, best_effort: bool) -> Selfwhere
Self: Sized,
fn set_best_effort(self, best_effort: bool) -> Selfwhere
Self: Sized,
👎Deprecated: Use set_compatibility() instead
impl Rule<AccessNet> for NetPort
Auto Trait Implementations§
impl Freeze for NetPort
impl RefUnwindSafe for NetPort
impl Send for NetPort
impl Sync for NetPort
impl Unpin for NetPort
impl UnwindSafe for NetPort
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