pub enum MemScopeError {
Memory {
operation: MemoryOperation,
message: Arc<str>,
context: Option<Arc<str>>,
},
Analysis {
analyzer: Arc<str>,
message: Arc<str>,
recoverable: bool,
},
Export {
format: Arc<str>,
message: Arc<str>,
partial_success: bool,
},
Configuration {
component: Arc<str>,
message: Arc<str>,
},
System {
error_type: SystemErrorType,
message: Arc<str>,
source_message: Option<Arc<str>>,
},
Internal {
message: Arc<str>,
location: Option<Arc<str>>,
},
}
Expand description
Unified error type for the entire memscope-rs system
This replaces the complex TrackingError with a simpler, more efficient design while maintaining all existing error information and backward compatibility.
Variants§
Memory
Memory tracking operations (allocation, deallocation, association)
Analysis
Analysis operations (fragmentation, lifecycle, etc.)
Export
Export operations (JSON, binary, HTML, etc.)
Configuration
Configuration and initialization errors
System
System-level errors (IO, threading, etc.)
Internal
Internal errors that should not normally occur
Implementations§
Source§impl MemScopeError
impl MemScopeError
Sourcepub fn memory(operation: MemoryOperation, message: impl Into<Arc<str>>) -> Self
pub fn memory(operation: MemoryOperation, message: impl Into<Arc<str>>) -> Self
Create a memory operation error
Sourcepub fn memory_with_context(
operation: MemoryOperation,
message: impl Into<Arc<str>>,
context: impl Into<Arc<str>>,
) -> Self
pub fn memory_with_context( operation: MemoryOperation, message: impl Into<Arc<str>>, context: impl Into<Arc<str>>, ) -> Self
Create a memory operation error with context
Sourcepub fn analysis(
analyzer: impl Into<Arc<str>>,
message: impl Into<Arc<str>>,
) -> Self
pub fn analysis( analyzer: impl Into<Arc<str>>, message: impl Into<Arc<str>>, ) -> Self
Create an analysis error
Sourcepub fn analysis_fatal(
analyzer: impl Into<Arc<str>>,
message: impl Into<Arc<str>>,
) -> Self
pub fn analysis_fatal( analyzer: impl Into<Arc<str>>, message: impl Into<Arc<str>>, ) -> Self
Create a non-recoverable analysis error
Sourcepub fn export(format: impl Into<Arc<str>>, message: impl Into<Arc<str>>) -> Self
pub fn export(format: impl Into<Arc<str>>, message: impl Into<Arc<str>>) -> Self
Create an export error
Sourcepub fn export_partial(
format: impl Into<Arc<str>>,
message: impl Into<Arc<str>>,
) -> Self
pub fn export_partial( format: impl Into<Arc<str>>, message: impl Into<Arc<str>>, ) -> Self
Create an export error with partial success
Sourcepub fn config(
component: impl Into<Arc<str>>,
message: impl Into<Arc<str>>,
) -> Self
pub fn config( component: impl Into<Arc<str>>, message: impl Into<Arc<str>>, ) -> Self
Create a configuration error
Sourcepub fn system(error_type: SystemErrorType, message: impl Into<Arc<str>>) -> Self
pub fn system(error_type: SystemErrorType, message: impl Into<Arc<str>>) -> Self
Create a system error
Sourcepub fn system_with_source(
error_type: SystemErrorType,
message: impl Into<Arc<str>>,
source: impl Error,
) -> Self
pub fn system_with_source( error_type: SystemErrorType, message: impl Into<Arc<str>>, source: impl Error, ) -> Self
Create a system error with source
Sourcepub fn internal_at(
message: impl Into<Arc<str>>,
location: impl Into<Arc<str>>,
) -> Self
pub fn internal_at( message: impl Into<Arc<str>>, location: impl Into<Arc<str>>, ) -> Self
Create an internal error with location
Sourcepub fn is_recoverable(&self) -> bool
pub fn is_recoverable(&self) -> bool
Check if this error is recoverable
Sourcepub fn severity(&self) -> ErrorSeverity
pub fn severity(&self) -> ErrorSeverity
Get error severity level
Sourcepub fn user_message(&self) -> &str
pub fn user_message(&self) -> &str
Get a user-friendly error message
Trait Implementations§
Source§impl Clone for MemScopeError
impl Clone for MemScopeError
Source§fn clone(&self) -> MemScopeError
fn clone(&self) -> MemScopeError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for MemScopeError
impl Debug for MemScopeError
Source§impl Display for MemScopeError
impl Display for MemScopeError
Source§impl Error for MemScopeError
impl Error for MemScopeError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
Source§impl From<Error> for MemScopeError
impl From<Error> for MemScopeError
Source§impl From<Error> for MemScopeError
impl From<Error> for MemScopeError
Source§impl From<TrackingError> for MemScopeError
impl From<TrackingError> for MemScopeError
Source§fn from(err: TrackingError) -> Self
fn from(err: TrackingError) -> Self
Auto Trait Implementations§
impl Freeze for MemScopeError
impl RefUnwindSafe for MemScopeError
impl Send for MemScopeError
impl Sync for MemScopeError
impl Unpin for MemScopeError
impl UnwindSafe for MemScopeError
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> 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>
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>
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