update and use ts shit idk anymore

This commit is contained in:
lda committed 2026-01-20 00:53:42 +07:00
1 parent 059ce959f0
commit 56eab6dbb3
7 files changed
+283 -268

No files matched your search

+1
View File
@@ -5,6 +5,7 @@
//! lowk why its free but its indirection and its ass
pub mod json;
pub mod nl;
use crate::utils::serialize::mac::option_mac;
use macaddr::MacAddr;
+20
View File
@@ -0,0 +1,20 @@
//! i said i aint doing ts no more why am i still here
use futures::TryStreamExt;
use crate::subcommands::address::AddrOutput;
// shit this one is even worse you needa collect info from two places
pub async fn get(dev: Option<&str>) -> anyhow::Result<Vec<AddrOutput>> {
let (conn, handle, _) = rtnetlink::new_connection()?;
tokio::spawn(conn); // every time?
let mut address = handle.address().get();
let mut link = handle.link().get();
if let Some(dev) = dev {
link = link.match_name(dev.to_owned());
if let Some(ind) = link.execute().try_next().await?.map(|a| a.header.index) {
address = address.set_link_index_filter(ind);
}
};
todo!()
}