Skip to main content

AllocatorGetVmoInfoRequest

Struct AllocatorGetVmoInfoRequest 

Source
pub struct AllocatorGetVmoInfoRequest {
    pub vmo: Option<Vmo>,
    pub need_weak: Option<bool>,
    pub need_single_buffer_settings: Option<bool>,
    pub constraints_to_check: Option<BufferCollectionConstraints>,
    pub vmo_settings_to_check: Option<Vmo>,
    pub vmo_settings_to_check_ignore_size: Option<bool>,
    /* private fields */
}

Fields§

§vmo: Option<Vmo>

vmo is required to be set; ownership is transferred to the server so in most cases a client will duplicate a handle and transfer the duplicate via this field.

The GetVmoInfo call will fail with NOT_FOUND if this VMO isn’t a sysmem-provided VMO. Children of sysmem-provided VMOs don’t count as sysmem-provided VMOs.

Assuming this is a sysmem-provided VMO, the handle can be a sysmem strong VMO handle or a sysmem weak VMO handle.

If this field is sysmem weak VMO handle, close_weak_asap will be set in the response (not the only reason for close_weak_asap to be set).

This field is required.

§need_weak: Option<bool>

Iff set to true, a successful response will have weak_vmo set to a sysmem weak VMO handle for the buffer, regardless of whether the vmo handle in the request was weak or not.

Also, when weak_vmo is set in the response, close_weak_asap will also be set in the response, whether vmo was sysmem strong or sysmem weak (not the only reason for close_weak_asap to be set).

If set to true and vmo is a weak vmo and there aren’t any remaining strong vmo handles for the logical buffer (and the sysmem server has had a chance to notice that), the request will fail with Error.NO_MORE_STRONG_VMO_HANDLES.

This field is optional. The default is false.

§need_single_buffer_settings: Option<bool>

Iff set to true, a successful response will have single_buffer_settings set to the SingleBufferSettings for the buffer’s buffer collection.

The fields in SingleBufferSettings can be thought of as similar in nature to the information available from zx_object_get_info with topic ZX_INFO_VMO, which doesn’t require any rights on the VMO handle to succeed. This information can be needed by the caller to know how to correctly handle / use the VMO. Similarly, this call doesn’t require any particular rights in order to get single_buffer_settings - just ZX_RIGHT_TRANSFER for the client’s message to send successfully, and of course the vmo field must be a handle to a sysmem-provided VMO.

Clients should avoid manually checking whether single_buffer_settings is consistent with the client’s BufferCollectionConstraints (or at least, shouldn’t only rely on that checking in the client). To have sysmem check, see constraints_to_check.

This field is optional. The default is false.

§constraints_to_check: Option<BufferCollectionConstraints>

Iff set, constraints_ok will be set in the response indicating whether the sent constraints are compatible with the parent buffer collection as allocated.

Buffer counts are not checked for consistency, as there’s no way for sysmem to know whether the passed-in vmo was originally handed out to the same logical participant that’s now checking the vmo against its constraints, and we also want to avoid adding things that might lock sysmem into a static number of buffers per collection.

This can be thought of as checking constraints_to_check against the single_buffer_settings (if that is/were requested), but sysmem is free to check against additional info as well (such as a hypothetical future sysmem3’s buffer collection info, or modified semantics for sysmem2 fields that this client hasn’t opted into, or similar). In other words, clients should let sysmem do this check, regardless of whether the client also does some checking of its own.

This field is optional. If un-set, no constraints checking occurs.

§vmo_settings_to_check: Option<Vmo>

If set, vmo_settings_match will be set to indicate whether the parent collection of vmo and vmo_settings_to_check have the same SingleBufferSettings. This will be true if both are the same VMO, will be true if both VMOs are from the same collection, and can also be true if two VMOs from different collections have the same SingleBufferSettings.

§vmo_settings_to_check_ignore_size: Option<bool>

When vmo_settings_to_check is set to a VMO and vmo_settings_to_check_ignore_size is set to true, the buffer size is ignored when comparing the two buffer’s settings. This can be useful to set when checking video decoder input buffers.

Trait Implementations§

Source§

impl Debug for AllocatorGetVmoInfoRequest

Source§

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

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

impl Decode<AllocatorGetVmoInfoRequest, DefaultFuchsiaResourceDialect> for AllocatorGetVmoInfoRequest

Source§

fn new_empty() -> Self

Creates a valid instance of Self. The specific value does not matter, since it will be overwritten by decode.
Source§

unsafe fn decode( &mut self, decoder: &mut Decoder<'_, DefaultFuchsiaResourceDialect>, offset: usize, depth: Depth, ) -> Result<()>

Decodes an object of type T from the decoder’s buffers into self. Read more
Source§

impl Default for AllocatorGetVmoInfoRequest

Source§

fn default() -> AllocatorGetVmoInfoRequest

Returns the “default value” for a type. Read more
Source§

impl Encode<AllocatorGetVmoInfoRequest, DefaultFuchsiaResourceDialect> for &mut AllocatorGetVmoInfoRequest

Source§

unsafe fn encode( self, encoder: &mut Encoder<'_, DefaultFuchsiaResourceDialect>, offset: usize, depth: Depth, ) -> Result<()>

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

impl PartialEq for AllocatorGetVmoInfoRequest

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl ResourceTypeMarker for AllocatorGetVmoInfoRequest

Source§

type Borrowed<'a> = &'a mut AllocatorGetVmoInfoRequest

The Rust type to use for encoding. This is a particular Encode<Self> type cheaply obtainable from &mut Self::Owned. There are three cases: Read more
Source§

fn take_or_borrow<'a>( value: &'a mut <Self as TypeMarker>::Owned, ) -> Self::Borrowed<'a>

Cheaply converts from &mut Self::Owned to Self::Borrowed. For HandleBased types this is “take” (it returns an owned handle and replaces value with Handle::invalid), and for all other types it is “borrow” (just converts from one reference to another).
Source§

impl TypeMarker for AllocatorGetVmoInfoRequest

Source§

type Owned = AllocatorGetVmoInfoRequest

The owned Rust type which this FIDL type decodes into.
Source§

fn inline_align(_context: Context) -> usize

Returns the minimum required alignment of the inline portion of the encoded object. It must be a (nonzero) power of two.
Source§

fn inline_size(_context: Context) -> usize

Returns the size of the inline portion of the encoded object, including padding for alignment. Must be a multiple of inline_align.
Source§

fn encode_is_copy() -> bool

Returns true if the memory layout of Self::Owned matches the FIDL wire format and encoding requires no validation. When true, we can optimize encoding arrays and vectors of Self::Owned to a single memcpy. Read more
Source§

fn decode_is_copy() -> bool

Returns true if the memory layout of Self::Owned matches the FIDL wire format and decoding requires no validation. When true, we can optimize decoding arrays and vectors of Self::Owned to a single memcpy.
Source§

impl Standalone<DefaultFuchsiaResourceDialect> for AllocatorGetVmoInfoRequest

Source§

impl StructuralPartialEq for AllocatorGetVmoInfoRequest

Auto Trait Implementations§

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, 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 = 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>,

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.