Struct devices::virtio::wl::WlState

source ·
pub struct WlState {
Show 14 fields wayland_paths: BTreeMap<String, PathBuf>, vm: VmRequester, resource_bridge: Option<Tube>, use_transition_flags: bool, wait_ctx: WaitContext<u32>, vfds: BTreeMap<u32, WlVfd>, next_vfd_id: u32, in_file_queue: Vec<File>, in_queue: VecDeque<(u32, WlRecv)>, current_recv_vfd: Option<u32>, recv_vfds: Vec<u32>, signaled_fence: Option<SafeDescriptor>, use_send_vfd_v2: bool, address_offset: Option<u64>,
}

Fields§

§wayland_paths: BTreeMap<String, PathBuf>§vm: VmRequester§resource_bridge: Option<Tube>§use_transition_flags: bool§wait_ctx: WaitContext<u32>§vfds: BTreeMap<u32, WlVfd>§next_vfd_id: u32§in_file_queue: Vec<File>§in_queue: VecDeque<(u32, WlRecv)>§current_recv_vfd: Option<u32>§recv_vfds: Vec<u32>§signaled_fence: Option<SafeDescriptor>§use_send_vfd_v2: bool§address_offset: Option<u64>

Implementations§

source§

impl WlState

source

pub fn new( wayland_paths: BTreeMap<String, PathBuf>, mapper: Box<dyn SharedMemoryMapper>, use_transition_flags: bool, use_send_vfd_v2: bool, resource_bridge: Option<Tube>, gralloc: RutabagaGralloc, address_offset: Option<u64> ) -> WlState

Create a new WlState instance for running a virtio-wl device.

source

pub fn wait_ctx(&self) -> &WaitContext<u32>

This is a hack so that we can drive the inner WaitContext from an async fn. The proper long-term solution is to replace the WaitContext completely by spawning async workers instead.

source

fn new_pipe(&mut self, id: u32, flags: u32) -> Result<WlResp<'_>, WlError>

source

fn new_alloc( &mut self, id: u32, flags: u32, size: u32 ) -> Result<WlResp<'_>, WlError>

source

fn new_dmabuf( &mut self, id: u32, width: u32, height: u32, format: u32 ) -> Result<WlResp<'_>, WlError>

source

fn dmabuf_sync( &mut self, vfd_id: u32, flags: u32 ) -> Result<WlResp<'_>, WlError>

source

fn new_context(&mut self, id: u32, name: &str) -> Result<WlResp<'_>, WlError>

source

fn process_wait_context(&mut self)

source

fn close(&mut self, vfd_id: u32) -> Result<WlResp<'_>, WlError>

source

fn get_info(&mut self, request: ResourceRequest) -> Option<SafeDescriptor>

source

fn send( &mut self, vfd_id: u32, vfd_count: usize, foreign_id: bool, reader: &mut Reader ) -> Result<WlResp<'_>, WlError>

source

fn recv(&mut self, vfd_id: u32) -> Result<(), WlError>

source

fn execute(&mut self, reader: &mut Reader) -> Result<WlResp<'_>, WlError>

source

fn next_recv(&self) -> Option<WlResp<'_>>

source

fn pop_recv(&mut self)

source

fn compute_pfn(&self, offset: &Option<u64>) -> u64

Auto Trait Implementations§

§

impl !RefUnwindSafe for WlState

§

impl !Send for WlState

§

impl !Sync for WlState

§

impl Unpin for WlState

§

impl !UnwindSafe for WlState

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V