App

Struct App 

Source
pub struct App {
    pub session: Option<Session>,
    pub prefs: Prefs,
    pub interactive: bool,
    pub trace: bool,
    pub no_save: bool,
    pub baud: u32,
    pub discovery: Discovery,
    pub last_scan: Vec<Found>,
}
Expand description

Everything a command may need beyond the device itself: the attachment, the settings, and the difference between a shell and a one-shot invocation.

Fields§

§session: Option<Session>§prefs: Prefs§interactive: bool

True in the shell, where a question can be asked and a failure returns to a prompt.

§trace: bool§no_save: bool§baud: u32§discovery: Discovery

How a bare connect resolves a scan — --pick at launch keeps asking for the rest of the shell session.

§last_scan: Vec<Found>

The last scan listing, so connect <N> can refer to it.

Implementations§

Source§

impl App

Source

pub fn session(&mut self) -> Result<&mut Session>

Source

pub fn device(&mut self) -> Result<&mut UlcpDevice<SessionLink>>

Source

pub fn target_is_ble(&self) -> bool

Source

pub fn detach(&mut self) -> Option<String>

Drop the attachment, returning what it was called. Dropping the link is what reverts session-scoped device state.

Source

pub fn rename(&mut self, label: String)

Source

pub fn for_extcap(session: Session, prefs: Prefs, baud: u32) -> Self

An attached, non-interactive app for the Wireshark extcap interface.

interactive is false in both its senses here: there is no prompt to return to, and nobody to answer a question. That is also what lets a dropped BLE link be recovered underneath a running capture.

Source

pub async fn attach(&mut self, target: Target) -> Result<()>

Source

pub async fn reattach(&mut self, tethered: bool) -> Result<()>

Re-attach the open link in the other mode. Used by provision, which needs a tethered handle for one command.

Source

pub async fn reconnect(&mut self) -> Result<()>

Open a fresh link to the same radio, keeping the capture tap so a recovered capture stays one file.

Source

pub fn prompt(&self) -> String

Auto Trait Implementations§

§

impl Freeze for App

§

impl !RefUnwindSafe for App

§

impl !Send for App

§

impl !Sync for App

§

impl Unpin for App

§

impl !UnwindSafe for App

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> AutoreleaseSafe for T
where T: ?Sized,