[−][src]Struct ether_dream::protocol::command::Data
Indicates to the DAC to add the following point data into its buffer.
Point data is laid out as follows:
- 0x64
: u16
Fields
points: Cow<'a, [DacPoint]>
Methods
impl<'a> Data<'a>
[src]
pub fn read_n_points<R>(reader: R) -> Result<u16> where
R: ReadBytesExt,
[src]
R: ReadBytesExt,
Read the u16
representing the number of points within the Data from the given
reader
.
This method is useful for determining how many more bytes should be read from a stream.
Note that if reading from a stream, this method assumes that the starting command byte has already been read.
pub fn read_points<R>(
reader: R,
n_points: u16,
points: &mut Vec<DacPoint>
) -> Result<()> where
R: ReadBytesExt,
[src]
reader: R,
n_points: u16,
points: &mut Vec<DacPoint>
) -> Result<()> where
R: ReadBytesExt,
Read and append the given number of points into the given Vec of DacPoints.
This method is useful as an alternative to Self::read_fields or Self::read_from_bytes as it allows for re-using a buffer of points rather than dynamically allocating a new one each time.
Note that if reading from a stream, this method assumes that the starting command byte
and the u16
representing the number of points have both already been read.
impl Data<'static>
[src]
pub fn read_fields<R: ReadBytesExt>(reader: R) -> Result<Self>
[src]
Consecutively read the fields of the Data type and return a Data instance.
Note that if reading from a stream, this method assumes that the starting command byte has already been read.
Trait Implementations
impl<'a> Clone for Data<'a>
[src]
impl<'a> Command for Data<'a>
[src]
const START_BYTE: u8
[src]
fn start_byte(&self) -> u8
[src]
impl<'a> Debug for Data<'a>
[src]
impl<'a> Eq for Data<'a>
[src]
impl<'a> From<Data<'a>> for Command<'a>
[src]
impl<'a> Hash for Data<'a>
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<'a> PartialEq<Data<'a>> for Data<'a>
[src]
impl ReadFromBytes for Data<'static>
[src]
fn read_from_bytes<R: ReadBytesExt>(reader: R) -> Result<Self>
[src]
impl<'a> StructuralEq for Data<'a>
[src]
impl<'a> StructuralPartialEq for Data<'a>
[src]
impl<'a> WriteToBytes for Data<'a>
[src]
fn write_to_bytes<W: WriteBytesExt>(&self, writer: W) -> Result<()>
[src]
Auto Trait Implementations
impl<'a> RefUnwindSafe for Data<'a>
impl<'a> Send for Data<'a>
impl<'a> Sync for Data<'a>
impl<'a> Unpin for Data<'a>
impl<'a> UnwindSafe for Data<'a>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,