Skip to main content

Bti

Struct Bti 

Source
pub struct Bti(/* private fields */);
Expand description

An object representing a Zircon Bus Transaction Initiator object. See BTI Documentation for details.

As essentially a subtype of NullableHandle, it can be freely interconverted.

Implementations§

Source§

impl Bti

Source

pub fn raw_handle(&self) -> u32

Return the handle’s integer value.

Source

pub fn invalid() -> Bti

Source

pub fn is_invalid(&self) -> bool

Source

pub fn into_raw(self) -> u32

Return the raw handle’s integer value without closing it when self is dropped.

Source

pub fn unowned(&self) -> Unowned<'_, Bti>

Returns an [Unowned] referring to this handle.

Source

pub fn as_handle_ref(&self) -> Unowned<'_, NullableHandle>

Returns a [HandleRef] referring to this handle.

Source

pub fn duplicate_handle(&self, rights: Rights) -> Result<Bti, Status>

Wraps the zx_handle_duplicate syscall.

Source

pub fn replace_handle(self, rights: Rights) -> Result<Bti, Status>

Wraps the zx_handle_replace syscall.

Source

pub fn into_handle(self) -> NullableHandle

Converts the value into its inner handle.

Source

pub fn signal( &self, clear_mask: Signals, set_mask: Signals, ) -> Result<(), Status>

Wraps the zx_object_signal syscall.

Source

pub fn wait_one( &self, signals: Signals, deadline: Instant<MonotonicTimeline>, ) -> WaitResult

Wraps the zx_object_wait_one syscall.

Source

pub fn wait_async( &self, port: &Port, key: u64, signals: Signals, options: WaitAsyncOpts, ) -> Result<(), Status>

Wraps the zx_object_wait_async syscall.

Source

pub fn wait_item(&self, signals: Signals) -> WaitItem<'_>

Return a WaitItem for this handle and the provided signals to use with object_wait_many.

Source

pub fn get_name(&self) -> Result<Name, Status>

Wraps a call to the zx_object_get_property syscall for the ZX_PROP_NAME property.

Source

pub fn set_name(&self, name: &Name) -> Result<(), Status>

Wraps a call to the zx_object_set_property syscall for the ZX_PROP_NAME property.

Source

pub fn basic_info(&self) -> Result<HandleBasicInfo, Status>

Wraps the zx_object_get_info syscall for the ZX_INFO_HANDLE_BASIC topic.

Source

pub fn count_info(&self) -> Result<HandleCountInfo, Status>

Wraps the zx_object_get_info syscall for the ZX_INFO_HANDLE_COUNT topic.

Source

pub fn koid(&self) -> Result<Koid, Status>

Returns the [Koid] for the object referred to by this handle.

Source§

impl Bti

Source

pub fn create(iommu: &Iommu, id: u64) -> Result<Bti, Status>

Source

pub fn info(&self) -> Result<BtiInfo, Status>

Wraps the zx_object_get_info syscall for the ZX_INFO_BTI topic.

Source

pub fn pin( &self, options: BtiOptions, vmo: &Vmo, offset: u64, size: u64, out_paddrs: &mut [usize], ) -> Result<Pmt, Status>

Source

pub unsafe fn release_quarantine(&self) -> Result<(), Status>

Releases all quarantined PMTs for the given BTI.

Wraps the zx_bti_release_quarantine system call.

§Safety

The caller must ensure that the hardware is in a state where it is no longer attempting to access the memory unpinned by this call. Otherwise, without an IOMMU, this can cause arbitrary memory corruption.

Trait Implementations§

Source§

impl AsHandleRef for Bti

Source§

fn as_handle_ref(&self) -> Unowned<'_, NullableHandle>

Get a reference to the handle. One important use of such a reference is for object_wait_many.
Source§

impl Debug for Bti

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Eq for Bti

Source§

impl From<Bti> for NullableHandle

Source§

fn from(x: Bti) -> NullableHandle

Converts to this type from the input type.
Source§

impl From<Handle> for Bti

Source§

fn from(handle: Handle) -> Bti

Converts to this type from the input type.
Source§

impl From<NullableHandle> for Bti

Source§

fn from(handle: NullableHandle) -> Bti

Converts to this type from the input type.
Source§

impl Hash for Bti

Source§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Ord for Bti

Source§

fn cmp(&self, other: &Bti) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 (const: unstable) · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 (const: unstable) · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

fn clamp_to<R>(self, range: R) -> Self
where Self: Sized, R: ClampBounds<Self>,

🔬This is a nightly-only experimental API. (clamp_to)
Restrict a value to a certain range. Read more
Source§

impl PartialEq for Bti

Source§

fn eq(&self, other: &Bti) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl PartialOrd for Bti

Source§

fn partial_cmp(&self, other: &Bti) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl StructuralPartialEq for Bti

Source§

impl TryFrom<Bti> for Handle

Source§

type Error = Status

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

fn try_from(x: Bti) -> Result<Handle, <Handle as TryFrom<Bti>>::Error>

Performs the conversion.

Auto Trait Implementations§

§

impl Freeze for Bti

§

impl RefUnwindSafe for Bti

§

impl Send for Bti

§

impl Sync for Bti

§

impl Unpin for Bti

§

impl UnsafeUnpin for Bti

§

impl UnwindSafe for Bti

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
Source§

impl<T> EncodableAsHandle for T

Source§

type Dialect = DefaultFuchsiaResourceDialect

What resource dialect can encode this object as a handle.
Source§

impl<T, D> Encode<Ambiguous1, D> for T
where D: ResourceDialect,

Source§

unsafe fn encode( self, _encoder: &mut Encoder<'_, D>, _offset: usize, _depth: Depth, ) -> Result<(), Error>

Encodes the object into the encoder’s buffers. Any handles stored in the object are swapped for Handle::INVALID. Read more
Source§

impl<T, D> Encode<Ambiguous2, D> for T
where D: ResourceDialect,

Source§

unsafe fn encode( self, _encoder: &mut Encoder<'_, D>, _offset: usize, _depth: Depth, ) -> Result<(), Error>

Encodes the object into the encoder’s buffers. Any handles stored in the object are swapped for Handle::INVALID. Read more
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.

§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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.