Builder

Struct Builder 

pub struct Builder<'a> {
    profile: u8,
    pdp_type: PdpType,
    auth_proto: AuthProto,
    apn_name: Option<&'a str>,
    username: Option<&'a str>,
    password: Option<&'a str>,
}
Expand description

Fields§

§profile: u8§pdp_type: PdpType§auth_proto: AuthProto§apn_name: Option<&'a str>§username: Option<&'a str>§password: Option<&'a str>

Implementations§

§

impl<'a> Builder<'a>

const fn new() -> Self

pub const fn profile(&mut self, profile: u8) -> &mut Self

Sets the profile index for the APN configuration.

The default profile is 0.

pub const fn profile_idx(&mut self, profile_idx: u8) -> &mut Self

👎Deprecated since 1.1.0: Use profile() instead

pub const fn pdp_type(&mut self, pdp_type: PdpType) -> &mut Self

Sets the PDP type for the APN configuration.

The default PDP type is PdpType::IPV4.

pub const fn auth_proto(&mut self, auth_proto: AuthProto) -> &mut Self

Sets the authentication protocol for the APN configuration.

The default authentication protocol is AuthProto::DEFAULT.

pub const fn apn_name(&mut self, apn_name: &'a str) -> &mut Self

Sets the APN name for the APN configuration.

Defaults to None, which means the APN name will not be set.

pub const fn username(&mut self, username: &'a str) -> &mut Self

Sets the username for the APN configuration.

Defaults to None, which means the username will not be set.

pub const fn password(&mut self, password: &'a str) -> &mut Self

Sets the password for the APN configuration.

Defaults to None, which means the password will not be set.

pub fn build_into(&self, apn: &mut Apn) -> Result<()>

Builds the APN configuration into the given Apn struct.

Since the Apn struct is quite large, this method allows you to reuse an existing Apn struct instead of allocating a new one.

pub fn build(&self) -> Result<Box<Apn>>

Builds the APN configuration.

Auto Trait Implementations§

§

impl<'a> Freeze for Builder<'a>

§

impl<'a> RefUnwindSafe for Builder<'a>

§

impl<'a> Send for Builder<'a>

§

impl<'a> Sync for Builder<'a>

§

impl<'a> Unpin for Builder<'a>

§

impl<'a> UnwindSafe for Builder<'a>

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where 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.

§

impl<T> Instrument for T

§

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

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

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 T
where 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

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 T
where U: TryFrom<T>,

Source§

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<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

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