Skip to content

Commit

Permalink
Some little rustdoc
Browse files Browse the repository at this point in the history
  • Loading branch information
est31 committed Feb 21, 2019
1 parent 85e13e2 commit 0e71f62
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/samples.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
// at your option. Please see the LICENSE file
// attached to this source distribution for details.

/*!
Traits for sample formats
*/

/// Trait for a packet of multiple samples
pub trait Samples {
fn num_samples(&self) -> usize;
fn truncate(&mut self, limit :usize);
Expand Down Expand Up @@ -34,6 +39,7 @@ impl<S :Sample> Samples for Vec<Vec<S>> {
}
}

/// A packet of multi-channel interleaved samples
pub struct InterleavedSamples<S :Sample> {
pub samples :Vec<S>,
pub channel_count :usize,
Expand Down Expand Up @@ -72,6 +78,7 @@ impl<S :Sample> Samples for InterleavedSamples<S> {
}
}

/// Trait representing a single sample
pub trait Sample {
fn from_float(fl :f32) -> Self;
}
Expand Down

0 comments on commit 0e71f62

Please sign in to comment.