pub async fn unyank(
        &mut self,
        crate_name: impl Into<String>,
        version: &Version,
    ) -> WrappedResult<(), NotFoundError, IoError> {
        let crate_name = crate_name.into();
        if self.crates.contains(&crate_name) {
            Ok(self
                .file(crate_name)
                .await?
                .unyank(version)
                .await?
                .map_err(NotFoundError::from))
        } else {
            Ok(Err(NotFoundError::no_crate(crate_name)))
        }
    }
/// Mark a selected version of a crate as 'unyanked'.
///
/// # Example
///
/// ```no_run
/// # use crate_index::{tree::{Tree, NotFoundError}, Error};
/// #
/// # #[async_std::main]
/// # async fn main() -> Result<(), Error> {
/// #    let mut tree = Tree::initialise("root", "download")
/// #        .build()
/// #        .await
/// #        .expect("couldn't create tree");
/// #
/// let crate_name = "some-crate";
/// let version = "0.1.0".parse().unwrap();
///
/// match tree.unyank(crate_name, &version).await? {
///     Ok(()) => println!("crate unyanked!"),
///     Err(NotFoundError::Crate(e)) => println!("crate not found! ({})", e.crate_name()),
///     Err(NotFoundError::Version(e)) => println!("version not found! ({})", e.version()),
/// }
/// #
/// #     Ok(())
/// # }
/// ```
///
/// # Errors
///
/// ## Outer Error
///
/// an [`IoError`] is returned if the filesystem cannot be read or written
/// to.
///
/// ## Inner Error
///
/// This function will return [`NotFoundError`] if the crate or the
/// selected version does not exist in the index.
Mark a selected version of a crate as 'unyanked'.
Mark a selected version of a crate as ' unyanked ' .
pub async fn unyank(
        &mut self,
        crate_name: impl Into<String>,
        version: &Version,
    ) -> WrappedResult<(), NotFoundError, IoError> {
        let crate_name = crate_name.into();
        if self.crates.contains(&crate_name) {
            Ok(self
                .file(crate_name)
                .await?
                .unyank(version)
                .await?
                .map_err(NotFoundError::from))
        } else {
            Ok(Err(NotFoundError::no_crate(crate_name)))
        }
    }
pub async fn unyank ( & mut self , crate_name : impl Into < String > , version : & Version , ) -> WrappedResult < ( ) , NotFoundError , IoError > { let crate_name = crate_name . into ( ) ; if self . crates . contains ( & crate_name ) { Ok ( self . file ( crate_name ) . await ? . unyank ( version ) . await ? . map_err ( NotFoundError :: from ) ) } else { Ok ( Err ( NotFoundError :: no_crate ( crate_name ) ) ) } }
Mark a selected version of a crate as 'unyanked'.
Mark a selected version of a crate as ' unyanked ' .
&mut self
crate_name
impl Into<String>
version
&Version
example
None
use crate_index::{tree::{tree, notfounderror}, error};
None
#[async_std::main]
None
async fn main() -> result<(), error> {
None
let mut tree = tree::initialise("root", "download")
None
.build()
None
.await
None
.expect("couldn't create tree");
let crate_name = "some-crate";
let version = "0.1.0".parse().unwrap().

match tree.unyank(crate_name, &version).await. {
Ok(()) => println!("crate unyanked!"),
Err(NotFoundError::Crate(e)) => println!("crate not found. ({})", e.crate_name()),
Err(NotFoundError::Version(e)) => println!("version not found.
let crate_name = " some - crate " ; let version = " 0 . 1 . 0 " . parse () . unwrap () . match tree . unyank ( crate_name &version ) . await . { Ok (( )) = > println! ( " crate unyanked! " ) Err ( NotFoundError :: Crate ( e )) = > println! ( " crate not found . ( {} ) " e . crate_name () ) Err ( NotFoundError :: Version ( e )) = > println! ( " version not found .
ok(())
None
}
None
errors
None
outer error
an [`IoError`] is returned if the filesystem cannot be read or written
to.
an [ ` IoError ` ] is returned if the filesystem cannot be read or written to .
inner error
This function will return [`NotFoundError`] if the crate or the
selected version does not exist in the index.
This function will return [ ` NotFoundError ` ] if the crate or the selected version does not exist in the index .