pub struct LayerBuilder<ProjectId = (), W: Write = Stdout> { /* private fields */ }Implementations§
Source§impl<W: Write> LayerBuilder<(), W>
impl<W: Write> LayerBuilder<(), W>
Sourcepub fn with_project_id<T: AsRef<str>>(self, text: T) -> LayerBuilder<T, W>
pub fn with_project_id<T: AsRef<str>>(self, text: T) -> LayerBuilder<T, W>
Sets the project’s ID for use by the Layer. This is mainly useful for
including trace IDs, where, depending on the writer you’re using,
Google Cloud may not be able to infer the correct project ID. To
(hopefully) get around this if it is ever a problem, this crate always
writes traces in the full format, projects/<...>/traces/<...>.
As such, the project ID is required.
If the opentelemetry feature is disabled, it is allowed to construct
the layer without calling this function.
Source§impl<ProjectId, W: Write> LayerBuilder<ProjectId, W>
impl<ProjectId, W: Write> LayerBuilder<ProjectId, W>
Sourcepub fn with_writer<N: Write>(self, writer: N) -> LayerBuilder<ProjectId, N>
pub fn with_writer<N: Write>(self, writer: N) -> LayerBuilder<ProjectId, N>
Sets the writer which logs will be written to. The default is std::io::stdout().
Auto Trait Implementations§
impl<ProjectId, W> Freeze for LayerBuilder<ProjectId, W>
impl<ProjectId, W> RefUnwindSafe for LayerBuilder<ProjectId, W>where
ProjectId: RefUnwindSafe,
W: RefUnwindSafe,
impl<ProjectId, W> Send for LayerBuilder<ProjectId, W>
impl<ProjectId, W> Sync for LayerBuilder<ProjectId, W>
impl<ProjectId, W> Unpin for LayerBuilder<ProjectId, W>
impl<ProjectId, W> UnsafeUnpin for LayerBuilder<ProjectId, W>where
ProjectId: UnsafeUnpin,
W: UnsafeUnpin,
impl<ProjectId, W> UnwindSafe for LayerBuilder<ProjectId, W>where
ProjectId: UnwindSafe,
W: UnwindSafe,
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