pub struct JsonItem {
pub demand: u64,
pub allowed_orientations: Option<Vec<fsize>>,
pub shape: JsonShape,
pub value: Option<u64>,
pub base_quality: Option<usize>,
}
Expand description
The JSON representation of an item
Fields§
§demand: u64
Number of times this item should be produced
allowed_orientations: Option<Vec<fsize>>
List of allowed orientations angles (in degrees). If none any orientation is allowed
shape: JsonShape
Polygon shape of the item
value: Option<u64>
The value of the item (for knapsack problems)
base_quality: Option<usize>
The quality required for the entire item, if not defined maximum quality is required
Trait Implementations§
Source§impl<'de> Deserialize<'de> for JsonItem
impl<'de> Deserialize<'de> for JsonItem
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
Auto Trait Implementations§
impl Freeze for JsonItem
impl RefUnwindSafe for JsonItem
impl Send for JsonItem
impl Sync for JsonItem
impl Unpin for JsonItem
impl UnwindSafe for JsonItem
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<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