pub enum SocketDirection {
Expose,
Mount,
}Expand description
Direction a published Unix socket is bridged.
Variants§
Expose
A guest process listens on the guest path; smolvm exposes it on the host. Host clients connect in — the Docker-bridge pattern.
Mount
A host process listens on the host path; smolvm makes it reachable inside the guest at the guest path. Guest clients connect in — the SSH-agent pattern.
Implementations§
Source§impl SocketDirection
impl SocketDirection
Sourcepub fn host_listens(&self) -> bool
pub fn host_listens(&self) -> bool
The libkrun krun_add_vsock_port2 listen flag for this direction.
Expose: the guest serves on the vsock port and the host connects in, so
libkrun listens on the host-side socket (true). Mount: the guest
connects out to the vsock port and libkrun dials the host socket, so
libkrun does not listen (false).
Trait Implementations§
Source§impl Clone for SocketDirection
impl Clone for SocketDirection
Source§fn clone(&self) -> SocketDirection
fn clone(&self) -> SocketDirection
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 moreimpl Copy for SocketDirection
Source§impl Debug for SocketDirection
impl Debug for SocketDirection
Source§impl<'de> Deserialize<'de> for SocketDirection
impl<'de> Deserialize<'de> for SocketDirection
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>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for SocketDirection
Source§impl FromStr for SocketDirection
impl FromStr for SocketDirection
Source§impl PartialEq for SocketDirection
impl PartialEq for SocketDirection
Source§impl Serialize for SocketDirection
impl Serialize for SocketDirection
impl StructuralPartialEq for SocketDirection
Auto Trait Implementations§
impl Freeze for SocketDirection
impl RefUnwindSafe for SocketDirection
impl Send for SocketDirection
impl Sync for SocketDirection
impl Unpin for SocketDirection
impl UnsafeUnpin for SocketDirection
impl UnwindSafe for SocketDirection
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