ExpectLen

Trait ExpectLen 

Source
pub trait ExpectLen: WithLen + Sized {
    // Required methods
    fn expect_len_lt(self, length: usize) -> Result<Self, ExpectedLenError>;
    fn expect_len_lte(self, length: usize) -> Result<Self, ExpectedLenError>;
    fn expect_len_eq(self, length: usize) -> Result<Self, ExpectedLenError>;
    fn expect_len_ne(self, length: usize) -> Result<Self, ExpectedLenError>;
    fn expect_len_gte(self, length: usize) -> Result<Self, ExpectedLenError>;
    fn expect_len_gt(self, length: usize) -> Result<Self, ExpectedLenError>;

    // Provided methods
    fn expect_non_empty(self) -> Result<Self, ExpectedLenError> { ... }
    fn expect_empty(self) -> Result<Self, ExpectedLenError> { ... }
    fn expect_len(self, length: usize) -> Result<Self, ExpectedLenError> { ... }
}

Required Methods§

Source

fn expect_len_lt(self, length: usize) -> Result<Self, ExpectedLenError>

Source

fn expect_len_lte(self, length: usize) -> Result<Self, ExpectedLenError>

Source

fn expect_len_eq(self, length: usize) -> Result<Self, ExpectedLenError>

Source

fn expect_len_ne(self, length: usize) -> Result<Self, ExpectedLenError>

Source

fn expect_len_gte(self, length: usize) -> Result<Self, ExpectedLenError>

Source

fn expect_len_gt(self, length: usize) -> Result<Self, ExpectedLenError>

Provided Methods§

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.

Implementors§