pub struct Recipe {
pub options: MorphOptions,
pub rules: Vec<OwnedMorphRule>,
}Expand description
A reusable morph recipe.
Fields§
§options: MorphOptionsMorphing options.
rules: Vec<OwnedMorphRule>Morph rules in application order.
Implementations§
Source§impl Recipe
impl Recipe
Sourcepub const fn new(options: MorphOptions, rules: Vec<OwnedMorphRule>) -> Self
pub const fn new(options: MorphOptions, rules: Vec<OwnedMorphRule>) -> Self
Creates a new recipe from morph options and rules.
Sourcepub fn from_toml(toml_str: &str) -> Result<Self, DeError>
pub fn from_toml(toml_str: &str) -> Result<Self, DeError>
Parses a recipe from a TOML string.
§Errors
Returns an error if deserialization fails, e.g. due to invalid TOML syntax or missing fields.
Sourcepub fn morph_rules(&self) -> Vec<MorphRule<'_>>
pub fn morph_rules(&self) -> Vec<MorphRule<'_>>
Returns the recipe rules as borrowed morph rules.
Sourcepub const fn morph_options(&self) -> MorphOptions
pub const fn morph_options(&self) -> MorphOptions
Returns the recipe options as morph options.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Recipe
impl<'de> Deserialize<'de> for Recipe
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Recipe
impl StructuralPartialEq for Recipe
Auto Trait Implementations§
impl Freeze for Recipe
impl RefUnwindSafe for Recipe
impl Send for Recipe
impl Sync for Recipe
impl Unpin for Recipe
impl UnsafeUnpin for Recipe
impl UnwindSafe for Recipe
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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 moreSource§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
Source§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
Convert this type into
T, using the provided data to resolve any offsets.