pub struct LicenseCheckedGuard<G: Guard> { /* private fields */ }Expand description
Wrapper for a guard that performs license checks.
This wrapper validates the license before each guard check, returning an error if the required feature is not licensed.
Implementations§
Source§impl<G: Guard> LicenseCheckedGuard<G>
impl<G: Guard> LicenseCheckedGuard<G>
Sourcepub fn new(
inner: G,
feature_name: impl Into<String>,
tier_name: impl Into<String>,
validator: Arc<LicenseValidator>,
) -> Self
pub fn new( inner: G, feature_name: impl Into<String>, tier_name: impl Into<String>, validator: Arc<LicenseValidator>, ) -> Self
Creates a new license-checked guard wrapper.
Sourcepub fn feature_name(&self) -> &str
pub fn feature_name(&self) -> &str
Returns the feature name.
Sourcepub async fn validate_license(&self) -> LicensedGuardResult<()>
pub async fn validate_license(&self) -> LicensedGuardResult<()>
Validates the license for this guard.
Trait Implementations§
Source§impl<G: Guard> Guard for LicenseCheckedGuard<G>
impl<G: Guard> Guard for LicenseCheckedGuard<G>
Source§fn check(&self, content: &str) -> GuardCheckResult
fn check(&self, content: &str) -> GuardCheckResult
Check content against this guard
Source§fn action(&self) -> GuardAction
fn action(&self) -> GuardAction
Get the action this guard takes on failure
Source§fn severity_threshold(&self) -> Severity
fn severity_threshold(&self) -> Severity
Get the minimum severity that triggers this guard
Source§impl<G: Guard> LicensedGuard for LicenseCheckedGuard<G>
impl<G: Guard> LicensedGuard for LicenseCheckedGuard<G>
Source§fn required_feature(&self) -> &str
fn required_feature(&self) -> &str
Returns the feature required to use this guard.
Source§fn required_tier(&self) -> &str
fn required_tier(&self) -> &str
Returns the license tier required for this guard.
Source§fn is_community(&self) -> bool
fn is_community(&self) -> bool
Returns true if this guard is available in the Community tier.
Auto Trait Implementations§
impl<G> Freeze for LicenseCheckedGuard<G>where
G: Freeze,
impl<G> !RefUnwindSafe for LicenseCheckedGuard<G>
impl<G> Send for LicenseCheckedGuard<G>
impl<G> Sync for LicenseCheckedGuard<G>
impl<G> Unpin for LicenseCheckedGuard<G>where
G: Unpin,
impl<G> !UnwindSafe for LicenseCheckedGuard<G>
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<G> InstrumentGuard for Gwhere
G: Guard,
impl<G> InstrumentGuard for Gwhere
G: Guard,
Source§fn instrumented(self) -> InstrumentedGuard<Self>
fn instrumented(self) -> InstrumentedGuard<Self>
Wrap this guard with metrics instrumentation
Source§fn instrumented_with(
self,
collector: Arc<GuardMetricsCollector>,
) -> InstrumentedGuard<Self>
fn instrumented_with( self, collector: Arc<GuardMetricsCollector>, ) -> InstrumentedGuard<Self>
Wrap this guard with a specific collector