Struct Attribute

Source
pub struct Attribute {
    pub name: String,
    pub type_: Type,
    pub multi_valued: bool,
    pub description: String,
    pub required: bool,
    pub canonical_values: Option<Vec<String>>,
    pub case_exact: bool,
    pub mutability: Mutability,
    pub returned: Returned,
    pub uniqueness: Uniqueness,
    pub reference_types: Option<Vec<String>>,
    pub sub_attributes: Option<Vec<Attribute>>,
}
Expand description

A single attribute of a SCIM schema.

Fields§

§name: String

The name of the attribute.

§type_: Type

The data type of the attribute.

§multi_valued: bool

Whether the attribute is multi-valued.

§description: String

A human-readable description of the attribute.

§required: bool

Whether the attribute is required.

§canonical_values: Option<Vec<String>>

A list of canonical values for the attribute.

§case_exact: bool

Whether the attribute is case-sensitive.

§mutability: Mutability

The mutability of the attribute.

§returned: Returned

When the attribute is returned.

§uniqueness: Uniqueness

The uniqueness of the attribute.

§reference_types: Option<Vec<String>>

If this attribute is a reference, the types of resources it references.

§sub_attributes: Option<Vec<Attribute>>

If this attribute is a complex type, the sub-attributes that form it.

Implementations§

Source§

impl Attribute

Source

pub fn new(name: String, type_: Type) -> Self

Construct a new attribute.

Source

pub fn multi_valued(self) -> Self

Set whether the attribute is multi-valued.

Source

pub fn required(self) -> Self

Set whether the attribute is required.

Source

pub fn case_exact(self) -> Self

Set whether the attribute is case-sensitive.

Source

pub fn sub_attributes(self, sub_attributes: Vec<Attribute>) -> Self

Set the sub-attributes of this attribute.

Source

pub fn immutable(self) -> Self

Set this attribute as immutable

Source

pub fn read_only(self) -> Self

Set this attribute as read-only

Source

pub fn write_only(self) -> Self

Set this attribute as write-only

Source

pub fn always_returned(self) -> Self

Set this attribute as always returned

Source

pub fn never_returned(self) -> Self

Set this attribute as never returned

Source

pub fn returned_on_request(self) -> Self

Set this attribute as returned on request

Source

pub fn unique(self) -> Self

Set this attribute as unique on this server

Source

pub fn globally_unique(self) -> Self

Set this attribute as globally unique

Source

pub fn reference_types(self, reference_types: Vec<String>) -> Self

Set the types of resources this attribute can reference.

Trait Implementations§

Source§

impl Clone for Attribute

Source§

fn clone(&self) -> Attribute

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Attribute

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Attribute

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for Attribute

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,