Struct daml_lf::element::DamlModule
source · [−]pub struct DamlModule<'a> { /* private fields */ }Implementations
sourceimpl<'a> DamlModule<'a>
impl<'a> DamlModule<'a>
sourcepub fn new_leaf(
path: Vec<Cow<'a, str>>,
flags: DamlFeatureFlags,
synonyms: Vec<DamlDefTypeSyn<'a>>,
data_types: HashMap<Cow<'a, str>, DamlData<'a>>,
values: HashMap<Cow<'a, str>, DamlDefValue<'a>>
) -> Self
pub fn new_leaf(
path: Vec<Cow<'a, str>>,
flags: DamlFeatureFlags,
synonyms: Vec<DamlDefTypeSyn<'a>>,
data_types: HashMap<Cow<'a, str>, DamlData<'a>>,
values: HashMap<Cow<'a, str>, DamlDefValue<'a>>
) -> Self
Create a leaf DamlModule.
sourcepub fn flags(&self) -> &DamlFeatureFlags
pub fn flags(&self) -> &DamlFeatureFlags
The DamlFeatureFlags of the module.
sourcepub fn synonyms(&self) -> &[DamlDefTypeSyn<'_>]
pub fn synonyms(&self) -> &[DamlDefTypeSyn<'_>]
The DamlDefTypeSyn of the module.
sourcepub fn child_modules(&self) -> impl Iterator<Item = &DamlModule<'a>>
pub fn child_modules(&self) -> impl Iterator<Item = &DamlModule<'a>>
The child DamlModule of the module.
sourcepub fn data_types(&self) -> impl Iterator<Item = &DamlData<'a>>
pub fn data_types(&self) -> impl Iterator<Item = &DamlData<'a>>
The DamlData declared in the module.
sourcepub fn values(&self) -> impl Iterator<Item = &DamlDefValue<'a>>
pub fn values(&self) -> impl Iterator<Item = &DamlDefValue<'a>>
The DamlDefValue declared in the module.
sourcepub fn local_name(&self) -> &str
pub fn local_name(&self) -> &str
Returns the local name of the module.
sourcepub fn child_module<S: AsRef<str>>(&self, name: S) -> Option<&DamlModule<'_>>
pub fn child_module<S: AsRef<str>>(&self, name: S) -> Option<&DamlModule<'_>>
Retrieve a child DamlModule by name or None if no such module exists.
sourcepub fn child_module_path<'b, S: AsRef<str>>(
&'a self,
relative_path: &'b [S]
) -> Option<&'a DamlModule<'a>>
pub fn child_module_path<'b, S: AsRef<str>>(
&'a self,
relative_path: &'b [S]
) -> Option<&'a DamlModule<'a>>
Retrieve a child DamlModule by name or None if no such module exists.
sourcepub fn data_type<S: AsRef<str>>(&self, name: S) -> Option<&DamlData<'a>>
pub fn data_type<S: AsRef<str>>(&self, name: S) -> Option<&DamlData<'a>>
Retrieve a DamlData by name or None if no such data type exists.
sourcepub fn value<S: AsRef<str>>(&self, name: S) -> Option<&DamlDefValue<'a>>
pub fn value<S: AsRef<str>>(&self, name: S) -> Option<&DamlDefValue<'a>>
Retrieve a DamlDefValue by name or None if no such value exists.
Trait Implementations
sourceimpl<'a> Clone for DamlModule<'a>
impl<'a> Clone for DamlModule<'a>
sourcefn clone(&self) -> DamlModule<'a>
fn clone(&self) -> DamlModule<'a>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl<'a> DamlVisitableElement<'a> for DamlModule<'a>
impl<'a> DamlVisitableElement<'a> for DamlModule<'a>
fn accept(&'a self, visitor: &'a mut impl DamlElementVisitor)
sourceimpl<'a> Debug for DamlModule<'a>
impl<'a> Debug for DamlModule<'a>
sourceimpl<'a> IntoBoundedStatic for DamlModule<'a>
impl<'a> IntoBoundedStatic for DamlModule<'a>
type Static = DamlModule<'static>
type Static = DamlModule<'static>
The target type is bounded by the 'static lifetime.
sourcefn into_static(self) -> Self::Static
fn into_static(self) -> Self::Static
Convert an owned T into an owned T such that T: 'static.
sourceimpl<'a> Serialize for DamlModule<'a>
impl<'a> Serialize for DamlModule<'a>
sourceimpl<'a> ToBoundedStatic for DamlModule<'a>
impl<'a> ToBoundedStatic for DamlModule<'a>
type Static = DamlModule<'static>
type Static = DamlModule<'static>
The target type is bounded by the 'static lifetime.
Auto Trait Implementations
impl<'a> RefUnwindSafe for DamlModule<'a>
impl<'a> Send for DamlModule<'a>
impl<'a> Sync for DamlModule<'a>
impl<'a> Unpin for DamlModule<'a>
impl<'a> UnwindSafe for DamlModule<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more