pub struct Arrangement<K> {
pub key: K,
pub children: Vec<Arrangement<K>>,
}Expand description
A node’s place in a new arrangement: its key and its children, in order. It deserializes from
the JSON a drag-and-drop tree editor sends, with the key as key or id:
[{ "id": 1, "children": [{ "id": 3 }, { "id": 2, "children": [] }] }]Fields§
§key: KThe node’s key.
children: Vec<Arrangement<K>>The node’s children, in order.
Implementations§
Source§impl<K> Arrangement<K>
impl<K> Arrangement<K>
Sourcepub fn children(
self,
children: impl IntoIterator<Item = Arrangement<K>>,
) -> Self
pub fn children( self, children: impl IntoIterator<Item = Arrangement<K>>, ) -> Self
Adds children after the node’s other children.
Trait Implementations§
Source§impl<K: Clone> Clone for Arrangement<K>
impl<K: Clone> Clone for Arrangement<K>
Source§impl<K: Debug> Debug for Arrangement<K>
impl<K: Debug> Debug for Arrangement<K>
Source§impl<'de, K> Deserialize<'de> for Arrangement<K>where
K: Deserialize<'de> + Default,
impl<'de, K> Deserialize<'de> for Arrangement<K>where
K: Deserialize<'de> + Default,
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<K: Eq> Eq for Arrangement<K>
Source§impl<K: PartialEq> PartialEq for Arrangement<K>
impl<K: PartialEq> PartialEq for Arrangement<K>
Source§impl<K> Serialize for Arrangement<K>where
K: Serialize,
impl<K> Serialize for Arrangement<K>where
K: Serialize,
impl<K: PartialEq> StructuralPartialEq for Arrangement<K>
Auto Trait Implementations§
impl<K> Forget for Arrangement<K>
impl<K> Freeze for Arrangement<K>
impl<K> Move for Arrangement<K>
impl<K> RefUnwindSafe for Arrangement<K>where
K: RefUnwindSafe,
impl<K> Send for Arrangement<K>
impl<K> Sync for Arrangement<K>
impl<K> Unpin for Arrangement<K>
impl<K> UnsafeUnpin for Arrangement<K>
impl<K> UnwindSafe for Arrangement<K>where
K: UnwindSafe,
RawVecInner: UnwindSafe,
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.impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<K> ForeignKey<K> for K
impl<K> ForeignKey<K> for K
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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 moreSource§impl<T> IntoViewData for Twhere
T: Serialize,
impl<T> IntoViewData for Twhere
T: Serialize,
Source§fn into_view_data(self) -> ViewData
fn into_view_data(self) -> ViewData
Converts the value into view data.