[−][src]Struct ovgu_canteen::Canteen
A canteen holds all the meals on all available days.
Fields
description: CanteenDescription
This identifies a canteen.
days: Vec<Day>
All available days holding the meals for this canteen.
Methods
impl Canteen
[src]
pub async fn new(desc: CanteenDescription) -> Result<Self, Error>
[src]
This method creates a new canteen instance from a given description.
Arguments
desc
- The identifier identifying the canteen.
Examples
Create a new canteen:
use ovgu_canteen::{Canteen, CanteenDescription}; let canteen = Canteen::new(CanteenDescription::UniCampusLowerHall).await.unwrap(); println!("{}", canteen.days[0].meals[0].name);
pub async fn update<'_>(&'_ mut self) -> Result<(), Error>
[src]
This method updates the canteen from the website.
pub fn merge(&mut self, other: Canteen) -> Result<(), Error>
[src]
This method merges this canteen with another canteen.
Both canteens must contain the same description, otherwise a
CouldNotMerge
error is given.
Trait Implementations
impl Debug for Canteen
[src]
impl<'de> Deserialize<'de> for Canteen
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl PartialEq<Canteen> for Canteen
[src]
impl Serialize for Canteen
[src]
Auto Trait Implementations
impl RefUnwindSafe for Canteen
impl Send for Canteen
impl Sync for Canteen
impl Unpin for Canteen
impl UnwindSafe for Canteen
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,