pub struct ImportRequest<'a> {
pub module_path: &'a str,
pub names: &'a [String],
pub default_import: Option<&'a str>,
pub namespace: Option<&'a str>,
pub alias: Option<&'a str>,
pub type_only: bool,
pub modifiers: &'a [String],
pub import_kind: Option<&'a str>,
}Expand description
Structured request to generate a single import line. Superset of the fields
the public aft_import schema exposes; each engine reads only the subset it
supports. New languages add fields here rather than growing positional
parameters on every generator signature.
Fields§
§module_path: &'a str§names: &'a [String]§default_import: Option<&'a str>§namespace: Option<&'a str>ES * as ns / Solidity * as A.
alias: Option<&'a str>Whole-module local alias (Solidity import "x" as A).
type_only: bool§modifiers: &'a [String]Statement-level modifier tokens (Java/C# static, C# global/unsafe,
wildcard, Swift @testable, …). Empty for the legacy engines.
import_kind: Option<&'a str>Symbol-kind-specific import (PHP function/const, Swift struct/…,
Scala given). Absent for the legacy engines.
Implementations§
Source§impl<'a> ImportRequest<'a>
impl<'a> ImportRequest<'a>
Sourcepub fn legacy(
module_path: &'a str,
names: &'a [String],
default_import: Option<&'a str>,
namespace: Option<&'a str>,
type_only: bool,
) -> Self
pub fn legacy( module_path: &'a str, names: &'a [String], default_import: Option<&'a str>, namespace: Option<&'a str>, type_only: bool, ) -> Self
Construct a request carrying only the legacy positional fields; the structured fields (alias/modifiers/import_kind) default to absent. Used by the back-compat free-function wrappers.
Trait Implementations§
Source§impl<'a> Clone for ImportRequest<'a>
impl<'a> Clone for ImportRequest<'a>
Source§fn clone(&self) -> ImportRequest<'a>
fn clone(&self) -> ImportRequest<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl<'a> Freeze for ImportRequest<'a>
impl<'a> RefUnwindSafe for ImportRequest<'a>
impl<'a> Send for ImportRequest<'a>
impl<'a> Sync for ImportRequest<'a>
impl<'a> Unpin for ImportRequest<'a>
impl<'a> UnsafeUnpin for ImportRequest<'a>
impl<'a> UnwindSafe for ImportRequest<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more