pub struct Xdc { /* private fields */ }Expand description
A Mini App shared in a chat: the message that carries it, and the realtime session it opens.
Implementations§
Source§impl Xdc
impl Xdc
Sourcepub fn message_id(&self) -> &str
pub fn message_id(&self) -> &str
The message that carries it.
Sourcepub fn file_hash(&self) -> &str
pub fn file_hash(&self) -> &str
The file’s SHA-256 as the sender states it. A claim until the file is
downloaded: manifest checks it, and
XdcMatch::Hash only matches what the download proves.
Sourcepub fn topic(&self) -> Option<&str>
pub fn topic(&self) -> Option<&str>
The realtime topic this copy’s players share. None for an app sent
by a client that predates per-message topics.
Sourcepub fn attachment(&self) -> &Attachment
pub fn attachment(&self) -> &Attachment
The attachment, for VectorBot::download_attachment.
Sourcepub async fn manifest(&self) -> Result<Manifest>
pub async fn manifest(&self) -> Result<Manifest>
The app’s manifest.toml (name, id, version…), named after the file when
it sets no name. Downloads the file the first time, up to
download_limit (32 MiB unless set); cached by everything that decides
the download after.
Sourcepub async fn join(&self) -> Result<XdcSession>
pub async fn join(&self) -> Result<XdcSession>
Join the app’s realtime session now: the bot connects to everyone already in it, and everyone who opens it later connects to the bot.
The session lasts until it is dropped or left: no
idle or quiet timeout applies, unlike a session a
run handler gets. Opt in with
set_idle_timeout /
set_quiet_timeout.
Trait Implementations§
Auto Trait Implementations§
impl Forget for Xdc
impl Freeze for Xdc
impl Move for Xdc
impl RefUnwindSafe for Xdc
impl Send for Xdc
impl Sync for Xdc
impl Unpin for Xdc
impl UnsafeUnpin for Xdc
impl UnwindSafe for Xdc
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more