Skip to main content

RustSpecRegistry

Struct RustSpecRegistry 

Source
pub struct RustSpecRegistry<'a> {
    pub scan_dirs: &'a [&'a str],
    pub const_name: &'a str,
    pub output_file: &'a str,
}
Expand description

Description of one Rust-source OpSpec registry to emit from build.rs.

Use this when operation implementations expose pub const SPEC: OpSpec or an associated impl Type { pub const SPEC: OpSpec = ...; } and the crate wants a generated &[&OpSpec] in OUT_DIR.

§build.rs example

vyre_build_scan::scan_rust_specs(&vyre_build_scan::RustSpecRegistry {
    scan_dirs: &["src/ops"],
    const_name: "GENERATED_REGISTRY",
    output_file: "ops_registry.rs",
});

Fields§

§scan_dirs: &'a [&'a str]

Source directories relative to the crate manifest, e.g. "src/ops".

§const_name: &'a str

Name of the emitted slice, e.g. "GENERATED_REGISTRY".

§output_file: &'a str

Bare output file name under $OUT_DIR, e.g. "ops_registry.rs".

Auto Trait Implementations§

§

impl<'a> Freeze for RustSpecRegistry<'a>

§

impl<'a> RefUnwindSafe for RustSpecRegistry<'a>

§

impl<'a> Send for RustSpecRegistry<'a>

§

impl<'a> Sync for RustSpecRegistry<'a>

§

impl<'a> Unpin for RustSpecRegistry<'a>

§

impl<'a> UnsafeUnpin for RustSpecRegistry<'a>

§

impl<'a> UnwindSafe for RustSpecRegistry<'a>

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> 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, 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.