Skip to main content

Subscription

Struct Subscription 

Source
pub struct Subscription { /* private fields */ }
Expand description

Represents the properties of a channel the user is subscribed to (as well as that user’s personal per-channel settings).

Changes: Removed email_address field from the dictionary in Zulip 8.0 (feature level 226). Removed role field from the dictionary in Zulip 6.0 (feature level 133).

Modified from openapi-generator-cli output:

$ openapi-generator-cli generate -g rust -i ./zerver/openapi/zulip.yaml -o zulip-openapi --skip-validate-spec
/*
* Zulip REST API
*
* Powerful open source group chat
*
* The version of the OpenAPI document: 1.0.0
*
* Generated by: https://openapi-generator.tech
*/

See zerver/openapi/zulip.yaml for the original OpenAPI configuration.

Configuration slightly modified to work with the Rust generator of openapi-generator-cli.

Implementations§

Source§

impl Subscription

Source

pub const fn new() -> Self

Creates a new Subscription.

Source§

impl Subscription

Source

pub const fn stream_id(&self) -> Option<u64>

Gets the Subscription stream_id.

The unique ID of a channel.

Source

pub fn set_stream_id(&mut self, val: u64)

Sets the Subscription stream_id.

The unique ID of a channel.

Source

pub fn unset_stream_id(&mut self) -> Option<u64>

Unsets the Subscription stream_id.

The unique ID of a channel.

Source

pub fn with_stream_id(self, val: u64) -> Self

Builder function that sets the Subscription stream_id.

The unique ID of a channel.

Source

pub const fn date_created(&self) -> Option<u64>

Gets the Subscription date_created.

The UNIX timestamp for when the channel was created, in UTC seconds.

Changes: New in Zulip 4.0 (feature level 30).

Source

pub fn set_date_created(&mut self, val: u64)

Sets the Subscription date_created.

The UNIX timestamp for when the channel was created, in UTC seconds.

Changes: New in Zulip 4.0 (feature level 30).

Source

pub fn unset_date_created(&mut self) -> Option<u64>

Unsets the Subscription date_created.

The UNIX timestamp for when the channel was created, in UTC seconds.

Changes: New in Zulip 4.0 (feature level 30).

Source

pub fn with_date_created(self, val: u64) -> Self

Builder function that sets the Subscription date_created.

The UNIX timestamp for when the channel was created, in UTC seconds.

Changes: New in Zulip 4.0 (feature level 30).

Source

pub const fn creator_id(&self) -> Option<u64>

Gets the Subscription creator_id.

The ID of the user who created this channel.

A null value means the channel has no recorded creator,

which is often because the channel is very old,

was created during realm creation or because it was created via a data import tool or management command.

Changes: New in Zulip 9.0 (feature level 254).

Source

pub fn set_creator_id(&mut self, val: u64)

Sets the Subscription creator_id.

The ID of the user who created this channel.

A null value means the channel has no recorded creator,

which is often because the channel is very old,

was created during realm creation or because it was created via a data import tool or management command.

Changes: New in Zulip 9.0 (feature level 254).

Source

pub fn unset_creator_id(&mut self) -> Option<u64>

Unsets the Subscription creator_id.

The ID of the user who created this channel.

A null value means the channel has no recorded creator,

which is often because the channel is very old,

was created during realm creation or because it was created via a data import tool or management command.

Changes: New in Zulip 9.0 (feature level 254).

Source

pub fn with_creator_id(self, val: u64) -> Self

Builder function that sets the Subscription creator_id.

The ID of the user who created this channel.

A null value means the channel has no recorded creator,

which is often because the channel is very old,

was created during realm creation or because it was created via a data import tool or management command.

Changes: New in Zulip 9.0 (feature level 254).

Source

pub const fn invite_only(&self) -> Option<bool>

Gets the Subscription invite_only.

Specifies whether the channel is private or not.

Only people who have been invited can access a private channel.

Source

pub fn set_invite_only(&mut self, val: bool)

Sets the Subscription invite_only.

Specifies whether the channel is private or not.

Only people who have been invited can access a private channel.

Source

pub fn unset_invite_only(&mut self) -> Option<bool>

Unsets the Subscription invite_only.

Specifies whether the channel is private or not.

Only people who have been invited can access a private channel.

Source

pub fn with_invite_only(self, val: bool) -> Self

Builder function that sets the Subscription invite_only.

Specifies whether the channel is private or not.

Only people who have been invited can access a private channel.

Source

pub const fn desktop_notifications(&self) -> Option<bool>

Gets the Subscription desktop_notifications.

A boolean specifying whether desktop notifications are enabled for the given channel.

A null value means the value of this setting should be inherited from the user-level default setting, enable_stream_desktop_notifications, for this channel.

Source

pub fn set_desktop_notifications(&mut self, val: bool)

Sets the Subscription desktop_notifications.

A boolean specifying whether desktop notifications are enabled for the given channel.

A null value means the value of this setting should be inherited from the user-level default setting, enable_stream_desktop_notifications, for this channel.

Source

pub fn unset_desktop_notifications(&mut self) -> Option<bool>

Unsets the Subscription desktop_notifications.

A boolean specifying whether desktop notifications are enabled for the given channel.

A null value means the value of this setting should be inherited from the user-level default setting, enable_stream_desktop_notifications, for this channel.

Source

pub fn with_desktop_notifications(self, val: bool) -> Self

Builder function that sets the Subscription desktop_notifications.

