Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@
# These are backup files generated by rustfmt
**/*.rs.bk

.vscode
.vscode

/local/
104 changes: 21 additions & 83 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 15 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ exclude = [

[dependencies]
byteorder = { version = "1.5.0", features = [] }
error-chain = "0.12.4"
libc = { version = "0.2.171" }
socket2 = { version = "0.5.9", features = ["all"] }
thiserror = "2.0.*"
uuid = { version = "1.12", features = ["v4"] }

[dev-dependencies]
Expand All @@ -35,6 +35,18 @@ std = []
[badges]
travis-ci = { repository = "Lan2u/RustSacn" }

[[examples]]
[[example]]
name = 'simple-receiver'
path = 'examples/simple-receiver.rs'

[[example]]
name = 'sine-wave-sender'
path = 'examples/sine-wave-sender.rs'
edition = '2024'

[[example]]
name = 'demo_rcv'
path = 'examples/demo_rcv/src/main.rs'

[[example]]
name = 'demo_src'
path = 'examples/demo_src/src/main.rs'
2 changes: 1 addition & 1 deletion examples/demo_rcv/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ edition = "2018"

[dependencies]
sacn = { path = "../../"}
error-chain = "0.12.2"
thiserror = "2.0.*"
26 changes: 15 additions & 11 deletions examples/demo_rcv/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,23 @@

/// Use the error-chain system to allow handling IO and sACN errors chained together.
/// error_chain! macro automatically creates the Error / ErrorKind / Result required to use the Errors/external errors below with error-chain.
///
///
/// Sacn create errors are wrapped in Sacn(::sacn::error::errors::Error).
///
///
/// Std io errors are wrapped in Io(::std::io::Error).
///
///

pub mod errors {
error_chain! {
foreign_links {
Sacn(::sacn::error::errors::Error);
Io(::std::io::Error);
}

errors {}
use thiserror::Error;

#[derive(Error, Debug)]
pub enum DemoError {
#[error(transparent)]
Sacn(#[from] ::sacn::error::errors::SacnError),

#[error(transparent)]
Io(#[from] ::std::io::Error),
}
}

pub type Result<T> = std::result::Result<T, DemoError>;
}
Loading