/// Registers a buffer collection with scenic and returns the associated import token.
///
/// # Parameters
/// - `buffer_collection_token`: The buffer collection token that is passed to the scenic allocator.
/// - `scenic_allocator`: The allocator proxy that is used to register the buffer collection.
Registers a buffer collection with scenic and returns the associated import token.
Registers a buffer collection with scenic and returns the associated import token .
fn register_buffer_collection_with_scenic(
    buffer_collection_token: ClientEnd<fsysmem::BufferCollectionTokenMarker>,
    scenic_allocator: &fuicomp::AllocatorSynchronousProxy,
) -> Result<fuicomp::BufferCollectionImportToken, vk::Result> {
    let (scenic_import_token, export_token) =
        zx::EventPair::create().expect("Failed to create event pair.");
    let export_token = fuicomp::BufferCollectionExportToken { value: export_token };
    let scenic_import_token = fuicomp::BufferCollectionImportToken { value: scenic_import_token };
    let args = fuicomp::RegisterBufferCollectionArgs {
        export_token: Some(export_token),
        buffer_collection_token: Some(buffer_collection_token),
        ..fuicomp::RegisterBufferCollectionArgs::EMPTY
    };
    scenic_allocator
        .register_buffer_collection(args, zx::Time::INFINITE)
        .map_err(|_| vk::ERROR_INITIALIZATION_FAILED)?
        .map_err(|_| vk::ERROR_INITIALIZATION_FAILED)?;
    Ok(scenic_import_token)
}
fn register_buffer_collection_with_scenic ( buffer_collection_token : ClientEnd < fsysmem :: BufferCollectionTokenMarker > , scenic_allocator : & fuicomp :: AllocatorSynchronousProxy , ) -> Result < fuicomp :: BufferCollectionImportToken , vk :: Result > { let ( scenic_import_token , export_token ) = zx :: EventPair :: create ( ) . expect ( " " ) ; let export_token = fuicomp :: BufferCollectionExportToken { value : export_token } ; let scenic_import_token = fuicomp :: BufferCollectionImportToken { value : scenic_import_token } ; let args = fuicomp :: RegisterBufferCollectionArgs { export_token : Some ( export_token ) , buffer_collection_token : Some ( buffer_collection_token ) , .. fuicomp :: RegisterBufferCollectionArgs :: EMPTY } ; scenic_allocator . register_buffer_collection ( args , zx :: Time :: INFINITE ) . map_err ( | _ | vk :: ERROR_INITIALIZATION_FAILED ) ? . map_err ( | _ | vk :: ERROR_INITIALIZATION_FAILED ) ? ; Ok ( scenic_import_token ) }
Registers a buffer collection with scenic and returns the associated import token.
Registers a buffer collection with scenic and returns the associated import token .
buffer_collection_token
ClientEnd<fsysmem::BufferCollectionTokenMarker>
The buffer collection token that is passed to the scenic allocator.
The buffer collection token that is passed to the scenic allocator .
scenic_allocator
&fuicomp::AllocatorSynchronousProxy
The allocator proxy that is used to register the buffer collection.
The allocator proxy that is used to register the buffer collection .