Builder

Struct Builder 

Source
pub struct Builder<T>(/* private fields */);
Expand description

A builder for TraceLogV1

Implementations§

Source§

impl Builder<TypeStage>

Source

pub fn type_(self, type_: impl Into<String>) -> Builder<TimeStage>

Sets the type_ field.

Source§

impl Builder<TimeStage>

Source

pub fn time(self, time: DateTime<Utc>) -> Builder<SpanStage>

Sets the time field.

Source§

impl Builder<SpanStage>

Source

pub fn span(self, span: Span) -> Builder<Complete>

Sets the span field.

Source§

impl Builder<Complete>

Source

pub fn type_(self, type_: impl Into<String>) -> Self

Sets the type_ field.

Source

pub fn time(self, time: DateTime<Utc>) -> Self

Sets the time field.

Source

pub fn uid(self, uid: impl Into<Option<UserId>>) -> Self

Sets the uid field.

Source

pub fn sid(self, sid: impl Into<Option<SessionId>>) -> Self

Sets the sid field.

Source

pub fn token_id(self, token_id: impl Into<Option<TokenId>>) -> Self

Sets the token_id field.

Source

pub fn org_id(self, org_id: impl Into<Option<OrganizationId>>) -> Self

Sets the org_id field.

Source

pub fn insert_unsafe_params( self, key: impl Into<String>, value: impl Serialize, ) -> Self

Adds an entry to the unsafe_params field.

Source

pub fn unsafe_params( self, unsafe_params: impl IntoIterator<Item = (impl Into<String>, impl Serialize)>, ) -> Self

Sets the unsafe_params field.

Source

pub fn extend_unsafe_params( self, unsafe_params: impl IntoIterator<Item = (impl Into<String>, impl Serialize)>, ) -> Self

Adds entries to the unsafe_params field.

Source

pub fn span(self, span: Span) -> Self

Sets the span field.

Source

pub fn build(self) -> TraceLogV1

Consumes the builder, returning a TraceLogV1.

Trait Implementations§

Source§

impl Default for Builder<TypeStage>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl From<TraceLogV1> for Builder<Complete>

Source§

fn from(v: TraceLogV1) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<T> Freeze for Builder<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for Builder<T>
where T: RefUnwindSafe,

§

impl<T> Send for Builder<T>
where T: Send,

§

impl<T> Sync for Builder<T>
where T: Sync,

§

impl<T> Unpin for Builder<T>
where T: Unpin,

§

impl<T> UnwindSafe for Builder<T>
where T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.