pub struct FnSink<F>(pub F);Expand description
A closure as a Sink.
use fit_encoder::{FnSink, Sink};
let mut seen = 0;
let mut sink = FnSink(|bytes: &[u8]| -> Result<(), ()> {
seen += bytes.len();
Ok(())
});
sink.write(b"abc").unwrap();
drop(sink);
assert_eq!(seen, 3);Tuple Fields§
§0: FTrait Implementations§
Auto Trait Implementations§
impl<F> Forget for FnSink<F>
impl<F> Freeze for FnSink<F>where
F: Freeze,
impl<F> Move for FnSink<F>
impl<F> RefUnwindSafe for FnSink<F>where
F: RefUnwindSafe,
impl<F> Send for FnSink<F>where
F: Send,
impl<F> Sync for FnSink<F>where
F: Sync,
impl<F> Unpin for FnSink<F>where
F: Unpin,
impl<F> UnsafeUnpin for FnSink<F>where
F: UnsafeUnpin,
impl<F> UnwindSafe for FnSink<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