pub struct Form {
pub settings: FormSettings,
pub pages: Vec<Page>,
}Expand description
One built form. Serialized as the snippet data JSON.
Fields§
§settings: FormSettings§pages: Vec<Page>Implementations§
Source§impl Form
impl Form
Sourcepub fn sanitize_rich_text(&mut self)
pub fn sanitize_rich_text(&mut self)
Sanitize the HTML of every rich-text field in place, with the same policy Markdown and rich-text blocks use. Applied to what is stored and to what the builder is handed, so no admin surface receives raw author HTML; the public render sanitizes again on its own.
Sourcepub fn fields(&self) -> impl Iterator<Item = &Field>
pub fn fields(&self) -> impl Iterator<Item = &Field>
Iterate every field across all pages/sections/rows/columns, in document order.
Sourcepub fn value_keys(&self) -> Vec<String>
pub fn value_keys(&self) -> Vec<String>
Ordered list of submission keys for value-collecting fields — the column order for the submissions table / CSV.
Sourcepub fn field_by_key(&self, key: &str) -> Option<&Field>
pub fn field_by_key(&self, key: &str) -> Option<&Field>
Find a value-collecting field by its key.
pub fn page_count(&self) -> usize
pub fn field_count(&self) -> usize
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Form
impl<'de> Deserialize<'de> for Form
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Form
Auto Trait Implementations§
impl Freeze for Form
impl RefUnwindSafe for Form
impl Send for Form
impl Sync for Form
impl Unpin for Form
impl UnsafeUnpin for Form
impl UnwindSafe for Form
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
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> ⓘ
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 moreCreates a shared type from an unshared type.