pub struct ReturnInfo {Show 13 fields
pub ty: Option<Type>,
pub ok_type: Option<Type>,
pub err_type: Option<Type>,
pub some_type: Option<Type>,
pub is_result: bool,
pub is_option: bool,
pub is_unit: bool,
pub is_stream: bool,
pub stream_item: Option<Type>,
pub is_iterator: bool,
pub iterator_item: Option<Type>,
pub is_reference: bool,
pub reference_inner: Option<Type>,
}Expand description
Parsed return type information
Fields§
§ty: Option<Type>The full return type
ok_type: Option<Type>Inner type if Result<T, E>
err_type: Option<Type>Error type if Result<T, E>
some_type: Option<Type>Inner type if Option<T>
is_result: boolWhether it’s a Result
is_option: boolWhether it’s an Option (and not Result)
is_unit: boolWhether it returns ()
is_stream: boolWhether it’s impl Stream<Item=T>
stream_item: Option<Type>The stream item type if is_stream
is_iterator: boolWhether it’s impl Iterator<Item=T>
iterator_item: Option<Type>The iterator item type if is_iterator
is_reference: boolWhether the return type is a reference (&T)
reference_inner: Option<Type>The inner type T if returning &T
Trait Implementations§
Source§impl Clone for ReturnInfo
impl Clone for ReturnInfo
Source§fn clone(&self) -> ReturnInfo
fn clone(&self) -> ReturnInfo
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ReturnInfo
impl RefUnwindSafe for ReturnInfo
impl !Send for ReturnInfo
impl !Sync for ReturnInfo
impl Unpin for ReturnInfo
impl UnsafeUnpin for ReturnInfo
impl UnwindSafe for ReturnInfo
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more