-
version 0.14.0
All checks were successfulRust / build (push) Successful in 1m54sreleased this
2025-05-03 11:48:56 +02:00 | 4 commits to main since this releaseThis is a big breaking change for the library.
- BREAKING: To support commands implemented outside the library, the
Command
enum has been renamed toTypedCommand
. - BREAKING: Connections have been removed. While this sounds like a huge change, the connections were thin wrappers around the underlying transports.
- BREAKING: The commands have been renamed to better reflect their usage.
- BREAKING: Nearly all calls to
panic!
,.unwrap()
and.expect()
have been removed and signatures changed to reflect that. Apart from out-of-bounds accesses on the containers, the library will not crash your app anymore. - BREAKING: The
BitVec
type alias has been renamed toDisplayBitVec
because of an issue in cbindgen that affectedservicepoint_binding_c
. - FEATURE: Add
UdpSocketExt
to easily use aUdpSocket
in a way similar to the old connections. - FEATURE:
Command
is now a new trait that gets auto-implemented if the required supertraits are. - FEATURE: Each command is now a struct with public fields. This means a command can be mutated and functions can declare specific types in their signatures.
- FEATURE: Containers like
CharGrid
andBitmap
have gotten newTryInto
implementations for their command struct. That means to send a bitmap to the top left of the screen with default compression, you can writeBitmapCommand::from(bitmap)
. - FEATURE: Some structs and enum values have been annotated with a
repr
attribute to make them usable in language bindings.
Migration Guide
- Some functions now return
None
orErr
when called improperly. To keep the old behavior, add an.expect()
or.unwrap()
. - Replace usages of
servicepoint::BitVec
withservicepoint::DisplayBitVec
.
Connection
Connection::Fake
can be replaced byFakeConnection
- though the usefulness of that decreased.Connection::Websocket
does not have an equivalent anymore. You should use tungstenite directly by first turning the command into a packet and then the packet into aVec<u8>
.- Instead of
Connection::open
useUdpSocket::bind_connect
after addingUdpSocketExt
to the imports. - Instead of calling
socket.send(command)
, usesocket.send_command(command)
.
Command names
v0.13 v0.14 Command::Clear ClearCommand Command::Utf8Data CharGridCommand Command::Brightness GlobalBrightnessCommand Command::BitmapLinearWin BitmapCommand Command::Cp437Data Cp437GridCommand Command::CharBrightness BrightnessGridCommand Command::HardReset HardResetCommand Command::FadeOut FadeOutCommand Command::BitmapLegacy BitmapLegacyCommand Command::BitmapLinear BitVecCommand { operation: Overwrite } Command::BitmapLinearAnd BitVecCommand { operation: And } Command::BitmapLinearOr BitVecCommand { operation: Or } Command::BitmapLinearXor BitVecCommand { operation: Xor } Known issues
- The examples use
UdpSocket::bind
instead ofbind_connect
, which makes them crash at runtime because the system call fails. This is fixed in v0.14.1
Downloads
- BREAKING: To support commands implemented outside the library, the