Skip to main content

AtCommand

Enum AtCommand 

Source
pub enum AtCommand {
    Equals {
        param: String,
        value: AtValue,
    },
    Execute {
        command: String,
    },
    Read {
        param: String,
    },
    Test {
        param: String,
    },
    Basic {
        command: String,
        number: Option<usize>,
    },
    Text {
        text: String,
        expected: Vec<String>,
    },
}
Expand description

An AT command.

Variants§

§

Equals

Either execute a non-basic command named param with value as argument, or set the current value of param to value.

Corresponds to AT<param>=<value>.

Fields

§param: String
§value: AtValue
§

Execute

Execute a non-basic command, with the name of command.

Corresponds to AT<command>.

Fields

§command: String
§

Read

Read the current value of param.

Corresponds to AT<param>?.

Fields

§param: String
§

Test

Return the available value range of param.

Corresponds to `AT=?’.

Fields

§param: String
§

Basic

Execute a basic command, where command indicates a single letter (A-Z) or the & symbol and a single letter, with an optional number parameter.

Corresponds to AT<command>[<number>].

Fields

§command: String
§number: Option<usize>
§

Text

Just send some raw text.

Fields

§text: String
§expected: Vec<String>

The set of ‘expected’ InformationResponses to this command.

Implementations§

Source§

impl AtCommand

Source

pub fn expected(&self) -> Vec<String>

Get the set of ‘expected’ InformationResponses for this command.

This is used by the library to filter out URCs (Unsolicited Response Codes) - basically, commands only get InformationResponses that match their expected() array, so we can filter all of the other responses out and assume that they’re URCs.

  • For Equals, Read, and Test, this is the value of vec![param].
  • For Execute and Basic, this is the value of vec![command].
  • For Text, this is the value of expected.
Source§

impl AtCommand

§enum Variant Predicates

Source

pub fn is_equals(&self) -> bool

Is this AtCommand a Equals?

Source

pub fn is_execute(&self) -> bool

Is this AtCommand a Execute?

Source

pub fn is_read(&self) -> bool

Is this AtCommand a Read?

Source

pub fn is_test(&self) -> bool

Is this AtCommand a Test?

Source

pub fn is_basic(&self) -> bool

Is this AtCommand a Basic?

Source

pub fn is_text(&self) -> bool

Is this AtCommand a Text?

Trait Implementations§

Source§

impl Clone for AtCommand

Source§

fn clone(&self) -> AtCommand

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for AtCommand

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for AtCommand

Writes the AtCommand out, as it would appear on the command line.

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for AtCommand

Source§

fn eq(&self, other: &AtCommand) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for AtCommand

Source§

impl StructuralPartialEq for AtCommand

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

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

Source§

type Error = Infallible

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

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

Performs the conversion.
Source§

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

Source§

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

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

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

Performs the conversion.