#[non_exhaustive]pub struct PolicyDefinition {
pub version: String,
pub translations: BTreeMap<String, PolicyTranslation>,
}Available on crate feature
api and (crate features client-api-c or client-api-s) and (crate features client or server) only.Expand description
The definition of a policy document.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.version: StringThe version of this policy document.
translations: BTreeMap<String, PolicyTranslation>Map from language codes to details of the document in that language.
Language codes SHOULD be formatted as per Section 2.2 of RFC 5646, though some implementations may use an underscore instead of dash (for example, en_US instead of en-US).
Implementations§
Source§impl PolicyDefinition
impl PolicyDefinition
Sourcepub fn new(
version: String,
translations: BTreeMap<String, PolicyTranslation>,
) -> PolicyDefinition
pub fn new( version: String, translations: BTreeMap<String, PolicyTranslation>, ) -> PolicyDefinition
Construct a new PolicyDefinition with the given version and translations.
Trait Implementations§
Source§impl Clone for PolicyDefinition
impl Clone for PolicyDefinition
Source§fn clone(&self) -> PolicyDefinition
fn clone(&self) -> PolicyDefinition
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 PolicyDefinition
impl Debug for PolicyDefinition
Source§impl<'de> Deserialize<'de> for PolicyDefinition
impl<'de> Deserialize<'de> for PolicyDefinition
Source§fn deserialize<D>(
deserializer: D,
) -> Result<PolicyDefinition, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<PolicyDefinition, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for PolicyDefinition
impl Serialize for PolicyDefinition
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for PolicyDefinition
impl RefUnwindSafe for PolicyDefinition
impl Send for PolicyDefinition
impl Sync for PolicyDefinition
impl Unpin for PolicyDefinition
impl UnwindSafe for PolicyDefinition
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