Skip to main content

Generator

Struct Generator 

Source
pub struct Generator { /* private fields */ }
Expand description

Builder for a CI workflow document.

Methods are pure setters; configuration is committed only when generate is called. Calling generate multiple times against the same Generator returns byte-identical output.

§Example

use dev_ci::{Generator, PathDep, Target};

let yaml = Generator::new()
    .target(Target::GitHubActions)
    .workflow_name("CI")
    .branches(["main", "release/*"])
    .matrix_os(["ubuntu-latest", "macos-latest", "windows-latest"])
    .with_clippy()
    .with_fmt()
    .with_docs()
    .with_msrv("1.85")
    .with_no_default_features_build()
    .with_all_features_build()
    .with_path_dep(PathDep::new("dev-report", "https://github.com/jamesgober/dev-report.git"))
    .generate();

assert!(yaml.contains("name: CI"));
assert!(yaml.contains("actions/checkout@v5"));

Implementations§

Source§

impl Generator

Source

pub fn new() -> Self

Begin a new generator with default settings.

Defaults: target = GitHubActions, workflow name = "CI", branches = ["main"], matrix = ["ubuntu-latest"], cache enabled, no extra jobs.

Examples found in repository?
examples/basic.rs (line 13)
12fn main() {
13    let yaml = Generator::new()
14        .target(Target::GitHubActions)
15        .with_clippy()
16        .with_fmt()
17        .with_docs()
18        .with_msrv("1.85")
19        .generate();
20
21    println!("{yaml}");
22}
More examples
Hide additional examples
examples/full_suite.rs (line 12)
11fn main() {
12    let yaml = Generator::new()
13        .target(Target::GitHubActions)
14        .workflow_name("CI")
15        .branches(["main"])
16        .matrix_os(["ubuntu-latest", "macos-latest", "windows-latest"])
17        .with_workspace()
18        .with_no_default_features_build()
19        .with_all_features_build()
20        .with_clippy()
21        .with_fmt()
22        .with_docs()
23        .with_msrv("1.85")
24        .generate();
25
26    println!("{yaml}");
27}
examples/write_to_disk.rs (line 17)
16fn main() {
17    let yaml = Generator::new()
18        .with_clippy()
19        .with_fmt()
20        .with_docs()
21        .with_msrv("1.85")
22        .generate();
23
24    let target = std::env::var("DEV_CI_WRITE_TARGET")
25        .map(PathBuf::from)
26        .unwrap_or_else(|_| std::env::temp_dir().join("dev-ci-example/ci.yml"));
27
28    if let Some(parent) = target.parent() {
29        std::fs::create_dir_all(parent).expect("create parent dir");
30    }
31    std::fs::write(&target, yaml).expect("write yaml");
32    println!("wrote {}", target.display());
33}
examples/path_deps.rs (line 12)
11fn main() {
12    let yaml = Generator::new()
13        .target(Target::GitHubActions)
14        .matrix_os(["ubuntu-latest", "macos-latest", "windows-latest"])
15        .with_path_dep(PathDep::new(
16            "dev-report",
17            "https://github.com/jamesgober/dev-report.git",
18        ))
19        .with_path_dep(PathDep::new(
20            "dev-tools",
21            "https://github.com/jamesgober/dev-tools.git",
22        ))
23        .with_clippy()
24        .with_fmt()
25        .with_docs()
26        .with_msrv("1.85")
27        .generate();
28
29    println!("{yaml}");
30}
Source

pub fn target(self, target: Target) -> Self

Select the target CI platform.

