pub trait ResultedVec<T, E> {
// Required methods
fn is_not_empty(self, err: E) -> Result<Vec<T>, E>;
fn count<U, F: Fn(usize, Vec<T>) -> Result<U, E>>(
self,
op: F,
) -> Result<U, E>;
fn into_count(self) -> Result<usize, E>;
fn into_result(self) -> Result<Vec<T>, E>;
}
Expand description
A trait providing extensions for vectors and results containing vectors, offering additional utility methods.
Required Methods§
Sourcefn is_not_empty(self, err: E) -> Result<Vec<T>, E>
fn is_not_empty(self, err: E) -> Result<Vec<T>, E>
Sourcefn into_count(self) -> Result<usize, E>
fn into_count(self) -> Result<usize, E>
Converts the vector into its count.
§Returns
Result<usize, E>
: Ok with the count of elements if the Result is Ok; otherwise, the original Err.
Sourcefn into_result(self) -> Result<Vec<T>, E>
fn into_result(self) -> Result<Vec<T>, E>
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.