pub struct BlockPermissions {
pub insert_delete_lines: Option<ModifyPolicy>,
pub remove_block: Option<ModifyPolicy>,
pub modify_schema: Option<ModifyPolicy>,
pub cell_input: Option<ModifyPolicy>,
pub sort_by_field: Option<ModifyPolicy>,
pub modify_description: Option<ModifyPolicy>,
pub override_validation: Option<ModifyPolicy>,
}Expand description
Per-operation overrides of a block’s ModifyPolicy.
None on an operation defers to the block’s own modify_policy, so a
block that says nothing here behaves exactly as it did when one policy
governed everything — which is what every block in a file written before
this existed says.
Fields§
§insert_delete_lines: Option<ModifyPolicy>§remove_block: Option<ModifyPolicy>§modify_schema: Option<ModifyPolicy>§cell_input: Option<ModifyPolicy>§sort_by_field: Option<ModifyPolicy>§modify_description: Option<ModifyPolicy>§override_validation: Option<ModifyPolicy>Implementations§
Source§impl BlockPermissions
impl BlockPermissions
Sourcepub fn policy_for(&self, op: BlockOp, fallback: ModifyPolicy) -> ModifyPolicy
pub fn policy_for(&self, op: BlockOp, fallback: ModifyPolicy) -> ModifyPolicy
The policy for one operation, or fallback when this block does not
single that operation out.
pub fn set(&mut self, op: BlockOp, policy: Option<ModifyPolicy>)
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
true when nothing is singled out, i.e. the block is governed by its
single policy alone. Lets the writer omit the attributes entirely.
Sourcepub fn explicit(&self, op: BlockOp) -> Option<ModifyPolicy>
pub fn explicit(&self, op: BlockOp) -> Option<ModifyPolicy>
The policy stated for op, if this block states one.
Trait Implementations§
Source§impl Clone for BlockPermissions
impl Clone for BlockPermissions
Source§fn clone(&self) -> BlockPermissions
fn clone(&self) -> BlockPermissions
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 BlockPermissions
impl Debug for BlockPermissions
Source§impl Default for BlockPermissions
impl Default for BlockPermissions
Source§fn default() -> BlockPermissions
fn default() -> BlockPermissions
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for BlockPermissions
impl<'de> Deserialize<'de> for BlockPermissions
Source§fn deserialize<D>(
deserializer: D,
) -> Result<BlockPermissions, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<BlockPermissions, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for BlockPermissions
Source§impl From<_GentsDummyBlockPermissions> for BlockPermissions
impl From<_GentsDummyBlockPermissions> for BlockPermissions
Source§fn from(value: _GentsDummyBlockPermissions) -> BlockPermissions
fn from(value: _GentsDummyBlockPermissions) -> BlockPermissions
Converts to this type from the input type.
Source§impl PartialEq for BlockPermissions
impl PartialEq for BlockPermissions
Source§impl Serialize for BlockPermissions
impl Serialize for BlockPermissions
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
impl StructuralPartialEq for BlockPermissions
Auto Trait Implementations§
impl Freeze for BlockPermissions
impl RefUnwindSafe for BlockPermissions
impl Send for BlockPermissions
impl Sync for BlockPermissions
impl Unpin for BlockPermissions
impl UnsafeUnpin for BlockPermissions
impl UnwindSafe for BlockPermissions
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreimpl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
impl<T> Scalar for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.