[−][src]Trait genie_support::MapInto
Helper trait to map a container of T to a container of some type F that implements From
For example, Result
Required methods
fn map_into(self) -> T
Map the contained T
into a different type.
Essentially, .map_into()
is the same as doing .map(|val| val.into())
.
Example
use genie_support::MapInto; let a: Option<u8> = Some(10); let b: Option<u16> = a.map_into(); assert_eq!(b, Some(10u16));
Implementations on Foreign Types
impl<Source, Target, Error> MapInto<Result<Target, Error>> for Result<Source, Error> where
Target: From<Source>,
[src]
Target: From<Source>,
impl<Source, Target> MapInto<Option<Target>> for Option<Source> where
Target: From<Source>,
[src]
Loading content...
Target: From<Source>,