pub struct BiPortMapping { /* private fields */ }
Expand description
Port mapping for sandbox instances - bidirectional for fast lookups
Implementations§
Source§impl BiPortMapping
impl BiPortMapping
Sourcepub fn insert(&mut self, sandbox_key: String, port: u16)
pub fn insert(&mut self, sandbox_key: String, port: u16)
Insert a mapping, handling any existing mappings for the port or sandbox
Sourcepub fn remove_by_sandbox(&mut self, sandbox_key: &str) -> Option<u16>
pub fn remove_by_sandbox(&mut self, sandbox_key: &str) -> Option<u16>
Remove a mapping by sandbox key
Sourcepub fn remove_by_port(&mut self, port: u16) -> Option<String>
pub fn remove_by_port(&mut self, port: u16) -> Option<String>
Remove a mapping by port
Sourcepub fn get_sandbox(&self, port: u16) -> Option<&String>
pub fn get_sandbox(&self, port: u16) -> Option<&String>
Get sandbox key by port
Sourcepub fn to_port_mapping(&self) -> PortMapping
pub fn to_port_mapping(&self) -> PortMapping
Convert to serializable format
Sourcepub fn from_port_mapping(mapping: PortMapping) -> Self
pub fn from_port_mapping(mapping: PortMapping) -> Self
Load from serializable format
Trait Implementations§
Source§impl Clone for BiPortMapping
impl Clone for BiPortMapping
Source§fn clone(&self) -> BiPortMapping
fn clone(&self) -> BiPortMapping
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for BiPortMapping
impl Debug for BiPortMapping
Source§impl Default for BiPortMapping
impl Default for BiPortMapping
Source§fn default() -> BiPortMapping
fn default() -> BiPortMapping
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for BiPortMapping
impl RefUnwindSafe for BiPortMapping
impl Send for BiPortMapping
impl Sync for BiPortMapping
impl Unpin for BiPortMapping
impl UnwindSafe for BiPortMapping
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more