A boolean specifying whether desktop notifications are enabled for the given channel.

A null value means the value of this setting should be inherited from the user-level default setting, enable_stream_desktop_notifications, for this channel.

Source

pub const fn email_notifications(&self) -> Option<bool>

Gets the Subscription email_notifications.

A boolean specifying whether email notifications are enabled for the given channel.

A null value means the value of this setting should be inherited from the user-level default setting, enable_stream_email_notifications, for this channel.

Source

pub fn set_email_notifications(&mut self, val: bool)

Sets the Subscription email_notifications.

A boolean specifying whether email notifications are enabled for the given channel.

A null value means the value of this setting should be inherited from the user-level default setting, enable_stream_email_notifications, for this channel.

Source

pub fn unset_email_notifications(&mut self) -> Option<bool>

Unsets the Subscription email_notifications.

A boolean specifying whether email notifications are enabled for the given channel.

A null value means the value of this setting should be inherited from the user-level default setting, enable_stream_email_notifications, for this channel.

Source

pub fn with_email_notifications(self, val: bool) -> Self

Builder function that sets the Subscription email_notifications.

A boolean specifying whether email notifications are enabled for the given channel.

A null value means the value of this setting should be inherited from the user-level default setting, enable_stream_email_notifications, for this channel.

Source

pub const fn wildcard_mentions_notify(&self) -> Option<bool>

Gets the Subscription wildcard_mentions_notify.

A boolean specifying whether wildcard mentions trigger notifications as though they were personal mentions in this channel.

A null value means the value of this setting should be inherited from the user-level default setting, wildcard_mentions_notify, for this channel.

Source

pub fn set_wildcard_mentions_notify(&mut self, val: bool)

Sets the Subscription wildcard_mentions_notify.

A boolean specifying whether wildcard mentions trigger notifications as though they were personal mentions in this channel.

A null value means the value of this setting should be inherited from the user-level default setting, wildcard_mentions_notify, for this channel.

Source

pub fn unset_wildcard_mentions_notify(&mut self) -> Option<bool>

Unsets the Subscription wildcard_mentions_notify.

A boolean specifying whether wildcard mentions trigger notifications as though they were personal mentions in this channel.

A null value means the value of this setting should be inherited from the user-level default setting, wildcard_mentions_notify, for this channel.

Source

pub fn with_wildcard_mentions_notify(self, val: bool) -> Self

Builder function that sets the Subscription wildcard_mentions_notify.

A boolean specifying whether wildcard mentions trigger notifications as though they were personal mentions in this channel.

A null value means the value of this setting should be inherited from the user-level default setting, wildcard_mentions_notify, for this channel.

Source

pub const fn push_notifications(&self) -> Option<bool>

Gets the Subscription push_notifications.

A boolean specifying whether push notifications are enabled for the given channel.

A null value means the value of this setting should be inherited from the user-level default setting, enable_stream_push_notifications, for this channel.

Source

pub fn set_push_notifications(&mut self, val: bool)

Sets the Subscription push_notifications.

A boolean specifying whether push notifications are enabled for the given channel.

A null value means the value of this setting should be inherited from the user-level default setting, enable_stream_push_notifications, for this channel.

Source

pub fn unset_push_notifications(&mut self) -> Option<bool>

Unsets the Subscription push_notifications.

A boolean specifying whether push notifications are enabled for the given channel.

A null value means the value of this setting should be inherited from the user-level default setting, enable_stream_push_notifications, for this channel.

Source

pub fn with_push_notifications(self, val: bool) -> Self

Builder function that sets the Subscription push_notifications.

A boolean specifying whether push notifications are enabled for the given channel.

A null value means the value of this setting should be inherited from the user-level default setting, enable_stream_push_notifications, for this channel.

Source

pub const fn audible_notifications(&self) -> Option<bool>

Gets the Subscription audible_notifications.

A boolean specifying whether audible notifications are enabled for the given channel.

A null value means the value of this setting should be inherited from the user-level default setting, enable_stream_audible_notifications, for this channel.

Source

pub fn set_audible_notifications(&mut self, val: bool)

Sets the Subscription audible_notifications.

A boolean specifying whether audible notifications are enabled for the given channel.

A null value means the value of this setting should be inherited from the user-level default setting, enable_stream_audible_notifications, for this channel.

Source

pub fn unset_audible_notifications(&mut self) -> Option<bool>

Unsets the Subscription audible_notifications.

A boolean specifying whether audible notifications are enabled for the given channel.

A null value means the value of this setting should be inherited from the user-level default setting, enable_stream_audible_notifications, for this channel.

Source

pub fn with_audible_notifications(self, val: bool) -> Self

Builder function that sets the Subscription audible_notifications.

A boolean specifying whether audible notifications are enabled for the given channel.

A null value means the value of this setting should be inherited from the user-level default setting, enable_stream_audible_notifications, for this channel.

Source

pub const fn pin_to_top(&self) -> Option<bool>

Gets the Subscription pin_to_top.

A boolean specifying whether the given channel has been pinned to the top.

Source

pub fn set_pin_to_top(&mut self, val: bool)

Sets the Subscription pin_to_top.

A boolean specifying whether the given channel has been pinned to the top.

Source

pub fn unset_pin_to_top(&mut self) -> Option<bool>

Unsets the Subscription pin_to_top.

A boolean specifying whether the given channel has been pinned to the top.

Source

