[−][src]Enum tao_of_rust::ch02::errors_handle::Result
std::result::Result 定义
Basic usage:
let x: Result<i32, &str> = Ok(-3); assert_eq!(x.is_ok(), true); let x: Result<i32, &str> = Err("Some error message"); assert_eq!(x.is_ok(), false);Run
Rust 2018 main函数可以返回Result<T, E>
// use std::fs::File; // fn main() -> Result<(), std::io::Error> { // let f = File::open("bar.txt")?; // Ok(()) // }Run
Variants
Ok(T)Err(E)Auto Trait Implementations
impl<T, E> Send for Result<T, E> where
E: Send,
T: Send,
impl<T, E> Send for Result<T, E> where
E: Send,
T: Send, impl<T, E> Sync for Result<T, E> where
E: Sync,
T: Sync,
impl<T, E> Sync for Result<T, E> where
E: Sync,
T: Sync, Blanket Implementations
impl<T> From for T[src]
impl<T> From for Timpl<T, U> Into for T where
U: From<T>, [src]
impl<T, U> Into for T where
U: From<T>, impl<T, U> TryFrom for T where
T: From<U>, [src]
impl<T, U> TryFrom for T where
T: From<U>, type Error = !
🔬 This is a nightly-only experimental API. (
try_from)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>impl<T> Borrow for T where
T: ?Sized, [src]
impl<T> Borrow for T where
T: ?Sized, impl<T> Any for T where
T: 'static + ?Sized, [src]
impl<T> Any for T where
T: 'static + ?Sized, fn get_type_id(&self) -> TypeId[src]
fn get_type_id(&self) -> TypeIdimpl<T> BorrowMut for T where
T: ?Sized, [src]
impl<T> BorrowMut for T where
T: ?Sized, fn borrow_mut(&mut self) -> &mut T[src]
fn borrow_mut(&mut self) -> &mut Timpl<T, U> TryInto for T where
U: TryFrom<T>, [src]
impl<T, U> TryInto for T where
U: TryFrom<T>,