pub struct InitTransducerDp<M, A>where
M: Monoid,
A: Transducer,{
fst: A,
init: M::T,
}Fields§
§fst: A§init: M::TImplementations§
Source§impl<M, A> InitTransducerDp<M, A>where
M: Monoid,
A: Transducer,
impl<M, A> InitTransducerDp<M, A>where
M: Monoid,
A: Transducer,
Sourcepub fn with_factory<F>(self, factory: F) -> Transducerdp<M, A, F::Container>
pub fn with_factory<F>(self, factory: F) -> Transducerdp<M, A, F::Container>
Examples found in repository?
crates/competitive/src/data_structure/transducer.rs (line 140)
136 pub fn with_hashmap(self) -> Transducerdp<M, A, HashMap<A::State, M::T>>
137 where
138 A: Transducer<State: Eq + Hash>,
139 {
140 self.with_factory(HashMapFactory::default())
141 }
142 pub fn with_vecmap<F>(
143 self,
144 key_to_index: F,
145 ) -> Transducerdp<M, A, VecMap<false, A::State, M::T, F>>
146 where
147 F: Fn(&A::State) -> usize + Clone,
148 {
149 self.with_factory(VecMapFactory::new(key_to_index))
150 }
151 pub fn with_fixed_vecmap<F>(
152 self,
153 key_to_index: F,
154 len: usize,
155 ) -> Transducerdp<M, A, VecMap<true, A::State, M::T, F>>
156 where
157 F: Fn(&A::State) -> usize + Clone,
158 {
159 self.with_factory(FixedVecMapFactory::new(key_to_index, len))
160 }pub fn with_hashmap(self) -> Transducerdp<M, A, HashMap<A::State, M::T>>
pub fn with_vecmap<F>( self, key_to_index: F, ) -> Transducerdp<M, A, VecMap<false, A::State, M::T, F>>
pub fn with_fixed_vecmap<F>( self, key_to_index: F, len: usize, ) -> Transducerdp<M, A, VecMap<true, A::State, M::T, F>>
Trait Implementations§
Source§impl<M, A> Clone for InitTransducerDp<M, A>
impl<M, A> Clone for InitTransducerDp<M, A>
Auto Trait Implementations§
impl<M, A> Freeze for InitTransducerDp<M, A>
impl<M, A> RefUnwindSafe for InitTransducerDp<M, A>
impl<M, A> Send for InitTransducerDp<M, A>
impl<M, A> Sync for InitTransducerDp<M, A>
impl<M, A> Unpin for InitTransducerDp<M, A>
impl<M, A> UnsafeUnpin for InitTransducerDp<M, A>
impl<M, A> UnwindSafe for InitTransducerDp<M, A>
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