pub fn with_pin_to_top(self, val: bool) -> Self

Builder function that sets the Subscription pin_to_top.

A boolean specifying whether the given channel has been pinned to the top.

Source

pub const fn is_muted(&self) -> Option<bool>

Gets the Subscription is_muted.

Whether the user has muted the channel. Muted channels do not count towards your total unread count and do not show up in the Combined feed view (previously known as All messages).

Changes: Prior to Zulip 2.1.0, this feature was represented by the more confusingly named in_home_view (with the opposite value, in_home_view=!is_muted).

Source

pub fn set_is_muted(&mut self, val: bool)

Sets the Subscription is_muted.

Whether the user has muted the channel. Muted channels do not count towards your total unread count and do not show up in the Combined feed view (previously known as All messages).

Changes: Prior to Zulip 2.1.0, this feature was represented by the more confusingly named in_home_view (with the opposite value, in_home_view=!is_muted).

Source

pub fn unset_is_muted(&mut self) -> Option<bool>

Unsets the Subscription is_muted.

Whether the user has muted the channel. Muted channels do not count towards your total unread count and do not show up in the Combined feed view (previously known as All messages).

Changes: Prior to Zulip 2.1.0, this feature was represented by the more confusingly named in_home_view (with the opposite value, in_home_view=!is_muted).

Source

pub fn with_is_muted(self, val: bool) -> Self

Builder function that sets the Subscription is_muted.

Whether the user has muted the channel. Muted channels do not count towards your total unread count and do not show up in the Combined feed view (previously known as All messages).

Changes: Prior to Zulip 2.1.0, this feature was represented by the more confusingly named in_home_view (with the opposite value, in_home_view=!is_muted).

Source

pub const fn in_home_view(&self) -> Option<bool>

Gets the Subscription in_home_view.

Legacy property for if the given channel is muted, with inverted meaning.

Changes: Deprecated in Zulip 2.1.0. Clients should use is_muted where available.

Source

pub fn set_in_home_view(&mut self, val: bool)

Sets the Subscription in_home_view.

Legacy property for if the given channel is muted, with inverted meaning.

Changes: Deprecated in Zulip 2.1.0. Clients should use is_muted where available.

Source

pub fn unset_in_home_view(&mut self) -> Option<bool>

Unsets the Subscription in_home_view.

Legacy property for if the given channel is muted, with inverted meaning.

Changes: Deprecated in Zulip 2.1.0. Clients should use is_muted where available.

Source

pub fn with_in_home_view(self, val: bool) -> Self

Builder function that sets the Subscription in_home_view.

Legacy property for if the given channel is muted, with inverted meaning.

Changes: Deprecated in Zulip 2.1.0. Clients should use is_muted where available.

Source

pub const fn is_announcement_only(&self) -> Option<bool>

Gets the Subscription is_announcement_only.

Whether only organization administrators can post to the channel.

Changes: Deprecated in Zulip 3.0 (feature level 1). Clients should use stream_post_policy instead.

Source

pub fn set_is_announcement_only(&mut self, val: bool)

Sets the Subscription is_announcement_only.

Whether only organization administrators can post to the channel.

Changes: Deprecated in Zulip 3.0 (feature level 1). Clients should use stream_post_policy instead.

Source

pub fn unset_is_announcement_only(&mut self) -> Option<bool>

Unsets the Subscription is_announcement_only.

Whether only organization administrators can post to the channel.

Changes: Deprecated in Zulip 3.0 (feature level 1). Clients should use stream_post_policy instead.

Source

pub fn with_is_announcement_only(self, val: bool) -> Self

Builder function that sets the Subscription is_announcement_only.

Whether only organization administrators can post to the channel.

Changes: Deprecated in Zulip 3.0 (feature level 1). Clients should use stream_post_policy instead.

Source

pub const fn is_web_public(&self) -> Option<bool>

Gets the Subscription is_web_public.

Whether the channel has been configured to allow unauthenticated access to its message history from the web.

Source

pub fn set_is_web_public(&mut self, val: bool)

Sets the Subscription is_web_public.

Whether the channel has been configured to allow unauthenticated access to its message history from the web.

Source

pub fn unset_is_web_public(&mut self) -> Option<bool>

Unsets the Subscription is_web_public.

Whether the channel has been configured to allow unauthenticated access to its message history from the web.

Source

pub fn with_is_web_public(self, val: bool) -> Self

Builder function that sets the Subscription is_web_public.

Whether the channel has been configured to allow unauthenticated access to its message history from the web.

Source

pub const fn stream_post_policy(&self) -> Option<StreamPostPolicy>

Gets the Subscription stream_post_policy.

A deprecated representation of a superset of the users who have permission to post messages to the channel available for backwards-compatibility.

Source

pub fn set_stream_post_policy(&mut self, val: StreamPostPolicy)

Sets the Subscription stream_post_policy.

A deprecated representation of a superset of the users who have permission to post messages to the channel available for backwards-compatibility.

Source

pub fn unset_stream_post_policy(&mut self) -> Option<StreamPostPolicy>

Unsets the Subscription stream_post_policy.

A deprecated representation of a superset of the users who have permission to post messages to the channel available for backwards-compatibility.

Source

pub fn with_stream_post_policy(self, val: StreamPostPolicy) -> Self

Builder function that sets the Subscription stream_post_policy.

A deprecated representation of a superset of the users who have permission to post messages to the channel available for backwards-compatibility.

Source

