Skip to content

Commit f261228

Browse files
authored
ref: Move the Envelope and SessionUpdate type to sentry-types (#251)
1 parent 2a987aa commit f261228

File tree

10 files changed

+498
-313
lines changed

10 files changed

+498
-313
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66

77
- The `Transport` was changed to work on `Envelope`s instead of `Event`s. The `send_event` trait function was removed in favor of `send_envelope`.
88

9+
**Features**:
10+
11+
- The `Envelope`, `SessionUpdate`, and other related types have been added to the `sentry_types::protocol::v7` module.
12+
913
## 0.19.1
1014

1115
**Fixes**:

sentry-core/src/client.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ impl Client {
256256
.and_then(|session| session.create_envelope_item())
257257
});
258258
if let Some(session_item) = session_item {
259-
envelope.add(session_item);
259+
envelope.add_item(session_item);
260260
}
261261
transport.send_envelope(envelope);
262262
return event_id;

sentry-core/src/envelope.rs

Lines changed: 0 additions & 155 deletions
This file was deleted.

sentry-core/src/hub.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ use std::sync::{Arc, Mutex, PoisonError, RwLock, TryLockError};
88
use std::thread;
99
use std::time::Duration;
1010

11-
use crate::protocol::{Breadcrumb, Event, Level};
12-
use crate::session::{Session, SessionStatus};
11+
use crate::protocol::{Breadcrumb, Event, Level, SessionStatus};
12+
use crate::session::Session;
1313
use crate::types::Uuid;
1414
use crate::{event_from_error, Integration, IntoBreadcrumbs, Scope, ScopeGuard};
1515
#[cfg(feature = "client")]
@@ -342,7 +342,7 @@ impl Hub {
342342
session.close();
343343
if let Some(item) = session.create_envelope_item() {
344344
let mut envelope = Envelope::new();
345-
envelope.add(item);
345+
envelope.add_item(item);
346346
if let Some(ref client) = top.client {
347347
client.capture_envelope(envelope);
348348
}

sentry-core/src/lib.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ mod api;
5757
mod breadcrumbs;
5858
mod clientoptions;
5959
mod constants;
60-
mod envelope;
6160
mod error;
6261
mod futures;
6362
mod hub;
@@ -71,7 +70,6 @@ mod transport;
7170
pub use crate::api::*;
7271
pub use crate::breadcrumbs::IntoBreadcrumbs;
7372
pub use crate::clientoptions::ClientOptions;
74-
pub use crate::envelope::Envelope;
7573
pub use crate::error::{capture_error, event_from_error, parse_type_from_debug};
7674
pub use crate::futures::{SentryFuture, SentryFutureExt};
7775
pub use crate::hub::Hub;
@@ -100,4 +98,4 @@ pub mod test;
10098
#[doc(inline)]
10199
pub use sentry_types as types;
102100
pub use sentry_types::protocol::v7 as protocol;
103-
pub use sentry_types::protocol::v7::{Breadcrumb, Level, User};
101+
pub use sentry_types::protocol::v7::{Breadcrumb, Envelope, Level, User};

0 commit comments

Comments
 (0)