pub struct Consomme { /* private fields */ }Expand description
A consomme instance.
Implementations§
Source§impl Consomme
impl Consomme
Sourcepub fn new(params: ConsommeParams) -> Self
pub fn new(params: ConsommeParams) -> Self
Creates a new consomme instance with specified state.
Sourcepub fn params_mut(&mut self) -> &mut ConsommeParams
pub fn params_mut(&mut self) -> &mut ConsommeParams
Get access to the parameters to be updated.
FUTURE: add support for updating only the parameters that can be safely changed at runtime.
Sourcepub fn clear_local_addr_map(&mut self)
pub fn clear_local_addr_map(&mut self)
Clears the local address mapping table. Call this after changing the
network configuration (e.g., via ConsommeParams::set_cidr) to avoid
stale or conflicting virtual address mappings.
Some in-flight packets may be lost during the transition; this is acceptable.
Sourcepub fn add_dns_record(
&mut self,
record: StaticDnsRecord,
name: &str,
) -> Result<(), StaticDnsRecordError>
pub fn add_dns_record( &mut self, record: StaticDnsRecord, name: &str, ) -> Result<(), StaticDnsRecordError>
Adds a static DNS record that will be returned directly if the guest sends a matching query.
Sourcepub fn create_virtual_address(&mut self, destination: IpAddr) -> Option<IpAddr>
pub fn create_virtual_address(&mut self, destination: IpAddr) -> Option<IpAddr>
Allocates a virtual address within this endpoint’s subnet and routes
guest traffic sent to it to destination on the host.
Returns None if the subnet’s virtual address pool is exhausted.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Consomme
impl !RefUnwindSafe for Consomme
impl Send for Consomme
impl Sync for Consomme
impl Unpin for Consomme
impl UnsafeUnpin for Consomme
impl !UnwindSafe for Consomme
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