Struct timely::container::flatcontainer::ResultRegion
source · 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>
§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.
§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.
§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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)