[−][src]Struct pelcodrs::MessageBuilder
Builder of Message (standard) instances.
Provided methods fill the message with corresponding bits, then MessageBuilder::finalize() produces the final Message.
Please note that currently no logical validation is done. For example the "sense" bit can be overwritten, and thus invalidate previous method call.
Example
let msg = MessageBuilder::new(10) .camera_on() .focus_far() .direction(Direction::DOWN) .tilt(Speed::Range(0.5)) .finalize()?; assert_eq!(&[0xFF, 0x0A, 0x88, 0x90, 0x00, 0x20, 0x42], msg.as_ref());
Methods
impl MessageBuilder
[src]
pub fn new(address: u8) -> MessageBuilder
[src]
pub fn direction(&mut self, direction: Direction) -> &mut Self
[src]
pub fn down(&mut self) -> &mut Self
[src]
pub fn up(&mut self) -> &mut Self
[src]
pub fn left(&mut self) -> &mut Self
[src]
pub fn right(&mut self) -> &mut Self
[src]
pub fn pan(&mut self, speed: Speed) -> &mut Self
[src]
pub fn tilt(&mut self, speed: Speed) -> &mut Self
[src]
pub fn stop(&mut self) -> &mut Self
[src]
pub fn zoom_in(&mut self) -> &mut Self
[src]
pub fn zoom_out(&mut self) -> &mut Self
[src]
pub fn camera_on(&mut self) -> &mut Self
[src]
pub fn camera_off(&mut self) -> &mut Self
[src]
pub fn auto_scan(&mut self) -> &mut Self
[src]
pub fn manual_scan(&mut self) -> &mut Self
[src]
pub fn close_iris(&mut self) -> &mut Self
[src]
pub fn open_iris(&mut self) -> &mut Self
[src]
pub fn focus_far(&mut self) -> &mut Self
[src]
pub fn focus_near(&mut self) -> &mut Self
[src]
pub fn finalize(self) -> Result<Message>
[src]
Trait Implementations
impl From<MessageBuilder> for Message
[src]
fn from(draft: MessageBuilder) -> Self
[src]
impl Clone for MessageBuilder
[src]
fn clone(&self) -> MessageBuilder
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for MessageBuilder
[src]
impl PartialEq<MessageBuilder> for MessageBuilder
[src]
fn eq(&self, other: &MessageBuilder) -> bool
[src]
fn ne(&self, other: &MessageBuilder) -> bool
[src]
impl Debug for MessageBuilder
[src]
Auto Trait Implementations
impl Send for MessageBuilder
impl Sync for MessageBuilder
impl Unpin for MessageBuilder
impl UnwindSafe for MessageBuilder
impl RefUnwindSafe for MessageBuilder
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
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>,
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<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> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,