Examples found in repository?
examples/basic.rs (line 14)
12fn main() {
13    let yaml = Generator::new()
14        .target(Target::GitHubActions)
15        .with_clippy()
16        .with_fmt()
17        .with_docs()
18        .with_msrv("1.85")
19        .generate();
20
21    println!("{yaml}");
22}
More examples
Hide additional examples
examples/full_suite.rs (line 13)
11fn main() {
12    let yaml = Generator::new()
13        .target(Target::GitHubActions)
14        .workflow_name("CI")
15        .branches(["main"])
16        .matrix_os(["ubuntu-latest", "macos-latest", "windows-latest"])
17        .with_workspace()
18        .with_no_default_features_build()
19        .with_all_features_build()
20        .with_clippy()
21        .with_fmt()
22        .with_docs()
23        .with_msrv("1.85")
24        .generate();
25
26    println!("{yaml}");
27}
examples/path_deps.rs (line 13)
11fn main() {
12    let yaml = Generator::new()
13        .target(Target::GitHubActions)
14        .matrix_os(["ubuntu-latest", "macos-latest", "windows-latest"])
15        .with_path_dep(PathDep::new(
16            "dev-report",
17            "https://github.com/jamesgober/dev-report.git",
18        ))
19        .with_path_dep(PathDep::new(
20            "dev-tools",
21            "https://github.com/jamesgober/dev-tools.git",
22        ))
23        .with_clippy()
24        .with_fmt()
25        .with_docs()
26        .with_msrv("1.85")
27        .generate();
28
29    println!("{yaml}");
30}
Source

pub fn target_kind(&self) -> Target

Selected target.

Source

pub fn workflow_name(self, name: impl Into<String>) -> Self

Set the workflow name: field. Defaults to "CI".

Examples found in repository?
examples/full_suite.rs (line 14)
11fn main() {
12    let yaml = Generator::new()
13        .target(Target::GitHubActions)
14        .workflow_name("CI")
15        .branches(["main"])
16        .matrix_os(["ubuntu-latest", "macos-latest", "windows-latest"])
17        .with_workspace()
18        .with_no_default_features_build()
19        .with_all_features_build()
20        .with_clippy()
21        .with_fmt()
22        .with_docs()
23        .with_msrv("1.85")
24        .generate();
25
26    println!("{yaml}");
27}
Source

pub fn branches<I, S>(self, branches: I) -> Self
where I: IntoIterator<Item = S>, S: Into<String>,

Set the push / pull_request branch filter list.

Defaults to ["main"]. Glob patterns are passed through unchanged.

Examples found in repository?
examples/full_suite.rs (line 15)
11fn main() {
12    let yaml = Generator::new()
13        .target(Target::GitHubActions)
14        .workflow_name("CI")
15        .branches(["main"])
16        .matrix_os(["ubuntu-latest", "macos-latest", "windows-latest"])
17        .with_workspace()
18        .with_no_default_features_build()
19        .with_all_features_build()
20        .with_clippy()
21        .with_fmt()
22        .with_docs()
23        .with_msrv("1.85")
24        .generate();
25
26    println!("{yaml}");
27}
Source

pub fn matrix_os<I, S>(self, os_list: I) -> Self
where I: IntoIterator<Item = S>, S: Into<String>,

Set the OS matrix for the test job. Defaults to a single ubuntu-latest runner.

Common multi-OS configuration: ["ubuntu-latest", "macos-latest", "windows-latest"].

Examples found in repository?
examples/full_suite.rs (line 16)
11fn main() {
12    let yaml = Generator::new()
13        .target(Target::GitHubActions)
14        .workflow_name("CI")
15        .branches(["main"])
16        .matrix_os(["ubuntu-latest", "macos-latest", "windows-latest"])
17        .with_workspace()
18        .with_no_default_features_build()
19        .with_all_features_build()
20        .with_clippy()
21        .with_fmt()
22        .with_docs()
23        .with_msrv("1.85")
24        .generate();
25
26    println!("{yaml}");
27}
More examples
Hide additional examples
examples/path_deps.rs (line 14)
11fn main() {
12    let yaml = Generator::new()
13        .target(Target::GitHubActions)
14        .matrix_os(["ubuntu-latest", "macos-latest", "windows-latest"])
15        .with_path_dep(PathDep::new(
16            "dev-report",
17            "https://github.com/jamesgober/dev-report.git",
18        ))
19        .with_path_dep(PathDep::new(
20            "dev-tools",
21            "https://github.com/jamesgober/dev-tools.git",
22        ))
23        .with_clippy()
24        .with_fmt()
25        .with_docs()
26        .with_msrv("1.85")
27        .generate();
28
29    println!("{yaml}");
30}
Source

