Enum glean_core::upload::UploadResult
source · pub enum UploadResult {
RecoverableFailure { /* private fields */ },
UnrecoverableFailure { /* private fields */ },
Incapable { /* private fields */ },
HttpStatus {
code: i32,
},
Done { /* private fields */ },
}
Expand description
The result of an attempted ping upload.
Variants§
RecoverableFailure
A recoverable failure.
During upload something went wrong, e.g. the network connection failed. The upload should be retried at a later time.
UnrecoverableFailure
An unrecoverable upload failure.
A possible cause might be a malformed URL.
Incapable
The uploader is not capable of uploading this request due to lack of or mismatched capabilities.
e.g. The ping requires upload over OHTTP, but the uploader doesn’t support OHTTP.
HttpStatus
A HTTP response code.
This can still indicate an error, depending on the status code.
Done
Signal that this uploader is done with work and won’t accept new work.
Implementations§
source§impl UploadResult
impl UploadResult
sourcepub fn get_label(&self) -> Option<&str>
pub fn get_label(&self) -> Option<&str>
Gets the label to be used in recording error counts for upload.
Returns None
if the upload finished succesfully.
Failures are recorded in the ping_upload_failure
metric.
sourcepub fn recoverable_failure() -> Self
pub fn recoverable_failure() -> Self
A recoverable failure.
During upload something went wrong, e.g. the network connection failed. The upload should be retried at a later time.
sourcepub fn unrecoverable_failure() -> Self
pub fn unrecoverable_failure() -> Self
An unrecoverable upload failure.
A possible cause might be a malformed URL.
sourcepub fn incapable() -> Self
pub fn incapable() -> Self
The uploader is not capable of uploading this request due to lack of or mismatched capabilities.
e.g. The ping requires upload over OHTTP, but the uploader doesn’t support OHTTP.
sourcepub fn http_status(code: i32) -> Self
pub fn http_status(code: i32) -> Self
A HTTP response code.
This can still indicate an error, depending on the status code.
Trait Implementations§
source§impl<UT> ConvertError<UT> for UploadResult
impl<UT> ConvertError<UT> for UploadResult
fn try_convert_unexpected_callback_error( e: UnexpectedUniFFICallbackError ) -> Result<Self>
source§impl Debug for UploadResult
impl Debug for UploadResult
source§impl<UT> FfiConverter<UT> for UploadResult
impl<UT> FfiConverter<UT> for UploadResult
§type FfiType = RustBuffer
type FfiType = RustBuffer
source§fn lower(v: Self) -> RustBuffer
fn lower(v: Self) -> RustBuffer
source§fn try_lift(buf: RustBuffer) -> Result<Self>
fn try_lift(buf: RustBuffer) -> Result<Self>
source§fn write(obj: Self, buf: &mut Vec<u8>)
fn write(obj: Self, buf: &mut Vec<u8>)
source§fn try_read(buf: &mut &[u8]) -> Result<Self>
fn try_read(buf: &mut &[u8]) -> Result<Self>
source§const TYPE_ID_META: MetadataBuffer = _
const TYPE_ID_META: MetadataBuffer = _
source§impl<UT> Lift<UT> for UploadResult
impl<UT> Lift<UT> for UploadResult
source§impl<UT> LiftRef<UT> for UploadResult
impl<UT> LiftRef<UT> for UploadResult
type LiftType = UploadResult
source§impl<UT> LiftReturn<UT> for UploadResult
impl<UT> LiftReturn<UT> for UploadResult
§type ReturnType = <UploadResult as Lift<UT>>::FfiType
type ReturnType = <UploadResult as Lift<UT>>::FfiType
source§fn try_lift_successful_return(v: Self::ReturnType) -> Result<Self>
fn try_lift_successful_return(v: Self::ReturnType) -> Result<Self>
§fn lift_foreign_return(
ffi_return: Self::ReturnType,
call_status: RustCallStatus
) -> Self
fn lift_foreign_return( ffi_return: Self::ReturnType, call_status: RustCallStatus ) -> Self
§fn lift_error(_buf: RustBuffer) -> Self
fn lift_error(_buf: RustBuffer) -> Self
§fn handle_callback_unexpected_error(e: UnexpectedUniFFICallbackError) -> Self
fn handle_callback_unexpected_error(e: UnexpectedUniFFICallbackError) -> Self
source§impl<UT> Lower<UT> for UploadResult
impl<UT> Lower<UT> for UploadResult
source§impl<UT> LowerError<UT> for UploadResult
impl<UT> LowerError<UT> for UploadResult
source§fn lower_error(obj: Self) -> RustBuffer
fn lower_error(obj: Self) -> RustBuffer
source§impl<UT> LowerReturn<UT> for UploadResult
impl<UT> LowerReturn<UT> for UploadResult
§type ReturnType = <UploadResult as Lower<UT>>::FfiType
type ReturnType = <UploadResult as Lower<UT>>::FfiType
source§fn lower_return(v: Self) -> Result<Self::ReturnType, RustCallError>
fn lower_return(v: Self) -> Result<Self::ReturnType, RustCallError>
§fn handle_failed_lift(
error: LiftArgsError
) -> Result<Self::ReturnType, RustCallError>
fn handle_failed_lift( error: LiftArgsError ) -> Result<Self::ReturnType, RustCallError>
source§impl<UT> TypeId<UT> for UploadResult
impl<UT> TypeId<UT> for UploadResult
const TYPE_ID_META: MetadataBuffer = _
Auto Trait Implementations§
impl RefUnwindSafe for UploadResult
impl Send for UploadResult
impl Sync for UploadResult
impl Unpin for UploadResult
impl UnwindSafe for UploadResult
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
§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
§unsafe fn consume_handle(handle: Handle) -> Arc<T>
unsafe fn consume_handle(handle: Handle) -> Arc<T>
Arc<>
Read more