Skip to main content

Layer

Struct Layer 

Source
pub struct Layer {
    pub allowed: Option<Vec<String>>,
    pub mode: Option<Mode>,
    pub denied: Option<Vec<String>>,
    pub user_may_extend: Option<bool>,
    pub confirm_each_write_back: Option<bool>,
    pub notify: Option<Notify>,
}
Expand description

One layer’s contribution. Every field is optional, and None means the layer says nothing about it rather than saying no.

Fields§

§allowed: Option<Vec<String>>

Extensions this layer permits.

§mode: Option<Mode>

Whether allowed stands alone or adds. Defaults to Mode::Replace deliberately. Concept 10 names the silent hole: an administrator who writes a list expecting it to be exhaustive and gets it unioned with the defaults has permitted things they never listed, and never finds out. Appending is the surprising reading, so it is the one that has to be asked for.

§denied: Option<Vec<String>>

Extensions this layer refuses. Always wins, everywhere.

§user_may_extend: Option<bool>

Whether the user’s own configuration is honoured at all. Only a policy layer setting this to false has any effect, and what it suppresses is Origin::Configuration — not another policy layer, which is administered too.

§confirm_each_write_back: Option<bool>

Whether every write-back is confirmed, rather than only the session close. Concept 6.2 keeps this off by default: a repack is atomic and unremarkable, and a prompt on every save is friction for everyone who is not archiving.

§notify: Option<Notify>

How much the tool says without being asked. See Notify.

Implementations§

Source§

impl Layer

Source

pub fn says_nothing(&self) -> bool

Whether this layer sets nothing at all.

A file that parses and holds no key is a layer that exists and has no opinion, which is different from one that is not there — but not different in any way a decision can see. What it changes is whether Effective::managed should call the machine administered, and it should not: see the note there.

allowed = [] is not this. An empty list is a layer permitting nothing, which says a great deal.

Trait Implementations§

Source§

impl Clone for Layer

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Layer

Source§

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

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

impl Default for Layer

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for Layer

§

impl RefUnwindSafe for Layer

§

impl Send for Layer

§

impl Sync for Layer

§

impl Unpin for Layer

§

impl UnsafeUnpin for Layer

§

impl UnwindSafe for Layer

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> NoneValue for T
where T: Default,

Source§

type NoneType = T

Source§

fn null_value() -> T

The none-equivalent value.
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 = !

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

fn try_from(value: U) -> Result<T, !>

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> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more