pub struct ArrangeRows<T>(/* private fields */);Expand description
Generic array wrapper for ArrangeRows.
§Example: Extending in your own code with custom inner types
use ot_tools_io::types::ArrangeRows;
use ot_tools_io::Defaults;
use ot_tools_io_derive::{ArrayDefaults, BoxedArrayDefaults};
use std::array::from_fn;
#[derive(Debug, PartialEq, Default, ArrayDefaults, BoxedArrayDefaults)]
pub struct CustomReminder(String);
let mut my_arr_reminders = ArrangeRows::<CustomReminder>::default();
let first = my_arr_reminders.first_mut().ok_or(())?;
*first = CustomReminder(
String::from(
"imagine this is a long reminder value that goes on for longer than normally allowed"
)
);
// first one changed
assert_eq!(
my_arr_reminders[0],
CustomReminder(
String::from(
"imagine this is a long reminder value that goes on for longer than normally allowed"
)
)
);
// rest are default
assert_eq!(my_arr_reminders[1], CustomReminder::default());
// correct length
assert_eq!(my_arr_reminders.len(), 256);
Implementations§
Trait Implementations§
Source§impl<T> AsMut<ArrangeRows<T>> for ArrangeRows<T>
impl<T> AsMut<ArrangeRows<T>> for ArrangeRows<T>
Source§fn as_mut(&mut self) -> &mut ArrangeRows<T>
fn as_mut(&mut self) -> &mut ArrangeRows<T>
Converts this type into a mutable reference of the (usually inferred) input type.
Source§impl<T> AsRef<ArrangeRows<T>> for ArrangeRows<T>
impl<T> AsRef<ArrangeRows<T>> for ArrangeRows<T>
Source§fn as_ref(&self) -> &ArrangeRows<T>
fn as_ref(&self) -> &ArrangeRows<T>
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl<T: Clone> Clone for ArrangeRows<T>
impl<T: Clone> Clone for ArrangeRows<T>
Source§fn clone(&self) -> ArrangeRows<T>
fn clone(&self) -> ArrangeRows<T>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<T: Copy> Copy for ArrangeRows<T>
Source§impl<T: Debug> Debug for ArrangeRows<T>
impl<T: Debug> Debug for ArrangeRows<T>
Source§impl<T> Deref for ArrangeRows<T>
impl<T> Deref for ArrangeRows<T>
Source§impl<T> DerefMut for ArrangeRows<T>
impl<T> DerefMut for ArrangeRows<T>
Source§impl<'de> Deserialize<'de> for ArrangeRows<ArrangeRow>
impl<'de> Deserialize<'de> for ArrangeRows<ArrangeRow>
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<T: Eq> Eq for ArrangeRows<T>
Source§impl<T: Hash> Hash for ArrangeRows<T>
impl<T: Hash> Hash for ArrangeRows<T>
Source§impl<T: Ord> Ord for ArrangeRows<T>
impl<T: Ord> Ord for ArrangeRows<T>
Source§fn cmp(&self, other: &ArrangeRows<T>) -> Ordering
fn cmp(&self, other: &ArrangeRows<T>) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<T: PartialEq> PartialEq for ArrangeRows<T>
impl<T: PartialEq> PartialEq for ArrangeRows<T>
Source§impl<T: PartialOrd> PartialOrd for ArrangeRows<T>
impl<T: PartialOrd> PartialOrd for ArrangeRows<T>
Source§impl Serialize for ArrangeRows<ArrangeRow>
impl Serialize for ArrangeRows<ArrangeRow>
impl<T: PartialEq> StructuralPartialEq for ArrangeRows<T>
Auto Trait Implementations§
impl<T> Freeze for ArrangeRows<T>where
T: Freeze,
impl<T> RefUnwindSafe for ArrangeRows<T>where
T: RefUnwindSafe,
impl<T> Send for ArrangeRows<T>where
T: Send,
impl<T> Sync for ArrangeRows<T>where
T: Sync,
impl<T> Unpin for ArrangeRows<T>where
T: Unpin,
impl<T> UnsafeUnpin for ArrangeRows<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for ArrangeRows<T>where
T: 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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.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 more