pub fn with_cache(self, enabled: bool) -> Self

Toggle the Swatinem/rust-cache@v2 action. Default: enabled.

Source

pub fn with_workspace(self) -> Self

Pass --workspace to every cargo invocation.

Examples found in repository?
examples/full_suite.rs (line 17)
11fn main() {
12    let yaml = Generator::new()
13        .target(Target::GitHubActions)
14        .workflow_name("CI")
15        .branches(["main"])
16        .matrix_os(["ubuntu-latest", "macos-latest", "windows-latest"])
17        .with_workspace()
18        .with_no_default_features_build()
19        .with_all_features_build()
20        .with_clippy()
21        .with_fmt()
22        .with_docs()
23        .with_msrv("1.85")
24        .generate();
25
26    println!("{yaml}");
27}
Source

pub fn features(self, features: impl Into<String>) -> Self

Pass --features <list> to every cargo invocation.

Mutually exclusive with with_all_features_build only in the sense that --all-features overrides --features in cargo itself; the generator emits both flags as configured.

Source

pub fn with_no_default_features_build(self) -> Self

Emit an additional build step under the test job that passes --no-default-features. Useful for crates with optional features that should compile cleanly under the bare configuration.

Examples found in repository?
examples/full_suite.rs (line 18)
11fn main() {
12    let yaml = Generator::new()
13        .target(Target::GitHubActions)
14        .workflow_name("CI")
15        .branches(["main"])
16        .matrix_os(["ubuntu-latest", "macos-latest", "windows-latest"])
17        .with_workspace()
18        .with_no_default_features_build()
19        .with_all_features_build()
20        .with_clippy()
21        .with_fmt()
22        .with_docs()
23        .with_msrv("1.85")
24        .generate();
25
26    println!("{yaml}");
27}
Source

pub fn with_all_features_build(self) -> Self

Emit an additional build + test step under the test job that passes --all-features.

Examples found in repository?
examples/full_suite.rs (line 19)
11fn main() {
12    let yaml = Generator::new()
13        .target(Target::GitHubActions)
14        .workflow_name("CI")
15        .branches(["main"])
16        .matrix_os(["ubuntu-latest", "macos-latest", "windows-latest"])
17        .with_workspace()
18        .with_no_default_features_build()
19        .with_all_features_build()
20        .with_clippy()
21        .with_fmt()
22        .with_docs()
23        .with_msrv("1.85")
24        .generate();
25
26    println!("{yaml}");
27}
Source

pub fn with_path_dep(self, dep: PathDep) -> Self

Declare a sibling path-dependency that the workflow must git clone into ../<name> before running cargo.

Matches the pattern the existing dev-* suite uses for its own CI (each crate clones its siblings into ..). May be called repeatedly.

Examples found in repository?
examples/path_deps.rs (lines 15-18)
11fn main() {
12    let yaml = Generator::new()
13        .target(Target::GitHubActions)
14        .matrix_os(["ubuntu-latest", "macos-latest", "windows-latest"])
15        .with_path_dep(PathDep::new(
16            "dev-report",
17            "https://github.com/jamesgober/dev-report.git",
18        ))
19        .with_path_dep(PathDep::new(
20            "dev-tools",
21            "https://github.com/jamesgober/dev-tools.git",
22        ))
23        .with_clippy()
24        .with_fmt()
25        .with_docs()
26        .with_msrv("1.85")
27        .generate();
28
29    println!("{yaml}");
30}
Source

pub fn with_clippy(self) -> Self

Include a clippy job.

