libutils 9.38.21

Common library types for faster development
//^
//^ HEAD
//^

//> HEAD -> SUPER
use super::Pointer;

//> HEAD -> CORE
use core::{
    ptr::NonNull,
    marker::PhantomCovariantLifetime
};


//^
//^ CONVERSIONS
//^

//> CONVERSIONS -> FROM NONNULL
impl<Type> const From<NonNull<Type>> for Pointer<'static, Type> {
    fn from(value: NonNull<Type>) -> Self {return Self {
        to: Some(value),
        lifetime: PhantomCovariantLifetime::new()
    }}
}

//> CONVERSIONS -> FROM OPTION NONNULL
impl<Type> const From<Option<NonNull<Type>>> for Pointer<'static, Type> {
    fn from(value: Option<NonNull<Type>>) -> Self {return Self {
        to: value,
        lifetime: PhantomCovariantLifetime::new()
    }}
}