#[non_exhaustive]pub struct CreateLobby {
pub metadata: LobbyMetadata,
pub members: Vec<LobbyMemberData>,
pub idle_timeout_seconds: Option<u32>,
}Expand description
The body of Create Lobby.
Social SDK clients cannot join or leave lobbies created this way.
discord.js counterpart: none (lobbies are not in discord.js v14 or discord-api-types).
§Examples
use djs_model::{
id::UserId,
rest::{CreateLobby, LobbyMemberData},
};
let mut body = CreateLobby::default();
body.metadata.insert("map".into(), "harbor".into());
body.members = vec![LobbyMemberData::new(UserId::new(7))];
body.idle_timeout_seconds = Some(600);
assert_eq!(
serde_json::to_string(&body)?,
r#"{"metadata":{"map":"harbor"},"members":[{"id":"7"}],"idle_timeout_seconds":600}"#
);Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.metadata: LobbyMetadataThe lobby’s metadata.
members: Vec<LobbyMemberData>Users to add (up to 25).
idle_timeout_seconds: Option<u32>How many seconds an idle lobby lives before it is shut down (5 to 604 800, seven days).
Trait Implementations§
Source§impl Clone for CreateLobby
impl Clone for CreateLobby
Source§impl Debug for CreateLobby
impl Debug for CreateLobby
Source§impl Default for CreateLobby
impl Default for CreateLobby
impl Eq for CreateLobby
Source§impl PartialEq for CreateLobby
impl PartialEq for CreateLobby
Source§impl Serialize for CreateLobby
impl Serialize for CreateLobby
impl StructuralPartialEq for CreateLobby
Auto Trait Implementations§
impl Freeze for CreateLobby
impl RefUnwindSafe for CreateLobby
impl Send for CreateLobby
impl Sync for CreateLobby
impl Unpin for CreateLobby
impl UnsafeUnpin for CreateLobby
impl UnwindSafe for CreateLobby
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