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 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
impl Options
sourcepub fn new(
from_addr: &str,
to_addr: &str,
namespace: &str,
default_tags: Vec<String>,
socket_path: Option<String>,
batching_options: Option<BatchingOptions>
) -> Self
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 Default for Options
impl Default for Options
source§fn default() -> Self
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
impl PartialEq for Options
impl StructuralPartialEq for Options
Auto Trait Implementations§
impl RefUnwindSafe for Options
impl Send for Options
impl Sync for Options
impl Unpin for Options
impl UnwindSafe for Options
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more