pub enum NetworkEvent {
Show 18 variants
NewLink(LinkMessage),
DelLink(LinkMessage),
NewAddress(AddressMessage),
DelAddress(AddressMessage),
NewRoute(RouteMessage),
DelRoute(RouteMessage),
NewNeighbor(NeighborMessage),
DelNeighbor(NeighborMessage),
NewFdb(FdbEntry),
DelFdb(FdbEntry),
NewQdisc(TcMessage),
DelQdisc(TcMessage),
NewClass(TcMessage),
DelClass(TcMessage),
NewFilter(TcMessage),
DelFilter(TcMessage),
NewAction(TcMessage),
DelAction(TcMessage),
}Expand description
Network events that can be received from the kernel.
These events are generated when network configuration changes occur.
Use Connection<Route>::subscribe to select
which event types to receive, then use Connection::events
to get a stream of events.
Variants§
NewLink(LinkMessage)
A new link was created or an existing link changed.
DelLink(LinkMessage)
A link was deleted.
NewAddress(AddressMessage)
A new address was added.
DelAddress(AddressMessage)
An address was removed.
NewRoute(RouteMessage)
A new route was added.
DelRoute(RouteMessage)
A route was removed.
NewNeighbor(NeighborMessage)
A new neighbor entry was added.
DelNeighbor(NeighborMessage)
A neighbor entry was removed.
NewFdb(FdbEntry)
A new FDB entry was added or learned.
DelFdb(FdbEntry)
An FDB entry was removed.
NewQdisc(TcMessage)
A new qdisc was added or changed.
DelQdisc(TcMessage)
A qdisc was deleted.
NewClass(TcMessage)
A new class was added or changed.
DelClass(TcMessage)
A class was deleted.
NewFilter(TcMessage)
A new filter was added or changed.
DelFilter(TcMessage)
A filter was deleted.
NewAction(TcMessage)
A new action was added or changed.
DelAction(TcMessage)
An action was deleted.
Implementations§
Source§impl NetworkEvent
impl NetworkEvent
Sourcepub fn ifindex(&self) -> Option<u32>
pub fn ifindex(&self) -> Option<u32>
Returns the interface index associated with this event, if any.
Sourcepub fn action(&self) -> &'static str
pub fn action(&self) -> &'static str
Returns “new” or “del” based on the event type.
Useful for display/logging purposes.
Sourcepub fn as_link(&self) -> Option<&LinkMessage>
pub fn as_link(&self) -> Option<&LinkMessage>
Returns the inner LinkMessage if this is a link event.
Sourcepub fn into_link(self) -> Option<LinkMessage>
pub fn into_link(self) -> Option<LinkMessage>
Consumes self and returns the inner LinkMessage if this is a link event.
Sourcepub fn as_address(&self) -> Option<&AddressMessage>
pub fn as_address(&self) -> Option<&AddressMessage>
Returns the inner AddressMessage if this is an address event.
Sourcepub fn into_address(self) -> Option<AddressMessage>
pub fn into_address(self) -> Option<AddressMessage>
Consumes self and returns the inner AddressMessage if this is an address event.
Sourcepub fn as_route(&self) -> Option<&RouteMessage>
pub fn as_route(&self) -> Option<&RouteMessage>
Returns the inner RouteMessage if this is a route event.
Sourcepub fn into_route(self) -> Option<RouteMessage>
pub fn into_route(self) -> Option<RouteMessage>
Consumes self and returns the inner RouteMessage if this is a route event.
Sourcepub fn as_neighbor(&self) -> Option<&NeighborMessage>
pub fn as_neighbor(&self) -> Option<&NeighborMessage>
Returns the inner NeighborMessage if this is a neighbor event.
Sourcepub fn into_neighbor(self) -> Option<NeighborMessage>
pub fn into_neighbor(self) -> Option<NeighborMessage>
Consumes self and returns the inner NeighborMessage if this is a neighbor event.
Sourcepub fn into_fdb(self) -> Option<FdbEntry>
pub fn into_fdb(self) -> Option<FdbEntry>
Consumes self and returns the inner FdbEntry if this is an FDB event.
Trait Implementations§
Source§impl Clone for NetworkEvent
impl Clone for NetworkEvent
Source§fn clone(&self) -> NetworkEvent
fn clone(&self) -> NetworkEvent
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more