Skip to main content

PartialConfig

Struct PartialConfig 

Source
pub struct PartialConfig {
Show 14 fields pub input: Option<PathBuf>, pub output: Option<String>, pub fps: Option<u32>, pub format: Option<String>, pub fade_in: Option<f32>, pub fade_out: Option<f32>, pub bitrate: Option<String>, pub crf: Option<u32>, pub open: Option<bool>, pub preview: Option<Option<usize>>, pub file_pattern: Option<String>, pub verbose: Option<bool>, pub verbose_ffmpeg: Option<bool>, pub background: Option<String>,
}
Expand description

A configuration where every field is optional: what a config file or the command line actually specified. Merge several with PartialConfig::or and turn the result into a RenderConfig with PartialConfig::into_config.

Fields§

§input: Option<PathBuf>§output: Option<String>§fps: Option<u32>§format: Option<String>§fade_in: Option<f32>§fade_out: Option<f32>§bitrate: Option<String>§crf: Option<u32>§open: Option<bool>§preview: Option<Option<usize>>

Some(None) = preview the middle frame, Some(Some(n)) = frame n

§file_pattern: Option<String>§verbose: Option<bool>§verbose_ffmpeg: Option<bool>§background: Option<String>

Implementations§

Source§

impl PartialConfig

Source

pub fn from_file(path: &str) -> Result<Self, String>

Read a .json or .toml config file (decided by extension; JSON otherwise).

Source

pub fn or(self, base: PartialConfig) -> PartialConfig

Fields set in self win; the rest are taken from base.

Source

pub fn into_config(self) -> Result<RenderConfig, String>

Fill in defaults and validate.

  • format defaults to the output extension, else webm
  • output defaults to output.<format>

Trait Implementations§

Source§

impl Debug for PartialConfig

Source§

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

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

impl Default for PartialConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for PartialConfig

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more

Auto Trait Implementations§

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.