pub struct Draft<S: BosStr = DefaultStr> {
pub device_id: Option<S>,
pub device_name: Option<S>,
pub langs: Option<Vec<Language>>,
pub postgate_embedding_rules: Option<Vec<DisableRule<S>>>,
pub posts: Vec<DraftPost<S>>,
pub threadgate_allow: Option<Vec<DraftThreadgateAllowItem<S>>>,
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}Expand description
A draft containing an array of draft posts.
Fields§
§device_id: Option<S>UUIDv4 identifier of the device that created this draft.
device_name: Option<S>The device and/or platform on which the draft was created.
langs: Option<Vec<Language>>Indicates human language of posts primary text content.
postgate_embedding_rules: Option<Vec<DisableRule<S>>>Embedding rules for the postgates to be created when this draft is published.
posts: Vec<DraftPost<S>>Array of draft posts that compose this draft.
threadgate_allow: Option<Vec<DraftThreadgateAllowItem<S>>>Allow-rules for the threadgate to be created when this draft is published.
extra_data: Option<BTreeMap<SmolStr, Data<S>>>Implementations§
Source§impl Draft<DefaultStr>
impl Draft<DefaultStr>
Sourcepub fn new() -> DraftBuilder<Empty, DefaultStr>
pub fn new() -> DraftBuilder<Empty, DefaultStr>
Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed
Trait Implementations§
Source§impl<'de, S> Deserialize<'de> for Draft<S>where
S: Deserialize<'de> + BosStr,
impl<'de, S> Deserialize<'de> for Draft<S>where
S: Deserialize<'de> + BosStr,
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<S: Eq + BosStr> Eq for Draft<S>
Source§impl<S: BosStr + IntoStatic> IntoStatic for Draft<S>
impl<S: BosStr + IntoStatic> IntoStatic for Draft<S>
Source§impl<S: BosStr> LexiconSchema for Draft<S>
impl<S: BosStr> LexiconSchema for Draft<S>
Source§fn lexicon_doc() -> LexiconDoc<'static>
fn lexicon_doc() -> LexiconDoc<'static>
Generate the lexicon document for this type Read more
Source§fn validate(&self) -> Result<(), ConstraintError>
fn validate(&self) -> Result<(), ConstraintError>
Validate an instance against lexicon constraints Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether this type should be inlined vs referenced Read more
impl<S: BosStr> StructuralPartialEq for Draft<S>
Auto Trait Implementations§
impl<S> Freeze for Draft<S>where
S: Freeze,
impl<S> RefUnwindSafe for Draft<S>where
S: RefUnwindSafe,
impl<S> Send for Draft<S>where
S: Send,
impl<S> Sync for Draft<S>where
S: Sync,
impl<S> Unpin for Draft<S>where
S: Unpin,
impl<S> UnsafeUnpin for Draft<S>where
S: UnsafeUnpin,
impl<S> UnwindSafe for Draft<S>where
S: UnwindSafe + RefUnwindSafe,
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§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.