Skip to main content

mesa3d_util/sys/stub/
tube.rs

1// Copyright 2025 Google
2// SPDX-License-Identifier: MIT
3
4use std::path::Path;
5
6use crate::AsBorrowedDescriptor;
7use crate::MesaError;
8use crate::MesaResult;
9use crate::OwnedDescriptor;
10use crate::TubeType;
11
12pub struct Tube;
13pub struct Listener;
14
15impl Tube {
16    pub fn new<P: AsRef<Path>>(_path: P, _kind: TubeType) -> MesaResult<Tube> {
17        Err(MesaError::Unsupported)
18    }
19
20    pub fn send(&self, _opaque_data: &[u8], _descriptors: &[OwnedDescriptor]) -> MesaResult<usize> {
21        Err(MesaError::Unsupported)
22    }
23
24    pub fn receive(&self, _opaque_data: &mut [u8]) -> MesaResult<(usize, Vec<OwnedDescriptor>)> {
25        Err(MesaError::Unsupported)
26    }
27}
28
29impl AsBorrowedDescriptor for Tube {
30    fn as_borrowed_descriptor(&self) -> &OwnedDescriptor {
31        unimplemented!()
32    }
33}
34
35impl Listener {
36    /// Creates a new `Listener` bound to the given path.
37    pub fn bind<P: AsRef<Path>>(_path: P) -> MesaResult<Listener> {
38        Err(MesaError::Unsupported)
39    }
40
41    pub fn accept(&self) -> MesaResult<Tube> {
42        Err(MesaError::Unsupported)
43    }
44}
45
46impl AsBorrowedDescriptor for Listener {
47    fn as_borrowed_descriptor(&self) -> &OwnedDescriptor {
48        unimplemented!()
49    }
50}