summaryrefslogtreecommitdiff
path: root/src/codec.rs
diff options
context:
space:
mode:
authorLibravatar Silas Bartha <silas@exvacuum.dev>2024-10-11 19:01:52 -0400
committerLibravatar Silas Bartha <silas@exvacuum.dev>2024-10-11 19:01:52 -0400
commit6c94102afc70ce28eee3d17aad997a056aaf9195 (patch)
tree11232fc59c356ce4f3b52cb140d779a3f1dc2006 /src/codec.rs
parent5b5f1bed5e8da9d799e5910793477ba0360d5135 (diff)
gltf, wav, and binary codecsv0.3.0
Diffstat (limited to 'src/codec.rs')
-rw-r--r--src/codec.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/codec.rs b/src/codec.rs
index 11fa76e..c46860f 100644
--- a/src/codec.rs
+++ b/src/codec.rs
@@ -3,16 +3,16 @@ use thiserror::Error;
/// Codecs enable the concealment of payload data inside the data of a carrier.
pub trait Codec {
/// Embeds payload data inside carrier, returning the result.
- fn encode(&self, carrier: &[u8], payload: &[u8]) -> Result<Vec<u8>, CodecError>;
+ fn encode(&self, carrier: &[u8], payload: &[u8]) -> Result<Vec<u8>, Error>;
/// Extracts payload data from an encoded carrier, returning the carrier with data removed and the
/// payload data.
- fn decode(&self, encoded: &[u8]) -> Result<(Vec<u8>, Vec<u8>), CodecError>;
+ fn decode(&self, encoded: &[u8]) -> Result<(Vec<u8>, Vec<u8>), Error>;
}
/// Errors produced by a codec
#[derive(Debug, Error)]
-pub enum CodecError {
+pub enum Error {
/// Variant used when data is determined not to be encoded. Note that a codec may have no way
/// of knowing this, so this may not be returned even if the data was not encoded
#[error("Data was not encoded with this codec")]