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
See: Apn::builder.
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>
impl<'a> Builder<'a>
const fn new() -> Self
pub const fn profile(&mut self, profile: u8) -> &mut 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
profile() insteadpub const fn pdp_type(&mut self, pdp_type: PdpType) -> &mut Self
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
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
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
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
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<()>
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.