Seq

Struct Seq 

Source
pub struct Seq {
    pub indices: Vec<i64>,
    pub missed: Vec<i64>,
    pub start: i64,
    pub end: i64,
    pub padding: usize,
    /* private fields */
}
Expand description

Sequence of numbered files

Fields§

§indices: Vec<i64>

Frame numbers actually present

§missed: Vec<i64>

Missing frame numbers

§start: i64

First frame

§end: i64

Last frame

§padding: usize

Padding (0 = variable/unpadded, >0 = fixed width)

Implementations§

Source§

impl Seq

Source

pub fn len(&self) -> usize

Get sequence length (number of files)

Source

pub fn is_empty(&self) -> bool

Check if sequence is empty (required by Clippy when len() exists)

Source

pub fn pattern(&self) -> &str

Get pattern with @ or ####

Source

pub fn get_file(&self, frame: i64) -> Option<String>

Get full file path for specific frame number. Returns None if frame doesn’t exist in sequence (not in indices).

§Arguments
  • frame - Frame number to look up
§Returns

Some(path) if frame exists, None otherwise

§Example
let seq = ...; // frames 1-100, pattern: "/renders/img_####.exr"
assert_eq!(seq.get_file(42), Some("/renders/img_0042.exr".to_string()));
assert_eq!(seq.get_file(999), None); // frame doesn't exist
Source

pub fn is_complete(&self) -> bool

Check if sequence is complete (no missing frames). A complete sequence has no gaps between start and end.

§Example
let seq1 = ...; // frames 1,2,3,4,5
assert!(seq1.is_complete());

let seq2 = ...; // frames 1,2,4,5 (missing 3)
assert!(!seq2.is_complete());
Source

pub fn expand(&self) -> Result<Vec<String>, String>

Expand sequence to all frame paths in range (start..=end). Includes paths for ALL frames including missing ones.

§Safety

Limited to 1M frames to prevent OOM. Returns error if range exceeds limit.

§Example
let seq = ...; // frames 1-3, pattern: "/img_@.exr"
assert_eq!(seq.expand()?, vec!["/img_1.exr", "/img_2.exr", "/img_3.exr"]);
Source

pub fn expand_existing(&self) -> Vec<String>

Expand sequence to only existing frame paths (indices only). Unlike expand(), this skips missing frames.

§Example
let seq = ...; // frames 1,3 (missing 2), pattern: "/img_@.exr"
assert_eq!(seq.expand_existing(), vec!["/img_1.exr", "/img_3.exr"]);
Source

pub fn first_file(&self) -> &str

Get first file path in sequence with original case. Use this for file operations (reading, globbing) since pattern() may have lowercase paths on Windows.

Source

pub fn last_file(&self) -> String

Get last file path in sequence.

Source

pub fn frame_count(&self) -> usize

Get frame count (number of existing frames, not range).

Source

pub fn range_count(&self) -> i64

Get total range (end - start + 1), including missing frames.

Source

pub fn to_map(&self) -> HashMap<&'static str, Value>

Convert sequence to HashMap for serialization/inspection. Useful for JSON export or debugging.

Source

pub fn to_json(&self) -> String

Serialize sequence to JSON string.

Source

pub fn to_json_pretty(&self) -> String

Serialize sequence to pretty JSON string.

Source

pub fn group_seqs(flist: &mut Vec<File>) -> Vec<Seq>

Group files into sequences. Uses mask-based grouping to handle unpadded sequences correctly.

Source

pub fn extract_seq(target: &File, files: &mut Vec<File>) -> Option<Seq>

Extract sequence containing target file from file list. Drains files with matching sig_hash, returns Seq containing target.

Trait Implementations§

Source§

impl Clone for Seq

Source§

fn clone(&self) -> Seq

Returns a duplicate of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Seq

Source§

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

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

impl Display for Seq

Source§

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

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

impl Serialize for Seq

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl Freeze for Seq

§

impl RefUnwindSafe for Seq

§

impl Send for Seq

§

impl Sync for Seq

§

impl Unpin for Seq

§

impl UnwindSafe for Seq

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> CloneToUninit for T
where T: Clone,

§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
§

impl<T> ToString for T
where T: Display + ?Sized,

§

fn to_string(&self) -> String

Converts the given value to a String. Read more
§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.