pub struct FtlTypeInfo {
pub type_kind: TypeKind,
pub type_name: &'static str,
pub variants: &'static [FtlVariant],
pub file_path: &'static str,
pub module_path: &'static str,
pub namespace: Option<NamespaceRule>,
}Expand description
Type information for FTL registration, used by derive macros and the CLI.
Fields§
§type_kind: TypeKind§type_name: &'static str§variants: &'static [FtlVariant]§file_path: &'static strThe file path where this type is defined (from file!() macro).
module_path: &'static strThe module path where this type is defined (from module_path!() macro).
namespace: Option<NamespaceRule>Optional namespace for FTL file output. If Some, the type will be written to
{lang}/{crate}/{namespace}.ftl instead of {lang}/{crate}.ftl.
Implementations§
Source§impl FtlTypeInfo
impl FtlTypeInfo
Sourcepub fn resolved_namespace(&self, manifest_dir: &Path) -> Option<String>
pub fn resolved_namespace(&self, manifest_dir: &Path) -> Option<String>
Resolve the namespace for this type, if configured.
Trait Implementations§
Source§impl AsRef<FtlTypeInfo> for FtlTypeInfo
impl AsRef<FtlTypeInfo> for FtlTypeInfo
Source§fn as_ref(&self) -> &FtlTypeInfo
fn as_ref(&self) -> &FtlTypeInfo
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl Clone for FtlTypeInfo
impl Clone for FtlTypeInfo
Source§fn clone(&self) -> FtlTypeInfo
fn clone(&self) -> FtlTypeInfo
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FtlTypeInfo
impl Debug for FtlTypeInfo
Source§impl Hash for FtlTypeInfo
impl Hash for FtlTypeInfo
Source§impl PartialEq for FtlTypeInfo
impl PartialEq for FtlTypeInfo
impl Eq for FtlTypeInfo
impl StructuralPartialEq for FtlTypeInfo
Auto Trait Implementations§
impl Freeze for FtlTypeInfo
impl RefUnwindSafe for FtlTypeInfo
impl Send for FtlTypeInfo
impl Sync for FtlTypeInfo
impl Unpin for FtlTypeInfo
impl UnsafeUnpin for FtlTypeInfo
impl UnwindSafe for FtlTypeInfo
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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