Skip to main content

TryFromPos

Trait TryFromPos 

Source
pub trait TryFromPos<T: Int>: Sized {
    // Required method
    fn try_from_pos(value: Pos<T>) -> Result<Self, TryFromPosError>;
}
Expand description

A trait for converting a Pos<T> to another type.

Required Methods§

Source

fn try_from_pos(value: Pos<T>) -> Result<Self, TryFromPosError>

Returns the type that the Pos<T> can be converted to.

§Errors

If the conversion fails, returns a TryFromPosError.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<S: Int, T: Int + TryFrom<S>> TryFromPos<S> for Pos<T>