pub struct Person {
pub user: String,
pub role: PersonRole,
pub live: bool,
pub seen_secs: Option<u64>,
}Expand description
A member of the riff in the reply to who: a person, not a session
(01M3NT4M3A4E3K5S2NM7MS6PQD).
use riff_core::wire::{Person, PersonRole};
let ada: Person =
serde_json::from_str(r#"{"user":"ada","role":"owner","live":false,"seen_secs":3600}"#).unwrap();
assert_eq!(ada.role, PersonRole::Owner);
assert_eq!(ada.role.tag(), Some("owner"));
assert_eq!(PersonRole::Member.tag(), None);
assert_eq!(ada.seen_secs, Some(3600));Fields§
§user: StringThe USER of the person.
role: PersonRole§live: boolTrue while a session of the person is live.
seen_secs: Option<u64>The seconds since the last call of a session of the person.
None when the server knows no session of the person.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Person
impl<'de> Deserialize<'de> for Person
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl JsonSchema for Person
impl JsonSchema for Person
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreimpl Eq for Person
impl StructuralPartialEq for Person
Auto Trait Implementations§
impl Freeze for Person
impl RefUnwindSafe for Person
impl Send for Person
impl Sync for Person
impl Unpin for Person
impl UnsafeUnpin for Person
impl UnwindSafe for Person
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.