Struct tracing_modality::Options
source · [−]pub struct Options { /* private fields */ }
Expand description
Initialization options.
Implementations
sourceimpl Options
impl Options
pub fn new() -> Options
sourcepub fn set_auth<S: AsRef<[u8]>>(&mut self, auth: S)
pub fn set_auth<S: AsRef<[u8]>>(&mut self, auth: S)
Set an auth token to be provided to modality. Tokens should be a hex stringish value.
sourcepub fn set_name<S: AsRef<str>>(&mut self, name: S)
pub fn set_name<S: AsRef<str>>(&mut self, name: S)
Set the name for the root timeline. By default this will be the name of the main thread as provided by the OS.
sourcepub fn add_metadata<K: AsRef<str>, V: Into<AttrVal>>(&mut self, key: K, value: V)
pub fn add_metadata<K: AsRef<str>, V: Into<AttrVal>>(&mut self, key: K, value: V)
Add arbitrary metadata to the root timeline.
This can be called multiple times.
sourcepub fn with_metadata<K: AsRef<str>, V: Into<AttrVal>>(
self,
key: K,
value: V
) -> Self
pub fn with_metadata<K: AsRef<str>, V: Into<AttrVal>>(
self,
key: K,
value: V
) -> Self
A chainable version of add_metadata.
sourcepub fn set_server_address(&mut self, addr: SocketAddr)
pub fn set_server_address(&mut self, addr: SocketAddr)
Set the address of modalityd or a modality reflector where trace data should be sent.
Defaults to localhost:default_port
sourcepub fn with_server_address(self, addr: SocketAddr) -> Self
pub fn with_server_address(self, addr: SocketAddr) -> Self
A chainable version of set_server_address.
Trait Implementations
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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more