Examples found in repository?
examples/basic.rs (line 15)
12fn main() {
13    let yaml = Generator::new()
14        .target(Target::GitHubActions)
15        .with_clippy()
16        .with_fmt()
17        .with_docs()
18        .with_msrv("1.85")
19        .generate();
20
21    println!("{yaml}");
22}
More examples
Hide additional examples
examples/full_suite.rs (line 20)
11fn main() {
12    let yaml = Generator::new()
13        .target(Target::GitHubActions)
14        .workflow_name("CI")
15        .branches(["main"])
16        .matrix_os(["ubuntu-latest", "macos-latest", "windows-latest"])
17        .with_workspace()
18        .with_no_default_features_build()
19        .with_all_features_build()
20        .with_clippy()
21        .with_fmt()
22        .with_docs()
23        .with_msrv("1.85")
24        .generate();
25
26    println!("{yaml}");
27}
examples/write_to_disk.rs (line 18)
16fn main() {
17    let yaml = Generator::new()
18        .with_clippy()
19        .with_fmt()
20        .with_docs()
21        .with_msrv("1.85")
22        .generate();
23
24    let target = std::env::var("DEV_CI_WRITE_TARGET")
25        .map(PathBuf::from)
26        .unwrap_or_else(|_| std::env::temp_dir().join("dev-ci-example/ci.yml"));
27
28    if let Some(parent) = target.parent() {
29        std::fs::create_dir_all(parent).expect("create parent dir");
30    }
31    std::fs::write(&target, yaml).expect("write yaml");
32    println!("wrote {}", target.display());
33}
examples/path_deps.rs (line 23)
11fn main() {
12    let yaml = Generator::new()
13        .target(Target::GitHubActions)
14        .matrix_os(["ubuntu-latest", "macos-latest", "windows-latest"])
15        .with_path_dep(PathDep::new(
16            "dev-report",
17            "https://github.com/jamesgober/dev-report.git",
18        ))
19        .with_path_dep(PathDep::new(
20            "dev-tools",
21            "https://github.com/jamesgober/dev-tools.git",
22        ))
23        .with_clippy()
24        .with_fmt()
25        .with_docs()
26        .with_msrv("1.85")
27        .generate();
28
29    println!("{yaml}");
30}
Source

pub fn with_fmt(self) -> Self

Include a rustfmt-check job.

Examples found in repository?
examples/basic.rs (line 16)
12fn main() {
13    let yaml = Generator::new()
14        .target(Target::GitHubActions)
15        .with_clippy()
16        .with_fmt()
17        .with_docs()
18        .with_msrv("1.85")
19        .generate();
20
21    println!("{yaml}");
22}
More examples
Hide additional examples
examples/full_suite.rs (line 21)
11fn main() {
12    let yaml = Generator::new()
13        .target(Target::GitHubActions)
14        .workflow_name("CI")
15        .branches(["main"])
16        .matrix_os(["ubuntu-latest", "macos-latest", "windows-latest"])
17        .with_workspace()
18        .with_no_default_features_build()
19        .with_all_features_build()
20        .with_clippy()
21        .with_fmt()
22        .with_docs()
23        .with_msrv("1.85")
24        .generate();
25
26    println!("{yaml}");
27}
examples/write_to_disk.rs (line 19)
16fn main() {
17    let yaml = Generator::new()
18        .with_clippy()
19        .with_fmt()
20        .with_docs()
21        .with_msrv("1.85")
22        .generate();
23
24    let target = std::env::var("DEV_CI_WRITE_TARGET")
25        .map(PathBuf::from)
26        .unwrap_or_else(|_| std::env::temp_dir().join("dev-ci-example/ci.yml"));
27
28    if let Some(parent) = target.parent() {
29        std::fs::create_dir_all(parent).expect("create parent dir");
30    }
31    std::fs::write(&target, yaml).expect("write yaml");
32    println!("wrote {}", target.display());
33}
examples/path_deps.rs (line 24)
11fn main() {
12    let yaml = Generator::new()
13        .target(Target::GitHubActions)
14        .matrix_os(["ubuntu-latest", "macos-latest", "windows-latest"])
15        .with_path_dep(PathDep::new(
16            "dev-report",
17            "https://github.com/jamesgober/dev-report.git",
18        ))
19        .with_path_dep(PathDep::new(
20            "dev-tools",
21            "https://github.com/jamesgober/dev-tools.git",
22        ))
23        .with_clippy()
24        .with_fmt()
25        .with_docs()
26        .with_msrv("1.85")
27        .generate();
28
29    println!("{yaml}");
30}
Source

