pub fn package_types(&self) -> crate::Result<Vec<PackageType>> {
    let target_os = if let Some((_, ref info)) = self.target {
      info.target_os()
    } else {
      std::env::consts::OS
    };
    let platform_types = match target_os {
      "macos" => vec![PackageType::OsxBundle, PackageType::Dmg],
      "ios" => vec![PackageType::IosBundle],
      "linux" => vec![PackageType::Deb, PackageType::AppImage],
      #[cfg(target_os = "windows")]
      "windows" => vec![PackageType::WindowsMsi],
      os => {
        return Err(crate::Error::GenericError(format!(
          "Native {} bundles not yet supported.",
          os
        )))
      }
    };
    if let Some(package_types) = &self.package_types {
      let mut types = vec![];
      for package_type in package_types {
        let package_type = *package_type;
        if platform_types
          .clone()
          .into_iter()
          .any(|t| t == package_type)
        {
          types.push(package_type);
        }
      }
      Ok(types)
    } else {
      Ok(platform_types)
    }
  }
/// If a list of package types was specified by the command-line, returns
/// that list filtered by the current target OS available targets.
///
/// If a target triple was specified by the
/// command-line, returns the native package type(s) for that target.
///
/// Otherwise returns the native package type(s) for the host platform.
///
/// Fails if the host/target's native package type is not supported.
If a list of package types was specified by the command-line, returns
that list filtered by the current target OS available targets.

If a target triple was specified by the
command-line, returns the native package type(s) for that target.

Otherwise returns the native package type(s) for the host platform.

Fails if the host/target's native package type is not supported.
If a list of package types was specified by the command - line returns that list filtered by the current target OS available targets . If a target triple was specified by the command - line returns the native package type ( s ) for that target . Otherwise returns the native package type ( s ) for the host platform . Fails if the host / target ' s native package type is not supported .
pub fn package_types(&self) -> crate::Result<Vec<PackageType>> {
    let target_os = if let Some((_, ref info)) = self.target {
      info.target_os()
    } else {
      std::env::consts::OS
    };
    let platform_types = match target_os {
      "macos" => vec![PackageType::OsxBundle, PackageType::Dmg],
      "ios" => vec![PackageType::IosBundle],
      "linux" => vec![PackageType::Deb, PackageType::AppImage],
      #[cfg(target_os = "windows")]
      "windows" => vec![PackageType::WindowsMsi],
      os => {
        return Err(crate::Error::GenericError(format!(
          "Native {} bundles not yet supported.",
          os
        )))
      }
    };
    if let Some(package_types) = &self.package_types {
      let mut types = vec![];
      for package_type in package_types {
        let package_type = *package_type;
        if platform_types
          .clone()
          .into_iter()
          .any(|t| t == package_type)
        {
          types.push(package_type);
        }
      }
      Ok(types)
    } else {
      Ok(platform_types)
    }
  }
pub fn package_types ( & self ) -> crate :: Result < Vec < PackageType > > { let target_os = if let Some ( ( _ , ref info ) ) = self . target { info . target_os ( ) } else { std :: env :: consts :: OS } ; let platform_types = match target_os { " " => vec ! [ PackageType OsxBundle PackageType Dmg ] , " " => vec ! [ PackageType IosBundle ] , " " => vec ! [ PackageType Deb PackageType AppImage ] , # [ cfg ( target_os " " ) ] " " => vec ! [ PackageType WindowsMsi ] , os => { return Err ( crate :: Error :: GenericError ( format ! ( " " os ) ) ) } } ; if let Some ( package_types ) = & self . package_types { let mut types = vec ! [ ] ; for package_type in package_types { let package_type = * package_type ; if platform_types . clone ( ) . into_iter ( ) . any ( | t | t == package_type ) { types . push ( package_type ) ; } } Ok ( types ) } else { Ok ( platform_types ) } }
If a list of package types was specified by the command-line, returns
that list filtered by the current target OS available targets.
If a list of package types was specified by the command - line returns that list filtered by the current target OS available targets .
&self
&self