pub struct HelloPayload {
pub token: Option<String>,
pub api_key: Option<String>,
pub client_name: Option<String>,
pub version: i64,
}Expand description
HELLO request payload — sent as the FIRST frame on a connection.
At least one of token / api_key should be populated when the
server has auth enabled. When the server runs in single-user mode
(auth.enabled: false), credentials are accepted-but-ignored and
the connection runs as the implicit local admin.
Fields§
§token: Option<String>Bearer JWT (same shape REST /auth/login returns).
api_key: Option<String>API key.
client_name: Option<String>User-Agent-style identifier surfaced in server-side tracing.
version: i64Wire spec protocol version; defaults to 1.
Implementations§
Source§impl HelloPayload
impl HelloPayload
Sourcepub fn new(client_name: impl Into<String>) -> Self
pub fn new(client_name: impl Into<String>) -> Self
Build a minimal HELLO payload identifying the client by name.
No credentials — works against a server running in single-user
mode (auth.enabled: false).
Sourcepub fn with_token(self, token: impl Into<String>) -> Self
pub fn with_token(self, token: impl Into<String>) -> Self
Attach a JWT bearer token. Replaces any previously set token/api_key.
Sourcepub fn with_api_key(self, api_key: impl Into<String>) -> Self
pub fn with_api_key(self, api_key: impl Into<String>) -> Self
Attach an API key. Replaces any previously set token/api_key.
Trait Implementations§
Source§impl Clone for HelloPayload
impl Clone for HelloPayload
Source§fn clone(&self) -> HelloPayload
fn clone(&self) -> HelloPayload
Returns a duplicate of the value. Read more
1.0.0 · 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 HelloPayload
impl Debug for HelloPayload
Source§impl Default for HelloPayload
impl Default for HelloPayload
Source§fn default() -> HelloPayload
fn default() -> HelloPayload
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for HelloPayload
impl RefUnwindSafe for HelloPayload
impl Send for HelloPayload
impl Sync for HelloPayload
impl Unpin for HelloPayload
impl UnsafeUnpin for HelloPayload
impl UnwindSafe for HelloPayload
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request