Skip to main content

BlockOp

Enum BlockOp 

Source
pub enum BlockOp {
    InsertDeleteLines,
    RemoveBlock,
    ModifySchema,
    CellInput,
    SortByField,
    ModifyDescription,
    OverrideValidation,
}
Expand description

The operations a block’s permissions can speak about separately.

One policy for the whole block is too blunt for the case this exists to serve: a block a craft or Watson built usually wants the user to keep typing into it while refusing to let them pull rows out from under it or re-point its schema, which would take the block out of the owner’s control for good.

Variants§

§

InsertDeleteLines

Insert or delete rows/columns inside the block.

§

RemoveBlock

Delete the whole block. Kept apart from the rest because it is the one operation there is no recovering from by editing: the records, the schema and this policy itself all go at once.

§

ModifySchema

Bind a different schema, or change the fields of the current one.

§

CellInput

Write a value into one of the block’s cells.

§

SortByField

Reorder the records by one of the fields.

§

ModifyDescription

Rewrite the prose description.

§

OverrideValidation

Write a value into a block cell that its field’s validation rule rejects.

Distinct from CellInput because the two answer different questions: CellInput is “may this actor write here at all”, this one is “may this actor write something the schema says is wrong”. A craft that maintains a table often has to seed a row it knows is incomplete — a required field it fills in on the next round — while a person typing into the same block should be held to the rule. Left at All (the default), a violating write lands and is flagged, which is what every block did before this op existed.

Implementations§

Source§

impl BlockOp

Source

pub const ALL: [BlockOp; 7]

Every operation, so a caller can render or check the whole set without having to keep its own list in step with this one.

Source

pub fn for_payload_type(payload_type: &str) -> Option<BlockOp>

Which operation a payload counts as, keyed by the payload’s wire type name (EditPayload’s type tag). None when the payload is not something a block can single out.

The mapping belongs to the engine because the engine defines the operations. Every host that enforces a policy needs it — the app, the craft runtime, Watson — and each keeping its own table is how the same payload comes to be governed differently in different hosts. A payload this returns None for is not unguarded: the caller falls back to its owner check, which is what the app already did.

Source

pub fn as_wire_str(&self) -> &'static str

Attribute name used for .xlsx persistence.

Trait Implementations§

Source§

impl Clone for BlockOp

Source§

fn clone(&self) -> BlockOp

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 Copy for BlockOp

Source§

impl Debug for BlockOp

Source§

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

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

impl<'de> Deserialize<'de> for BlockOp

Source§

fn deserialize<D>( deserializer: D, ) -> Result<BlockOp, <D as Deserializer<'de>>::Error>
where D: Deserializer<'de>,

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

impl Eq for BlockOp

Source§

impl PartialEq for BlockOp

Source§

fn eq(&self, other: &BlockOp) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for BlockOp

Source§

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
Source§

impl StructuralPartialEq for BlockOp

Source§

impl TS for BlockOp

Source§

fn _register(manager: &mut DescriptorManager, generic_base: bool) -> usize

Source§

fn _ts_name() -> String

Source§

fn _is_optional() -> bool

Source§

fn _tag() -> Option<&'static str>

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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 more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Scalar for T
where T: 'static + Clone + PartialEq + Debug,

Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

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

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

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