pub struct ResultRegion<T, E> { /* private fields */ }
Expand description
A region to hold Result
s.
§Examples
Add results to a result region:
use flatcontainer::{RegionPreference, Push, Region, ResultRegion};
let mut r =
<ResultRegion<<() as RegionPreference>::Region, <String as RegionPreference>::Region>>::default();
let ok_index = r.push(Result::<(), String>::Ok(()));
let err_index = r.push(Result::<(), String>::Err("Error".to_string()));
assert_eq!(Ok(()), r.index(ok_index));
assert_eq!(Err("Error"), r.index(err_index));
Trait Implementations§
Source§impl<T, E> Clone for ResultRegion<T, E>
impl<T, E> Clone for ResultRegion<T, E>
Source§fn clone(&self) -> ResultRegion<T, E>
fn clone(&self) -> ResultRegion<T, E>
Returns a copy of the value. Read more
Source§fn clone_from(&mut self, source: &ResultRegion<T, E>)
fn clone_from(&mut self, source: &ResultRegion<T, E>)
Performs copy-assignment from
source
. Read moreSource§impl<T, E> Debug for ResultRegion<T, E>
impl<T, E> Debug for ResultRegion<T, E>
Source§impl<T, E> Default for ResultRegion<T, E>
impl<T, E> Default for ResultRegion<T, E>
Source§fn default() -> ResultRegion<T, E>
fn default() -> ResultRegion<T, E>
Returns the “default value” for a type. Read more
Source§impl<'de, T, E> Deserialize<'de> for ResultRegion<T, E>where
T: Deserialize<'de>,
E: Deserialize<'de>,
impl<'de, T, E> Deserialize<'de> for ResultRegion<T, E>where
T: Deserialize<'de>,
E: Deserialize<'de>,
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ResultRegion<T, E>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ResultRegion<T, E>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<'a, T, TC, E, EC> Push<&'a Result<T, E>> for ResultRegion<TC, EC>
impl<'a, T, TC, E, EC> Push<&'a Result<T, E>> for ResultRegion<TC, EC>
Source§impl<T, TC, E, EC> Push<Result<T, E>> for ResultRegion<TC, EC>
impl<T, TC, E, EC> Push<Result<T, E>> for ResultRegion<TC, EC>
Source§impl<T, E> Region for ResultRegion<T, E>
impl<T, E> Region for ResultRegion<T, E>
Source§type Owned = Result<<T as Region>::Owned, <E as Region>::Owned>
type Owned = Result<<T as Region>::Owned, <E as Region>::Owned>
An owned type that can be constructed from a read item.
Source§type ReadItem<'a> = Result<<T as Region>::ReadItem<'a>, <E as Region>::ReadItem<'a>>
where
ResultRegion<T, E>: 'a
type ReadItem<'a> = Result<<T as Region>::ReadItem<'a>, <E as Region>::ReadItem<'a>> where ResultRegion<T, E>: 'a
The type of the data that one gets out of the container.
Source§type Index = Result<<T as Region>::Index, <E as Region>::Index>
type Index = Result<<T as Region>::Index, <E as Region>::Index>
The type to index into the container. Should be treated
as an opaque type, even if known.
Source§fn merge_regions<'a>(
regions: impl Iterator<Item = &'a ResultRegion<T, E>> + Clone,
) -> ResultRegion<T, E>where
ResultRegion<T, E>: 'a,
fn merge_regions<'a>(
regions: impl Iterator<Item = &'a ResultRegion<T, E>> + Clone,
) -> ResultRegion<T, E>where
ResultRegion<T, E>: 'a,
Construct a region that can absorb the contents of
regions
in the future.Source§fn index(
&self,
index: <ResultRegion<T, E> as Region>::Index,
) -> <ResultRegion<T, E> as Region>::ReadItem<'_>
fn index( &self, index: <ResultRegion<T, E> as Region>::Index, ) -> <ResultRegion<T, E> as Region>::ReadItem<'_>
Index into the container. The index must be obtained by
pushing data into the container.
Source§fn reserve_regions<'a, I>(&mut self, regions: I)
fn reserve_regions<'a, I>(&mut self, regions: I)
Ensure that the region can absorb the items of
regions
without reallocationSource§fn reborrow<'b, 'a>(
item: <ResultRegion<T, E> as Region>::ReadItem<'a>,
) -> <ResultRegion<T, E> as Region>::ReadItem<'b>where
'a: 'b,
ResultRegion<T, E>: 'a,
fn reborrow<'b, 'a>(
item: <ResultRegion<T, E> as Region>::ReadItem<'a>,
) -> <ResultRegion<T, E> as Region>::ReadItem<'b>where
'a: 'b,
ResultRegion<T, E>: 'a,
Converts a read item into one with a narrower lifetime.
Source§impl<'a, T, TC, E, EC> ReserveItems<&'a Result<T, E>> for ResultRegion<TC, EC>
impl<'a, T, TC, E, EC> ReserveItems<&'a Result<T, E>> for ResultRegion<TC, EC>
Source§impl<T, TC, E, EC> ReserveItems<Result<T, E>> for ResultRegion<TC, EC>
impl<T, TC, E, EC> ReserveItems<Result<T, E>> for ResultRegion<TC, EC>
Source§impl<T, E> Serialize for ResultRegion<T, E>
impl<T, E> Serialize for ResultRegion<T, E>
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl<T, E> Freeze for ResultRegion<T, E>
impl<T, E> RefUnwindSafe for ResultRegion<T, E>where
T: RefUnwindSafe,
E: RefUnwindSafe,
impl<T, E> Send for ResultRegion<T, E>
impl<T, E> Sync for ResultRegion<T, E>
impl<T, E> Unpin for ResultRegion<T, E>
impl<T, E> UnwindSafe for ResultRegion<T, E>where
T: UnwindSafe,
E: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)