Skip to main content

TypeIdExt

Trait TypeIdExt 

Source
pub trait TypeIdExt {
    // Required method
    fn non_never(self) -> Option<Self>
       where Self: Sized;
}
Expand description

Extension trait for TypeId with chainable methods for common operations.

This trait provides idiomatic Rust methods to reduce boilerplate when working with TypeId values. Methods are designed to be chainable and composable with iterator combinators.

§Examples

// Filter out NEVER types in a map operation
.filter_map(|&id| some_operation(id).non_never())

Required Methods§

Source

fn non_never(self) -> Option<Self>
where Self: Sized,

Returns Some(self) if self is not NEVER, otherwise None.

This is useful for filter_map chains where you want to skip NEVER results.

Implementors§