tritonserver_rs::trace

Struct Trace

Source
pub struct Trace { /* private fields */ }
Expand description

Inference object that provides custom tracing.

Is constructed with TraceHandler object that is activated each time an event occures.

Implementations§

Source§

impl Trace

Source

pub fn new_with_handle<H: TraceHandler>( level: Level, parent_id: u64, handle: Arc<H>, ) -> Result<Self, Error>

Create a new inference trace object.

The handler.trace_activity() will be called to report activity for this trace as well as for any child traces that are spawned by this one, and so the trace_activity should check the trace object (first argument) to determine specifically what activity is being reported.

level: The tracing level.
parent_id: The parent trace id for this trace. A value of 0 indicates that there is not parent trace.
handle: The callback function where activity for the trace is reported.

Source

pub fn get_id(&self) -> Result<u64, Error>

Get the id associated with the trace. Every trace is assigned an id that is unique across all traces created for a Triton server.

Source

pub fn get_parent_id(&self) -> Result<u64, Error>

Get the parent id associated with the trace.
The parent id indicates a parent-child relationship between two traces. A parent id value of 0 indicates that there is no parent trace.

Source

pub fn get_model_name(&self) -> Result<&str, Error>

Get the name of the model associated with the trace.

Source

pub fn get_model_version(&self) -> Result<i64, Error>

Get the version of the model associated with the trace.

Trait Implementations§

Source§

impl Drop for Trace

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl Freeze for Trace

§

impl RefUnwindSafe for Trace

§

impl !Send for Trace

§

impl !Sync for Trace

§

impl Unpin for Trace

§

impl UnwindSafe for Trace

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.