Skip to main content

Images

Struct Images 

Source
pub struct Images<'w> { /* private fields */ }
Expand description

A read-only view over the images (frames) held by a MagickWand.

Obtained from MagickWand::images. Creating the view resets the wand’s iterator, and each frame handed out by Images::get, Images::first, Images::last, or the iteration helpers re-pins the iterator to the correct frame before delegating, so frame access stays consistent regardless of call order.

Implementations§

Source§

impl<'w> Images<'w>

Source

pub fn count(&self) -> usize

The number of images (frames) in the list.

Source

pub fn is_empty(&self) -> bool

Returns true if the list contains no images.

Source

pub fn get(&self, index: usize) -> Option<ImageRef<'_>>

Borrow the frame at index, or None if out of bounds.

Source

pub fn first(&self) -> Option<ImageRef<'_>>

Borrow the first frame, or None if the list is empty.

Source

pub fn last(&self) -> Option<ImageRef<'_>>

Borrow the last frame, or None if the list is empty.

Source

pub fn for_each(&self, f: impl FnMut(usize, ImageRef<'_>))

Visit every frame in order, passing its index and a borrow to f.

Source

pub fn try_for_each( &self, f: impl FnMut(usize, ImageRef<'_>) -> Result<(), MagickError>, ) -> Result<(), MagickError>

Like Images::for_each, but f may fail; the first error stops iteration and is returned.

Auto Trait Implementations§

§

impl<'w> Freeze for Images<'w>

§

impl<'w> RefUnwindSafe for Images<'w>

§

impl<'w> !Send for Images<'w>

§

impl<'w> !Sync for Images<'w>

§

impl<'w> Unpin for Images<'w>

§

impl<'w> UnsafeUnpin for Images<'w>

§

impl<'w> UnwindSafe for Images<'w>

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> 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.

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.