pub struct DDPConnection {
pub pixel_config: PixelConfig,
pub id: ID,
pub receiver_packet: Receiver<Packet>,
/* private fields */
}
Expand description
Represents a connection to a DDP display
Fields§
§pixel_config: PixelConfig
§id: ID
§receiver_packet: Receiver<Packet>
Implementations§
Source§impl DDPConnection
impl DDPConnection
Sourcepub fn write(&mut self, data: &[u8]) -> Result<usize, DDPError>
pub fn write(&mut self, data: &[u8]) -> Result<usize, DDPError>
Writes pixel data to the display
You send the data
Sourcepub fn write_offset(
&mut self,
data: &[u8],
offset: u32,
) -> Result<usize, DDPError>
pub fn write_offset( &mut self, data: &[u8], offset: u32, ) -> Result<usize, DDPError>
Writes pixel data to the display with offset
You send the data with offset
Sourcepub fn write_message(&mut self, msg: Message) -> Result<usize, DDPError>
pub fn write_message(&mut self, msg: Message) -> Result<usize, DDPError>
Allows you to send JSON messages to display This is useful for things like setting the brightness or changing the display mode
You provide a Message (either typed or untyped) and it will be sent to the display
pub fn get_incoming(&self) -> Result<Packet, DDPError>
pub fn try_new<A>(
addr: A,
pixel_config: PixelConfig,
id: ID,
socket: UdpSocket,
) -> Result<DDPConnection, DDPError>where
A: ToSocketAddrs,
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DDPConnection
impl RefUnwindSafe for DDPConnection
impl Send for DDPConnection
impl Sync for DDPConnection
impl Unpin for DDPConnection
impl UnwindSafe for DDPConnection
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