pub trait VecExt<T> {
// Required methods
fn pop_or_cbkp_error(
&mut self,
code: ErrorCode,
message: impl Into<String>,
) -> Result<T>;
fn last_or_cbkp_error(
&self,
code: ErrorCode,
message: impl Into<String>,
) -> Result<&T>;
fn last_mut_or_cbkp_error(
&mut self,
code: ErrorCode,
message: impl Into<String>,
) -> Result<&mut T>;
}Expand description
Extension trait for Vec<T> providing panic-safe access operations
Required Methods§
Sourcefn pop_or_cbkp_error(
&mut self,
code: ErrorCode,
message: impl Into<String>,
) -> Result<T>
fn pop_or_cbkp_error( &mut self, code: ErrorCode, message: impl Into<String>, ) -> Result<T>
Pop from vector safely, returning a structured error if empty
§Errors
Returns the specified error code and message if the vector is empty.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.