pub struct Encoder { /* private fields */ }Expand description
Reed-Solomon BCH encoder
Implementations§
Source§impl Encoder
impl Encoder
Sourcepub fn encode(&self, data: &[u8]) -> Result<Buffer, UsageError>
pub fn encode(&self, data: &[u8]) -> Result<Buffer, UsageError>
Encodes passed &[u8] slice and returns Buffer with result.
The number of ecc symbols used will depend on Encoder constant
that was used.
§Example
use reed_solomon_32::encoder::ENCODER_8;
let data = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
let encoded = ENCODER_8.encode(&data).unwrap();
println!("whole: {:?}", &encoded[..]);
println!("data: {:?}", encoded.data());
println!("ecc: {:?}", encoded.ecc());Trait Implementations§
Auto Trait Implementations§
impl Freeze for Encoder
impl RefUnwindSafe for Encoder
impl Send for Encoder
impl Sync for Encoder
impl Unpin for Encoder
impl UnwindSafe for Encoder
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