Struct channel2::ChannelStore

source ·
pub struct ChannelStore {
    pub channel_index: ChannelIndex,
    /* private fields */
}

Fields§

§channel_index: ChannelIndex

Implementations§

source§

impl ChannelStore

source

pub fn global(cx: &AppContext) -> Model<Self>

source

pub fn new( client: Arc<Client>, user_store: Model<UserStore>, cx: &mut ModelContext<'_, Self> ) -> Self

source

pub fn client(&self) -> Arc<Client>

source

pub fn channel_count(&self) -> usize

Returns the number of unique channels in the store

source

pub fn index_of_channel(&self, channel_id: ChannelId) -> Option<usize>

Returns the index of a channel ID in the list of unique channels

source

pub fn channels(&self) -> impl '_ + Iterator<Item = &Arc<Channel>>

Returns an iterator over all unique channels

source

pub fn ordered_channels( &self ) -> impl '_ + Iterator<Item = (usize, &Arc<Channel>)>

Iterate over all entries in the channel DAG

source

pub fn channel_at_index(&self, ix: usize) -> Option<&Arc<Channel>>

source

pub fn channel_at(&self, ix: usize) -> Option<&Arc<Channel>>

source

pub fn has_channel_invitation(&self, channel_id: ChannelId) -> bool

source

pub fn channel_invitations(&self) -> &[Arc<Channel>]

source

pub fn channel_for_id(&self, channel_id: ChannelId) -> Option<&Arc<Channel>>

source

pub fn has_open_channel_buffer( &self, channel_id: ChannelId, _cx: &AppContext ) -> bool

source

pub fn open_channel_buffer( &mut self, channel_id: ChannelId, cx: &mut ModelContext<'_, Self> ) -> Task<Result<Model<ChannelBuffer>>>

source

pub fn fetch_channel_messages( &self, message_ids: Vec<u64>, cx: &mut ModelContext<'_, Self> ) -> Task<Result<Vec<ChannelMessage>>>

source

pub fn has_channel_buffer_changed(&self, channel_id: ChannelId) -> Option<bool>

source

pub fn has_new_messages(&self, channel_id: ChannelId) -> Option<bool>

source

pub fn notes_changed( &mut self, channel_id: ChannelId, epoch: u64, version: &Global, cx: &mut ModelContext<'_, Self> )

source

pub fn new_message( &mut self, channel_id: ChannelId, message_id: u64, cx: &mut ModelContext<'_, Self> )

source

pub fn acknowledge_message_id( &mut self, channel_id: ChannelId, message_id: u64, cx: &mut ModelContext<'_, Self> )

source

pub fn acknowledge_notes_version( &mut self, channel_id: ChannelId, epoch: u64, version: &Global, cx: &mut ModelContext<'_, Self> )

source

pub fn open_channel_chat( &mut self, channel_id: ChannelId, cx: &mut ModelContext<'_, Self> ) -> Task<Result<Model<ChannelChat>>>

source

pub fn is_channel_admin(&self, channel_id: ChannelId) -> bool

source

pub fn channel_participants(&self, channel_id: ChannelId) -> &[Arc<User>]

source

pub fn create_channel( &self, name: &str, parent_id: Option<ChannelId>, cx: &mut ModelContext<'_, Self> ) -> Task<Result<ChannelId>>

source

pub fn move_channel( &mut self, channel_id: ChannelId, to: Option<ChannelId>, cx: &mut ModelContext<'_, Self> ) -> Task<Result<()>>

source

pub fn set_channel_visibility( &mut self, channel_id: ChannelId, visibility: ChannelVisibility, cx: &mut ModelContext<'_, Self> ) -> Task<Result<()>>

source

pub fn invite_member( &mut self, channel_id: ChannelId, user_id: UserId, role: ChannelRole, cx: &mut ModelContext<'_, Self> ) -> Task<Result<()>>

source

pub fn remove_member( &mut self, channel_id: ChannelId, user_id: u64, cx: &mut ModelContext<'_, Self> ) -> Task<Result<()>>

source

pub fn set_member_role( &mut self, channel_id: ChannelId, user_id: UserId, role: ChannelRole, cx: &mut ModelContext<'_, Self> ) -> Task<Result<()>>

source

pub fn rename( &mut self, channel_id: ChannelId, new_name: &str, cx: &mut ModelContext<'_, Self> ) -> Task<Result<()>>

source

pub fn respond_to_channel_invite( &mut self, channel_id: ChannelId, accept: bool, cx: &mut ModelContext<'_, Self> ) -> Task<Result<()>>

source

pub fn get_channel_member_details( &self, channel_id: ChannelId, cx: &mut ModelContext<'_, Self> ) -> Task<Result<Vec<ChannelMembership>>>

source

pub fn remove_channel( &self, channel_id: ChannelId ) -> impl Future<Output = Result<()>>

source

pub fn has_pending_channel_invite_response(&self, _: &Arc<Channel>) -> bool

source

pub fn has_pending_channel_invite( &self, channel_id: ChannelId, user_id: UserId ) -> bool

Trait Implementations§

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = mem::align_of::<T>()

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more