pub struct StreamByteOptions {
pub topic: String,
pub attributes: HashMap<String, String>,
pub destination_identities: Vec<ParticipantIdentity>,
pub id: Option<String>,
pub mime_type: Option<String>,
pub name: Option<String>,
pub total_length: Option<u64>,
pub compress: Option<bool>,
pub sender_identity: Option<ParticipantIdentity>,
}Expand description
Options used when opening an outgoing byte data stream.
Fields§
§topic: String§attributes: HashMap<String, String>§destination_identities: Vec<ParticipantIdentity>§id: Option<String>The id associated with the stream. If unspecified, a new uuid will be created and used per call.
mime_type: Option<String>§name: Option<String>§total_length: Option<u64>§compress: Option<bool>Whether to deflate-raw compress the payload when all recipients support it.
Defaults to true (compression opt-out). Ignored by the incremental stream_bytes.
sender_identity: Option<ParticipantIdentity>The identity the stream’s packets are attributed to. If unspecified, the packets carry no explicit identity and the server attributes them to the sending participant. Only participants with the appropriate permission (e.g. agents) may impersonate another identity.
Implementations§
Source§impl StreamByteOptions
impl StreamByteOptions
pub fn new_with_topic(topic: impl Into<String>) -> Self
Sourcepub fn with_topic(self, topic: String) -> Self
pub fn with_topic(self, topic: String) -> Self
Sets the topic the stream is published to.
Sourcepub fn with_attributes(self, attributes: HashMap<String, String>) -> Self
pub fn with_attributes(self, attributes: HashMap<String, String>) -> Self
Replaces all attributes attached to the stream.
Sourcepub fn with_attribute(
self,
key: impl Into<String>,
value: impl Into<String>,
) -> Self
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.
Sourcepub fn with_destination_identities(
self,
destination_identities: Vec<ParticipantIdentity>,
) -> Self
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.
Sourcepub fn with_destination_identity(
self,
identity: impl Into<ParticipantIdentity>,
) -> Self
pub fn with_destination_identity( self, identity: impl Into<ParticipantIdentity>, ) -> Self
Adds a single participant identity to the stream’s destinations.
Sourcepub fn with_id(self, id: impl Into<String>) -> Self
pub fn with_id(self, id: impl Into<String>) -> Self
Sets an explicit stream id. If unset, a new uuid is generated per call.
Sourcepub fn with_mime_type(self, mime_type: impl Into<String>) -> Self
pub fn with_mime_type(self, mime_type: impl Into<String>) -> Self
Sets the MIME type describing the stream’s payload.
Sourcepub fn with_name(self, name: impl Into<String>) -> Self
pub fn with_name(self, name: impl Into<String>) -> Self
Sets a human-readable name for the stream (e.g. a file name).
Sourcepub fn with_total_length(self, total_length: u64) -> Self
pub fn with_total_length(self, total_length: u64) -> Self
Sets the total byte length of the payload, when known ahead of time.
Sourcepub fn with_compress(self, compress: bool) -> Self
pub fn with_compress(self, compress: bool) -> Self
Sets whether to deflate-raw compress the payload when all recipients support it.
Defaults to true (compression opt-out).
Sourcepub fn with_sender_identity(
self,
identity: impl Into<ParticipantIdentity>,
) -> Self
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.
Trait Implementations§
Source§impl Clone for StreamByteOptions
impl Clone for StreamByteOptions
Source§fn clone(&self) -> StreamByteOptions
fn clone(&self) -> StreamByteOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more