mirror of
https://github.com/teloxide/teloxide.git
synced 2025-03-25 16:12:06 +01:00
Document UpState
This commit is contained in:
parent
e9b797fe61
commit
b255dfaf61
1 changed files with 8 additions and 0 deletions
|
@ -1,6 +1,14 @@
|
||||||
#[cfg(feature = "frunk")]
|
#[cfg(feature = "frunk")]
|
||||||
use frunk::{from_generic, generic::Generic, hlist::HAppender, into_generic};
|
use frunk::{from_generic, generic::Generic, hlist::HAppender, into_generic};
|
||||||
|
|
||||||
|
/// Constructs a structure from another structure and a field.
|
||||||
|
///
|
||||||
|
/// Let `X` be a structure of `field1, ..., fieldN`, `Y` be `field1, ...,
|
||||||
|
/// fieldN, fieldN+1`. Both `X` and `Y` implement [`Generic`]. Then `Y::up(x,
|
||||||
|
/// fieldN+1)` constructs `Y` from all the fields of `x: X` plus `Y`'s
|
||||||
|
/// `fieldN+1`.
|
||||||
|
///
|
||||||
|
/// [`Generic`]: https://docs.rs/frunk/latest/frunk/generic/trait.Generic.html
|
||||||
#[cfg(feature = "frunk")]
|
#[cfg(feature = "frunk")]
|
||||||
pub trait UpState: Sized {
|
pub trait UpState: Sized {
|
||||||
fn up<T1, T1Repr, F>(src: T1, field: F) -> Self
|
fn up<T1, T1Repr, F>(src: T1, field: F) -> Self
|
||||||
|
|
Loading…
Add table
Reference in a new issue