mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-09 12:49:23 +00:00
Impl ScanData serialization in the DB
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
use core::{marker::PhantomData, fmt::Debug};
|
||||
use std::collections::HashMap;
|
||||
use std::{io, collections::HashMap};
|
||||
|
||||
use group::GroupEncoding;
|
||||
|
||||
@@ -179,6 +179,19 @@ pub struct Return<S: ScannerFeed> {
|
||||
output: OutputFor<S>,
|
||||
}
|
||||
|
||||
impl<S: ScannerFeed> Return<S> {
|
||||
pub(crate) fn write(&self, writer: &mut impl io::Write) -> io::Result<()> {
|
||||
self.address.write(writer)?;
|
||||
self.output.write(writer)
|
||||
}
|
||||
|
||||
pub(crate) fn read(reader: &mut impl io::Read) -> io::Result<Self> {
|
||||
let address = AddressFor::<S>::read(reader)?;
|
||||
let output = OutputFor::<S>::read(reader)?;
|
||||
Ok(Return { address, output })
|
||||
}
|
||||
}
|
||||
|
||||
/// An update for the scheduler.
|
||||
pub struct SchedulerUpdate<S: ScannerFeed> {
|
||||
outputs: Vec<OutputFor<S>>,
|
||||
|
||||
Reference in New Issue
Block a user