pub struct MaaImageListBuffer { /* private fields */ }Expand description
A list buffer for storing multiple images.
Provides indexed access and iteration over a collection of MaaImageBuffers.
Implementations§
Source§impl MaaImageListBuffer
impl MaaImageListBuffer
Sourcepub unsafe fn from_raw(handle: *mut MaaImageListBuffer) -> Self
pub unsafe fn from_raw(handle: *mut MaaImageListBuffer) -> Self
Create from an existing handle.
§Safety
This function assumes the handle is valid. The returned buffer will NOT take ownership of the handle (it won’t be destroyed on drop). Use this when you are borrowing a handle from the C API.
Sourcepub fn from_handle(handle: *mut MaaImageListBuffer) -> Option<Self>
pub fn from_handle(handle: *mut MaaImageListBuffer) -> Option<Self>
Create from an existing handle safely (checks for null).
Returns None if handle is null.
Sourcepub fn as_ptr(&self) -> *mut MaaImageListBuffer
pub fn as_ptr(&self) -> *mut MaaImageListBuffer
Get the underlying raw handle.
Sourcepub fn raw(&self) -> *mut MaaImageListBuffer
pub fn raw(&self) -> *mut MaaImageListBuffer
Get the underlying raw handle (alias for as_ptr).
Source§impl MaaImageListBuffer
impl MaaImageListBuffer
Sourcepub fn at(&self, index: usize) -> Option<MaaImageBuffer>
pub fn at(&self, index: usize) -> Option<MaaImageBuffer>
Get image at index. Returns None if index out of bounds. Note: The returned buffer is a view into this list (non-owning).
Sourcepub fn append(&self, image: &MaaImageBuffer) -> MaaResult<()>
pub fn append(&self, image: &MaaImageBuffer) -> MaaResult<()>
Appends an image to the end of the list.
Sourcepub fn set(&self, data: &[&MaaImageBuffer]) -> MaaResult<()>
pub fn set(&self, data: &[&MaaImageBuffer]) -> MaaResult<()>
Set the content of this list, replacing existing content.
Sourcepub fn to_vec(&self) -> Vec<MaaImageBuffer>
pub fn to_vec(&self) -> Vec<MaaImageBuffer>
Get all images as a vector of MaaImageBuffer handles.
Sourcepub fn iter(&self) -> impl Iterator<Item = MaaImageBuffer> + '_
pub fn iter(&self) -> impl Iterator<Item = MaaImageBuffer> + '_
Get an iterator over the images in the list.
Sourcepub fn to_vec_of_vec(&self) -> Vec<Vec<u8>>
pub fn to_vec_of_vec(&self) -> Vec<Vec<u8>>
Get all images as a vector of encoded byte vectors.