Skip to main content

Request

Struct Request 

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

Represents the request to the Register Zulip API.

Implementations§

Source§

impl Request

Source

pub const fn new() -> Self

Creates a new Request.

Source§

impl Request

Source

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

Gets the Request apply_markdown.

Set to true if you would like the content to be rendered in HTML

format (otherwise the API will return the raw text that the user entered)

Source

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

Sets the Request apply_markdown.

Set to true if you would like the content to be rendered in HTML

format (otherwise the API will return the raw text that the user entered)

Source

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

Unsets the Request apply_markdown.

Set to true if you would like the content to be rendered in HTML

format (otherwise the API will return the raw text that the user entered)

Source

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

Builder function that sets the Request apply_markdown.

Set to true if you would like the content to be rendered in HTML

format (otherwise the API will return the raw text that the user entered)

Source

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

Gets the Request client_gravatar.

Whether the client supports computing gravatars URLs. If

enabled, avatar_url will be included in the response only

if there is a Zulip avatar, and will be null for users who

are using gravatar as their avatar. This option

significantly reduces the compressed size of user data,

since gravatar URLs are long, random strings and thus do not

compress well. The client_gravatar field is set to true if

clients can compute their own gravatars.

The default value is true for authenticated requests and

false for unauthenticated requests.

Passing true in an unauthenticated request is an error.

Changes: Before Zulip 6.0 (feature level 149), this

parameter was silently ignored and processed as though it

were false in unauthenticated requests.

Source

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

Sets the Request client_gravatar.

Whether the client supports computing gravatars URLs. If

enabled, avatar_url will be included in the response only

if there is a Zulip avatar, and will be null for users who

are using gravatar as their avatar. This option

significantly reduces the compressed size of user data,

since gravatar URLs are long, random strings and thus do not

compress well. The client_gravatar field is set to true if

clients can compute their own gravatars.

The default value is true for authenticated requests and

false for unauthenticated requests.

Passing true in an unauthenticated request is an error.

Changes: Before Zulip 6.0 (feature level 149), this

parameter was silently ignored and processed as though it

were false in unauthenticated requests.

Source

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

Unsets the Request client_gravatar.

Whether the client supports computing gravatars URLs. If

enabled, avatar_url will be included in the response only

if there is a Zulip avatar, and will be null for users who

are using gravatar as their avatar. This option

significantly reduces the compressed size of user data,

since gravatar URLs are long, random strings and thus do not

compress well. The client_gravatar field is set to true if

clients can compute their own gravatars.

The default value is true for authenticated requests and

false for unauthenticated requests.

Passing true in an unauthenticated request is an error.

Changes: Before Zulip 6.0 (feature level 149), this

parameter was silently ignored and processed as though it

were false in unauthenticated requests.

Source

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

Builder function that sets the Request client_gravatar.

Whether the client supports computing gravatars URLs. If

enabled, avatar_url will be included in the response only

if there is a Zulip avatar, and will be null for users who

are using gravatar as their avatar. This option

significantly reduces the compressed size of user data,

since gravatar URLs are long, random strings and thus do not

compress well. The client_gravatar field is set to true if

clients can compute their own gravatars.

The default value is true for authenticated requests and

false for unauthenticated requests.

Passing true in an unauthenticated request is an error.

Changes: Before Zulip 6.0 (feature level 149), this

parameter was silently ignored and processed as though it

were false in unauthenticated requests.

Source

pub const fn include_subscribers(&self) -> Option<IncludeSubscribers>

Gets the Request include_subscribers.

Whether each returned channel object should include a subscribers

field containing a list of the user IDs of its subscribers.

Source

pub fn set_include_subscribers(&mut self, val: IncludeSubscribers)

Sets the Request include_subscribers.

Whether each returned channel object should include a subscribers

field containing a list of the user IDs of its subscribers.

Source

pub fn unset_include_subscribers(&mut self) -> Option<IncludeSubscribers>

Unsets the Request include_subscribers.

Whether each returned channel object should include a subscribers

field containing a list of the user IDs of its subscribers.

Source

pub fn with_include_subscribers(self, val: IncludeSubscribers) -> Self

Builder function that sets the Request include_subscribers.

Whether each returned channel object should include a subscribers

field containing a list of the user IDs of its subscribers.

Source

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

Gets the Request slim_presence.

If true, the presences object returned in the response will be keyed

by user ID and the entry for each user’s presence data will be in the

modern format.

Changes: New in Zulip 3.0 (no feature level; API unstable).

Source

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

Sets the Request slim_presence.

If true, the presences object returned in the response will be keyed

by user ID and the entry for each user’s presence data will be in the

modern format.

Changes: New in Zulip 3.0 (no feature level; API unstable).

Source

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

