mlx_rs::utils

Trait IntoOption

Source
pub trait IntoOption<T> {
    // Required method
    fn into_option(self) -> Option<T>;
}
Expand description

A helper trait that is just like Into<Option<T>> but improves ergonomics by allowing implicit conversion from &[T; N] to &[T].

Required Methods§

Source

fn into_option(self) -> Option<T>

Convert into an Option.

Implementations on Foreign Types§

Source§

impl<'a> IntoOption<Ord<'a>> for &'a str

Source§

fn into_option(self) -> Option<Ord<'a>>

Source§

impl<'a> IntoOption<Ord<'a>> for f64

Source§

fn into_option(self) -> Option<Ord<'a>>

Source§

impl<'a, T> IntoOption<&'a [T]> for &'a Vec<T>

Source§

fn into_option(self) -> Option<&'a [T]>

Source§

impl<'a, T, const N: usize> IntoOption<&'a [T]> for &'a [T; N]

Source§

fn into_option(self) -> Option<&'a [T]>

Source§

impl<T> IntoOption<T> for Option<T>

Implementors§

Source§

impl<T> IntoOption<T> for T