use crate::{ lenses::{LensOver, LensView}, Optics, }; impl std::ops::FnOnce<(A,)> for Optics where L: LensView, { type Output = L::Field; extern "rust-call" fn call_once(self, args: (A,)) -> Self::Output { L::view(&self.0, args.0) } } impl std::ops::FnMut<(A,)> for Optics where L: LensView, { extern "rust-call" fn call_mut(&mut self, args: (A,)) -> Self::Output { L::view(&self.0, args.0) } } impl std::ops::Fn<(A,)> for Optics where L: LensView, { extern "rust-call" fn call(&self, args: (A,)) -> Self::Output { L::view(&self.0, args.0) } } impl std::ops::FnOnce<(A, F)> for Optics where L: LensOver, F: FnOnce(L::Field) -> L::Field, { type Output = A; extern "rust-call" fn call_once(self, args: (A, F)) -> Self::Output { L::over(&self.0, args.0, args.1) } } impl std::ops::FnMut<(A, F)> for Optics where L: LensOver, F: FnOnce(L::Field) -> L::Field, { extern "rust-call" fn call_mut(&mut self, args: (A, F)) -> Self::Output { L::over(&self.0, args.0, args.1) } } impl std::ops::Fn<(A, F)> for Optics where L: LensOver, F: FnOnce(L::Field) -> L::Field, { extern "rust-call" fn call(&self, args: (A, F)) -> Self::Output { L::over(&self.0, args.0, args.1) } }