Struct channel2::ChannelStore
source · pub struct ChannelStore {
pub channel_index: ChannelIndex,
/* private fields */
}
Fields§
§channel_index: ChannelIndex
Implementations§
source§impl ChannelStore
impl ChannelStore
pub fn global(cx: &AppContext) -> Model<Self>
pub fn new( client: Arc<Client>, user_store: Model<UserStore>, cx: &mut ModelContext<'_, Self> ) -> Self
pub fn client(&self) -> Arc<Client>
sourcepub fn channel_count(&self) -> usize
pub fn channel_count(&self) -> usize
Returns the number of unique channels in the store
sourcepub fn index_of_channel(&self, channel_id: ChannelId) -> Option<usize>
pub fn index_of_channel(&self, channel_id: ChannelId) -> Option<usize>
Returns the index of a channel ID in the list of unique channels
sourcepub fn channels(&self) -> impl '_ + Iterator<Item = &Arc<Channel>>
pub fn channels(&self) -> impl '_ + Iterator<Item = &Arc<Channel>>
Returns an iterator over all unique channels
sourcepub fn ordered_channels(
&self
) -> impl '_ + Iterator<Item = (usize, &Arc<Channel>)>
pub fn ordered_channels( &self ) -> impl '_ + Iterator<Item = (usize, &Arc<Channel>)>
Iterate over all entries in the channel DAG
pub fn channel_at_index(&self, ix: usize) -> Option<&Arc<Channel>>
pub fn channel_at(&self, ix: usize) -> Option<&Arc<Channel>>
pub fn has_channel_invitation(&self, channel_id: ChannelId) -> bool
pub fn channel_invitations(&self) -> &[Arc<Channel>]
pub fn channel_for_id(&self, channel_id: ChannelId) -> Option<&Arc<Channel>>
pub fn has_open_channel_buffer( &self, channel_id: ChannelId, _cx: &AppContext ) -> bool
pub fn open_channel_buffer( &mut self, channel_id: ChannelId, cx: &mut ModelContext<'_, Self> ) -> Task<Result<Model<ChannelBuffer>>>
pub fn fetch_channel_messages( &self, message_ids: Vec<u64>, cx: &mut ModelContext<'_, Self> ) -> Task<Result<Vec<ChannelMessage>>>
pub fn has_channel_buffer_changed(&self, channel_id: ChannelId) -> Option<bool>
pub fn has_new_messages(&self, channel_id: ChannelId) -> Option<bool>
pub fn notes_changed( &mut self, channel_id: ChannelId, epoch: u64, version: &Global, cx: &mut ModelContext<'_, Self> )
pub fn new_message( &mut self, channel_id: ChannelId, message_id: u64, cx: &mut ModelContext<'_, Self> )
pub fn acknowledge_message_id( &mut self, channel_id: ChannelId, message_id: u64, cx: &mut ModelContext<'_, Self> )
pub fn acknowledge_notes_version( &mut self, channel_id: ChannelId, epoch: u64, version: &Global, cx: &mut ModelContext<'_, Self> )
pub fn open_channel_chat( &mut self, channel_id: ChannelId, cx: &mut ModelContext<'_, Self> ) -> Task<Result<Model<ChannelChat>>>
pub fn is_channel_admin(&self, channel_id: ChannelId) -> bool
pub fn channel_participants(&self, channel_id: ChannelId) -> &[Arc<User>]
pub fn create_channel( &self, name: &str, parent_id: Option<ChannelId>, cx: &mut ModelContext<'_, Self> ) -> Task<Result<ChannelId>>
pub fn move_channel( &mut self, channel_id: ChannelId, to: Option<ChannelId>, cx: &mut ModelContext<'_, Self> ) -> Task<Result<()>>
pub fn set_channel_visibility( &mut self, channel_id: ChannelId, visibility: ChannelVisibility, cx: &mut ModelContext<'_, Self> ) -> Task<Result<()>>
pub fn invite_member( &mut self, channel_id: ChannelId, user_id: UserId, role: ChannelRole, cx: &mut ModelContext<'_, Self> ) -> Task<Result<()>>
pub fn remove_member( &mut self, channel_id: ChannelId, user_id: u64, cx: &mut ModelContext<'_, Self> ) -> Task<Result<()>>
pub fn set_member_role( &mut self, channel_id: ChannelId, user_id: UserId, role: ChannelRole, cx: &mut ModelContext<'_, Self> ) -> Task<Result<()>>
pub fn rename( &mut self, channel_id: ChannelId, new_name: &str, cx: &mut ModelContext<'_, Self> ) -> Task<Result<()>>
pub fn respond_to_channel_invite( &mut self, channel_id: ChannelId, accept: bool, cx: &mut ModelContext<'_, Self> ) -> Task<Result<()>>
pub fn get_channel_member_details( &self, channel_id: ChannelId, cx: &mut ModelContext<'_, Self> ) -> Task<Result<Vec<ChannelMembership>>>
pub fn remove_channel( &self, channel_id: ChannelId ) -> impl Future<Output = Result<()>>
pub fn has_pending_channel_invite_response(&self, _: &Arc<Channel>) -> bool
pub fn has_pending_channel_invite( &self, channel_id: ChannelId, user_id: UserId ) -> bool
Trait Implementations§
impl EventEmitter<ChannelEvent> for ChannelStore
Auto Trait Implementations§
impl !RefUnwindSafe for ChannelStore
impl Send for ChannelStore
impl Sync for ChannelStore
impl Unpin for ChannelStore
impl !UnwindSafe for ChannelStore
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