blob: 0a60ea8bdf0e10cb991222a8041a6679e37c4f5a (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
use serde::Serializer;
use std::os::unix::prelude::*;
pub trait SerializeWithFds {
fn serialize<Ser>(&self, serializer: SerializerWithFds<Ser>) -> Result<Ser::Ok, Ser::Error>
where
Ser: Serializer;
}
#[derive(Debug)]
pub struct SerializerWithFds<'fds, Ser> {
pub serializer: Ser,
pub fds: &'fds mut Vec<RawFd>,
}
impl<'fds, Ser> SerializerWithFds<'fds, Ser> {
pub fn new(fds: &'fds mut Vec<RawFd>, serializer: Ser) -> Self {
Self { serializer, fds }
}
}
|