Skip to main content

Result

Type Alias Result 

Source
pub type Result<T> = Result<T, AfpError>;
Expand description

Shorthand for core::result::Result<T, AfpError>.

§Example

use audiofp::{AfpError, Result};

fn at_least_one_second(samples: &[f32]) -> Result<()> {
    if samples.len() < 16_000 {
        return Err(AfpError::AudioTooShort { needed: 16_000, got: samples.len() });
    }
    Ok(())
}

Aliased Type§

pub enum Result<T> {
    Ok(T),
    Err(AfpError),
}

Variants§

§1.0.0

Ok(T)

Contains the success value

§1.0.0

Err(AfpError)

Contains the error value