pub struct AdContextBuilder { /* private fields */ }Expand description
Implementations§
Source§impl AdContextBuilder
impl AdContextBuilder
Sourcepub fn new() -> Self
pub fn new() -> Self
Create an empty builder.
§Examples
use tenferro_ad::AdContextBuilder;
let _builder = AdContextBuilder::new();Sourcepub fn with_extension_rules(self, rules: ExtensionRuleSet) -> Self
pub fn with_extension_rules(self, rules: ExtensionRuleSet) -> Self
Include an owned extension rule set.
§Examples
use tenferro_ad::{AdContext, extension::ExtensionRuleSet};
let _ad = AdContext::builder()
.with_extension_rules(ExtensionRuleSet::new())
.build()
.unwrap();Sourcepub fn build(self) -> Result<AdContext, ExtensionRegistryError>
pub fn build(self) -> Result<AdContext, ExtensionRegistryError>
Build the context.
Duplicate extension family registrations are rejected.
§Examples
use tenferro_ad::AdContext;
let ad = AdContext::builder().build().unwrap();
assert!(ad.extension_rules().lookup_rule("example.missing.v1").is_none());Trait Implementations§
Source§impl Clone for AdContextBuilder
impl Clone for AdContextBuilder
Source§fn clone(&self) -> AdContextBuilder
fn clone(&self) -> AdContextBuilder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AdContextBuilder
impl Debug for AdContextBuilder
Source§impl Default for AdContextBuilder
impl Default for AdContextBuilder
Source§fn default() -> AdContextBuilder
fn default() -> AdContextBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for AdContextBuilder
impl !RefUnwindSafe for AdContextBuilder
impl Send for AdContextBuilder
impl Sync for AdContextBuilder
impl Unpin for AdContextBuilder
impl UnsafeUnpin for AdContextBuilder
impl !UnwindSafe for AdContextBuilder
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
fn rand<T>(&self, rng: &mut (impl Rng + ?Sized)) -> Twhere
Self: Distribution<T>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more