Unsets the Request slim_presence.

If true, the presences object returned in the response will be keyed

by user ID and the entry for each user’s presence data will be in the

modern format.

Changes: New in Zulip 3.0 (no feature level; API unstable).

Source

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

Builder function that sets the Request slim_presence.

If true, the presences object returned in the response will be keyed

by user ID and the entry for each user’s presence data will be in the

modern format.

Changes: New in Zulip 3.0 (no feature level; API unstable).

Source

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

Gets the Request presence_history_limit_days.

Limits how far back in time to fetch user presence data. If not specified,

defaults to 14 days. A value of N means that the oldest presence data

fetched will be from at most N days ago.

Changes: New in Zulip 10.0 (feature level 288).

Source

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

Sets the Request presence_history_limit_days.

Limits how far back in time to fetch user presence data. If not specified,

defaults to 14 days. A value of N means that the oldest presence data

fetched will be from at most N days ago.

Changes: New in Zulip 10.0 (feature level 288).

Source

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

Unsets the Request presence_history_limit_days.

Limits how far back in time to fetch user presence data. If not specified,

defaults to 14 days. A value of N means that the oldest presence data

fetched will be from at most N days ago.

Changes: New in Zulip 10.0 (feature level 288).

Source

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

Builder function that sets the Request presence_history_limit_days.

Limits how far back in time to fetch user presence data. If not specified,

defaults to 14 days. A value of N means that the oldest presence data

fetched will be from at most N days ago.

Changes: New in Zulip 10.0 (feature level 288).

Source

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

Gets the Request all_public_streams.

Whether you would like to request message events from all public

channels. Useful for workflow bots that you’d like to see all new messages

sent to public channels. (You can also subscribe the user to private channels).

Source

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

Sets the Request all_public_streams.

Whether you would like to request message events from all public

channels. Useful for workflow bots that you’d like to see all new messages

sent to public channels. (You can also subscribe the user to private channels).

Source

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

Unsets the Request all_public_streams.

Whether you would like to request message events from all public

channels. Useful for workflow bots that you’d like to see all new messages

sent to public channels. (You can also subscribe the user to private channels).

Source

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

Builder function that sets the Request all_public_streams.

Whether you would like to request message events from all public

channels. Useful for workflow bots that you’d like to see all new messages

sent to public channels. (You can also subscribe the user to private channels).

Source

pub const fn client_capabilities(&self) -> Option<ClientCapabilities>

Gets the Request client_capabilities.

Dictionary containing details on features the client supports that are

relevant to the format of responses sent by the server.

Source

pub fn set_client_capabilities(&mut self, val: ClientCapabilities)

Sets the Request client_capabilities.

Dictionary containing details on features the client supports that are

relevant to the format of responses sent by the server.

Source

pub fn unset_client_capabilities(&mut self) -> Option<ClientCapabilities>

Unsets the Request client_capabilities.

Dictionary containing details on features the client supports that are

relevant to the format of responses sent by the server.

Source

pub fn with_client_capabilities(self, val: ClientCapabilities) -> Self

Builder function that sets the Request client_capabilities.

Dictionary containing details on features the client supports that are

relevant to the format of responses sent by the server.

Source§

impl Request

Source

pub fn event_types(&self) -> Option<&[EventType]>

Gets the Request event_types.

A JSON-encoded array indicating which types of events you’re interested

in. Values that you might find useful include:

Source

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

Sets the Request event_types.

A JSON-encoded array indicating which types of events you’re interested

in. Values that you might find useful include:

Source

pub fn unset_event_types(&mut self) -> Option<Vec<EventType>>

Unsets the Request event_types.

A JSON-encoded array indicating which types of events you’re interested

in. Values that you might find useful include:

Source

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

Builder function that sets the Request event_types.

A JSON-encoded array indicating which types of events you’re interested

in. Values that you might find useful include:

Source

pub fn fetch_event_types(&self) -> Option<&[EventType]>

Gets the Request fetch_event_types.

Same as the event_types parameter except that the values in

fetch_event_types are used to fetch initial data. If

fetch_event_types is not provided, event_types is used and if

event_types is not provided, this parameter defaults to null.

Event types not supported by the server are ignored, in order to simplify

the implementation of client apps that support multiple server versions.

Source

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

Sets the Request fetch_event_types.

Same as the event_types parameter except that the values in

fetch_event_types are used to fetch initial data. If

fetch_event_types is not provided, event_types is used and if

event_types is not provided, this parameter defaults to null.

Event types not supported by the server are ignored, in order to simplify

the implementation of client apps that support multiple server versions.

Source

pub fn unset_fetch_event_types(&mut self) -> Option<Vec<EventType>>

Unsets the Request fetch_event_types.

Same as the event_types parameter except that the values in