pub fn with_docs(self) -> Self

Include a cargo doc job with RUSTDOCFLAGS="-D warnings".

Examples found in repository?
examples/basic.rs (line 17)
12fn main() {
13    let yaml = Generator::new()
14        .target(Target::GitHubActions)
15        .with_clippy()
16        .with_fmt()
17        .with_docs()
18        .with_msrv("1.85")
19        .generate();
20
21    println!("{yaml}");
22}
More examples
Hide additional examples
examples/full_suite.rs (line 22)
11fn main() {
12    let yaml = Generator::new()
13        .target(Target::GitHubActions)
14        .workflow_name("CI")
15        .branches(["main"])
16        .matrix_os(["ubuntu-latest", "macos-latest", "windows-latest"])
17        .with_workspace()
18        .with_no_default_features_build()
19        .with_all_features_build()
20        .with_clippy()
21        .with_fmt()
22        .with_docs()
23        .with_msrv("1.85")
24        .generate();
25
26    println!("{yaml}");
27}
examples/write_to_disk.rs (line 20)
16fn main() {
17    let yaml = Generator::new()
18        .with_clippy()
19        .with_fmt()
20        .with_docs()
21        .with_msrv("1.85")
22        .generate();
23
24    let target = std::env::var("DEV_CI_WRITE_TARGET")
25        .map(PathBuf::from)
26        .unwrap_or_else(|_| std::env::temp_dir().join("dev-ci-example/ci.yml"));
27
28    if let Some(parent) = target.parent() {
29        std::fs::create_dir_all(parent).expect("create parent dir");
30    }
31    std::fs::write(&target, yaml).expect("write yaml");
32    println!("wrote {}", target.display());
33}
examples/path_deps.rs (line 25)
11fn main() {
12    let yaml = Generator::new()
13        .target(Target::GitHubActions)
14        .matrix_os(["ubuntu-latest", "macos-latest", "windows-latest"])
15        .with_path_dep(PathDep::new(
16            "dev-report",
17            "https://github.com/jamesgober/dev-report.git",
18        ))
19        .with_path_dep(PathDep::new(
20            "dev-tools",
21            "https://github.com/jamesgober/dev-tools.git",
22        ))
23        .with_clippy()
24        .with_fmt()
25        .with_docs()
26        .with_msrv("1.85")
27        .generate();
28
29    println!("{yaml}");
30}
Source

pub fn with_msrv(self, version: impl Into<String>) -> Self

Include an MSRV job pinned to the given Rust version.

