pub struct ClientConfig {
pub endpoint: String,
pub token: Option<String>,
pub namespace: Option<String>,
pub pool_name: Option<String>,
pub encoding: EncodingKind,
pub transport: TransportKind,
pub headers: Option<HashMap<String, String>>,
pub max_input_size: Option<usize>,
pub disable_metadata_lookup: bool,
}Expand description
Connection settings resolved by Client::new the same way RivetKit for
TypeScript resolves createClient options.
Fields§
§endpoint: StringRivet Engine endpoint. Supports URL auth for the namespace and token
(https://namespace:token@api.rivet.dev); the credentials are stripped
from the endpoint before use.
token: Option<String>Token sent with every request. Falls back to RIVET_TOKEN, then to
default for an engine on this machine. A remote endpoint without a
token connects unauthenticated.
namespace: Option<String>Falls back to RIVET_NAMESPACE, then default.
pool_name: Option<String>Node pool that get_or_create and create place new actors in. Falls
back to RIVET_POOL, then default.
encoding: EncodingKind§transport: TransportKind§headers: Option<HashMap<String, String>>§max_input_size: Option<usize>§disable_metadata_lookup: boolImplementations§
Source§impl ClientConfig
impl ClientConfig
pub fn new(endpoint: impl Into<String>) -> Self
pub fn token(self, token: impl Into<String>) -> Self
pub fn token_opt(self, token: Option<String>) -> Self
pub fn namespace(self, namespace: impl Into<String>) -> Self
pub fn pool_name(self, pool_name: impl Into<String>) -> Self
pub fn encoding(self, encoding: EncodingKind) -> Self
pub fn transport(self, transport: TransportKind) -> Self
pub fn header(self, key: impl Into<String>, value: impl Into<String>) -> Self
pub fn headers(self, headers: HashMap<String, String>) -> Self
pub fn max_input_size(self, max_input_size: usize) -> Self
pub fn disable_metadata_lookup(self, disable: bool) -> Self
Auto Trait Implementations§
impl Forget for ClientConfig
impl Freeze for ClientConfig
impl Move for ClientConfig
impl RefUnwindSafe for ClientConfig
impl Send for ClientConfig
impl Sync for ClientConfig
impl Unpin for ClientConfig
impl UnsafeUnpin for ClientConfig
impl UnwindSafe for ClientConfig
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