AprsIsFilter

Enum AprsIsFilter 

Source
pub enum AprsIsFilter {
    Range {
        lat: f64,
        lon: f64,
        distance_km: f64,
    },
    Area {
        lat1: f64,
        lon1: f64,
        lat2: f64,
        lon2: f64,
    },
    Prefix(Vec<String>),
    Budlist(Vec<String>),
    Object(Vec<String>),
    Type(String),
    Symbol(String),
    Friend {
        callsign: String,
        distance_km: f64,
    },
    Group(String),
    Raw(String),
}
Expand description

Structured APRS-IS filter expression.

Per http://www.aprs-is.net/javAPRSFilter.aspx, APRS-IS servers accept a small query language for selecting which packets to deliver to a client connection. Each filter is one or more tokens separated by spaces. This enum covers the commonly-used forms; use AprsIsFilter::raw to drop in any literal filter string for advanced cases.

Variants§

§

Range

Range filter r/lat/lon/distance_km — packets from stations within the given radius.

Fields

§lat: f64

Centre latitude in degrees (positive = North).

§lon: f64

Centre longitude in degrees (positive = East).

§distance_km: f64

Radius in kilometres.

§

Area

Area / box filter a/lat1/lon1/lat2/lon2 — packets within a lat/lon bounding box (NW and SE corners).

Fields

§lat1: f64

Northwest latitude.

§lon1: f64

Northwest longitude.

§lat2: f64

Southeast latitude.

§lon2: f64

Southeast longitude.

§

Prefix(Vec<String>)

Prefix filter p/aa/bb/cc — packets whose source callsign begins with any of the given prefixes.

§

Budlist(Vec<String>)

Budlist filter b/call1/call2 — packets from exactly these stations.

§

Object(Vec<String>)

Object filter o/obj1/obj2 — object reports with these names.

§

Type(String)

Type filter t/poimntqsu — characters select which frame types are wanted (p=position, o=object, i=item, m=message, n=nws, t=telemetry, q=query, s=status, u=user-defined).

§

Symbol(String)

Symbol filter s/sym1sym2/... — symbols to include.

§

Friend

“Friend” / range-around-station filter f/call/distance_km.

Fields

§callsign: String

Station to centre on.

§distance_km: f64

Distance in km.

§

Group(String)

Group message filter g/name — bulletins addressed to this group.

§

Raw(String)

Raw literal filter string for advanced / uncommon cases.

Implementations§

Source§

impl AprsIsFilter

Source

pub fn raw(s: impl Into<String>) -> Self

Build a raw literal filter expression.

Source

pub fn as_wire(&self) -> String

Format this filter as the exact wire-format string APRS-IS servers expect after the filter keyword in the login line.

Source

pub fn join(filters: &[Self]) -> String

Combine multiple filter clauses into a single filter string by joining with spaces — APRS-IS allows an OR of any number of clauses in a single filter directive.

Trait Implementations§

Source§

impl Clone for AprsIsFilter

Source§

fn clone(&self) -> AprsIsFilter

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for AprsIsFilter

Source§

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

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

impl PartialEq for AprsIsFilter

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · 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 StructuralPartialEq for AprsIsFilter

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.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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, 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.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more