Struct tracing_modality::options::Options
source · pub struct Options { /* private fields */ }
Expand description
Initialization options.
Implementations§
source§impl 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 Freeze for Options
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)