1
0
Fork 0
forked from wry/wry

autocommit 2022-01-07 15:08:31 CET

This commit is contained in:
Julian Orth 2022-01-07 15:08:31 +01:00
parent 4a939477a2
commit f8e7557d1d
18 changed files with 1258 additions and 35 deletions

View file

@ -1,18 +1,19 @@
use crate::fixed::Fixed;
use crate::object::ObjectId;
use crate::utils::buffd::buf_out::{BufFdOut, MsgFds};
use std::mem;
use std::mem::MaybeUninit;
use std::rc::Rc;
use uapi::OwnedFd;
use crate::fixed::Fixed;
pub struct MsgFormatter<'a> {
buf: &'a mut BufFdOut,
pos: usize,
fds: &'a mut Vec<OwnedFd>,
fds: &'a mut Vec<Rc<OwnedFd>>,
}
impl<'a> MsgFormatter<'a> {
pub fn new(buf: &'a mut BufFdOut, fds: &'a mut Vec<OwnedFd>) -> Self {
pub fn new(buf: &'a mut BufFdOut, fds: &'a mut Vec<Rc<OwnedFd>>) -> Self {
Self {
pos: buf.out_pos,
buf,
@ -46,7 +47,7 @@ impl<'a> MsgFormatter<'a> {
self
}
pub fn fd(&mut self, fd: OwnedFd) -> &mut Self {
pub fn fd(&mut self, fd: Rc<OwnedFd>) -> &mut Self {
self.fds.push(fd);
self
}