pub struct TraceProvider { /* private fields */ }Expand description
Use this object to start and run a trace provider under an existing libasync dispatcher
handle.
You can use this in combination with libasync_scope_dispatcher to run the trace
provider on top of fuchsia-async, for example:
#[fuchsia::main]
async fn main() {
// create a new scoped async dispatcher object for the current fuchsia-async executor.
let scope_dispatcher = libasync_scope_dispatcher::ScopeDispatcher::new();
// create a trace provider on it.
let trace_provider =
fuchsia_trace_provider::TraceProvider::new_with_fdio(&scope_dispatcher, None);
// run your program here...
// drop the trace provider before shutting down the dispatcher since it will queue work
// on the dispatcher.
drop(trace_provider);
// shutdown the dispatcher.
scope_dispatcher.shutdown().await;
}Note: As in the example above, make sure that this object is dropped before the dispatcher shuts down.
Implementations§
Source§impl TraceProvider
impl TraceProvider
pub fn new_with_fdio( dispatcher: &impl AsAsyncDispatcherRef, name: Option<&CStr>, ) -> Option<Self>
Trait Implementations§
Source§impl Drop for TraceProvider
impl Drop for TraceProvider
Auto Trait Implementations§
impl !Send for TraceProvider
impl !Sync for TraceProvider
impl Freeze for TraceProvider
impl RefUnwindSafe for TraceProvider
impl Unpin for TraceProvider
impl UnsafeUnpin for TraceProvider
impl UnwindSafe for TraceProvider
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