pub const fn message_retention_days(&self) -> Option<i32>

Gets the Subscription message_retention_days.

Number of days that messages sent to this channel will be stored before being automatically deleted by the message retention policy.

There are two special values:

  • null, the default, means the channel will inherit the organization level setting.

  • -1 encodes retaining messages in this channel forever.

Changes: New in Zulip 3.0 (feature level 17).

Source

pub fn set_message_retention_days(&mut self, val: i32)

Sets the Subscription message_retention_days.

Number of days that messages sent to this channel will be stored before being automatically deleted by the message retention policy.

There are two special values:

  • null, the default, means the channel will inherit the organization level setting.

  • -1 encodes retaining messages in this channel forever.

Changes: New in Zulip 3.0 (feature level 17).

Source

pub fn unset_message_retention_days(&mut self) -> Option<i32>

Unsets the Subscription message_retention_days.

Number of days that messages sent to this channel will be stored before being automatically deleted by the message retention policy.

There are two special values:

  • null, the default, means the channel will inherit the organization level setting.

  • -1 encodes retaining messages in this channel forever.

Changes: New in Zulip 3.0 (feature level 17).

Source

pub fn with_message_retention_days(self, val: i32) -> Self

Builder function that sets the Subscription message_retention_days.

Number of days that messages sent to this channel will be stored before being automatically deleted by the message retention policy.

There are two special values:

  • null, the default, means the channel will inherit the organization level setting.

  • -1 encodes retaining messages in this channel forever.

Changes: New in Zulip 3.0 (feature level 17).

Source

pub const fn history_public_to_subscribers(&self) -> Option<bool>

Gets the Subscription history_public_to_subscribers.

Whether the history of the channel is public to its subscribers.

