pub struct AntChatRoom { /* private fields */ }Implementations§
Source§impl AntChatRoom
impl AntChatRoom
pub fn chat_id(&self) -> String
pub fn name(&self) -> String
pub fn agents(&self) -> HashMap<String, Agent>
Sourcepub fn repository(&self) -> Option<u64>
pub fn repository(&self) -> Option<u64>
The owner’s Termite repository personas start from, by id; None when it has none.
Sourcepub fn group(&self) -> Option<Group>
pub fn group(&self) -> Option<Group>
The group that owns the chat, whose repositories it takes; None for a person’s.
Sourcepub async fn set_repository(
&self,
repository: Option<&Repository>,
) -> Result<()>
pub async fn set_repository( &self, repository: Option<&Repository>, ) -> Result<()>
Attach one of the owner’s repositories, or None to detach. Personas’ forks of the old one are deleted.
Sourcepub fn watch_repository(
&self,
listener: impl Fn(Option<u64>) + Send + Sync + 'static,
) -> Box<dyn FnOnce() + Send + Sync>
pub fn watch_repository( &self, listener: impl Fn(Option<u64>) + Send + Sync + 'static, ) -> Box<dyn FnOnce() + Send + Sync>
Hear about every repository change, from anyone in the room. Returns a function that stops listening.
pub fn hydrate(&self, state: &Value)
pub fn handle_event(&self, packet: &Value) -> bool
pub fn upsert_agent(&self, identity: Identity) -> Agent
pub fn remove_agent(&self, id: &str)
Sourcepub async fn get_chat(
&self,
hooks: Option<Arc<dyn RoomHooks>>,
) -> Result<ArchitectChat>
pub async fn get_chat( &self, hooks: Option<Arc<dyn RoomHooks>>, ) -> Result<ArchitectChat>
Lazily mint/open the architect Parrot ChatRoom.
pub async fn connect( authorization: &CredentialsOrApiKey, target_id: &str, opts: ConnectOptions, ) -> Result<(AntChatRoom, Presence)>
pub async fn join( authorization: &CredentialsOrApiKey, access_code: &str, hooks: Option<Arc<dyn Hooks>>, ) -> Result<(AntChatRoom, Presence)>
Methods from Deref<Target = Room>§
pub fn endpoint(&self) -> &str
pub fn ws(&self) -> RoomSocket
pub fn id(&self) -> &str
pub fn get_presences(&self) -> Vec<Presence>
The caller’s Credentials or ApiKey from the live authorization pack.
pub fn post(&self, packet: &Value)
pub fn disconnect(&self)
pub async fn generate_access_code(&self) -> Result<String>
Trait Implementations§
Source§impl Clone for AntChatRoom
impl Clone for AntChatRoom
Auto Trait Implementations§
impl Forget for AntChatRoom
impl Freeze for AntChatRoom
impl Move for AntChatRoom
impl RefUnwindSafe for AntChatRoom
impl Send for AntChatRoom
impl Sync for AntChatRoom
impl Unpin for AntChatRoom
impl UnsafeUnpin for AntChatRoom
impl UnwindSafe for AntChatRoom
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