Struct sentry_contrib_native::Envelope [−][src]
pub struct Envelope { /* fields omitted */ }
The actual body which transports send to Sentry.
Examples
struct CustomTransport { #[cfg(feature = "transport-custom")] dsn: Dsn, }; impl Transport for CustomTransport { fn send(&self, raw_envelope: RawEnvelope) { // serialize it, maybe move this to another thread to prevent blocking let envelope: Envelope = raw_envelope.serialize(); // look at that body! println!("{:?}", envelope.as_bytes()); // let's build the whole `Request` #[cfg(feature = "transport-custom")] let request: Request = envelope.into_request(self.dsn.clone()); } }
Implementations
impl Envelope
[src]
#[must_use]pub fn as_bytes(&self) -> &[u8]
[src]
#[must_use]
pub fn as_bytes(&self) -> &[u8]Get underlying data as &[u8]
.
#[must_use = "`Request` doesn't do anything until it is sent"]pub fn into_request(self, dsn: Dsn) -> Request
[src]
#[must_use = "`Request` doesn't do anything until it is sent"]
pub fn into_request(self, dsn: Dsn) -> RequestThis is supported on crate feature
transport-custom
only.Constructs a HTTP request for the provided sys::Envelope
with the
DSN that was registered with the SDK.
The return value has all of the necessary pieces of data to create a HTTP request with the HTTP client of your choice:
- The URL to send the request to.
- The headers that must be set.
- The body of the request.
The content-length
header is already set for you, though some HTTP
clients will automatically overwrite it, which should be fine.
The body
in the request is an Envelope
, which implements
AsRef<[u8]>
to retrieve the actual bytes that should be sent as the
body.
Trait Implementations
impl AsRef<[u8]> for Envelope
[src]
impl Debug for Envelope
[src]
impl Drop for Envelope
[src]
impl Eq for Envelope
[src]
impl Hash for Envelope
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Ord for Envelope
[src]
fn cmp(&self, other: &Envelope) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]
pub fn max(self, other: Self) -> Self#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]
pub fn min(self, other: Self) -> Self#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
#[must_use]
pub fn clamp(self, min: Self, max: Self) -> Selfimpl PartialEq<Envelope> for Envelope
[src]
impl PartialOrd<Envelope> for Envelope
[src]
fn partial_cmp(&self, other: &Envelope) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
pub fn lt(&self, other: &Rhs) -> bool#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
pub fn le(&self, other: &Rhs) -> bool#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
pub fn gt(&self, other: &Rhs) -> bool#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
pub fn ge(&self, other: &Rhs) -> boolimpl Send for Envelope
[src]
impl StructuralEq for Envelope
[src]
impl StructuralPartialEq for Envelope
[src]
impl Sync for Envelope
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,