The Outgoing trait now has no attributes except incoming_no_deserialize, it looks for any references and lifetimes in a struct declaration and removes them. The point of the Outgoing trait is to allow references to be serialized and owned values to come out of deserialization. It has no ability to wrap values in Raw (then EventResult).
26 lines
486 B
Rust
26 lines
486 B
Rust
use ruma_api::Outgoing;
|
|
use ruma_identifiers::UserId;
|
|
|
|
#[allow(unused)]
|
|
pub struct Thing<'t, T> {
|
|
some: &'t str,
|
|
t: &'t T,
|
|
}
|
|
|
|
#[derive(Debug)]
|
|
pub struct IncomingThing<T> {
|
|
some: String,
|
|
t: T,
|
|
}
|
|
|
|
#[derive(Outgoing)]
|
|
#[incoming_no_deserialize]
|
|
pub struct Request<'a, T> {
|
|
pub abc: &'a str,
|
|
pub thing: Thing<'a, T>,
|
|
pub device_id: &'a ::ruma_identifiers::DeviceId,
|
|
pub user_id: &'a UserId,
|
|
pub bytes: &'a [u8],
|
|
pub recursive: &'a [Thing<'a, T>],
|
|
}
|