[−][src]Struct rdp::model::data::Check
This is a wrapper around a copyable message to check constness
Methods
impl<T> Check<T>
[src]
pub fn new(value: T) -> Self
[src]
Create a new check for a Message
Example
use rdp::model::data::{Check, U16, Message}; use std::io::Cursor; let mut s = Cursor::new(vec![4, 0]); let mut x = Check::new(U16::LE(4)); assert!(!x.read(&mut s).is_err()); let mut s2 = Cursor::new(vec![5, 0]); assert!(x.read(&mut s2).is_err());
Trait Implementations
impl<T: Message + Clone + PartialEq> Message for Check<T>
[src]
fn write(&self, writer: &mut dyn Write) -> RdpResult<()>
[src]
Check values doesn't happen during write steps
fn read(&mut self, reader: &mut dyn Read) -> RdpResult<()>
[src]
Check value will be made during reading steps
Example
use rdp::model::data::{Check, U16, Message}; use std::io::Cursor; let mut s = Cursor::new(vec![4, 0]); let mut x = Check::new(U16::LE(4)); assert!(!x.read(&mut s).is_err()); let mut s2 = Cursor::new(vec![5, 0]); assert!(x.read(&mut s2).is_err());
fn length(&self) -> u64
[src]
This is the length of the inner value
fn visit(&self) -> DataType
[src]
Same as visit of the inner value
Example
let mut s = Cursor::new(vec![8, 0, 0, 0, 3]); let mut x = trame![ Check::new(U32::LE(8)), 0 as u8 ]; x.read(&mut s); assert_eq!(cast!(DataType::U32, x[0]).unwrap(), 8)
fn options(&self) -> MessageOption
[src]
No option
Auto Trait Implementations
impl<T> RefUnwindSafe for Check<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for Check<T> where
T: Send,
T: Send,
impl<T> Sync for Check<T> where
T: Sync,
T: Sync,
impl<T> Unpin for Check<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for Check<T> where
T: UnwindSafe,
T: UnwindSafe,
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> Same<T> for T
type Output = T
Should always be Self
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,