Struct dogstatsd::Options [] [src]

pub struct Options {
    pub from_addr: String,
    pub to_addr: String,
    pub namespace: String,
}

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

Methods

impl Options
[src]

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: "127.0.0.1:8126".into(),
          to_addr: "127.0.0.1:8125".into(),
          namespace: String::new(),
      },
      options
  )

fn new(from_addr: &str, to_addr: &str, namespace: &str) -> 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", "");

Trait Implementations

impl PartialEq for Options
[src]

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

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, __arg_0: &Options) -> bool

This method tests for !=.

impl Debug for Options
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.