Feature Flags and shit codex did idfk

This commit is contained in:
lda committed 2026-04-04 18:07:27 +07:00
1 parent f483a8507a
commit 1cfa0d56ba
15 files changed
+348 -74

No files matched your search

+17
View File
@@ -5,8 +5,10 @@
//! lowk why its free but its indirection and its ass
pub mod json;
#[cfg(all(unix, feature = "experimental-nl"))]
pub mod nl;
pub use crate::subcommands::Backend;
use crate::utils::serialize::mac::option_mac;
use macaddr::MacAddr;
use serde::{Deserialize, Serialize};
@@ -40,3 +42,18 @@ pub struct AddrInfo {
pub label: Option<String>,
// many more exist; we only take what we need
}
pub async fn get(dev: Option<&str>) -> anyhow::Result<Vec<AddrOutput>> {
get_with_backend(Backend::Json, dev).await
}
pub async fn get_with_backend(
backend: Backend,
dev: Option<&str>,
) -> anyhow::Result<Vec<AddrOutput>> {
match backend {
Backend::Json => json::get(dev).await,
#[cfg(all(unix, feature = "experimental-nl"))]
Backend::Netlink => nl::get(dev).await,
}
}
+1 -1
View File
@@ -1,5 +1,5 @@
//! i said i aint doing ts no more why am i still here
#![cfg(unix)]
use futures::TryStreamExt;
use crate::subcommands::address::AddrOutput;