Struct sentry_contrib_native_sys::Transport
source · [−]#[repr(C)]pub struct Transport(_);
Expand description
This represents an interface for user-defined transports.
Transports are responsible for sending envelopes to sentry and are the last step in the event pipeline.
Envelopes will be submitted to the transport in a fire and forget fashion, and the transport must send those envelopes in order.
A transport has the following hooks, all of which
take the user provided state
as last parameter. The transport state needs
to be set with sentry_transport_set_state
and typically holds handles and
other information that can be reused across requests.
send_func
: This function will take ownership of an envelope, and is responsible for freeing it viasentry_envelope_free
.startup_func
: This hook will be called by sentry inside ofsentry_init
and instructs the transport to initialize itself. Failures will bubble up tosentry_init
.shutdown_func
: Instructs the transport to flush its queue and shut down. This hook receives a millisecond-resolutiontimeout
parameter and should returntrue
when the transport was flushed and shut down successfully. In case offalse
, sentry will log an error, but continue with freeing the transport.free_func
: Frees the transportsstate
. This hook might be called even thoughshutdown_func
returnedfalse
previously.
The transport interface might be extended in the future with hooks to flush its internal queue without shutting down, and to dump its internal queue to disk in case of a hard crash.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Transport
impl Send for Transport
impl Sync for Transport
impl Unpin for Transport
impl UnwindSafe for Transport
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more