Struct dogstatsd::Options

source ·
pub struct Options {
    pub from_addr: String,
    pub to_addr: String,
    pub namespace: String,
    pub default_tags: Vec<String>,
    pub socket_path: Option<String>,
    pub batching_options: Option<BatchingOptions>,
}
Expand description

The struct that represents the options available for the Dogstatsd client.

Fields§

§from_addr: String

The address of the udp socket we’ll bind to for sending.

§to_addr: String

The address of the udp socket we’ll send metrics and events to.

§namespace: String

A namespace to prefix all metrics with, joined with a ‘.’.

§default_tags: Vec<String>

Default tags to include with every request.

§socket_path: Option<String>

OPTIONAL, if defined, will use UDS instead of UDP and will ignore UDP options

§batching_options: Option<BatchingOptions>

OPTIONAL, if defined, will utilize batching for sending metrics

Implementations§

source§

impl Options

source

pub fn new( from_addr: &str, to_addr: &str, namespace: &str, default_tags: Vec<String>, socket_path: Option<String>, batching_options: Option<BatchingOptions> ) -> Self

Create a new options struct by supplying values for all fields.

Examples
  use dogstatsd::Options;

  let options = Options::new("127.0.0.1:9000", "127.0.0.1:9001", "", vec!(String::new()), None, None);

Trait Implementations§

source§

impl Debug for Options

source§

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

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

impl Default for Options

source§

fn default() -> Self

Create a new options struct with all the default settings.

Examples
  use dogstatsd::Options;

  let options = Options::default();

  assert_eq!(
      Options {
          from_addr: "0.0.0.0:0".into(),
          to_addr: "127.0.0.1:8125".into(),
          namespace: String::new(),
          default_tags: vec!(),
          socket_path: None,
          batching_options: None,
      },
      options
  )
source§

impl PartialEq for Options

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl StructuralPartialEq for Options

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> 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, U> TryFrom<U> for T
where U: Into<T>,

§

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

§

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<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V