pub struct Buffer(_);
Implementations
sourceimpl Buffer
impl Buffer
pub fn from_file<P: AsRef<Path>>(path: P) -> Result<Buffer>
pub fn from_encoded_data(data: &[u8]) -> Result<Buffer>
pub fn from_float_array(
sr: c_uint,
channels: c_uint,
data: &[f32]
) -> Result<Buffer>
pub fn from_stream_handle(&self, handle: StreamHandle) -> Result<Buffer>
pub fn from_stream_params(
protocol: &str,
path: &str,
param: usize
) -> Result<Buffer>
sourcepub fn from_read_seek<R: Read + Seek>(reader: R) -> Result<Buffer>
pub fn from_read_seek<R: Read + Seek>(reader: R) -> Result<Buffer>
Decode a buffer from a Read + Seek
implementation.
This avoids the Sync and ’static requirements on going through a stream handle.
We require Seek
as well because there are some formats that Synthizer
can’t decode without it, most notably wav.
pub fn get_length_in_samples(&self) -> Result<u32>
pub fn get_length_in_seconds(&self) -> Result<f64>
pub fn get_channels(&self) -> Result<u32>
pub fn get_size_in_bytes(&self) -> Result<u64>
pub fn handle(&self) -> &Handle
pub fn into_handle(self) -> Handle
pub fn get_type(&self) -> Result<ObjectType>
sourcepub fn cast_to<T: CastTarget>(&self) -> Result<Option<T>>
pub fn cast_to<T: CastTarget>(&self) -> Result<Option<T>>
Try to cast this object to another object type. Will return
Ok(None)
if this is because of a type mismatch, otherwise Err
.
Clones self
on success in order to prevent throwing the object
away on error.
pub fn get_userdata(&self) -> Result<Option<Arc<dyn Any + Send + Sync>>>
pub fn set_userdata(
&self,
userdata: Option<impl Any + Send + Sync>
) -> Result<()>
pub fn config_delete_behavior(
&self,
config: &DeleteBehaviorConfig
) -> Result<()>
pub fn current_time(&self) -> DoubleProperty<'_>
pub fn suggested_automation_time(&self) -> DoubleProperty<'_>
Trait Implementations
sourceimpl Ord for Buffer
impl Ord for Buffer
sourceimpl PartialOrd<Buffer> for Buffer
impl PartialOrd<Buffer> for Buffer
sourcefn partial_cmp(&self, other: &Buffer) -> Option<Ordering>
fn partial_cmp(&self, other: &Buffer) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl Eq for Buffer
impl StructuralEq for Buffer
impl StructuralPartialEq for Buffer
Auto Trait Implementations
impl RefUnwindSafe for Buffer
impl Send for Buffer
impl Sync for Buffer
impl Unpin for Buffer
impl UnwindSafe for Buffer
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more