pub enum CarlaError {
Connection(ConnectionError),
Resource(ResourceError),
Operation(OperationError),
Validation(ValidationError),
Map(MapError),
Sensor(SensorError),
Internal(InternalError),
Io(Error),
}Expand description
Main error type for all CARLA operations.
This enum categorizes errors into actionable groups, allowing users to handle specific error conditions with appropriate recovery strategies.
Variants§
Connection(ConnectionError)
Connection-related errors (network, timeouts, disconnections)
Resource(ResourceError)
Resource-related errors (actors, blueprints not found, etc.)
Operation(OperationError)
Operation failures (spawn, physics, simulation errors)
Validation(ValidationError)
Validation errors (invalid parameters, out of bounds, etc.)
Map(MapError)
Map-related errors (loading, waypoints, topology)
Sensor(SensorError)
Sensor-related errors (data, configuration, listening)
Internal(InternalError)
Internal errors (FFI, unexpected states, bugs)
Io(Error)
I/O errors (file operations)
Implementations§
Source§impl CarlaError
impl CarlaError
Sourcepub fn is_connection_error(&self) -> bool
pub fn is_connection_error(&self) -> bool
Returns true if this is a connection-related error.
§Examples
let error: CarlaError = ConnectionError::Timeout {
operation: "spawn".to_string(),
duration: Duration::from_secs(5),
source: None,
}
.into();
assert!(error.is_connection_error());Sourcepub fn is_timeout(&self) -> bool
pub fn is_timeout(&self) -> bool
Returns true if this is a timeout error.
§Examples
let error: CarlaError = ConnectionError::Timeout {
operation: "spawn".to_string(),
duration: Duration::from_secs(5),
source: None,
}
.into();
assert!(error.is_timeout());Sourcepub fn is_not_found(&self) -> bool
pub fn is_not_found(&self) -> bool
Returns true if this is a resource not found error.
§Examples
let error: CarlaError = ResourceError::NotFound {
resource_type: ResourceType::Blueprint,
identifier: "vehicle.tesla.model3".to_string(),
context: None,
}
.into();
assert!(error.is_not_found());Sourcepub fn is_retriable(&self) -> bool
pub fn is_retriable(&self) -> bool
Returns true if this error should be retried.
This includes:
- Timeout errors
- Disconnection errors
- Some spawn failures
§Examples
let error: CarlaError = ConnectionError::Timeout {
operation: "spawn".to_string(),
duration: Duration::from_secs(5),
source: None,
}
.into();
assert!(error.is_retriable());Trait Implementations§
Source§impl Debug for CarlaError
impl Debug for CarlaError
Source§impl Display for CarlaError
impl Display for CarlaError
Source§impl Error for CarlaError
impl Error for CarlaError
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<ConnectionError> for CarlaError
impl From<ConnectionError> for CarlaError
Source§fn from(source: ConnectionError) -> Self
fn from(source: ConnectionError) -> Self
Source§impl From<Error> for CarlaError
impl From<Error> for CarlaError
Source§impl From<InternalError> for CarlaError
impl From<InternalError> for CarlaError
Source§fn from(source: InternalError) -> Self
fn from(source: InternalError) -> Self
Source§impl From<MapError> for CarlaError
impl From<MapError> for CarlaError
Source§impl From<OperationError> for CarlaError
impl From<OperationError> for CarlaError
Source§fn from(source: OperationError) -> Self
fn from(source: OperationError) -> Self
Source§impl From<ResourceError> for CarlaError
impl From<ResourceError> for CarlaError
Source§fn from(source: ResourceError) -> Self
fn from(source: ResourceError) -> Self
Source§impl From<SensorError> for CarlaError
impl From<SensorError> for CarlaError
Source§fn from(source: SensorError) -> Self
fn from(source: SensorError) -> Self
Source§impl From<ValidationError> for CarlaError
impl From<ValidationError> for CarlaError
Source§fn from(source: ValidationError) -> Self
fn from(source: ValidationError) -> Self
Auto Trait Implementations§
impl Freeze for CarlaError
impl !RefUnwindSafe for CarlaError
impl Send for CarlaError
impl Sync for CarlaError
impl Unpin for CarlaError
impl !UnwindSafe for CarlaError
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> 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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.