pub enum UnixSocketMode {
Connect,
ConnectBind,
}Expand description
Which operations are permitted on a pathname AF_UNIX socket.
Mirrors AccessMode for files: Connect is the read-analog
(client-side use of an existing socket), ConnectBind is the write-analog
(also permits bind(2), which creates the socket file — i.e. offering a
service at that path). Default grants should omit bind; use ConnectBind
only when the sandboxed program creates the socket itself (e.g. tsx’s
self-IPC pipe in issue #685).
Invariant separate-read-write (see proj/invariants.yaml).
Variants§
Connect
Allow connect(2) only. The socket must already exist.
ConnectBind
Allow both connect(2) and bind(2). bind(2) creates the socket
file at grant time so the path need not exist yet.
Implementations§
Source§impl UnixSocketMode
impl UnixSocketMode
Sourcepub fn permits_bind(self) -> bool
pub fn permits_bind(self) -> bool
True if this mode permits bind(2) on the granted path.
Trait Implementations§
Source§impl Clone for UnixSocketMode
impl Clone for UnixSocketMode
Source§fn clone(&self) -> UnixSocketMode
fn clone(&self) -> UnixSocketMode
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for UnixSocketMode
Source§impl Debug for UnixSocketMode
impl Debug for UnixSocketMode
Source§impl<'de> Deserialize<'de> for UnixSocketMode
impl<'de> Deserialize<'de> for UnixSocketMode
Source§fn 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>,
Source§impl Display for UnixSocketMode
impl Display for UnixSocketMode
impl Eq for UnixSocketMode
Source§impl PartialEq for UnixSocketMode
impl PartialEq for UnixSocketMode
Source§fn eq(&self, other: &UnixSocketMode) -> bool
fn eq(&self, other: &UnixSocketMode) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for UnixSocketMode
impl Serialize for UnixSocketMode
impl StructuralPartialEq for UnixSocketMode
Auto Trait Implementations§
impl Freeze for UnixSocketMode
impl RefUnwindSafe for UnixSocketMode
impl Send for UnixSocketMode
impl Sync for UnixSocketMode
impl Unpin for UnixSocketMode
impl UnsafeUnpin for UnixSocketMode
impl UnwindSafe for UnixSocketMode
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.