Select

Struct Select 

Source
pub struct Select<U: UniqueIdentifier, const IDX: usize>(/* private fields */);
Expand description

Vector element selection type

§Example

use gmt_dos_actors_clients_interface::{Data, UniqueIdentifier, Update, Write,
    select::{Select, Selector}};
pub enum TTT {}
impl UniqueIdentifier for TTT {
    type DataType = Vec<u32>;
}
pub struct Client {
    pub data: Vec<u32>,
}
impl Update for Client {}
impl Write<TTT> for Client {
    fn write(&mut self) -> Option<Data<TTT>> {
        Some(self.data.clone().into())
    }
}
impl Selector for Client {}
let mut client = Client {
    data: vec![1, 2, 3, 4, 5],
};
let data = <Client as Write<Select<TTT, 3>>>::write(&mut client);

Trait Implementations§

Source§

impl<U: UniqueIdentifier, const IDX: usize> UniqueIdentifier for Select<U, IDX>

Source§

impl<U: UniqueIdentifier, const IDX: usize> Update for Select<U, IDX>

Source§

fn update(&mut self)

Source§

impl<T, C, U, const IDX: usize> Write<Select<U, IDX>> for C
where T: Copy, C: Write<U> + Selector, U: UniqueIdentifier<DataType = Vec<T>>,

Source§

fn write(&mut self) -> Option<Data<Select<U, IDX>>>

Auto Trait Implementations§

§

impl<U, const IDX: usize> Freeze for Select<U, IDX>

§

impl<U, const IDX: usize> RefUnwindSafe for Select<U, IDX>
where U: RefUnwindSafe,

§

impl<U, const IDX: usize> Send for Select<U, IDX>

§

impl<U, const IDX: usize> Sync for Select<U, IDX>

§

impl<U, const IDX: usize> Unpin for Select<U, IDX>
where U: Unpin,

§

impl<U, const IDX: usize> UnwindSafe for Select<U, IDX>
where U: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<U> Quote for U

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.