[−][src]Struct dqcsim::common::converter::ConverterMap
K: user-defined key for identifying which converter to use I: detector input = constructor output O: detector output = constructor input
Implementations
impl<'c, K, I, O> ConverterMap<'c, K, I, O> where
K: Eq + Hash + Clone,
I: Eq + Hash + Clone,
O: Clone,
[src]
K: Eq + Hash + Clone,
I: Eq + Hash + Clone,
O: Clone,
pub fn new(cache_key_generator: Option<Box<dyn Fn(&I) -> I>>) -> Self
[src]
Constructs a new empty ConverterMap.
pub fn push(
&mut self,
key: impl Into<K>,
converter: Box<dyn Converter<Input = I, Output = O> + 'c>
)
[src]
&mut self,
key: impl Into<K>,
converter: Box<dyn Converter<Input = I, Output = O> + 'c>
)
Appends a Converter with the specified key to the back of the collection of Detectors in this map.
pub fn insert(
&mut self,
index: usize,
key: impl Into<K>,
converter: Box<dyn Converter<Input = I, Output = O> + 'c>
)
[src]
&mut self,
index: usize,
key: impl Into<K>,
converter: Box<dyn Converter<Input = I, Output = O> + 'c>
)
Inserts a Converter at position index within the collection of Detectors in this map, with the specified key associated to the inserted Converter.
pub fn with(
self,
key: impl Into<K>,
converter: Box<dyn Converter<Input = I, Output = O> + 'c>
) -> Self
[src]
self,
key: impl Into<K>,
converter: Box<dyn Converter<Input = I, Output = O> + 'c>
) -> Self
Appends the specified Converter with the corresponding specified key to the collection and returns the updated DetectorMap.
pub fn clear_cache(&self)
[src]
Clears the cache.
pub fn len(&self) -> usize
[src]
Returns the number of Detectors in the collection.
pub fn is_empty(&self) -> bool
[src]
Returns true if the collection contains no Detectors.
Trait Implementations
impl<'c, I, K, O> Converter for ConverterMap<'c, K, I, O> where
K: Eq + Hash + Clone,
I: Eq + Hash + Clone,
O: Clone,
[src]
K: Eq + Hash + Clone,
I: Eq + Hash + Clone,
O: Clone,
type Input = I
The more generic detector input type = constructor output type.
type Output = (K, O)
The more specific detector output type = constructor input type.
fn detect(&self, input: &I) -> Result<Option<(K, O)>>
[src]
fn construct(&self, input: &(K, O)) -> Result<I>
[src]
impl<'c, K, I, O> Default for ConverterMap<'c, K, I, O> where
K: Eq + Hash + Clone,
I: Eq + Hash + Clone,
O: Clone,
[src]
K: Eq + Hash + Clone,
I: Eq + Hash + Clone,
O: Clone,
Auto Trait Implementations
impl<'c, K, I, O> !RefUnwindSafe for ConverterMap<'c, K, I, O>
impl<'c, K, I, O> !Send for ConverterMap<'c, K, I, O>
impl<'c, K, I, O> !Sync for ConverterMap<'c, K, I, O>
impl<'c, K, I, O> Unpin for ConverterMap<'c, K, I, O> where
I: Unpin,
K: Unpin,
O: Unpin,
I: Unpin,
K: Unpin,
O: Unpin,
impl<'c, K, I, O> !UnwindSafe for ConverterMap<'c, K, I, O>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,