[][src]Struct ovgu_canteen::Canteen

pub struct Canteen {
    pub description: CanteenDescription,
    pub days: Vec<Day>,
}

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]

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.