pub struct RegisterBufferCollectionArgs {
pub export_token: Option<BufferCollectionExportToken>,
pub buffer_collection_token: Option<ClientEnd<BufferCollectionTokenMarker>>,
pub usage: Option<RegisterBufferCollectionUsage>,
pub usages: Option<RegisterBufferCollectionUsages>,
pub buffer_collection_token2: Option<ClientEnd<BufferCollectionTokenMarker>>,
/* private fields */
}
Expand description
The table of arguments for [RegisterBufferCollection
]. Note that some
fields below are REQUIRED.
Fields§
§export_token: Option<BufferCollectionExportToken>
Clients can send [export_token
] to register buffer collections with Allocator to be used
later in [fuchsia.ui.composition/Flatland
] instances or other Scenic APIs, such as
Screenshot.
For example, by passing a BufferCollectionImportToken
containing the matching peer of
BufferCollectionExportToken
, they can create image resources via
[fuchsia.ui.composition/Flatland.CreateImage
].
Clients should wait for the response before using import_token
.
This field is REQUIRED.
buffer_collection_token: Option<ClientEnd<BufferCollectionTokenMarker>>
§usage: Option<RegisterBufferCollectionUsage>
The client can register a buffer collection for various uses, each coming with their own unique constraints.
This field is OPTIONAL. If usage
is omitted it will be treated as if
it has the DEFAULT option.
§Deprecation
This arg is deprecated at API version 9 with addition of |usages|.
If both the usages
and usage
fields are set, usages
takes precedence and usage
is
ignored.
usages: Option<RegisterBufferCollectionUsages>
The client can register a buffer collection for various uses and has the ability to combine usages if multiple are needed.
This field is OPTIONAL. If usages
is omitted it will be treated as if
it has only the DEFAULT option.
buffer_collection_token2: Option<ClientEnd<BufferCollectionTokenMarker>>
Flatland participates in the allocation of buffers by setting constraints on the
BufferCollection referenced by buffer_collection_token
. It will not block on buffers
being allocated until the client creates content using the BufferCollection.
The buffer collection registered with export_token
is available and kept alive as long
as the client holds a valid BufferCollectionImportToken
. They will be garbage collected
when all BufferCollectionImportToken
s are closed and all the associated Image resources
are released.
Exactly one of buffer_collection_token2
/ buffer_collection_token
must be set.
Trait Implementations§
Source§impl Debug for RegisterBufferCollectionArgs
impl Debug for RegisterBufferCollectionArgs
Source§impl Decode<RegisterBufferCollectionArgs, DefaultFuchsiaResourceDialect> for RegisterBufferCollectionArgs
impl Decode<RegisterBufferCollectionArgs, DefaultFuchsiaResourceDialect> for RegisterBufferCollectionArgs
Source§impl Default for RegisterBufferCollectionArgs
impl Default for RegisterBufferCollectionArgs
Source§fn default() -> RegisterBufferCollectionArgs
fn default() -> RegisterBufferCollectionArgs
Source§impl Encode<RegisterBufferCollectionArgs, DefaultFuchsiaResourceDialect> for &mut RegisterBufferCollectionArgs
impl Encode<RegisterBufferCollectionArgs, DefaultFuchsiaResourceDialect> for &mut RegisterBufferCollectionArgs
Source§impl PartialEq for RegisterBufferCollectionArgs
impl PartialEq for RegisterBufferCollectionArgs
Source§fn eq(&self, other: &RegisterBufferCollectionArgs) -> bool
fn eq(&self, other: &RegisterBufferCollectionArgs) -> bool
self
and other
values to be equal, and is used by ==
.Source§impl ResourceTypeMarker for RegisterBufferCollectionArgs
impl ResourceTypeMarker for RegisterBufferCollectionArgs
Source§type Borrowed<'a> = &'a mut RegisterBufferCollectionArgs
type Borrowed<'a> = &'a mut RegisterBufferCollectionArgs
Encode<Self>
type cheaply obtainable from &mut Self::Owned
. There are three cases: Read moreSource§fn take_or_borrow<'a>(
value: &'a mut <Self as TypeMarker>::Owned,
) -> Self::Borrowed<'a>
fn take_or_borrow<'a>( value: &'a mut <Self as TypeMarker>::Owned, ) -> Self::Borrowed<'a>
&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 RegisterBufferCollectionArgs
impl TypeMarker for RegisterBufferCollectionArgs
Source§type Owned = RegisterBufferCollectionArgs
type Owned = RegisterBufferCollectionArgs
Source§fn inline_align(_context: Context) -> usize
fn inline_align(_context: Context) -> usize
Source§fn inline_size(_context: Context) -> usize
fn inline_size(_context: Context) -> usize
inline_align
.§fn encode_is_copy() -> bool
fn encode_is_copy() -> bool
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§fn decode_is_copy() -> bool
fn decode_is_copy() -> bool
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.