pub struct Transducer;Expand description
Represents a transducer struct.
Implementations§
Source§impl<'a> Transducer
impl<'a> Transducer
Sourcepub fn reduce<S>(cx: &'a mut NgynContext<'_>) -> Swhere
S: Transformer<'a>,
pub fn reduce<S>(cx: &'a mut NgynContext<'_>) -> Swhere
S: Transformer<'a>,
Reduces the given NgynContext using the specified Transformer and returns an instance of S.
§Arguments
cx- The mutable reference to theNgynContext.
§Examples
ⓘ
struct MyTransformer;
impl Transformer for MyTransformer {
fn transform(cx: &mut NgynContext) -> Option<Self> {
// Transformation logic goes here
MyTransformer
}
}
let mut cx = NgynContext::default();
let result: MyTransformer = Transducer::reduce(&mut cx);Auto Trait Implementations§
impl Freeze for Transducer
impl RefUnwindSafe for Transducer
impl Send for Transducer
impl Sync for Transducer
impl Unpin for Transducer
impl UnsafeUnpin for Transducer
impl UnwindSafe for Transducer
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