pub struct CreateBlock {
pub sheet_idx: usize,
pub id: usize,
pub master_row: usize,
pub master_col: usize,
pub row_cnt: usize,
pub col_cnt: usize,
pub owner: Option<String>,
pub modify_policy: Option<ModifyPolicy>,
pub permissions: Option<BlockPermissions>,
pub description: Option<String>,
pub analyzes: Option<usize>,
pub pivot: Option<PivotSpecParts>,
}Expand description
Create a new block.
Note that the block id is assigned by you and must be unused on the sheet
(see Workbook::get_available_block_id); an id already in use rejects the
transaction. master_row/master_col is the top-left corner and must be
an ordinary cell, not inside another block.
owner, modify_policy, permissions and description are metadata the
host uses to gate write access at runtime — ask
Workbook::may_modify_block rather than reading them apart. The engine
does not enforce them itself: a payload carries no trace of who prompted
it, so only the host knows whether an edit came from a person or a craft.
Fields§
§sheet_idx: usize§id: usize§master_row: usize§master_col: usize§row_cnt: usize§col_cnt: usize§owner: Option<String>§modify_policy: Option<ModifyPolicy>§permissions: Option<BlockPermissions>Per-operation overrides of modify_policy. Omitted, the single policy
governs every operation.
description: Option<String>What the block is for, in prose, for an AI or a person reading the sheet later. A craft creating a block should say what it is for here.
analyzes: Option<usize>Which block this one analyses, when it is an analysis block. Set here
rather than in a follow-up payload so the block is never briefly a
stray table — the whole creation lands as one transaction, and a reader
between two payloads never sees a total row it would mistake for a
record. See design/block-analysis.md.
pivot: Option<PivotSpecParts>When the block is a PIVOT, the recipe its cells and its shape derive
from. Requires analyzes: a pivot with no source is refused, because
every cell of it would aggregate nothing. See design/block-pivot.md.
Trait Implementations§
Source§impl Clone for CreateBlock
impl Clone for CreateBlock
Source§fn clone(&self) -> CreateBlock
fn clone(&self) -> CreateBlock
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CreateBlock
impl Debug for CreateBlock
Source§impl<'de> Deserialize<'de> for CreateBlock
impl<'de> Deserialize<'de> for CreateBlock
Source§fn deserialize<D>(
deserializer: D,
) -> Result<CreateBlock, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<CreateBlock, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Source§impl From<CreateBlock> for EditPayload
impl From<CreateBlock> for EditPayload
Source§fn from(value: CreateBlock) -> EditPayload
fn from(value: CreateBlock) -> EditPayload
Source§impl From<_GentsDummyCreateBlock> for CreateBlock
impl From<_GentsDummyCreateBlock> for CreateBlock
Source§fn from(value: _GentsDummyCreateBlock) -> CreateBlock
fn from(value: _GentsDummyCreateBlock) -> CreateBlock
impl Payload for CreateBlock
Source§impl Serialize for CreateBlock
impl Serialize for CreateBlock
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,
Auto Trait Implementations§
impl Freeze for CreateBlock
impl RefUnwindSafe for CreateBlock
impl Send for CreateBlock
impl Sync for CreateBlock
impl Unpin for CreateBlock
impl UnsafeUnpin for CreateBlock
impl UnwindSafe for CreateBlock
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
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<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> ⓘ
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> ⓘ
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,
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>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
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
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.