[][src]Struct mpls::types::Angle

pub struct Angle<'mpls> {
    pub index: u8,
    // some fields omitted
}

Represents a playlist's angle.

"Angles", as they are called, are just a variation of a playlist where one or more segments are swapped out for different ones. The overall number of segments, however, is always the same for all angles.

You can use the segments method to retrieve the playlist segments associated with this angle.

Fields

index: u8

The angle index in this playlist.

Implementations

impl<'_> Angle<'_>[src]

pub fn segments(&self) -> Vec<&Clip>[src]

Gets all segments for this angle.

Examples

Get all clip file names (without their extension) for an angle:

use mpls::Mpls;

let segments: Vec<&str> = angle
    .segments()
    .iter()
    .map(|s| s.file_name.as_ref())
    .collect();

assert_eq!(segments, &["00055", "00059", "00061"])

Multi-angle:

use mpls::Mpls;

// let mpls = Mpls::from(...)?;
let angles = mpls.angles();
let segments: (Vec<&str>, Vec<&str>) = (
    angles[0].segments().iter().map(|s| s.file_name.as_ref()).collect(),
    angles[1].segments().iter().map(|s| s.file_name.as_ref()).collect());

assert_eq!(&segments.0[..5], &["00081", "00082", "00086", "00087", "00091"]);
assert_eq!(&segments.1[..5], &["00081", "00083", "00086", "00088", "00091"]);

Trait Implementations

impl<'mpls> Clone for Angle<'mpls>[src]

impl<'mpls> Copy for Angle<'mpls>[src]

impl<'mpls> Debug for Angle<'mpls>[src]

impl<'a, '_> Display for Angle<'_>[src]

Auto Trait Implementations

impl<'mpls> RefUnwindSafe for Angle<'mpls>

impl<'mpls> Send for Angle<'mpls>

impl<'mpls> Sync for Angle<'mpls>

impl<'mpls> Unpin for Angle<'mpls>

impl<'mpls> UnwindSafe for Angle<'mpls>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.