StreamOptions

Struct StreamOptions 

Source
pub struct StreamOptions<F: StreamFormat> { /* private fields */ }
Expand description

Configuration options for GPS data streams

This struct allows configuring various aspects of the data stream, such as enabling specific data types or formatting options.

Use the format-specific constructors (StreamOptions::json(), etc.) to create instances with appropriate defaults.

Implementations§

Source§

impl<F: StreamFormat> StreamOptions<F>

Source

pub fn scaled(self, enable: bool) -> Self

Enables or disables scaled output

When enabled, GPSD applies scaling to output values. This affects units and precision of reported values.

Source

pub fn split24(self, enable: bool) -> Self

Enables or disables split24 mode

When enabled, AIS type 24 messages are split into separate part A and part B messages.

Source§

impl StreamOptions<Json>

Source

pub fn json() -> StreamOptions<Json>

Creates stream options for JSON format output

Returns a configuration for receiving structured GPS data as JSON messages.

Source

pub fn pps(self, enable: bool) -> Self

Enables or disables PPS (Pulse Per Second) messages

When enabled, the stream will include PPS timing messages if the GPS receiver supports precision timing.

Source

pub fn timing(self, enable: bool) -> Self

Enables or disables timing information

When enabled, messages include detailed timing information about when data was received and processed.

Source§

impl StreamOptions<Nmea>

Source

pub fn nmea() -> StreamOptions<Nmea>

Creates stream options for NMEA format output

Returns a configuration for receiving raw NMEA 0183 sentences from the GPS receiver.

Source

pub fn device<S: AsRef<str>>(self, device: S) -> Self

Specifies a particular GPS device to stream from

§Arguments
  • device - Path to the GPS device (e.g., “/dev/ttyUSB0”)
Source§

impl StreamOptions<Raw>

Source

pub fn raw() -> StreamOptions<Raw>

Creates stream options for raw format output

Returns a configuration for receiving raw binary data from the GPS receiver.

Source

pub fn hex_dump(self, enable: bool) -> Self

Configures hex dump mode for raw data

§Arguments
  • enable - true for hex dump format, false for binary
Source

pub fn device<S: AsRef<str>>(self, device: S) -> Self

Specifies a particular GPS device to stream from

§Arguments
  • device - Path to the GPS device (e.g., “/dev/ttyUSB0”)

Trait Implementations§

Source§

impl<F: Clone + StreamFormat> Clone for StreamOptions<F>

Source§

fn clone(&self) -> StreamOptions<F>

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<F: Debug + StreamFormat> Debug for StreamOptions<F>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<F> Freeze for StreamOptions<F>

§

impl<F> RefUnwindSafe for StreamOptions<F>
where F: RefUnwindSafe,

§

impl<F> Send for StreamOptions<F>
where F: Send,

§

impl<F> Sync for StreamOptions<F>
where F: Sync,

§

impl<F> Unpin for StreamOptions<F>
where F: Unpin,

§

impl<F> UnwindSafe for StreamOptions<F>
where F: UnwindSafe,

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, 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.