pub struct HypercallAbi {
pub(crate) hypercall_id: usize,
pub(crate) args: Vec<usize>,
pub(crate) res: Vec<usize>,
}Expand description
Architecture-agnostic wrapper for any hypercall ABI between CrosVM and the guest.
Fields§
§hypercall_id: usize§args: Vec<usize>§res: Vec<usize>Implementations§
Source§impl HypercallAbi
impl HypercallAbi
Sourcepub fn new(hypercall_id: usize, args: &[usize], default_res: &[usize]) -> Self
pub fn new(hypercall_id: usize, args: &[usize], default_res: &[usize]) -> Self
Creates a new HypercallAbi instance, with the default error result.
Sourcepub fn hypercall_id(&self) -> usize
pub fn hypercall_id(&self) -> usize
Returns the hypercall unique identifier, for routing.
Sourcepub fn get_argument(&self, n: usize) -> Option<&usize>
pub fn get_argument(&self, n: usize) -> Option<&usize>
Returns the n-th guest-provided architecture-specific arguments.
Sourcepub fn get_results(&self) -> &[usize]
pub fn get_results(&self) -> &[usize]
Returns the architecture-specific results for the guest, if set.
Sourcepub fn set_results(&mut self, res: &[usize])
pub fn set_results(&mut self, res: &[usize])
Sets the architecture-specific results for the guest.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HypercallAbi
impl RefUnwindSafe for HypercallAbi
impl Send for HypercallAbi
impl Sync for HypercallAbi
impl Unpin for HypercallAbi
impl UnwindSafe for HypercallAbi
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn 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>
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)
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)
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.