pub struct CliOAuthBuilder { /* private fields */ }
Expand description

A builder for CliOAuth structs.

Not constructed directly. See CliOAuth::builder().

Implementations§

source§

impl CliOAuthBuilder

source

pub fn port(self, port: u16) -> Self

Configures a single port for the web server to attempt to bind to.

For simplicity, must be a non-privileged port (greater than or equal to 1024).

source

pub fn port_range(self, ports: Range<u16>) -> Self

Configures a range of ports for the web server to attempt to bind to.

When the CliOAuth instance is constructed, each of these ports will be tried in order. The first open one will be used.

The default range is 3456..3465.

source

pub fn ip_address(self, ip_address: impl Into<IpAddr>) -> Self

Configures the local IP address for the web server to listen on.

Address must be valid on the system. The default is “localhost” (127.0.0.1), which works fine in most cases.

source

pub fn socket_address(self, address: SocketAddr) -> Self

Configures a socket address (IP address and port) for the web server to listen on.

If provided, it overrides the ip_address, port, and port_range settings.

source

pub fn timeout(self, timeout: u64) -> Self

Configures the number of seconds the server will wait for an authorization code.

If the server has not received a request containing a valid authorization code, it will shut itself down, and the token exchange will not be possible.

The default is 60 seconds.

source

pub fn scope(self, scope: Scope) -> Self

Adds a scope to include with the authorization request.

source

pub fn scopes<S>(self, scopes: S) -> Selfwhere S: IntoIterator<Item = Scope>,

Adds scopes to include with the authorization request.

source

pub fn build(self) -> ConfigResult<CliOAuth>

Constructs the CliOAuth instance with the configuration captured in this builder.

Trait Implementations§

source§

impl Debug for CliOAuthBuilder

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more