pub struct ClientOptions {
pub transport: Arc<dyn Transport>,
pub server_id: Option<String>,
pub token_source: Option<Arc<dyn ServerTokenSource>>,
pub refresh_threshold: Duration,
}Expand description
How to build a RedseatClient.
Fields§
§transport: Arc<dyn Transport>How to reach the server.
server_id: Option<String>The server, for token refresh. Without it (or without token_source), the
client uses the token given with RedseatClient::set_token until it is refused.
token_source: Option<Arc<dyn ServerTokenSource>>§refresh_threshold: DurationHow long before expiry the token is refreshed.
Implementations§
Source§impl ClientOptions
impl ClientOptions
pub fn new(transport: Arc<dyn Transport>) -> Self
Sourcepub fn with_token_source(
self,
server_id: impl Into<String>,
source: Arc<dyn ServerTokenSource>,
) -> Self
pub fn with_token_source( self, server_id: impl Into<String>, source: Arc<dyn ServerTokenSource>, ) -> Self
Refresh tokens of server_id with source.
Auto Trait Implementations§
impl !RefUnwindSafe for ClientOptions
impl !UnwindSafe for ClientOptions
impl Forget for ClientOptions
impl Freeze for ClientOptionswhere
*const ArcInner<dyn Transport> is !null: Freeze,
PhantomData<ArcInner<dyn Transport>>: Freeze,
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
*const ArcInner<dyn ServerTokenSource> is !null: Freeze,
PhantomData<ArcInner<dyn ServerTokenSource>>: Freeze,
impl Move for ClientOptions
impl Send for ClientOptions
impl Sync for ClientOptions
impl Unpin for ClientOptions
impl UnsafeUnpin for ClientOptionswhere
*const ArcInner<dyn Transport> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn Transport>>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
*const ArcInner<dyn ServerTokenSource> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn ServerTokenSource>>: UnsafeUnpin,
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