pub struct Stack<D: Driver> { /* private fields */ }
Expand description
A network stack.
This is the main entry point for the network stack.
Implementations§
Source§impl<D: Driver + 'static> Stack<D>
impl<D: Driver + 'static> Stack<D>
Sourcepub fn new<const SOCK: usize>(
device: D,
config: Config,
resources: &'static mut StackResources<SOCK>,
random_seed: u64,
) -> Self
pub fn new<const SOCK: usize>( device: D, config: Config, resources: &'static mut StackResources<SOCK>, random_seed: u64, ) -> Self
Create a new network stack.
Sourcepub fn ethernet_address(&self) -> [u8; 6]
pub fn ethernet_address(&self) -> [u8; 6]
Get the MAC address of the network interface.
Sourcepub fn is_link_up(&self) -> bool
pub fn is_link_up(&self) -> bool
Get whether the link is up.
Sourcepub fn is_config_up(&self) -> bool
pub fn is_config_up(&self) -> bool
Get whether the network stack has a valid IP configuration. This is true if the network stack has a static IP configuration or if DHCP has completed
Sourcepub fn config_v4(&self) -> Option<StaticConfigV4>
pub fn config_v4(&self) -> Option<StaticConfigV4>
Get the current IPv4 configuration.
Sourcepub fn config_v6(&self) -> Option<StaticConfigV6>
pub fn config_v6(&self) -> Option<StaticConfigV6>
Get the current IPv6 configuration.
Source§impl<D: Driver + Device + 'static> Stack<D>
impl<D: Driver + Device + 'static> Stack<D>
Sourcepub fn join_multicast_group<T>(&self, addr: T) -> Result<bool, MulticastError>
pub fn join_multicast_group<T>(&self, addr: T) -> Result<bool, MulticastError>
Join a multicast group.
Sourcepub fn leave_multicast_group<T>(&self, addr: T) -> Result<bool, MulticastError>
pub fn leave_multicast_group<T>(&self, addr: T) -> Result<bool, MulticastError>
Leave a multicast group.
Sourcepub fn has_multicast_group<T: Into<IpAddress>>(&self, addr: T) -> bool
pub fn has_multicast_group<T: Into<IpAddress>>(&self, addr: T) -> bool
Get whether the network stack has joined the given multicast group.
Auto Trait Implementations§
impl<D> !Freeze for Stack<D>
impl<D> !RefUnwindSafe for Stack<D>
impl<D> Send for Stack<D>where
D: Send,
impl<D> !Sync for Stack<D>
impl<D> Unpin for Stack<D>where
D: Unpin,
impl<D> !UnwindSafe for Stack<D>
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