pub struct ClientIdentity { /* private fields */ }Expand description
Application identity sent with Inline HTTP and realtime requests.
Use ClientIdentity::sdk() for low-level SDK callers, or pass your own
application-specific type such as cli, matrix-bridge, or agent.
Implementations§
Source§impl ClientIdentity
impl ClientIdentity
Sourcepub fn new(
client_type: impl Into<String>,
client_version: impl Into<String>,
) -> ClientIdentity
pub fn new( client_type: impl Into<String>, client_version: impl Into<String>, ) -> ClientIdentity
Creates a client identity and panics if the values are invalid.
This is intended for static or already-validated values. Use
ClientIdentity::try_new when accepting user or config input.
§Panics
Panics when either field is empty after trimming or cannot be represented as an HTTP header value.
Sourcepub fn try_new(
client_type: impl Into<String>,
client_version: impl Into<String>,
) -> Result<ClientIdentity, ClientIdentityError>
pub fn try_new( client_type: impl Into<String>, client_version: impl Into<String>, ) -> Result<ClientIdentity, ClientIdentityError>
Creates a client identity after trimming and validating header values.
Sourcepub fn sdk() -> ClientIdentity
pub fn sdk() -> ClientIdentity
Returns the default SDK identity for this crate version.
Sourcepub fn client_type(&self) -> &str
pub fn client_type(&self) -> &str
Returns the Inline client type, such as rust-sdk or cli.
Sourcepub fn client_version(&self) -> &str
pub fn client_version(&self) -> &str
Returns the application version sent to Inline.
Trait Implementations§
Source§impl Clone for ClientIdentity
impl Clone for ClientIdentity
Source§fn clone(&self) -> ClientIdentity
fn clone(&self) -> ClientIdentity
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ClientIdentity
impl Debug for ClientIdentity
Source§impl Default for ClientIdentity
impl Default for ClientIdentity
impl Eq for ClientIdentity
Source§impl PartialEq for ClientIdentity
impl PartialEq for ClientIdentity
Source§fn eq(&self, other: &ClientIdentity) -> bool
fn eq(&self, other: &ClientIdentity) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ClientIdentity
Auto Trait Implementations§
impl Freeze for ClientIdentity
impl RefUnwindSafe for ClientIdentity
impl Send for ClientIdentity
impl Sync for ClientIdentity
impl Unpin for ClientIdentity
impl UnsafeUnpin for ClientIdentity
impl UnwindSafe for ClientIdentity
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more