pub struct FnConverter<F>{ /* private fields */ }Expand description
Converter implementation backed by a closure.
use daedalus_data::convert::{Converter, ConverterBuilder};
use daedalus_data::model::{TypeExpr, Value, ValueType};
let conv = ConverterBuilder::new(
"noop",
TypeExpr::Scalar(ValueType::Int),
TypeExpr::Scalar(ValueType::Int),
|v: Value| Ok(v),
)
.build();
assert_eq!(conv.cost(), 1);Trait Implementations§
Source§impl<F> Converter for FnConverter<F>
impl<F> Converter for FnConverter<F>
Auto Trait Implementations§
impl<F> Freeze for FnConverter<F>where
F: Freeze,
impl<F> RefUnwindSafe for FnConverter<F>where
F: RefUnwindSafe,
impl<F> Send for FnConverter<F>
impl<F> Sync for FnConverter<F>
impl<F> Unpin for FnConverter<F>where
F: Unpin,
impl<F> UnwindSafe for FnConverter<F>where
F: 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