pub struct BodyPreset {
pub name: String,
pub category: BodyCategory,
pub description: String,
pub params: BodyParams,
pub tags: Vec<String>,
}Expand description
A named body preset with a full parameter set.
Fields§
§name: StringUnique preset name.
category: BodyCategoryBody type category.
description: StringHuman-readable description.
params: BodyParamsParameter map.
Tags for filtering and search.
Implementations§
Source§impl BodyPreset
impl BodyPreset
Sourcepub fn new(name: impl Into<String>, category: BodyCategory) -> Self
pub fn new(name: impl Into<String>, category: BodyCategory) -> Self
Create a new preset with default empty params.
Sourcepub fn with_param(self, key: impl Into<String>, value: f32) -> Self
pub fn with_param(self, key: impl Into<String>, value: f32) -> Self
Builder: set a parameter value.
Sourcepub fn with_description(self, desc: impl Into<String>) -> Self
pub fn with_description(self, desc: impl Into<String>) -> Self
Builder: set description.
Sourcepub fn get_param(&self, key: &str) -> f32
pub fn get_param(&self, key: &str) -> f32
Get a parameter value; returns 0.5 if the key is missing.
Sourcepub fn param_count(&self) -> usize
pub fn param_count(&self) -> usize
Number of parameters stored in this preset.
Auto Trait Implementations§
impl Freeze for BodyPreset
impl RefUnwindSafe for BodyPreset
impl Send for BodyPreset
impl Sync for BodyPreset
impl Unpin for BodyPreset
impl UnsafeUnpin for BodyPreset
impl UnwindSafe for BodyPreset
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> 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 more