#[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 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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.