Struct daml_lf::element::DamlArchive
source · [−]pub struct DamlArchive<'a> { /* private fields */ }Implementations
sourceimpl<'a> DamlArchive<'a>
impl<'a> DamlArchive<'a>
sourcepub const fn new(
name: Cow<'a, str>,
main_package_id: Cow<'a, str>,
packages: HashMap<Cow<'a, str>, DamlPackage<'a>>
) -> Self
pub const fn new(
name: Cow<'a, str>,
main_package_id: Cow<'a, str>,
packages: HashMap<Cow<'a, str>, DamlPackage<'a>>
) -> Self
pub fn name(&self) -> &str
sourcepub fn main_package_id(&self) -> &str
pub fn main_package_id(&self) -> &str
Return the package id of the main DamlPackage contained in this DamlArchive.
sourcepub fn packages(&self) -> impl Iterator<Item = &DamlPackage<'_>>
pub fn packages(&self) -> impl Iterator<Item = &DamlPackage<'_>>
Return an Iterator of the DamlPackage in this DamlArchive.
sourcepub fn package_by_name(&self, name: &str) -> Option<&DamlPackage<'_>>
pub fn package_by_name(&self, name: &str) -> Option<&DamlPackage<'_>>
Return the first DamlPackage in this DamlArchive which has the given name or None if no such
package exists.
sourcepub fn main_package(&self) -> Option<&DamlPackage<'_>>
pub fn main_package(&self) -> Option<&DamlPackage<'_>>
Return the main DamlPackage in this DamlArchive or None if no such package exists.
sourcepub fn data_by_tycon<'b>(
&'a self,
tycon: &'b DamlTyCon<'_>
) -> Option<&'a DamlData<'a>>
pub fn data_by_tycon<'b>(
&'a self,
tycon: &'b DamlTyCon<'_>
) -> Option<&'a DamlData<'a>>
Retrieve a DamlData contained within this DamlArchive referred to by the supplied DamlTyCon or None if
not such data item exists.
DOCME
sourcepub fn data_by_tycon_name<'b>(
&'a self,
tycon_name: &'b DamlTyConName<'_>
) -> Option<&'a DamlData<'a>>
pub fn data_by_tycon_name<'b>(
&'a self,
tycon_name: &'b DamlTyConName<'_>
) -> Option<&'a DamlData<'a>>
Retrieve a DamlData contained within this DamlArchive referred to by the supplied DamlTyConName or None
if not such data item exists.
DOCME
sourcepub fn data<P, M, D>(
&'a self,
package_id: P,
module_path: &[M],
data_name: D
) -> Option<&'a DamlData<'a>> where
P: AsRef<str>,
M: AsRef<str>,
D: AsRef<str>,
pub fn data<P, M, D>(
&'a self,
package_id: P,
module_path: &[M],
data_name: D
) -> Option<&'a DamlData<'a>> where
P: AsRef<str>,
M: AsRef<str>,
D: AsRef<str>,
Retrieve a DamlData contained within this DamlArchive referred to by the supplied package id, module path &
name or None if not such data item exists.
DOCME
sourcepub fn value_by_name<'b>(
&'a self,
name: &'b DamlValueName<'_>
) -> Option<&'a DamlDefValue<'a>>
pub fn value_by_name<'b>(
&'a self,
name: &'b DamlValueName<'_>
) -> Option<&'a DamlDefValue<'a>>
Retrieve a DamlDefValue for a given DamlValueName or None if no such value exists in this DamlArchive.
DOCME
Trait Implementations
sourceimpl<'a> Clone for DamlArchive<'a>
impl<'a> Clone for DamlArchive<'a>
sourcefn clone(&self) -> DamlArchive<'a>
fn clone(&self) -> DamlArchive<'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 DamlArchive<'a>
impl<'a> DamlVisitableElement<'a> for DamlArchive<'a>
fn accept(&'a self, visitor: &'a mut impl DamlElementVisitor)
sourceimpl<'a> Debug for DamlArchive<'a>
impl<'a> Debug for DamlArchive<'a>
sourceimpl<'a> Default for DamlArchive<'a>
impl<'a> Default for DamlArchive<'a>
sourcefn default() -> DamlArchive<'a>
fn default() -> DamlArchive<'a>
Returns the “default value” for a type. Read more
sourceimpl<'a> IntoBoundedStatic for DamlArchive<'a>
impl<'a> IntoBoundedStatic for DamlArchive<'a>
type Static = DamlArchive<'static>
type Static = DamlArchive<'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 DamlArchive<'a>
impl<'a> Serialize for DamlArchive<'a>
sourceimpl<'a> ToBoundedStatic for DamlArchive<'a>
impl<'a> ToBoundedStatic for DamlArchive<'a>
type Static = DamlArchive<'static>
type Static = DamlArchive<'static>
The target type is bounded by the 'static lifetime.
Auto Trait Implementations
impl<'a> RefUnwindSafe for DamlArchive<'a>
impl<'a> Send for DamlArchive<'a>
impl<'a> Sync for DamlArchive<'a>
impl<'a> Unpin for DamlArchive<'a>
impl<'a> UnwindSafe for DamlArchive<'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