Currently always true for public channels (i.e. \"invite_only\": false implies \"history_public_to_subscribers\": true),

but clients should not make that assumption, as we may change that behavior in the future.

Source

pub fn set_history_public_to_subscribers(&mut self, val: bool)

Sets the Subscription history_public_to_subscribers.

Whether the history of the channel is public to its subscribers.

Currently always true for public channels (i.e. \"invite_only\": false implies \"history_public_to_subscribers\": true),

but clients should not make that assumption, as we may change that behavior in the future.

Source

pub fn unset_history_public_to_subscribers(&mut self) -> Option<bool>

Unsets the Subscription history_public_to_subscribers.

Whether the history of the channel is public to its subscribers.

Currently always true for public channels (i.e. \"invite_only\": false implies \"history_public_to_subscribers\": true),

but clients should not make that assumption, as we may change that behavior in the future.

Source

pub fn with_history_public_to_subscribers(self, val: bool) -> Self

Builder function that sets the Subscription history_public_to_subscribers.

Whether the history of the channel is public to its subscribers.

Currently always true for public channels (i.e. \"invite_only\": false implies \"history_public_to_subscribers\": true),

but clients should not make that assumption, as we may change that behavior in the future.

Source

pub const fn first_message_id(&self) -> Option<u64>

Gets the Subscription first_message_id.

The ID of the first message in the channel.

Intended to help clients determine whether they need to display UI like the "show all topics" widget that would suggest the channel has older history that can be accessed.

Is null for channels with no message history.

Source

pub fn set_first_message_id(&mut self, val: u64)

Sets the Subscription first_message_id.

The ID of the first message in the channel.

Intended to help clients determine whether they need to display UI like the "show all topics" widget that would suggest the channel has older history that can be accessed.

Is null for channels with no message history.

Source

pub fn unset_first_message_id(&mut self) -> Option<u64>

Unsets the Subscription first_message_id.

The ID of the first message in the channel.

Intended to help clients determine whether they need to display UI like the "show all topics" widget that would suggest the channel has older history that can be accessed.

Is null for channels with no message history.

Source

pub fn with_first_message_id(self, val: u64) -> Self

Builder function that sets the Subscription first_message_id.

The ID of the first message in the channel.

Intended to help clients determine whether they need to display UI like the "show all topics" widget that would suggest the channel has older history that can be accessed.

Is null for channels with no message history.

Source

pub const fn folder_id(&self) -> Option<u64>

Gets the Subscription folder_id.

The ID of the folder to which the channel belongs.

Is null if channel does not belong to any folder.

Changes: New in Zulip 11.0 (feature level 389).

Source

pub fn set_folder_id(&mut self, val: u64)

Sets the Subscription folder_id.

The ID of the folder to which the channel belongs.

Is null if channel does not belong to any folder.

Changes: New in Zulip 11.0 (feature level 389).

Source

pub fn unset_folder_id(&mut self) -> Option<u64>

Unsets the Subscription folder_id.

The ID of the folder to which the channel belongs.

Is null if channel does not belong to any folder.

Changes: New in Zulip 11.0 (feature level 389).

Source

pub fn with_folder_id(self, val: u64) -> Self

Builder function that sets the Subscription folder_id.

The ID of the folder to which the channel belongs.

Is null if channel does not belong to any folder.

Changes: New in Zulip 11.0 (feature level 389).

Source

pub const fn topics_policy(&self) -> Option<TopicsPolicy>

Gets the Subscription topics_policy.

Source

pub fn set_topics_policy(&mut self, val: TopicsPolicy)

Sets the Subscription topics_policy.

Source

pub fn unset_topics_policy(&mut self) -> Option<TopicsPolicy>

Unsets the Subscription topics_policy.

Source

pub fn with_topics_policy(self, val: TopicsPolicy) -> Self

Builder function that sets the Subscription topics_policy.

Source

pub const fn is_recently_active(&self) -> Option<bool>

Gets the Subscription is_recently_active.

Whether the channel has recent message activity.

Clients should use this to implement hiding inactive channels.

Changes: New in Zulip 10.0 (feature level 323). Previously, clients implemented the demote_inactive_streams from local message history, resulting in a choppy loading experience.

Source

pub fn set_is_recently_active(&mut self, val: bool)

Sets the Subscription is_recently_active.

Whether the channel has recent message activity.

Clients should use this to implement hiding inactive channels.

Changes: New in Zulip 10.0 (feature level 323). Previously, clients implemented the demote_inactive_streams from local message history, resulting in a choppy loading experience.

Source

pub fn unset_is_recently_active(&mut self) -> Option<bool>

Unsets the Subscription is_recently_active.

Whether the channel has recent message activity.

Clients should use this to implement hiding inactive channels.

Changes: New in Zulip 10.0 (feature level 323). Previously, clients implemented the demote_inactive_streams from local message history, resulting in a choppy loading experience.

Source

pub fn with_is_recently_active(self, val: bool) -> Self

Builder function that sets the Subscription is_recently_active.

Whether the channel has recent message activity.

Clients should use this to implement hiding inactive channels.

Changes: New in Zulip 10.0 (feature level 323). Previously, clients implemented the demote_inactive_streams from local message history, resulting in a choppy loading experience.

Source

pub const fn stream_weekly_traffic(&self) -> Option<u64>

Gets the Subscription stream_weekly_traffic.

The average number of messages sent to the channel per week, as estimated based on recent weeks, rounded to the nearest integer.

If null, the channel was recently created and there is insufficient data to estimate the average traffic.

Source

pub fn set_stream_weekly_traffic(&mut self, val: u64)

Sets the Subscription stream_weekly_traffic.

The average number of messages sent to the channel per week, as estimated based on recent weeks, rounded to the nearest integer.

If null, the channel was recently created and there is insufficient data to estimate the average traffic.

Source

pub fn unset_stream_weekly_traffic(&mut self) -> Option<u64>

Unsets the Subscription stream_weekly_traffic.

The average number of messages sent to the channel per week, as estimated based on recent weeks, rounded to the nearest integer.

If null, the channel was recently created and there is insufficient data to estimate the average traffic.

Source

pub fn with_stream_weekly_traffic(self, val: u64) -> Self

Builder function that sets the Subscription stream_weekly_traffic.

The average number of messages sent to the channel per week, as estimated based on recent weeks, rounded to the nearest integer.

If null, the channel was recently created and there is insufficient data to estimate the average traffic.

Source

pub const fn is_archived(&self) -> Option<bool>

Gets the Subscription is_archived.

A boolean indicating whether the channel is archived.

Changes: New in Zulip 10.0 (feature level 315). Previously, subscriptions only included active channels.

Note that some endpoints will never return archived channels unless the client declares explicit support for them via the archived_channels client capability.

Source

pub fn set_is_archived(&mut self, val: bool)

Sets the Subscription is_archived.

A boolean indicating whether the channel is archived.

Changes: New in Zulip 10.0 (feature level 315). Previously, subscriptions only included active channels.

Note that some endpoints will never return archived channels unless the client declares explicit support for them via the archived_channels client capability.

Source

pub fn unset_is_archived(&mut self) -> Option<bool>

Unsets the Subscription is_archived.

A boolean indicating whether the channel is archived.

Changes: New in Zulip 10.0 (feature level 315). Previously, subscriptions only included active channels.

Note that some endpoints will never return archived channels unless the client declares explicit support for them via the archived_channels client capability.

Source

pub fn with_is_archived(self, val: bool) -> Self

Builder function that sets the Subscription is_archived.

A boolean indicating whether the channel is archived.

Changes: New in Zulip 10.0 (feature level 315). Previously, subscriptions only included active channels.

Note that some endpoints will never return archived channels unless the client declares explicit support for them via the archived_channels client capability.

Source

pub const fn subscriber_count(&self) -> Option<f64>

Gets the Subscription subscriber_count.

The total number of non-deactivated users (including bots) who are subscribed to the channel.

Clients are responsible for updating this value using peer_add and peer_remove events.

The server’s internals cannot guarantee this value is correctly synced with peer_add and peer_remove events for the channel.

As a result, if a (rare) race occurs between a change in the channel’s subscribers and fetching this value,

it is possible for a client that is correctly following the events protocol to end up with a permanently off-by-one error in the channel’s subscriber count.

Clients are recommended to fetch full subscriber data for a channel in contexts where it is important to avoid this risk.

The official web application, for example, uses this field primarily while waiting to fetch a given channel’s full subscriber list from the server.

Changes: New in Zulip 11.0 (feature level 394).

Source

pub fn set_subscriber_count(&mut self, val: f64)

Sets the Subscription subscriber_count.

The total number of non-deactivated users (including bots) who are subscribed to the channel.

Clients are responsible for updating this value using peer_add and peer_remove events.

The server’s internals cannot guarantee this value is correctly synced with peer_add and peer_remove events for the channel.

As a result, if a (rare) race occurs between a change in the channel’s subscribers and fetching this value,

it is possible for a client that is correctly following the events protocol to end up with a permanently off-by-one error in the channel’s subscriber count.

Clients are recommended to fetch full subscriber data for a channel in contexts where it is important to avoid this risk.

The official web application, for example, uses this field primarily while waiting to fetch a given channel’s full subscriber list from the server.

Changes: New in Zulip 11.0 (feature level 394).

Source

pub fn unset_subscriber_count(&mut self) -> Option<f64>

Unsets the Subscription subscriber_count.

The total number of non-deactivated users (including bots) who are subscribed to the channel.

Clients are responsible for updating this value using peer_add and peer_remove events.

The server’s internals cannot guarantee this value is correctly synced with peer_add and peer_remove events for the channel.

As a result, if a (rare) race occurs between a change in the channel’s subscribers and fetching this value,

it is possible for a client that is correctly following the events protocol to end up with a permanently off-by-one error in the channel’s subscriber count.

Clients are recommended to fetch full subscriber data for a channel in contexts where it is important to avoid this risk.

The official web application, for example, uses this field primarily while waiting to fetch a given channel’s full subscriber list from the server.

Changes: New in Zulip 11.0 (feature level 394).

Source

pub fn with_subscriber_count(self, val: f64) -> Self

Builder function that sets the Subscription subscriber_count.

The total number of non-deactivated users (including bots) who are subscribed to the channel.

Clients are responsible for updating this value using peer_add and peer_remove events.

The server’s internals cannot guarantee this value is correctly synced with peer_add and peer_remove events for the channel.

As a result, if a (rare) race occurs between a change in the channel’s subscribers and fetching this value,

it is possible for a client that is correctly following the events protocol to end up with a permanently off-by-one error in the channel’s subscriber count.

Clients are recommended to fetch full subscriber data for a channel in contexts where it is important to avoid this risk.

The official web application, for example, uses this field primarily while waiting to fetch a given channel’s full subscriber list from the server.

Changes: New in Zulip 11.0 (feature level 394).

Source§

impl Subscription

Source

pub fn name(&self) -> Option<&str>

Gets the Subscription name.

The name of a channel.

Source

pub fn set_name<'a, C: Into<Cow<'a, str>>>(&mut self, val: C)

Sets the Subscription name.

The name of a channel.

Source

pub fn unset_name(&mut self) -> Option<String>

Unsets the Subscription name.

The name of a channel.

Source

pub fn with_name<'a, C: Into<Cow<'a, str>>>(self, val: C) -> Self

Builder function that sets the Subscription name.

The name of a channel.

Source

pub fn description(&self) -> Option<&str>

Gets the Subscription description.

The description of the channel in Zulip-flavored Markdown format,

intended to be used to prepopulate UI for editing a channel’s description.

See Markdown message formatting for details on Zulip’s HTML format.

See also rendered_description.

Source

pub fn set_description<'a, C: Into<Cow<'a, str>>>(&mut self, val: C)

Sets the Subscription description.

The description of the channel in Zulip-flavored Markdown format,

intended to be used to prepopulate UI for editing a channel’s description.

See Markdown message formatting for details on Zulip’s HTML format.

See also rendered_description.

Source

pub fn unset_description(&mut self) -> Option<String>

Unsets the Subscription description.

The description of the channel in Zulip-flavored Markdown format,

intended to be used to prepopulate UI for editing a channel’s description.

See Markdown message formatting for details on Zulip’s HTML format.

See also rendered_description.

Source

pub fn with_description<'a, C: Into<Cow<'a, str>>>(self, val: C) -> Self

Builder function that sets the Subscription description.

The description of the channel in Zulip-flavored Markdown format,

intended to be used to prepopulate UI for editing a channel’s description.

See Markdown message formatting for details on Zulip’s HTML format.

See also rendered_description.

Source

pub fn rendered_description(&self) -> Option<&str>

Gets the Subscription rendered_description.

The description of the channel rendered as HTML,

intended to be used when displaying the channel description in a UI.

One should use the standard Zulip rendered_markdown CSS when displaying this content so that emoji, LaTeX,

and other syntax work correctly.

And any client-side security logic for user-generated message content should be applied when displaying this HTML as though it were the body of a Zulip message.

See also description.

Source

pub fn set_rendered_description<'a, C: Into<Cow<'a, str>>>(&mut self, val: C)

Sets the Subscription rendered_description.

The description of the channel rendered as HTML,

intended to be used when displaying the channel description in a UI.

One should use the standard Zulip rendered_markdown CSS when displaying this content so that emoji, LaTeX,

and other syntax work correctly.

And any client-side security logic for user-generated message content should be applied when displaying this HTML as though it were the body of a Zulip message.

See also description.

Source

pub fn unset_rendered_description(&mut self) -> Option<String>

Unsets the Subscription rendered_description.

The description of the channel rendered as HTML,

intended to be used when displaying the channel description in a UI.

One should use the standard Zulip rendered_markdown CSS when displaying this content so that emoji, LaTeX,

and other syntax work correctly.

And any client-side security logic for user-generated message content should be applied when displaying this HTML as though it were the body of a Zulip message.

See also description.

Source

pub fn with_rendered_description<'a, C: Into<Cow<'a, str>>>( self, val: C, ) -> Self

Builder function that sets the Subscription rendered_description.

The description of the channel rendered as HTML,

intended to be used when displaying the channel description in a UI.

One should use the standard Zulip rendered_markdown CSS when displaying this content so that emoji, LaTeX,

and other syntax work correctly.

And any client-side security logic for user-generated message content should be applied when displaying this HTML as though it were the body of a Zulip message.

See also description.

Source

pub fn subscribers(&self) -> Option<&[u64]>

Gets the Subscription subscribers.

A list of user IDs of users who are also subscribed to a given channel. Included only if include_subscribers is true.

Source

pub fn set_subscribers<'a, C: Into<Cow<'a, [u64]>>>(&mut self, val: C)

Sets the Subscription subscribers.

A list of user IDs of users who are also subscribed to a given channel. Included only if include_subscribers is true.

Source

pub fn unset_subscribers(&mut self) -> Option<Vec<u64>>

Unsets the Subscription subscribers.

A list of user IDs of users who are also subscribed to a given channel. Included only if include_subscribers is true.

Source

pub fn with_subscribers<'a, C: Into<Cow<'a, [u64]>>>(self, val: C) -> Self

Builder function that sets the Subscription subscribers.

A list of user IDs of users who are also subscribed to a given channel. Included only if include_subscribers is true.

Source

pub fn partial_subscribers(&self) -> Option<&[u64]>

Gets the Subscription partial_subscribers.

If include_subscribers=\"partial\" was requested, the server may,

at its discretion, send a partial_subscribers list rather than a subscribers list for channels with a large number of subscribers.

The partial_subscribers list contains an arbitrary subset of the channel’s subscribers that is guaranteed to include all bot user

subscribers as well as all users who have been active in the last 14 days, but otherwise can be chosen arbitrarily by the server.

Changes: New in Zulip 11.0 (feature level 412).

Source

pub fn set_partial_subscribers<'a, C: Into<Cow<'a, [u64]>>>(&mut self, val: C)

Sets the Subscription partial_subscribers.

If include_subscribers=\"partial\" was requested, the server may,

at its discretion, send a partial_subscribers list rather than a subscribers list for channels with a large number of subscribers.

The partial_subscribers list contains an arbitrary subset of the channel’s subscribers that is guaranteed to include all bot user

subscribers as well as all users who have been active in the last 14 days, but otherwise can be chosen arbitrarily by the server.

Changes: New in Zulip 11.0 (feature level 412).

Source

pub fn unset_partial_subscribers(&mut self) -> Option<Vec<u64>>

Unsets the Subscription partial_subscribers.

If include_subscribers=\"partial\" was requested, the server may,

at its discretion, send a partial_subscribers list rather than a subscribers list for channels with a large number of subscribers.

The partial_subscribers list contains an arbitrary subset of the channel’s subscribers that is guaranteed to include all bot user

subscribers as well as all users who have been active in the last 14 days, but otherwise can be chosen arbitrarily by the server.

Changes: New in Zulip 11.0 (feature level 412).

Source

pub fn with_partial_subscribers<'a, C: Into<Cow<'a, [u64]>>>( self, val: C, ) -> Self

Builder function that sets the Subscription partial_subscribers.

If include_subscribers=\"partial\" was requested, the server may,

at its discretion, send a partial_subscribers list rather than a subscribers list for channels with a large number of subscribers.

The partial_subscribers list contains an arbitrary subset of the channel’s subscribers that is guaranteed to include all bot user

subscribers as well as all users who have been active in the last 14 days, but otherwise can be chosen arbitrarily by the server.

Changes: New in Zulip 11.0 (feature level 412).

Source

pub fn color(&self) -> Option<&str>

Gets the Subscription color.

The user’s personal color for the channel.

Source

pub fn set_color<'a, C: Into<Cow<'a, str>>>(&mut self, val: C)

Sets the Subscription color.

The user’s personal color for the channel.

Source

pub fn unset_color(&mut self) -> Option<String>

Unsets the Subscription color.

The user’s personal color for the channel.

Source

pub fn with_color<'a, C: Into<Cow<'a, str>>>(self, val: C) -> Self

Builder function that sets the Subscription color.

The user’s personal color for the channel.

Source§

impl Subscription

Source

pub fn can_add_subscribers_group(&self) -> Option<&CanAddSubscribersGroup>

Gets the Subscription can_add_subscribers_group.

Source

pub fn set_can_add_subscribers_group(&mut self, val: CanAddSubscribersGroup)

Sets the Subscription can_add_subscribers_group.

Source

pub fn unset_can_add_subscribers_group( &mut self, ) -> Option<CanAddSubscribersGroup>

Unsets the Subscription can_add_subscribers_group.

Source

pub fn with_can_add_subscribers_group(self, val: CanAddSubscribersGroup) -> Self

Builder function that sets the Subscription can_add_subscribers_group.

Source

pub fn can_remove_subscribers_group(&self) -> Option<&CanRemoveSubscribersGroup>

Gets the Subscription can_remove_subscribers_group.

Source

pub fn set_can_remove_subscribers_group( &mut self, val: CanRemoveSubscribersGroup, )

Sets the Subscription can_remove_subscribers_group.

Source

pub fn unset_can_remove_subscribers_group( &mut self, ) -> Option<CanRemoveSubscribersGroup>

Unsets the Subscription can_remove_subscribers_group.

Source

pub fn with_can_remove_subscribers_group( self, val: CanRemoveSubscribersGroup, ) -> Self

Builder function that sets the Subscription can_remove_subscribers_group.

Source

pub fn can_administer_channel_group(&self) -> Option<&CanAdministerChannelGroup>

Gets the Subscription can_administer_channel_group.

Source

pub fn set_can_administer_channel_group( &mut self, val: CanAdministerChannelGroup, )

Sets the Subscription can_administer_channel_group.

Source

pub fn unset_can_administer_channel_group( &mut self, ) -> Option<CanAdministerChannelGroup>

Unsets the Subscription can_administer_channel_group.

Source

pub fn with_can_administer_channel_group( self, val: CanAdministerChannelGroup, ) -> Self

Builder function that sets the Subscription can_administer_channel_group.

Source

pub fn can_delete_any_message_group(&self) -> Option<&CanDeleteAnyMessageGroup>

Gets the Subscription can_delete_any_message_group.

Source

pub fn set_can_delete_any_message_group( &mut self, val: CanDeleteAnyMessageGroup, )

Sets the Subscription can_delete_any_message_group.

Source

pub fn unset_can_delete_any_message_group( &mut self, ) -> Option<CanDeleteAnyMessageGroup>

Unsets the Subscription can_delete_any_message_group.

Source

pub fn with_can_delete_any_message_group( self, val: CanDeleteAnyMessageGroup, ) -> Self

Builder function that sets the Subscription can_delete_any_message_group.

Source

pub fn can_delete_own_message_group(&self) -> Option<&CanDeleteOwnMessageGroup>

Gets the Subscription can_delete_own_message_group.

Source

pub fn set_can_delete_own_message_group( &mut self, val: CanDeleteOwnMessageGroup, )

Sets the Subscription can_delete_own_message_group.

Source

pub fn unset_can_delete_own_message_group( &mut self, ) -> Option<CanDeleteOwnMessageGroup>

Unsets the Subscription can_delete_own_message_group.

Source

pub fn with_can_delete_own_message_group( self, val: CanDeleteOwnMessageGroup, ) -> Self

Builder function that sets the Subscription can_delete_own_message_group.

Source

pub fn can_move_messages_out_of_channel_group( &self, ) -> Option<&CanMoveMessagesOutOfChannelGroup>

Gets the Subscription can_move_messages_out_of_channel_group.

Source

pub fn set_can_move_messages_out_of_channel_group( &mut self, val: CanMoveMessagesOutOfChannelGroup, )

Sets the Subscription can_move_messages_out_of_channel_group.

Source

pub fn unset_can_move_messages_out_of_channel_group( &mut self, ) -> Option<CanMoveMessagesOutOfChannelGroup>

Unsets the Subscription can_move_messages_out_of_channel_group.

Source

pub fn with_can_move_messages_out_of_channel_group( self, val: CanMoveMessagesOutOfChannelGroup, ) -> Self

Builder function that sets the Subscription can_move_messages_out_of_channel_group.

Source

pub fn can_move_messages_within_channel_group( &self, ) -> Option<&CanMoveMessagesWithinChannelGroup>

Gets the Subscription can_move_messages_within_channel_group.

Source

pub fn set_can_move_messages_within_channel_group( &mut self, val: CanMoveMessagesWithinChannelGroup, )

Sets the Subscription can_move_messages_within_channel_group.

Source

pub fn unset_can_move_messages_within_channel_group( &mut self, ) -> Option<CanMoveMessagesWithinChannelGroup>

Unsets the Subscription can_move_messages_within_channel_group.

Source

pub fn with_can_move_messages_within_channel_group( self, val: CanMoveMessagesWithinChannelGroup, ) -> Self

Builder function that sets the Subscription can_move_messages_within_channel_group.

Source

pub fn can_send_message_group(&self) -> Option<&CanSendMessageGroup>

Gets the Subscription can_send_message_group.

Source

pub fn set_can_send_message_group(&mut self, val: CanSendMessageGroup)

Sets the Subscription can_send_message_group.

Source

pub fn unset_can_send_message_group(&mut self) -> Option<CanSendMessageGroup>

Unsets the Subscription can_send_message_group.

Source

pub fn with_can_send_message_group(self, val: CanSendMessageGroup) -> Self

Builder function that sets the Subscription can_send_message_group.

Source

pub fn can_subscribe_group(&self) -> Option<&CanSubscribeGroup>

Gets the Subscription can_subscribe_group.

Source

pub fn set_can_subscribe_group(&mut self, val: CanSubscribeGroup)

Sets the Subscription can_subscribe_group.

Source

pub fn unset_can_subscribe_group(&mut self) -> Option<CanSubscribeGroup>

Unsets the Subscription can_subscribe_group.

Source

pub fn with_can_subscribe_group(self, val: CanSubscribeGroup) -> Self

Builder function that sets the Subscription can_subscribe_group.

Source

pub fn can_resolve_topics_group(&self) -> Option<&CanResolveTopicsGroup>

Gets the Subscription can_resolve_topics_group.

Source

pub fn set_can_resolve_topics_group(&mut self, val: CanResolveTopicsGroup)

Sets the Subscription can_resolve_topics_group.

Source

pub fn unset_can_resolve_topics_group( &mut self, ) -> Option<CanResolveTopicsGroup>

Unsets the Subscription can_resolve_topics_group.

Source

pub fn with_can_resolve_topics_group(self, val: CanResolveTopicsGroup) -> Self

Builder function that sets the Subscription can_resolve_topics_group.

Trait Implementations§

Source§

impl Clone for Subscription

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Subscription

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Subscription

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Subscription

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for Subscription

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for Subscription

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for Subscription

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Subscription

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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, U> Into<U> for T
where 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.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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.
Source§

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

Source§

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