pub enum AsyncError {
Initialization {
component: Arc<str>,
message: Arc<str>,
recoverable: bool,
},
TaskTracking {
operation: TaskOperation,
message: Arc<str>,
task_id: Option<TaskId>,
},
AllocationTracking {
event_type: AllocationEventType,
message: Arc<str>,
allocation_size: Option<usize>,
},
BufferManagement {
buffer_type: BufferType,
message: Arc<str>,
events_lost: Option<usize>,
},
DataAggregation {
aggregator: Arc<str>,
message: Arc<str>,
partial_data_available: bool,
},
Integration {
component: Arc<str>,
message: Arc<str>,
fallback_available: bool,
},
System {
operation: Arc<str>,
message: Arc<str>,
source_error: Option<Arc<str>>,
},
}
Expand description
Unified error type for async memory tracking operations
Follows the project’s pattern of using Arc<str>
for efficient error messages
and avoiding string cloning overhead.
Variants§
Initialization
Task tracking initialization or configuration errors
TaskTracking
Task identification and propagation errors
AllocationTracking
Memory allocation tracking errors
BufferManagement
Event buffer management errors
DataAggregation
Data aggregation and analysis errors
Integration
Integration errors with tokio runtime or tracing
System
System-level errors (threading, IO, etc.)
Implementations§
Source§impl AsyncError
impl AsyncError
Sourcepub fn initialization(component: &str, message: &str, recoverable: bool) -> Self
pub fn initialization(component: &str, message: &str, recoverable: bool) -> Self
Create an initialization error
Sourcepub fn task_tracking(
operation: TaskOperation,
message: &str,
task_id: Option<TaskId>,
) -> Self
pub fn task_tracking( operation: TaskOperation, message: &str, task_id: Option<TaskId>, ) -> Self
Create a task tracking error
Sourcepub fn allocation_tracking(
event_type: AllocationEventType,
message: &str,
allocation_size: Option<usize>,
) -> Self
pub fn allocation_tracking( event_type: AllocationEventType, message: &str, allocation_size: Option<usize>, ) -> Self
Create an allocation tracking error
Sourcepub fn buffer_management(
buffer_type: BufferType,
message: &str,
events_lost: Option<usize>,
) -> Self
pub fn buffer_management( buffer_type: BufferType, message: &str, events_lost: Option<usize>, ) -> Self
Create a buffer management error
Sourcepub fn data_aggregation(
aggregator: &str,
message: &str,
partial_data: bool,
) -> Self
pub fn data_aggregation( aggregator: &str, message: &str, partial_data: bool, ) -> Self
Create a data aggregation error
Sourcepub fn integration(
component: &str,
message: &str,
fallback_available: bool,
) -> Self
pub fn integration( component: &str, message: &str, fallback_available: bool, ) -> Self
Create an integration error
Sourcepub fn system(operation: &str, message: &str, source: Option<&str>) -> Self
pub fn system(operation: &str, message: &str, source: Option<&str>) -> Self
Create a system error
Sourcepub fn is_recoverable(&self) -> bool
pub fn is_recoverable(&self) -> bool
Check if this error is recoverable
Trait Implementations§
Source§impl Clone for AsyncError
impl Clone for AsyncError
Source§fn clone(&self) -> AsyncError
fn clone(&self) -> AsyncError
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for AsyncError
impl Debug for AsyncError
Source§impl Display for AsyncError
impl Display for AsyncError
Source§impl Error for AsyncError
impl Error for AsyncError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for AsyncError
impl RefUnwindSafe for AsyncError
impl Send for AsyncError
impl Sync for AsyncError
impl Unpin for AsyncError
impl UnwindSafe for AsyncError
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
Mutably borrows from an owned value. Read more
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more