pub struct Ops { /* private fields */ }Expand description
High-level operations used by CLI/TUI/GUI/MCP to keep behavior consistent.
Implementations§
Source§impl Ops
impl Ops
pub fn new(cfg: OpsConfig) -> Self
pub fn config(&self) -> &OpsConfig
pub async fn resolve_host_ip(&self, host: &str) -> Result<IpAddr>
pub async fn discover_ipv4( &self, subnet: Option<String>, resolve: bool, ) -> Result<(String, Vec<Host>)>
pub async fn discover_ipv4_with_progress( &self, subnet: Option<String>, resolve: bool, progress: Option<Arc<dyn Fn(DiscoverProgress) + Send + Sync>>, ) -> Result<(String, Vec<Host>)>
pub async fn scan_ports( &self, host: &str, ports: Option<Vec<u16>>, ) -> Result<(IpAddr, Vec<PortResult>)>
pub async fn scan_ports_with_progress( &self, host: &str, ports: Option<Vec<u16>>, progress: Option<Arc<dyn Fn(PortScanProgress) + Send + Sync>>, ) -> Result<(IpAddr, Vec<PortResult>)>
pub async fn inspect_host( &self, host: String, ports: Option<Vec<u16>>, ) -> Result<InspectResult>
pub async fn sweep_ipv4( &self, subnet: Option<String>, ports: Option<Vec<u16>>, resolve_hostnames: bool, ) -> Result<(String, Vec<SweepEntry>)>
pub async fn sweep_ipv4_with_progress( &self, subnet: Option<String>, ports: Option<Vec<u16>>, resolve_hostnames: bool, progress: Option<Arc<dyn Fn(SweepProgress) + Send + Sync>>, ) -> Result<(String, Vec<SweepEntry>)>
pub async fn ping_host_summary( &self, host: &str, count: u32, ) -> Result<PingSummary>
pub async fn dns_lookup( &self, host: &str, record: Option<String>, ) -> Result<Vec<DnsRecord>>
pub fn list_interfaces(&self) -> Vec<InterfaceInfo>
pub fn get_arp_table(&self) -> Result<Vec<ArpEntry>>
pub fn pcap_check_support(&self) -> Result<Vec<String>>
pub fn capture_pcap( &self, interface: String, filter: Option<String>, duration: Option<u64>, output_file: Option<String>, max_packets: Option<usize>, ) -> Result<PcapResult>
Sourcepub async fn capture_pcap_async(
&self,
interface: String,
filter: Option<String>,
duration: Option<u64>,
output_file: Option<String>,
max_packets: Option<usize>,
) -> Result<PcapResult>
pub async fn capture_pcap_async( &self, interface: String, filter: Option<String>, duration: Option<u64>, output_file: Option<String>, max_packets: Option<usize>, ) -> Result<PcapResult>
Async-friendly PCAP capture wrapper.
PCAP capture is inherently blocking (libpcap read loop + file I/O). This runs it in a dedicated blocking thread so async runtimes (CLI/Tauri/MCP) remain responsive.
pub async fn capture_pcap_async_with_cancel( &self, interface: String, filter: Option<String>, duration: Option<u64>, output_file: Option<String>, max_packets: Option<usize>, cancel: Option<PcapCancelToken>, ) -> Result<PcapResult>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Ops
impl RefUnwindSafe for Ops
impl Send for Ops
impl Sync for Ops
impl Unpin for Ops
impl UnsafeUnpin for Ops
impl UnwindSafe for Ops
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