pub struct CrashShipper { /* private fields */ }Expand description
Offline crash spool shipping API. Offline crash spool shipping API. Offline crash spool shipping API. Reusable crash uploader with pooled HTTP connections and an in-memory token.
Convenience shipping functions create one uploader per scan. Keep this value to reuse its pool across scans, or supply a Reqwest client for private CAs, mutual TLS, proxy settings, and custom timeouts.
Implementations§
Source§impl CrashShipper
impl CrashShipper
Sourcepub fn new(token: SecretString) -> Result<Self, ShipError>
pub fn new(token: SecretString) -> Result<Self, ShipError>
Creates an uploader with a 10-second connect timeout, 30-second read timeout, and 60-second total request timeout.
The offline spool owns retries; HTTP-level retries are disabled to avoid recording a crash index more than once during one upload attempt.
§Errors
Returns ShipError::Http if the HTTP client cannot be initialized.
Sourcepub fn with_client(client: Client, token: SecretString) -> Self
pub fn with_client(client: Client, token: SecretString) -> Self
Uses a caller-configured HTTP client. Its timeout and retry policy apply.
Sourcepub fn with_config(self, config: ShipConfig) -> Self
pub fn with_config(self, config: ShipConfig) -> Self
Sets dump and attachment compression options.
Sourcepub async fn ship_pending(
&self,
spool_dir: impl AsRef<Path>,
endpoint: Url,
) -> Result<usize, ShipError>
pub async fn ship_pending( &self, spool_dir: impl AsRef<Path>, endpoint: Url, ) -> Result<usize, ShipError>
Ships pending entries to an explicit endpoint using this client’s connection pool.
§Errors
See ship_pending_crashes_with_config. Failed entries remain pending.
Trait Implementations§
Source§impl Clone for CrashShipper
impl Clone for CrashShipper
Auto Trait Implementations§
impl !RefUnwindSafe for CrashShipper
impl !UnwindSafe for CrashShipper
impl Freeze for CrashShipper
impl Send for CrashShipper
impl Sync for CrashShipper
impl Unpin for CrashShipper
impl UnsafeUnpin for CrashShipper
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request