Examples found in repository?
examples/basic.rs (line 18)
12fn main() {
13    let yaml = Generator::new()
14        .target(Target::GitHubActions)
15        .with_clippy()
16        .with_fmt()
17        .with_docs()
18        .with_msrv("1.85")
19        .generate();
20
21    println!("{yaml}");
22}
More examples
Hide additional examples
examples/full_suite.rs (line 23)
11fn main() {
12    let yaml = Generator::new()
13        .target(Target::GitHubActions)
14        .workflow_name("CI")
15        .branches(["main"])
16        .matrix_os(["ubuntu-latest", "macos-latest", "windows-latest"])
17        .with_workspace()
18        .with_no_default_features_build()
19        .with_all_features_build()
20        .with_clippy()
21        .with_fmt()
22        .with_docs()
23        .with_msrv("1.85")
24        .generate();
25
26    println!("{yaml}");
27}
examples/write_to_disk.rs (line 21)
16fn main() {
17    let yaml = Generator::new()
18        .with_clippy()
19        .with_fmt()
20        .with_docs()
21        .with_msrv("1.85")
22        .generate();
23
24    let target = std::env::var("DEV_CI_WRITE_TARGET")
25        .map(PathBuf::from)
26        .unwrap_or_else(|_| std::env::temp_dir().join("dev-ci-example/ci.yml"));
27
28    if let Some(parent) = target.parent() {
29        std::fs::create_dir_all(parent).expect("create parent dir");
30    }
31    std::fs::write(&target, yaml).expect("write yaml");
32    println!("wrote {}", target.display());
33}
examples/path_deps.rs (line 26)
11fn main() {
12    let yaml = Generator::new()
13        .target(Target::GitHubActions)
14        .matrix_os(["ubuntu-latest", "macos-latest", "windows-latest"])
15        .with_path_dep(PathDep::new(
16            "dev-report",
17            "https://github.com/jamesgober/dev-report.git",
18        ))
19        .with_path_dep(PathDep::new(
20            "dev-tools",
21            "https://github.com/jamesgober/dev-tools.git",
22        ))
23        .with_clippy()
24        .with_fmt()
25        .with_docs()
26        .with_msrv("1.85")
27        .generate();
28
29    println!("{yaml}");
30}
Source

pub fn generate(&self) -> String

Render the workflow document.

Output is byte-deterministic for a given configuration.

Examples found in repository?
examples/basic.rs (line 19)
12fn main() {
13    let yaml = Generator::new()
14        .target(Target::GitHubActions)
15        .with_clippy()
16        .with_fmt()
17        .with_docs()
18        .with_msrv("1.85")
19        .generate();
20
21    println!("{yaml}");
22}
More examples
Hide additional examples
examples/full_suite.rs (line 24)
11fn main() {
12    let yaml = Generator::new()
13        .target(Target::GitHubActions)
14        .workflow_name("CI")
15        .branches(["main"])
16        .matrix_os(["ubuntu-latest", "macos-latest", "windows-latest"])
17        .with_workspace()
18        .with_no_default_features_build()
19        .with_all_features_build()
20        .with_clippy()
21        .with_fmt()
22        .with_docs()
23        .with_msrv("1.85")
24        .generate();
25
26    println!("{yaml}");
27}
examples/write_to_disk.rs (line 22)
16fn main() {
17    let yaml = Generator::new()
18        .with_clippy()
19        .with_fmt()
20        .with_docs()
21        .with_msrv("1.85")
22        .generate();
23
24    let target = std::env::var("DEV_CI_WRITE_TARGET")
25        .map(PathBuf::from)
26        .unwrap_or_else(|_| std::env::temp_dir().join("dev-ci-example/ci.yml"));
27
28    if let Some(parent) = target.parent() {
29        std::fs::create_dir_all(parent).expect("create parent dir");
30    }
31    std::fs::write(&target, yaml).expect("write yaml");
32    println!("wrote {}", target.display());
33}
examples/path_deps.rs (line 27)
11fn main() {
12    let yaml = Generator::new()
13        .target(Target::GitHubActions)
14        .matrix_os(["ubuntu-latest", "macos-latest", "windows-latest"])
15        .with_path_dep(PathDep::new(
16            "dev-report",
17            "https://github.com/jamesgober/dev-report.git",
18        ))
19        .with_path_dep(PathDep::new(
20            "dev-tools",
21            "https://github.com/jamesgober/dev-tools.git",
22        ))
23        .with_clippy()
24        .with_fmt()
25        .with_docs()
26        .with_msrv("1.85")
27        .generate();
28
29    println!("{yaml}");
30}

Trait Implementations§

Source§

impl Clone for Generator

Source§

fn clone(&self) -> Generator

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Generator

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Generator

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.