net_lattice_platform/interface_provider.rs
1use net_lattice_core::Result;
2
3/// Lists network interfaces.
4///
5/// Generic over an associated `Interface` type rather than naming
6/// `net_lattice_model::interface::Interface` directly — `net-lattice-platform`
7/// does not depend on `net-lattice-model` (see ARCHITECTURE.md). The facade
8/// crate (`net-lattice`) is what constrains `Interface` to the concrete model
9/// type.
10///
11/// Unlike [`RouteProvider`](crate::RouteProvider), this trait is read-only for
12/// now: listing interfaces. Configuring interfaces (setting MTU, bringing them
13/// up/down) is a write operation that will be added once the API design for
14/// `InterfaceConfig` vs `Interface` state/config split is settled — see
15/// ARCHITECTURE.md's State Model section.
16pub trait InterfaceProvider {
17 type Interface;
18
19 fn interfaces(&self) -> Result<Vec<Self::Interface>>;
20}