Skip to main content

grammers_client/update/
raw.rs

1// Copyright 2020 - developers of the `grammers` project.
2//
3// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
4// https://www.apache.org/licenses/LICENSE-2.0> or the MIT license
5// <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your
6// option. This file may not be copied, modified, or distributed
7// except according to those terms.
8
9use std::ops::{Deref, DerefMut};
10
11use grammers_session::updates::State;
12use grammers_tl_types as tl;
13
14/// Update that has not been wrapped in a nicer interface.
15#[derive(Debug, Clone)]
16pub struct Raw {
17    pub raw: tl::enums::Update,
18    pub state: State,
19}
20
21impl Deref for Raw {
22    type Target = tl::enums::Update;
23
24    fn deref(&self) -> &Self::Target {
25        &self.raw
26    }
27}
28
29impl DerefMut for Raw {
30    fn deref_mut(&mut self) -> &mut Self::Target {
31        &mut self.raw
32    }
33}