1 // Copyright 2024 The ChromiumOS Authors 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 use std::path::Path; 6 7 use crate::rutabaga_os::AsBorrowedDescriptor; 8 use crate::rutabaga_os::OwnedDescriptor; 9 use crate::rutabaga_os::RawDescriptor; 10 use crate::rutabaga_os::TubeType; 11 use crate::rutabaga_utils::RutabagaError; 12 use crate::rutabaga_utils::RutabagaResult; 13 14 pub struct Stub(()); 15 pub type Tube = Stub; 16 pub type Listener = Stub; 17 18 impl Tube { new<P: AsRef<Path>>(_path: P, _kind: TubeType) -> RutabagaResult<Tube>19 pub fn new<P: AsRef<Path>>(_path: P, _kind: TubeType) -> RutabagaResult<Tube> { 20 Err(RutabagaError::Unsupported) 21 } 22 send( &self, _opaque_data: &[u8], _descriptors: &[RawDescriptor], ) -> RutabagaResult<usize>23 pub fn send( 24 &self, 25 _opaque_data: &[u8], 26 _descriptors: &[RawDescriptor], 27 ) -> RutabagaResult<usize> { 28 Err(RutabagaError::Unsupported) 29 } 30 receive( &self, _opaque_data: &mut [u8], ) -> RutabagaResult<(usize, Vec<OwnedDescriptor>)>31 pub fn receive( 32 &self, 33 _opaque_data: &mut [u8], 34 ) -> RutabagaResult<(usize, Vec<OwnedDescriptor>)> { 35 Err(RutabagaError::Unsupported) 36 } 37 } 38 39 impl AsBorrowedDescriptor for Tube { as_borrowed_descriptor(&self) -> &OwnedDescriptor40 fn as_borrowed_descriptor(&self) -> &OwnedDescriptor { 41 unimplemented!() 42 } 43 } 44 45 impl Listener { 46 /// Creates a new `Listener` bound to the given path. bind<P: AsRef<Path>>(_path: P) -> RutabagaResult<Listener>47 pub fn bind<P: AsRef<Path>>(_path: P) -> RutabagaResult<Listener> { 48 Err(RutabagaError::Unsupported) 49 } 50 accept(&self) -> RutabagaResult<Tube>51 pub fn accept(&self) -> RutabagaResult<Tube> { 52 Err(RutabagaError::Unsupported) 53 } 54 } 55