Struct holochain_zome_types::zome::inline_zome::InlineZome
source · pub struct InlineZome<T = IntegrityZomeMarker> { /* private fields */ }
Expand description
An “inline” zome definition in pure Rust, as opposed to a zome defined in Wasm.
Implementations§
source§impl<T> InlineZome<T>
impl<T> InlineZome<T>
pub fn functions(&self) -> Vec<FunctionName> ⓘ
sourcepub fn function<F, I, O>(self, name: &str, f: F) -> Selfwhere
F: Fn(BoxApi, I) -> InlineZomeResult<O> + 'static + Send + Sync,
I: DeserializeOwned + Debug,
O: Serialize + Debug,
pub fn function<F, I, O>(self, name: &str, f: F) -> Selfwhere
F: Fn(BoxApi, I) -> InlineZomeResult<O> + 'static + Send + Sync,
I: DeserializeOwned + Debug,
O: Serialize + Debug,
Define a new zome function or callback with the given name
sourcepub fn callback<F, I, O>(self, name: &str, f: F) -> Selfwhere
F: Fn(BoxApi, I) -> InlineZomeResult<O> + 'static + Send + Sync,
I: DeserializeOwned + Debug,
O: Serialize + Debug,
👎Deprecated: Alias for function
pub fn callback<F, I, O>(self, name: &str, f: F) -> Selfwhere
F: Fn(BoxApi, I) -> InlineZomeResult<O> + 'static + Send + Sync,
I: DeserializeOwned + Debug,
O: Serialize + Debug,
function
Alias for function
sourcepub fn maybe_call(
&self,
api: BoxApi,
name: &FunctionName,
input: ExternIO
) -> InlineZomeResult<Option<ExternIO>>
pub fn maybe_call(
&self,
api: BoxApi,
name: &FunctionName,
input: ExternIO
) -> InlineZomeResult<Option<ExternIO>>
Make a call to an inline zome callback. If the callback doesn’t exist, return None.
sourcepub fn set_global(self, name: impl Into<String>, val: u8) -> Self
pub fn set_global(self, name: impl Into<String>, val: u8) -> Self
Set a global value for this zome.
source§impl InlineZome<IntegrityZomeMarker>
impl InlineZome<IntegrityZomeMarker>
sourcepub fn new<S: Into<String>, E: IntoIterator<Item = EntryDef>>(
uuid: S,
entry_defs: E,
num_link_types: u8
) -> Self
pub fn new<S: Into<String>, E: IntoIterator<Item = EntryDef>>(
uuid: S,
entry_defs: E,
num_link_types: u8
) -> Self
Create a new integrity zome with the given network seed
sourcepub fn new_unique<E: IntoIterator<Item = EntryDef>>(
entry_defs: E,
num_link_types: u8
) -> Self
pub fn new_unique<E: IntoIterator<Item = EntryDef>>(
entry_defs: E,
num_link_types: u8
) -> Self
Create a new integrity zome with a unique random network seed
Trait Implementations§
source§impl<T: Debug> Debug for InlineZome<T>
impl<T: Debug> Debug for InlineZome<T>
source§impl From<InlineZome<CoordinatorZomeMarker>> for CoordinatorZomeDef
impl From<InlineZome<CoordinatorZomeMarker>> for CoordinatorZomeDef
source§fn from(iz: InlineCoordinatorZome) -> Self
fn from(iz: InlineCoordinatorZome) -> Self
Converts to this type from the input type.
source§impl From<InlineZome<CoordinatorZomeMarker>> for ZomeDef
impl From<InlineZome<CoordinatorZomeMarker>> for ZomeDef
source§fn from(iz: InlineCoordinatorZome) -> Self
fn from(iz: InlineCoordinatorZome) -> Self
Converts to this type from the input type.
source§impl From<InlineZome<IntegrityZomeMarker>> for IntegrityZomeDef
impl From<InlineZome<IntegrityZomeMarker>> for IntegrityZomeDef
source§fn from(iz: InlineIntegrityZome) -> Self
fn from(iz: InlineIntegrityZome) -> Self
Converts to this type from the input type.
source§impl From<InlineZome<IntegrityZomeMarker>> for ZomeDef
impl From<InlineZome<IntegrityZomeMarker>> for ZomeDef
source§fn from(iz: InlineIntegrityZome) -> Self
fn from(iz: InlineIntegrityZome) -> Self
Converts to this type from the input type.
source§impl<T: Hash> Hash for InlineZome<T>
impl<T: Hash> Hash for InlineZome<T>
source§impl<T: Debug> InlineZomeT for InlineZome<T>
impl<T: Debug> InlineZomeT for InlineZome<T>
source§fn functions(&self) -> Vec<FunctionName> ⓘ
fn functions(&self) -> Vec<FunctionName> ⓘ
Get the functions for this
InlineZome
.source§fn maybe_call(
&self,
api: BoxApi,
name: &FunctionName,
input: ExternIO
) -> InlineZomeResult<Option<ExternIO>>
fn maybe_call(
&self,
api: BoxApi,
name: &FunctionName,
input: ExternIO
) -> InlineZomeResult<Option<ExternIO>>
Make a call to an inline zome function.
If the function doesn’t exist, return None.
source§impl<T: Ord> Ord for InlineZome<T>
impl<T: Ord> Ord for InlineZome<T>
source§fn cmp(&self, other: &InlineZome<T>) -> Ordering
fn cmp(&self, other: &InlineZome<T>) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl<T: PartialEq> PartialEq<InlineZome<T>> for InlineZome<T>
impl<T: PartialEq> PartialEq<InlineZome<T>> for InlineZome<T>
source§fn eq(&self, other: &InlineZome<T>) -> bool
fn eq(&self, other: &InlineZome<T>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<T: PartialOrd> PartialOrd<InlineZome<T>> for InlineZome<T>
impl<T: PartialOrd> PartialOrd<InlineZome<T>> for InlineZome<T>
source§fn partial_cmp(&self, other: &InlineZome<T>) -> Option<Ordering>
fn partial_cmp(&self, other: &InlineZome<T>) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl<T: Eq> Eq for InlineZome<T>
Auto Trait Implementations§
impl<T = IntegrityZomeMarker> !RefUnwindSafe for InlineZome<T>
impl<T> Send for InlineZome<T>where
T: Send,
impl<T> Sync for InlineZome<T>where
T: Sync,
impl<T> Unpin for InlineZome<T>where
T: Unpin,
impl<T = IntegrityZomeMarker> !UnwindSafe for InlineZome<T>
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
§impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
§fn deserialize(
&self,
deserializer: &mut D
) -> Result<With<T, W>, <D as Fallible>::Error>
fn deserialize(
&self,
deserializer: &mut D
) -> Result<With<T, W>, <D as Fallible>::Error>
Deserializes using the given deserializer
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.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>
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.§impl<T> Upcastable for Twhere
T: Any + Send + Sync + 'static,
impl<T> Upcastable for Twhere
T: Any + Send + Sync + 'static,
§fn upcast_any_ref(&self) -> &(dyn Any + 'static)
fn upcast_any_ref(&self) -> &(dyn Any + 'static)
upcast ref
§fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)
upcast mut ref