#[non_exhaustive]pub enum ChatCreateInput<'a> {
Direct {
client_id: Option<&'a str>,
contact_id: &'a Id,
},
Group {
client_id: Option<&'a str>,
name: &'a str,
member_ids: &'a [Id],
description: Option<&'a str>,
avatar_blob_id: Option<&'a Id>,
message_expiry_seconds: Option<u64>,
},
}Expand description
Input parameters for Chat/set create.
Discriminates the two user-creatable Chat kinds from the spec. Each
variant carries the fields required for that kind plus an optional
client_id; when None — or Some("") — a ULID is generated
automatically (see the per-variant client_id doc).
Channel Chats are NOT created via Chat/set. Per
draft-atwood-jmap-chat-00 §Chat (line 436), Channel Chats are created
as part of a Space via the addChannels patch key in Space/set
(see SpacePatch::add_channels and SpaceAddChannelInput); the
server assigns the channel’s chatId at that time. A spec-compliant
server will reject a Chat/set create with kind: "channel".
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Direct
Create a direct (one-to-one) chat.
Fields
Group
Create a group chat.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for ChatCreateInput<'a>
impl<'a> RefUnwindSafe for ChatCreateInput<'a>
impl<'a> Send for ChatCreateInput<'a>
impl<'a> Sync for ChatCreateInput<'a>
impl<'a> Unpin for ChatCreateInput<'a>
impl<'a> UnsafeUnpin for ChatCreateInput<'a>
impl<'a> UnwindSafe for ChatCreateInput<'a>
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