fetch_event_types are used to fetch initial data. If

fetch_event_types is not provided, event_types is used and if

event_types is not provided, this parameter defaults to null.

Event types not supported by the server are ignored, in order to simplify

the implementation of client apps that support multiple server versions.

Source

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

Builder function that sets the Request fetch_event_types.

Same as the event_types parameter except that the values in

fetch_event_types are used to fetch initial data. If

fetch_event_types is not provided, event_types is used and if

event_types is not provided, this parameter defaults to null.

Event types not supported by the server are ignored, in order to simplify

the implementation of client apps that support multiple server versions.

Source

pub fn narrow(&self) -> Option<&[NarrowTuple]>

Gets the Request narrow.

A JSON-encoded array of arrays of length 2 indicating the

narrow filter(s) for which you’d

like to receive events for.

For example, to receive events for direct messages (including

group direct messages) received by the user, one can use

"narrow": [["is", "dm"]].

Unlike the API for fetching messages,

this narrow parameter is simply a filter on messages that the

user receives through their channel subscriptions (or because

they are a recipient of a direct message).

This means that a client that requests a narrow filter of

[["channel", "Denmark"]] will receive events for new messages

sent to that channel while the user is subscribed to that

channel. The client will not receive any message events at all

if the user is not subscribed to "Denmark".

Newly created bot users are not usually subscribed to any

channels, so bots using this API need to be

subscribed to any channels whose messages

you’d like them to process using this endpoint.

See the all_public_streams parameter for how to process all

public channel messages in an organization.

Changes: See changes section

of search/narrow filter documentation.

Source

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

Sets the Request narrow.

A JSON-encoded array of arrays of length 2 indicating the

narrow filter(s) for which you’d

like to receive events for.

For example, to receive events for direct messages (including

group direct messages) received by the user, one can use

"narrow": [["is", "dm"]].

Unlike the API for fetching messages,

this narrow parameter is simply a filter on messages that the

user receives through their channel subscriptions (or because

they are a recipient of a direct message).

This means that a client that requests a narrow filter of

[["channel", "Denmark"]] will receive events for new messages

sent to that channel while the user is subscribed to that

channel. The client will not receive any message events at all

if the user is not subscribed to "Denmark".

Newly created bot users are not usually subscribed to any

channels, so bots using this API need to be

subscribed to any channels whose messages

you’d like them to process using this endpoint.

See the all_public_streams parameter for how to process all

public channel messages in an organization.

Changes: See changes section

of search/narrow filter documentation.

Source

pub fn unset_narrow(&mut self) -> Option<Vec<NarrowTuple>>

Unsets the Request narrow.

A JSON-encoded array of arrays of length 2 indicating the

narrow filter(s) for which you’d

like to receive events for.

For example, to receive events for direct messages (including

group direct messages) received by the user, one can use

"narrow": [["is", "dm"]].

Unlike the API for fetching messages,

this narrow parameter is simply a filter on messages that the

user receives through their channel subscriptions (or because

they are a recipient of a direct message).

This means that a client that requests a narrow filter of

[["channel", "Denmark"]] will receive events for new messages

sent to that channel while the user is subscribed to that

channel. The client will not receive any message events at all

if the user is not subscribed to "Denmark".

Newly created bot users are not usually subscribed to any

channels, so bots using this API need to be

subscribed to any channels whose messages

you’d like them to process using this endpoint.

See the all_public_streams parameter for how to process all

public channel messages in an organization.

Changes: See changes section

of search/narrow filter documentation.

Source

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

Builder function that sets the Request narrow.

A JSON-encoded array of arrays of length 2 indicating the

narrow filter(s) for which you’d

like to receive events for.

For example, to receive events for direct messages (including

group direct messages) received by the user, one can use

"narrow": [["is", "dm"]].

Unlike the API for fetching messages,

this narrow parameter is simply a filter on messages that the

user receives through their channel subscriptions (or because

they are a recipient of a direct message).

This means that a client that requests a narrow filter of

[["channel", "Denmark"]] will receive events for new messages

sent to that channel while the user is subscribed to that

channel. The client will not receive any message events at all

if the user is not subscribed to "Denmark".

Newly created bot users are not usually subscribed to any

channels, so bots using this API need to be

subscribed to any channels whose messages

you’d like them to process using this endpoint.

See the all_public_streams parameter for how to process all

public channel messages in an organization.

Changes: See changes section

of search/narrow filter documentation.

Trait Implementations§

Source§

impl Clone for Request

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 Request

Source§

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

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

impl Default for Request

Source§

fn default() -> Self

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

impl<'de> Deserialize<'de> for Request

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 Eq for Request

Source§

impl PartialEq for Request

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 Request

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 Request

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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, 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