Trait Guard

Source
pub trait Guard {
    // Required method
    fn check<T>(v: &[u8]) -> Result<(), GuardError>;
}
Expand description

The trait describes types which define boundary checking strategies. See the module-level documentation for more details.

Required Methods§

Source

fn check<T>(v: &[u8]) -> Result<(), GuardError>

Check the size of the given byte slice against a particular type.

§Errors

If the slice’s size does not comply with this guard, an error which specifies the incompatibility is returned.

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§