Skip to main content

SendTextOptions

Struct SendTextOptions 

Source
#[non_exhaustive]
pub struct SendTextOptions { pub topic: String, pub attributes: HashMap<String, String>, pub destination_identities: Vec<ParticipantIdentity>, pub id: Option<String>, pub operation_type: Option<OperationType>, pub version: Option<i32>, pub reply_to_stream_id: Option<String>, pub attached_stream_ids: Vec<String>, pub generated: Option<bool>, pub sender_identity: Option<ParticipantIdentity>, pub compress: Option<bool>, pub on_progress: Option<StreamProgressCallback>, }
Expand description

Options for send_text. Progress is reported once after the complete send is acknowledged.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§topic: String

Topic the stream is published to.

§attributes: HashMap<String, String>

Attributes attached to the stream.

§destination_identities: Vec<ParticipantIdentity>

Recipients; an empty list delivers to all participants.

§id: Option<String>

Explicit stream id, or a new UUID per call when unspecified.

§operation_type: Option<OperationType>

Operation this text stream represents.

§version: Option<i32>

Version used to order updates to the same content.

§reply_to_stream_id: Option<String>

Id of the stream this text replies to.

§attached_stream_ids: Vec<String>

Ids of streams attached to this text.

§generated: Option<bool>

Whether the text was machine-generated.

§sender_identity: Option<ParticipantIdentity>

Identity attributed to the packets, or the sending participant when unspecified. Impersonating another identity requires the appropriate permission (e.g. agents).

§compress: Option<bool>

Whether to deflate-raw compress when all recipients support it. Defaults to true.

§on_progress: Option<StreamProgressCallback>

Reports payload byte length once after the complete send is acknowledged.

Implementations§

Source§

impl SendTextOptions

Source

pub fn new_with_topic(topic: impl Into<String>) -> Self

Creates options for the given topic. Use the with_* setters to customize them.

Source

pub fn with_topic(self, topic: impl Into<String>) -> Self

Sets the topic the stream is published to, accepting any value convertible to String.

Source

pub fn with_attributes(self, attributes: HashMap<String, String>) -> Self

Replaces all attributes attached to the stream.

Source

pub fn with_attribute( self, key: impl Into<String>, value: impl Into<String>, ) -> Self

Adds a single attribute to the stream, overwriting any existing value for key.

Source

pub fn with_destination_identities( self, destination_identities: Vec<ParticipantIdentity>, ) -> Self

Replaces the set of participant identities the stream is delivered to. An empty list delivers to all participants in the room.

Source

pub fn with_destination_identity( self, identity: impl Into<ParticipantIdentity>, ) -> Self

Adds a single participant identity to the stream’s destinations.

Source

pub fn with_id(self, id: impl Into<String>) -> Self

Sets an explicit stream id. If unset, a new uuid is generated per call.

Source

pub fn with_sender_identity( self, identity: impl Into<ParticipantIdentity>, ) -> Self

Sets the identity the stream’s packets are attributed to. Only participants with the appropriate permission (e.g. agents) may impersonate another identity.

Source

pub fn with_operation_type(self, operation_type: OperationType) -> Self

Sets the operation this text stream represents (e.g. create or update).

Source

pub fn with_version(self, version: i32) -> Self

Sets the version of the text, used to order updates to the same content.

Source

pub fn with_reply_to_stream_id( self, reply_to_stream_id: impl Into<String>, ) -> Self

Sets the id of the stream this text is a reply to.

Source

pub fn with_attached_stream_ids(self, attached_stream_ids: Vec<String>) -> Self

Replaces the set of stream ids attached to this text (e.g. referenced files).

Source

pub fn with_attached_stream_id( self, attached_stream_id: impl Into<String>, ) -> Self

Adds a single attached stream id to this text.

Source

pub fn with_generated(self, generated: bool) -> Self

Sets whether the text was machine-generated (e.g. by an agent).

Source

pub fn with_compress(self, compress: bool) -> Self

Sets whether to deflate-raw compress when all recipients support it. Defaults to true (compression opt-out).

Source

pub fn with_on_progress( self, callback: impl Fn(StreamProgress) + Send + Sync + 'static, ) -> Self

Sets the progress callback; see Self::on_progress for reporting semantics.

Trait Implementations§

Source§

impl Clone for SendTextOptions

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 SendTextOptions

Source§

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

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

impl Eq for SendTextOptions

Source§

impl PartialEq for SendTextOptions

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 StructuralPartialEq for SendTextOptions

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<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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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