AuthRequiredFields

Trait AuthRequiredFields 

Source
pub trait AuthRequiredFields: Sized + PartialEq {
    // Provided methods
    fn auth_required_fields() -> Vec<Self> { ... }
    fn auth_required(&self) -> bool { ... }
}
Expand description

A trait to identify which fields in an enum require user authentication.

Provided Methods§

Source

fn auth_required_fields() -> Vec<Self>

Returns a vector of enum variants that require authentication.

By default, this returns an empty vector, assuming most fields are public. This method should be overridden for enums that have protected fields.

Source

fn auth_required(&self) -> bool

Checks if a specific field instance requires authentication.

Returns true if self is present in the list of authentication-required fields.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§