Struct sentry_contrib_native_sys::Transport[][src]

#[repr(C)]
pub struct Transport(_);

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 via sentry_envelope_free.
  • startup_func: This hook will be called by sentry inside of sentry_init and instructs the transport to initialize itself. Failures will bubble up to sentry_init.
  • shutdown_func: Instructs the transport to flush its queue and shut down. This hook receives a millisecond-resolution timeout parameter and should return true when the transport was flushed and shut down successfully. In case of false, sentry will log an error, but continue with freeing the transport.
  • free_func: Frees the transports state. This hook might be called even though shutdown_func returned false 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

impl Clone for Transport[src]

impl Copy for Transport[src]

impl Debug for Transport[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.