diff --git a/.lock b/.lock new file mode 100644 index 0000000000..e69de29bb2 diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 0000000000..e69de29bb2 diff --git a/CNAME b/CNAME new file mode 100644 index 0000000000..469a724ea9 --- /dev/null +++ b/CNAME @@ -0,0 +1 @@ +doc.fluence.dev diff --git a/air_interpreter_fs/air_interpreter/fn.air_interpreter_path.html b/air_interpreter_fs/air_interpreter/fn.air_interpreter_path.html new file mode 100644 index 0000000000..9821f4eaff --- /dev/null +++ b/air_interpreter_fs/air_interpreter/fn.air_interpreter_path.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../air_interpreter_fs/fn.air_interpreter_path.html...

+ + + \ No newline at end of file diff --git a/air_interpreter_fs/air_interpreter/fn.write_default_air_interpreter.html b/air_interpreter_fs/air_interpreter/fn.write_default_air_interpreter.html new file mode 100644 index 0000000000..b47a92099b --- /dev/null +++ b/air_interpreter_fs/air_interpreter/fn.write_default_air_interpreter.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../air_interpreter_fs/fn.write_default_air_interpreter.html...

+ + + \ No newline at end of file diff --git a/air_interpreter_fs/all.html b/air_interpreter_fs/all.html new file mode 100644 index 0000000000..4f3b6c53bf --- /dev/null +++ b/air_interpreter_fs/all.html @@ -0,0 +1 @@ +List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/air_interpreter_fs/fn.air_interpreter_path.html b/air_interpreter_fs/fn.air_interpreter_path.html new file mode 100644 index 0000000000..de10408076 --- /dev/null +++ b/air_interpreter_fs/fn.air_interpreter_path.html @@ -0,0 +1 @@ +air_interpreter_path in air_interpreter_fs - Rust
pub fn air_interpreter_path(base_dir: &Path) -> PathBuf
\ No newline at end of file diff --git a/air_interpreter_fs/fn.write_default_air_interpreter.html b/air_interpreter_fs/fn.write_default_air_interpreter.html new file mode 100644 index 0000000000..be70f96d23 --- /dev/null +++ b/air_interpreter_fs/fn.write_default_air_interpreter.html @@ -0,0 +1 @@ +write_default_air_interpreter in air_interpreter_fs - Rust
pub fn write_default_air_interpreter(destination: &Path) -> Result<()>
\ No newline at end of file diff --git a/air_interpreter_fs/index.html b/air_interpreter_fs/index.html new file mode 100644 index 0000000000..f151ab0321 --- /dev/null +++ b/air_interpreter_fs/index.html @@ -0,0 +1,2 @@ +air_interpreter_fs - Rust

Functions

\ No newline at end of file diff --git a/air_interpreter_fs/sidebar-items.js b/air_interpreter_fs/sidebar-items.js new file mode 100644 index 0000000000..7207076f3e --- /dev/null +++ b/air_interpreter_fs/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"fn":["air_interpreter_path","write_default_air_interpreter"]}; \ No newline at end of file diff --git a/aquamarine/all.html b/aquamarine/all.html new file mode 100644 index 0000000000..8bf9cd4cfb --- /dev/null +++ b/aquamarine/all.html @@ -0,0 +1 @@ +List of all items in this crate

List of all items

Structs

Enums

Traits

Type Aliases

\ No newline at end of file diff --git a/aquamarine/aqua_runtime/trait.AquaRuntime.html b/aquamarine/aqua_runtime/trait.AquaRuntime.html new file mode 100644 index 0000000000..926c2499ee --- /dev/null +++ b/aquamarine/aqua_runtime/trait.AquaRuntime.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../aquamarine/trait.AquaRuntime.html...

+ + + \ No newline at end of file diff --git a/aquamarine/aquamarine/struct.AquamarineApi.html b/aquamarine/aquamarine/struct.AquamarineApi.html new file mode 100644 index 0000000000..42f171fcb7 --- /dev/null +++ b/aquamarine/aquamarine/struct.AquamarineApi.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../aquamarine/struct.AquamarineApi.html...

+ + + \ No newline at end of file diff --git a/aquamarine/aquamarine/struct.AquamarineBackend.html b/aquamarine/aquamarine/struct.AquamarineBackend.html new file mode 100644 index 0000000000..57841cff98 --- /dev/null +++ b/aquamarine/aquamarine/struct.AquamarineBackend.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../aquamarine/struct.AquamarineBackend.html...

+ + + \ No newline at end of file diff --git a/aquamarine/config/struct.DataStoreConfig.html b/aquamarine/config/struct.DataStoreConfig.html new file mode 100644 index 0000000000..1bf98d64b7 --- /dev/null +++ b/aquamarine/config/struct.DataStoreConfig.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../aquamarine/struct.DataStoreConfig.html...

+ + + \ No newline at end of file diff --git a/aquamarine/config/struct.VmConfig.html b/aquamarine/config/struct.VmConfig.html new file mode 100644 index 0000000000..f70d44d212 --- /dev/null +++ b/aquamarine/config/struct.VmConfig.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../aquamarine/struct.VmConfig.html...

+ + + \ No newline at end of file diff --git a/aquamarine/config/struct.VmPoolConfig.html b/aquamarine/config/struct.VmPoolConfig.html new file mode 100644 index 0000000000..a049598691 --- /dev/null +++ b/aquamarine/config/struct.VmPoolConfig.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../aquamarine/struct.VmPoolConfig.html...

+ + + \ No newline at end of file diff --git a/aquamarine/enum.AquamarineApiError.html b/aquamarine/enum.AquamarineApiError.html new file mode 100644 index 0000000000..9538fb5c07 --- /dev/null +++ b/aquamarine/enum.AquamarineApiError.html @@ -0,0 +1,60 @@ +AquamarineApiError in aquamarine - Rust
pub enum AquamarineApiError {
+    ParticleExpired {
+        particle_id: String,
+    },
+    OneshotCancelled {
+        particle_id: String,
+    },
+    AquamarineDied {
+        particle_id: Option<String>,
+    },
+    ExecutionTimedOut {
+        particle_id: String,
+        timeout: FormattedDuration,
+    },
+    AquamarineQueueFull {
+        particle_id: Option<String>,
+    },
+    SignatureVerificationFailed {
+        particle_id: String,
+        err: ParticleError,
+    },
+    WorkerIsNotActive {
+        worker_id: String,
+        particle_id: String,
+    },
+}

Variants§

§

ParticleExpired

Fields

§particle_id: String
§

OneshotCancelled

Fields

§particle_id: String
§

AquamarineDied

Fields

§particle_id: Option<String>
§

ExecutionTimedOut

Fields

§particle_id: String
§timeout: FormattedDuration
§

AquamarineQueueFull

Fields

§particle_id: Option<String>
§

SignatureVerificationFailed

Fields

§particle_id: String
§

WorkerIsNotActive

Fields

§worker_id: String
§particle_id: String

Implementations§

Trait Implementations§

source§

impl Debug for AquamarineApiError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for AquamarineApiError

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for AquamarineApiError

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/aquamarine/enum.DataStoreError.html b/aquamarine/enum.DataStoreError.html new file mode 100644 index 0000000000..19373dacc0 --- /dev/null +++ b/aquamarine/enum.DataStoreError.html @@ -0,0 +1,44 @@ +DataStoreError in aquamarine - Rust
pub enum DataStoreError {
+    CreateDataStore(Error),
+    VaultError(VaultError),
+    StoreData(Error, PathBuf),
+    CleanupData(Error),
+    CreateAnomalyDir(Error),
+    WriteAnomaly(Error, PathBuf),
+    SerializeAnomaly(Error),
+    ReadData(Error, PathBuf),
+}

Variants§

§

CreateDataStore(Error)

§

VaultError(VaultError)

§

StoreData(Error, PathBuf)

§

CleanupData(Error)

§

CreateAnomalyDir(Error)

§

WriteAnomaly(Error, PathBuf)

§

SerializeAnomaly(Error)

§

ReadData(Error, PathBuf)

Trait Implementations§

source§

impl Debug for DataStoreError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for DataStoreError

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for DataStoreError

source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl From<VaultError> for DataStoreError

source§

fn from(source: VaultError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/aquamarine/error/enum.AquamarineApiError.html b/aquamarine/error/enum.AquamarineApiError.html new file mode 100644 index 0000000000..cc12fbadd5 --- /dev/null +++ b/aquamarine/error/enum.AquamarineApiError.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../aquamarine/enum.AquamarineApiError.html...

+ + + \ No newline at end of file diff --git a/aquamarine/index.html b/aquamarine/index.html new file mode 100644 index 0000000000..9c2e1a9be9 --- /dev/null +++ b/aquamarine/index.html @@ -0,0 +1,2 @@ +aquamarine - Rust

Crate aquamarine

source ·

Structs

Enums

Traits

Type Aliases

\ No newline at end of file diff --git a/aquamarine/particle_data_store/enum.DataStoreError.html b/aquamarine/particle_data_store/enum.DataStoreError.html new file mode 100644 index 0000000000..7c6aa458ea --- /dev/null +++ b/aquamarine/particle_data_store/enum.DataStoreError.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../aquamarine/enum.DataStoreError.html...

+ + + \ No newline at end of file diff --git a/aquamarine/particle_data_store/struct.ParticleDataStore.html b/aquamarine/particle_data_store/struct.ParticleDataStore.html new file mode 100644 index 0000000000..568dd92120 --- /dev/null +++ b/aquamarine/particle_data_store/struct.ParticleDataStore.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../aquamarine/struct.ParticleDataStore.html...

+ + + \ No newline at end of file diff --git a/aquamarine/particle_effects/struct.InterpretationStats.html b/aquamarine/particle_effects/struct.InterpretationStats.html new file mode 100644 index 0000000000..c6bb9ca71a --- /dev/null +++ b/aquamarine/particle_effects/struct.InterpretationStats.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../aquamarine/struct.InterpretationStats.html...

+ + + \ No newline at end of file diff --git a/aquamarine/particle_effects/struct.ParticleEffects.html b/aquamarine/particle_effects/struct.ParticleEffects.html new file mode 100644 index 0000000000..c65613df6b --- /dev/null +++ b/aquamarine/particle_effects/struct.ParticleEffects.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../aquamarine/struct.ParticleEffects.html...

+ + + \ No newline at end of file diff --git a/aquamarine/particle_effects/struct.RemoteRoutingEffects.html b/aquamarine/particle_effects/struct.RemoteRoutingEffects.html new file mode 100644 index 0000000000..7f0c98f5e7 --- /dev/null +++ b/aquamarine/particle_effects/struct.RemoteRoutingEffects.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../aquamarine/struct.RemoteRoutingEffects.html...

+ + + \ No newline at end of file diff --git a/aquamarine/plumber/struct.Plumber.html b/aquamarine/plumber/struct.Plumber.html new file mode 100644 index 0000000000..5a37d4d8c9 --- /dev/null +++ b/aquamarine/plumber/struct.Plumber.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../aquamarine/struct.Plumber.html...

+ + + \ No newline at end of file diff --git a/aquamarine/sidebar-items.js b/aquamarine/sidebar-items.js new file mode 100644 index 0000000000..6283a104c3 --- /dev/null +++ b/aquamarine/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["AquamarineApiError","DataStoreError"],"struct":["AquamarineApi","AquamarineBackend","DataStoreConfig","InterpretationStats","ParticleDataStore","ParticleEffects","Plumber","RemoteRoutingEffects","VmConfig","VmPoolConfig","WasmBackendConfig","WasmtimeWasmBackend"],"trait":["AquaRuntime"],"type":["AVMRunner"]}; \ No newline at end of file diff --git a/aquamarine/struct.AquamarineApi.html b/aquamarine/struct.AquamarineApi.html new file mode 100644 index 0000000000..7a732392a4 --- /dev/null +++ b/aquamarine/struct.AquamarineApi.html @@ -0,0 +1,47 @@ +AquamarineApi in aquamarine - Rust
pub struct AquamarineApi { /* private fields */ }

Implementations§

source§

impl AquamarineApi

source

pub fn new(outlet: Sender<Command>, execution_timeout: Duration) -> Self

source

pub fn execute( + self, + particle: ExtendedParticle, + function: Option<ServiceFunction> +) -> impl Future<Output = Result<(), AquamarineApiError>>

Send particle to the interpreters pool

+
source

pub fn add_service( + self, + service: String, + functions: HashMap<String, ServiceFunction> +) -> impl Future<Output = Result<(), AquamarineApiError>>

source

pub fn remove_service( + self, + service: String +) -> impl Future<Output = Result<(), AquamarineApiError>>

Trait Implementations§

source§

impl Clone for AquamarineApi

source§

fn clone(&self) -> AquamarineApi

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/aquamarine/struct.AquamarineBackend.html b/aquamarine/struct.AquamarineBackend.html new file mode 100644 index 0000000000..884089834b --- /dev/null +++ b/aquamarine/struct.AquamarineBackend.html @@ -0,0 +1,51 @@ +AquamarineBackend in aquamarine - Rust
pub struct AquamarineBackend<RT: AquaRuntime, F> { /* private fields */ }

Implementations§

source§

impl<RT: AquaRuntime, F: ParticleFunctionStatic> AquamarineBackend<RT, F>

source

pub fn new( + config: VmPoolConfig, + vm_config: RT::Config, + avm_wasm_backend_config: WasmBackendConfig, + data_store_config: DataStoreConfig, + builtins: F, + out: Sender<Result<RemoteRoutingEffects, AquamarineApiError>>, + plumber_metrics: Option<ParticleExecutorMetrics>, + vm_pool_metrics: Option<VmPoolMetrics>, + health_registry: Option<&mut HealthCheckRegistry>, + workers: Arc<Workers>, + key_storage: Arc<KeyStorage>, + scopes: PeerScopes, + worker_events: Receiver<Event> +) -> Result<(Self, AquamarineApi)>

source

pub fn poll(&mut self, cx: &mut Context<'_>) -> Poll<()>

source

pub fn start(self) -> JoinHandle<()>

Auto Trait Implementations§

§

impl<RT, F> !RefUnwindSafe for AquamarineBackend<RT, F>

§

impl<RT, F> Send for AquamarineBackend<RT, F>where + F: Send,

§

impl<RT, F> !Sync for AquamarineBackend<RT, F>

§

impl<RT, F> Unpin for AquamarineBackend<RT, F>where + F: Unpin, + RT: Unpin, + <RT as AquaRuntime>::Config: Unpin,

§

impl<RT, F> !UnwindSafe for AquamarineBackend<RT, F>

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/aquamarine/struct.DataStoreConfig.html b/aquamarine/struct.DataStoreConfig.html new file mode 100644 index 0000000000..5e96a1bb1a --- /dev/null +++ b/aquamarine/struct.DataStoreConfig.html @@ -0,0 +1,44 @@ +DataStoreConfig in aquamarine - Rust
pub struct DataStoreConfig {
+    pub particles_dir: PathBuf,
+    pub particles_vault_dir: PathBuf,
+    pub particles_anomaly_dir: PathBuf,
+}

Fields§

§particles_dir: PathBuf

Dir for the interpreter to persist particle data +to merge it between particles of the same particle_id

+
§particles_vault_dir: PathBuf

Dir to store directories shared between services +in the span of a single particle execution

+
§particles_anomaly_dir: PathBuf

Dir to store particles data of AquaVM performance anomalies

+

Implementations§

source§

impl DataStoreConfig

source

pub fn new(base_dir: PathBuf) -> Self

Trait Implementations§

source§

impl Clone for DataStoreConfig

source§

fn clone(&self) -> DataStoreConfig

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for DataStoreConfig

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/aquamarine/struct.InterpretationStats.html b/aquamarine/struct.InterpretationStats.html new file mode 100644 index 0000000000..5b17dbed4a --- /dev/null +++ b/aquamarine/struct.InterpretationStats.html @@ -0,0 +1,41 @@ +InterpretationStats in aquamarine - Rust
pub struct InterpretationStats {
+    pub interpretation_time: Duration,
+    pub memory_delta: usize,
+    pub new_data_len: Option<usize>,
+    pub success: bool,
+}
Expand description

Performance stats about particle’s interpretation

+

Fields§

§interpretation_time: Duration§memory_delta: usize§new_data_len: Option<usize>§success: bool

Implementations§

Trait Implementations§

source§

impl Clone for InterpretationStats

source§

fn clone(&self) -> InterpretationStats

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for InterpretationStats

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/aquamarine/struct.ParticleDataStore.html b/aquamarine/struct.ParticleDataStore.html new file mode 100644 index 0000000000..18ed37e125 --- /dev/null +++ b/aquamarine/struct.ParticleDataStore.html @@ -0,0 +1,83 @@ +ParticleDataStore in aquamarine - Rust
pub struct ParticleDataStore {
+    pub particle_data_store: PathBuf,
+    pub vault: ParticleVault,
+    pub anomaly_data_store: PathBuf,
+}

Fields§

§particle_data_store: PathBuf§vault: ParticleVault§anomaly_data_store: PathBuf

Implementations§

source§

impl ParticleDataStore

source

pub fn new( + particle_data_store: PathBuf, + vault_dir: PathBuf, + anomaly_data_store: PathBuf +) -> Self

source

pub fn data_file( + &self, + particle_id: &str, + current_peer_id: &str, + signature: &[u8] +) -> PathBuf

source

pub fn anomaly_dir( + &self, + particle_id: &str, + current_peer_id: &str, + signature: &[u8] +) -> PathBuf

Returns $ANOMALY_DATA_STORE/$particle_id/$timestamp

+
source§

impl ParticleDataStore

source

pub async fn initialize(&self) -> Result<(), DataStoreError>

source

pub async fn store_data( + &self, + data: &[u8], + particle_id: &str, + current_peer_id: &str, + signature: &[u8] +) -> Result<(), DataStoreError>

source

pub async fn read_data( + &self, + particle_id: &str, + current_peer_id: &str, + signature: &[u8] +) -> Result<Vec<u8>, DataStoreError>

source

pub async fn batch_cleanup_data( + &self, + cleanup_keys: Vec<(String, PeerId, Vec<u8>, String)> +)

source

pub fn detect_anomaly( + &self, + execution_time: Duration, + memory_delta: usize, + outcome: &RawAVMOutcome +) -> bool

source

pub async fn save_anomaly_data( + &self, + air_script: &str, + current_data: &[u8], + call_results: &CallResults, + particle_parameters: &ParticleParameters<'_>, + particle_signature: &[u8], + outcome: &RawAVMOutcome, + execution_time: Duration, + memory_delta: usize +) -> Result<(), DataStoreError>

Trait Implementations§

source§

impl Clone for ParticleDataStore

source§

fn clone(&self) -> ParticleDataStore

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ParticleDataStore

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/aquamarine/struct.ParticleEffects.html b/aquamarine/struct.ParticleEffects.html new file mode 100644 index 0000000000..9b3e578a73 --- /dev/null +++ b/aquamarine/struct.ParticleEffects.html @@ -0,0 +1,43 @@ +ParticleEffects in aquamarine - Rust
pub struct ParticleEffects {
+    pub new_data: Vec<u8>,
+    pub next_peers: Vec<PeerId>,
+    pub call_requests: CallRequests,
+}
Expand description

Effects produced by particle execution. Currently the only effect is that of sending particles.

+

Fields§

§new_data: Vec<u8>

New particle data

+
§next_peers: Vec<PeerId>

Instruction to send particle to these peers

+
§call_requests: CallRequests

Instruction to execute host calls

+

Implementations§

Trait Implementations§

source§

impl Clone for ParticleEffects

source§

fn clone(&self) -> ParticleEffects

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ParticleEffects

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/aquamarine/struct.Plumber.html b/aquamarine/struct.Plumber.html new file mode 100644 index 0000000000..c469d30bb0 --- /dev/null +++ b/aquamarine/struct.Plumber.html @@ -0,0 +1,61 @@ +Plumber in aquamarine - Rust

Struct aquamarine::Plumber

source ·
pub struct Plumber<RT: AquaRuntime, F> { /* private fields */ }

Implementations§

source§

impl<RT: AquaRuntime, F: ParticleFunctionStatic> Plumber<RT, F>

source

pub fn new( + config: RT::Config, + host_vm_pool: VmPool<RT>, + data_store: Arc<ParticleDataStore>, + builtins: F, + metrics: Option<ParticleExecutorMetrics>, + workers: Arc<Workers>, + key_storage: Arc<KeyStorage>, + scope: PeerScopes, + avm_wasm_backend: WasmtimeWasmBackend +) -> Self

source

pub fn ingest( + &mut self, + particle: ExtendedParticle, + function: Option<ServiceFunction>, + peer_scope: PeerScope +)

Receives and ingests incoming particle: creates a new actor or forwards to the existing mailbox

+
source

pub fn create_worker_pool(&mut self, worker_id: WorkerId, thread_count: usize)

source

pub fn remove_worker_pool(&mut self, worker_id: WorkerId)

source

pub fn add_service( + &self, + service: String, + functions: HashMap<String, ServiceFunction>, + fallback: Option<ServiceFunction> +)

source

pub fn remove_service(&self, service: String)

source

pub fn poll( + &mut self, + cx: &mut Context<'_> +) -> Poll<Result<RemoteRoutingEffects, AquamarineApiError>>

Auto Trait Implementations§

§

impl<RT, F> !RefUnwindSafe for Plumber<RT, F>

§

impl<RT, F> Send for Plumber<RT, F>where + F: Send,

§

impl<RT, F> !Sync for Plumber<RT, F>

§

impl<RT, F> Unpin for Plumber<RT, F>where + F: Unpin, + RT: Unpin, + <RT as AquaRuntime>::Config: Unpin,

§

impl<RT, F> !UnwindSafe for Plumber<RT, F>

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/aquamarine/struct.RemoteRoutingEffects.html b/aquamarine/struct.RemoteRoutingEffects.html new file mode 100644 index 0000000000..586e04efdb --- /dev/null +++ b/aquamarine/struct.RemoteRoutingEffects.html @@ -0,0 +1,38 @@ +RemoteRoutingEffects in aquamarine - Rust
pub struct RemoteRoutingEffects {
+    pub particle: ExtendedParticle,
+    pub next_peers: Vec<PeerId>,
+}

Fields§

§particle: ExtendedParticle§next_peers: Vec<PeerId>

Trait Implementations§

source§

impl Clone for RemoteRoutingEffects

source§

fn clone(&self) -> RemoteRoutingEffects

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for RemoteRoutingEffects

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/aquamarine/struct.VmConfig.html b/aquamarine/struct.VmConfig.html new file mode 100644 index 0000000000..826ee7948d --- /dev/null +++ b/aquamarine/struct.VmConfig.html @@ -0,0 +1,57 @@ +VmConfig in aquamarine - Rust

Struct aquamarine::VmConfig

source ·
pub struct VmConfig {
+    pub current_peer_id: PeerId,
+    pub air_interpreter: PathBuf,
+    pub max_heap_size: Option<u64>,
+    pub air_size_limit: Option<u64>,
+    pub particle_size_limit: Option<u64>,
+    pub call_result_size_limit: Option<u64>,
+    pub hard_limit_enabled: bool,
+}

Fields§

§current_peer_id: PeerId§air_interpreter: PathBuf

Path to AIR interpreter .wasm file (aquamarine.wasm)

+
§max_heap_size: Option<u64>

Maximum heap size in bytes available for the interpreter.

+
§air_size_limit: Option<u64>

Maximum AIR script size in bytes.

+
§particle_size_limit: Option<u64>

Maximum particle size in bytes.

+
§call_result_size_limit: Option<u64>

Maximum call result size in bytes.

+
§hard_limit_enabled: bool

A knob to enable/disable hard limits behavior in AquaVM.

+

Implementations§

source§

impl VmConfig

source

pub fn new( + current_peer_id: PeerId, + air_interpreter: PathBuf, + max_heap_size: Option<u64>, + air_size_limit: Option<u64>, + particle_size_limit: Option<u64>, + call_result_size_limit: Option<u64>, + hard_limit_enabled: bool +) -> Self

Trait Implementations§

source§

impl Clone for VmConfig

source§

fn clone(&self) -> VmConfig

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for VmConfig

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/aquamarine/struct.VmPoolConfig.html b/aquamarine/struct.VmPoolConfig.html new file mode 100644 index 0000000000..607f356890 --- /dev/null +++ b/aquamarine/struct.VmPoolConfig.html @@ -0,0 +1,40 @@ +VmPoolConfig in aquamarine - Rust
pub struct VmPoolConfig {
+    pub pool_size: usize,
+    pub execution_timeout: Duration,
+}

Fields§

§pool_size: usize

Number of VMs to create

+
§execution_timeout: Duration

Timeout of a particle execution

+

Implementations§

source§

impl VmPoolConfig

source

pub fn new(pool_size: usize, execution_timeout: Duration) -> Self

Trait Implementations§

source§

impl Clone for VmPoolConfig

source§

fn clone(&self) -> VmPoolConfig

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for VmPoolConfig

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/aquamarine/struct.WasmBackendConfig.html b/aquamarine/struct.WasmBackendConfig.html new file mode 100644 index 0000000000..4d2980fba4 --- /dev/null +++ b/aquamarine/struct.WasmBackendConfig.html @@ -0,0 +1,46 @@ +WasmBackendConfig in aquamarine - Rust
pub struct WasmBackendConfig {
+    pub debug_info: bool,
+    pub wasm_backtrace: bool,
+    pub async_wasm_stack: usize,
+    pub max_wasm_stack: usize,
+    pub epoch_interruption_duration: Option<Duration>,
+}

Fields§

§debug_info: bool

Configures whether DWARF debug information will be emitted during compilation.

+
§wasm_backtrace: bool

Configures whether the errors from the VM should collect the wasm backtrace and parse debug info.

+
§async_wasm_stack: usize

Configures the size of the stacks used for asynchronous execution.

+
§max_wasm_stack: usize

Configures the maximum amount of stack space available for executing WebAssembly code.

+
§epoch_interruption_duration: Option<Duration>

Enables the epoch interruption mechanism.

+

Trait Implementations§

§

impl Clone for WasmBackendConfig

§

fn clone(&self) -> WasmBackendConfig

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for WasmBackendConfig

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Default for WasmBackendConfig

§

fn default() -> WasmBackendConfig

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/aquamarine/struct.WasmtimeWasmBackend.html b/aquamarine/struct.WasmtimeWasmBackend.html new file mode 100644 index 0000000000..320bac36e2 --- /dev/null +++ b/aquamarine/struct.WasmtimeWasmBackend.html @@ -0,0 +1,38 @@ +WasmtimeWasmBackend in aquamarine - Rust
pub struct WasmtimeWasmBackend { /* private fields */ }

Implementations§

§

impl WasmtimeWasmBackend

pub fn increment_epoch(&self)

pub fn new( + config: WasmtimeConfig +) -> Result<WasmtimeWasmBackend, WasmBackendError>

Trait Implementations§

§

impl Clone for WasmtimeWasmBackend

§

fn clone(&self) -> WasmtimeWasmBackend

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl WasmBackend for WasmtimeWasmBackend

§

type Store = WasmtimeStore

A type that stores all the data, while most of the types are handles to data from Store.
§

type Module = WasmtimeModule

A compiled, but not instantiated module.
§

type Imports = WasmtimeImports

An object that holds all the functions that are given to Module as imports.
§

type Instance = WasmtimeInstance

An instantiated module ready to be executed.
§

type Context<'c> = WasmtimeContext<'c>

A temporary immutable handle to Store.
§

type ContextMut<'c> = WasmtimeContextMut<'c>

A temporary mutable handle to Store
§

type ImportCallContext<'c> = WasmtimeImportCallContext<'c>

A type that is used to pass context to imports.
§

type HostFunction = WasmtimeFunction

A host function prepared to be used as import for instantiating a module, contained in Store.
§

type ExportFunction = WasmtimeFunction

An export function from a wasm instance, contained in Store
§

type Memory = WasmtimeMemory

A wasm memory.
§

type MemoryView = WasmtimeMemory

A view to the wasm memory.
§

type Wasi = WasmtimeWasi

Type that provides all WASI-related APIs.
§

fn new_async() -> Result<WasmtimeWasmBackend, WasmBackendError>

Creates a new wasm backend with default configuration. In future, a configuration +may be passed as argument. The only option at the moment is an asynchronous backend.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/aquamarine/trait.AquaRuntime.html b/aquamarine/trait.AquaRuntime.html new file mode 100644 index 0000000000..f9233a86e6 --- /dev/null +++ b/aquamarine/trait.AquaRuntime.html @@ -0,0 +1,69 @@ +AquaRuntime in aquamarine - Rust
pub trait AquaRuntime: Sized + Send + 'static {
+    type Config: Clone + Send + 'static;
+    type Error: Error + Send + Sync + 'static;
+
+    // Required methods
+    fn create_runtime(
+        config: Self::Config,
+        wasm_backend: WasmtimeWasmBackend,
+        waker: Waker
+    ) -> Result<Self, Self::Error>;
+    fn into_effects(
+        outcome: Result<RawAVMOutcome, Self::Error>,
+        particle_id: String
+    ) -> ParticleEffects;
+    fn call<'life0, 'life1, 'life2, 'async_trait>(
+        &'life0 mut self,
+        air: impl 'async_trait + Into<String> + Send,
+        prev_data: impl 'async_trait + Into<Vec<u8>> + Send,
+        current_data: impl 'async_trait + Into<Vec<u8>> + Send,
+        particle_params: ParticleParameters<'life1>,
+        call_results: CallResults,
+        key_pair: &'life2 KeyPair
+    ) -> Pin<Box<dyn Future<Output = Result<RawAVMOutcome, Self::Error>> + Send + 'async_trait>>
+       where Self: 'async_trait,
+             'life0: 'async_trait,
+             'life1: 'async_trait,
+             'life2: 'async_trait;
+    fn memory_stats(&self) -> AVMMemoryStats;
+}

Required Associated Types§

source

type Config: Clone + Send + 'static

source

type Error: Error + Send + Sync + 'static

Required Methods§

source

fn create_runtime( + config: Self::Config, + wasm_backend: WasmtimeWasmBackend, + waker: Waker +) -> Result<Self, Self::Error>

source

fn into_effects( + outcome: Result<RawAVMOutcome, Self::Error>, + particle_id: String +) -> ParticleEffects

source

fn call<'life0, 'life1, 'life2, 'async_trait>( + &'life0 mut self, + air: impl 'async_trait + Into<String> + Send, + prev_data: impl 'async_trait + Into<Vec<u8>> + Send, + current_data: impl 'async_trait + Into<Vec<u8>> + Send, + particle_params: ParticleParameters<'life1>, + call_results: CallResults, + key_pair: &'life2 KeyPair +) -> Pin<Box<dyn Future<Output = Result<RawAVMOutcome, Self::Error>> + Send + 'async_trait>>where + Self: 'async_trait, + 'life0: 'async_trait, + 'life1: 'async_trait, + 'life2: 'async_trait,

source

fn memory_stats(&self) -> AVMMemoryStats

Return current size of memory. Use only for diagnostics purposes.

+

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl AquaRuntime for AVMRunner<WasmtimeWasmBackend>

source§

fn create_runtime( + config: Self::Config, + backend: WasmtimeWasmBackend, + waker: Waker +) -> Result<Self, Self::Error>

Creates AVM in background (on blocking threadpool)

+
§

type Config = VmConfig

§

type Error = RunnerError

source§

fn into_effects( + outcome: Result<RawAVMOutcome, Self::Error>, + particle_id: String +) -> ParticleEffects

source§

fn call<'life0, 'life1, 'life2, 'async_trait>( + &'life0 mut self, + air: impl 'async_trait + Into<String> + Send, + prev_data: impl 'async_trait + Into<Vec<u8>> + Send, + current_data: impl 'async_trait + Into<Vec<u8>> + Send, + particle_params: ParticleParameters<'life1>, + call_results: CallResults, + key_pair: &'life2 KeyPair +) -> Pin<Box<dyn Future<Output = Result<RawAVMOutcome, Self::Error>> + Send + 'async_trait>>where + Self: 'async_trait, + 'life0: 'async_trait, + 'life1: 'async_trait, + 'life2: 'async_trait,

source§

fn memory_stats(&self) -> AVMMemoryStats

Implementors§

\ No newline at end of file diff --git a/aquamarine/type.AVMRunner.html b/aquamarine/type.AVMRunner.html new file mode 100644 index 0000000000..867bad9218 --- /dev/null +++ b/aquamarine/type.AVMRunner.html @@ -0,0 +1 @@ +AVMRunner in aquamarine - Rust

Type Alias aquamarine::AVMRunner

source ·
pub type AVMRunner = AVMRunner<WasmtimeWasmBackend>;

Aliased Type§

struct AVMRunner { /* private fields */ }
\ No newline at end of file diff --git a/async_unlock/all.html b/async_unlock/all.html new file mode 100644 index 0000000000..c38f44b0b2 --- /dev/null +++ b/async_unlock/all.html @@ -0,0 +1 @@ +List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/async_unlock/fn.unlock.html b/async_unlock/fn.unlock.html new file mode 100644 index 0000000000..03908d55ff --- /dev/null +++ b/async_unlock/fn.unlock.html @@ -0,0 +1,2 @@ +unlock in async_unlock - Rust

Function async_unlock::unlock

source ·
pub async fn unlock<T, R>(m: &Mutex<T>, f: impl FnOnce(&mut T) -> R) -> R
Expand description

Performs computation on a value inside Mutex, unlocking Mutex immediately after f is computed

+
\ No newline at end of file diff --git a/async_unlock/fn.unlock_f.html b/async_unlock/fn.unlock_f.html new file mode 100644 index 0000000000..073c98bdad --- /dev/null +++ b/async_unlock/fn.unlock_f.html @@ -0,0 +1,6 @@ +unlock_f in async_unlock - Rust

Function async_unlock::unlock_f

source ·
pub async fn unlock_f<T, R, F: Future<Output = R>>(
+    m: &Mutex<T>,
+    f: impl FnOnce(&mut T) -> F
+) -> R
Expand description

Performs async computation on a value inside Mutex +This function guarantees that Mutex will be unlocked before awaiting computation described by f

+
\ No newline at end of file diff --git a/async_unlock/index.html b/async_unlock/index.html new file mode 100644 index 0000000000..2b5409d3a1 --- /dev/null +++ b/async_unlock/index.html @@ -0,0 +1,5 @@ +async_unlock - Rust

Crate async_unlock

source ·
Expand description

This crate describes functions to work with async_std’s Mutex in a manner that guarantees +shortest possible lock time by dropping MutexGuard ASAP.

+

Functions

  • Performs computation on a value inside Mutex, unlocking Mutex immediately after f is computed
  • Performs async computation on a value inside Mutex +This function guarantees that Mutex will be unlocked before awaiting computation described by f
\ No newline at end of file diff --git a/async_unlock/sidebar-items.js b/async_unlock/sidebar-items.js new file mode 100644 index 0000000000..be48a8651a --- /dev/null +++ b/async_unlock/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"fn":["unlock","unlock_f"]}; \ No newline at end of file diff --git a/chain_connector/Capacity/enum.CapacityCalls.html b/chain_connector/Capacity/enum.CapacityCalls.html new file mode 100644 index 0000000000..6ee77d748d --- /dev/null +++ b/chain_connector/Capacity/enum.CapacityCalls.html @@ -0,0 +1,51 @@ +CapacityCalls in chain_connector::Capacity - Rust
pub enum CapacityCalls {
+    getGlobalNonce(getGlobalNonceCall),
+    getStatus(getStatusCall),
+    submitProof(submitProofCall),
+    submitProofs(submitProofsCall),
+}
Expand description

Container for all the Capacity function calls.

+

Variants§

§

getGlobalNonce(getGlobalNonceCall)

§

getStatus(getStatusCall)

§

submitProof(submitProofCall)

§

submitProofs(submitProofsCall)

Implementations§

source§

impl CapacityCalls

source

pub const SELECTORS: &'static [[u8; 4]] = _

All the selectors of this enum.

+

Note that the selectors might not be in the same order as the variants. +No guarantees are made about the order of the selectors.

+

Prefer using SolInterface methods instead.

+

Trait Implementations§

source§

impl SolInterface for CapacityCalls

source§

const NAME: &'static str = "CapacityCalls"

The name of this type.
source§

const MIN_DATA_LENGTH: usize = 0usize

The minimum length of the data for this type. Read more
source§

const COUNT: usize = 4usize

The number of variants.
source§

fn selector(&self) -> [u8; 4]

The selector of this instance.
source§

fn selector_at(i: usize) -> Option<[u8; 4]>

The selector of this type at the given index, used in +selectors. Read more
source§

fn valid_selector(selector: [u8; 4]) -> bool

Returns true if the given selector is known to this type.
source§

fn abi_decode_raw( + selector: [u8; 4], + data: &[u8], + validate: bool +) -> Result<Self>

ABI-decodes the given data into one of the variants of self.
source§

fn abi_encoded_size(&self) -> usize

The size of the encoded data, without any selectors.
source§

fn abi_encode_raw(&self, out: &mut Vec<u8>)

ABI-encodes self into the given buffer, without any selectors.
§

fn type_check(selector: [u8; 4]) -> Result<(), Error>

Returns an error if the given selector is not known to this type.
§

fn selectors() -> Selectors<Self>

Returns an iterator over the selectors of this type.
§

fn abi_encode(&self) -> Vec<u8>

ABI-encodes self into the given buffer.
§

fn abi_decode(data: &[u8], validate: bool) -> Result<Self, Error>

ABI-decodes the given data into one of the variants of self.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/chain_connector/Capacity/enum.CapacityErrors.html b/chain_connector/Capacity/enum.CapacityErrors.html new file mode 100644 index 0000000000..163386b3bd --- /dev/null +++ b/chain_connector/Capacity/enum.CapacityErrors.html @@ -0,0 +1,49 @@ +CapacityErrors in chain_connector::Capacity - Rust
pub enum CapacityErrors {
+    TooManyProofs(TooManyProofs),
+    CapacityCommitmentIsNotActive(CapacityCommitmentIsNotActive),
+}
Expand description

Container for all the Capacity custom errors.

+

Variants§

§

TooManyProofs(TooManyProofs)

§

CapacityCommitmentIsNotActive(CapacityCommitmentIsNotActive)

Implementations§

source§

impl CapacityErrors

source

pub const SELECTORS: &'static [[u8; 4]] = _

All the selectors of this enum.

+

Note that the selectors might not be in the same order as the variants. +No guarantees are made about the order of the selectors.

+

Prefer using SolInterface methods instead.

+

Trait Implementations§

source§

impl SolInterface for CapacityErrors

source§

const NAME: &'static str = "CapacityErrors"

The name of this type.
source§

const MIN_DATA_LENGTH: usize = 0usize

The minimum length of the data for this type. Read more
source§

const COUNT: usize = 2usize

The number of variants.
source§

fn selector(&self) -> [u8; 4]

The selector of this instance.
source§

fn selector_at(i: usize) -> Option<[u8; 4]>

The selector of this type at the given index, used in +selectors. Read more
source§

fn valid_selector(selector: [u8; 4]) -> bool

Returns true if the given selector is known to this type.
source§

fn abi_decode_raw( + selector: [u8; 4], + data: &[u8], + validate: bool +) -> Result<Self>

ABI-decodes the given data into one of the variants of self.
source§

fn abi_encoded_size(&self) -> usize

The size of the encoded data, without any selectors.
source§

fn abi_encode_raw(&self, out: &mut Vec<u8>)

ABI-encodes self into the given buffer, without any selectors.
§

fn type_check(selector: [u8; 4]) -> Result<(), Error>

Returns an error if the given selector is not known to this type.
§

fn selectors() -> Selectors<Self>

Returns an iterator over the selectors of this type.
§

fn abi_encode(&self) -> Vec<u8>

ABI-encodes self into the given buffer.
§

fn abi_decode(data: &[u8], validate: bool) -> Result<Self, Error>

ABI-decodes the given data into one of the variants of self.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/chain_connector/Capacity/index.html b/chain_connector/Capacity/index.html new file mode 100644 index 0000000000..6a13fd4216 --- /dev/null +++ b/chain_connector/Capacity/index.html @@ -0,0 +1,34 @@ +chain_connector::Capacity - Rust
Expand description

Module containing a contract’s types and functions.

+
contract Capacity {
+    error TooManyProofs();
+    error CapacityCommitmentIsNotActive(CCStatus status);
+    function getGlobalNonce() external view returns (bytes32);
+    function getStatus(bytes32 commitmentId) external view returns (CCStatus);
+    function submitProof(bytes32 unitId, bytes32 localUnitNonce, bytes32 resultHash) external;
+    function submitProofs(bytes32[] memory unitIds, bytes32[] memory localUnitNonces, bytes32[] memory resultHashes) external;
+}
+

Structs

  • @dev Capacity commitment is not active +Custom error with signature CapacityCommitmentIsNotActive(uint8) and selector 0x0852c720.
  • @dev Throws if peer sent too many proofs for the commitment by unit per epoch +Custom error with signature TooManyProofs() and selector 0xe5d50da7.
  • Function with signature getGlobalNonce() and selector 0x92163b4b.
  • Container type for the return parameters of the getGlobalNonce() function.
  • @dev Returns the commitment status +@param commitmentId Commitment id +@return status commitment status +Function with signature getStatus(bytes32) and selector 0x5de28ae0.
  • @dev Returns the commitment status +@param commitmentId Commitment id +@return status commitment status +Container type for the return parameters of the getStatus(bytes32) function.
  • @dev Submits a proof for the commitment +@param unitId Compute unit id which provied the proof +@param localUnitNonce The local nonce of the unit for calculating the target hash. It’s the proof +@param resultHash The target hash of this proof +Function with signature submitProof(bytes32,bytes32,bytes32) and selector 0x4ece5685.
  • @dev Submits a proof for the commitment +@param unitId Compute unit id which provied the proof +@param localUnitNonce The local nonce of the unit for calculating the target hash. It’s the proof +@param resultHash The target hash of this proof +Container type for the return parameters of the submitProof(bytes32,bytes32,bytes32) function.
  • @dev Submits proofs for the commitment +@param unitIds Compute unit ids which provide the proof +@param localUnitNonces Local nonces of the units for calculating the target hashes. It’s the proof +@param resultHashes Target hashes of this proof +Function with signature submitProofs(bytes32[],bytes32[],bytes32[]) and selector 0x64b75e31.
  • @dev Submits proofs for the commitment +@param unitIds Compute unit ids which provide the proof +@param localUnitNonces Local nonces of the units for calculating the target hashes. It’s the proof +@param resultHashes Target hashes of this proof +Container type for the return parameters of the submitProofs(bytes32[],bytes32[],bytes32[]) function.

Enums

\ No newline at end of file diff --git a/chain_connector/Capacity/sidebar-items.js b/chain_connector/Capacity/sidebar-items.js new file mode 100644 index 0000000000..78b8ab1626 --- /dev/null +++ b/chain_connector/Capacity/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["CapacityCalls","CapacityErrors"],"struct":["CapacityCommitmentIsNotActive","TooManyProofs","getGlobalNonceCall","getGlobalNonceReturn","getStatusCall","getStatusReturn","submitProofCall","submitProofReturn","submitProofsCall","submitProofsReturn"]}; \ No newline at end of file diff --git a/chain_connector/Capacity/struct.CapacityCommitmentIsNotActive.html b/chain_connector/Capacity/struct.CapacityCommitmentIsNotActive.html new file mode 100644 index 0000000000..219efec8a7 --- /dev/null +++ b/chain_connector/Capacity/struct.CapacityCommitmentIsNotActive.html @@ -0,0 +1,45 @@ +CapacityCommitmentIsNotActive in chain_connector::Capacity - Rust
pub struct CapacityCommitmentIsNotActive {
+    pub status: <CCStatus as SolType>::RustType,
+}
Expand description

@dev Capacity commitment is not active +Custom error with signature CapacityCommitmentIsNotActive(uint8) and selector 0x0852c720.

+
error CapacityCommitmentIsNotActive(CCStatus status);
+

Fields§

§status: <CCStatus as SolType>::RustType

Trait Implementations§

source§

impl Clone for CapacityCommitmentIsNotActive

source§

fn clone(&self) -> CapacityCommitmentIsNotActive

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl SolError for CapacityCommitmentIsNotActive

§

type Parameters<'a> = (CCStatus,)

The underlying tuple type which represents the error’s members. Read more
§

type Token<'a> = <<CapacityCommitmentIsNotActive as SolError>::Parameters<'a> as SolType>::Token<'a>

The corresponding [TokenSeq] type.
source§

const SIGNATURE: &'static str = "CapacityCommitmentIsNotActive(uint8)"

The error’s ABI signature.
source§

const SELECTOR: [u8; 4] = _

The error selector: keccak256(SIGNATURE)[0..4]
source§

fn new<'a>(tuple: <Self::Parameters<'a> as SolType>::RustType) -> Self

Convert from the tuple type used for ABI encoding and decoding.
source§

fn tokenize(&self) -> Self::Token<'_>

Convert to the token type used for EIP-712 encoding and decoding.
§

fn abi_encoded_size(&self) -> usize

The size of the error params when encoded in bytes, without the +selector.
§

fn abi_decode_raw(data: &[u8], validate: bool) -> Result<Self, Error>

ABI decode this call’s arguments from the given slice, without its +selector.
§

fn abi_decode(data: &[u8], validate: bool) -> Result<Self, Error>

ABI decode this error’s arguments from the given slice, with the +selector.
§

fn abi_encode_raw(&self, out: &mut Vec<u8>)

ABI encode the error to the given buffer without its selector.
§

fn abi_encode(&self) -> Vec<u8>

ABI encode the error to the given buffer with its selector.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/chain_connector/Capacity/struct.TooManyProofs.html b/chain_connector/Capacity/struct.TooManyProofs.html new file mode 100644 index 0000000000..9c5bcdf431 --- /dev/null +++ b/chain_connector/Capacity/struct.TooManyProofs.html @@ -0,0 +1,43 @@ +TooManyProofs in chain_connector::Capacity - Rust
pub struct TooManyProofs {}
Expand description

@dev Throws if peer sent too many proofs for the commitment by unit per epoch +Custom error with signature TooManyProofs() and selector 0xe5d50da7.

+
error TooManyProofs();
+

Trait Implementations§

source§

impl Clone for TooManyProofs

source§

fn clone(&self) -> TooManyProofs

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl SolError for TooManyProofs

§

type Parameters<'a> = ()

The underlying tuple type which represents the error’s members. Read more
§

type Token<'a> = <<TooManyProofs as SolError>::Parameters<'a> as SolType>::Token<'a>

The corresponding [TokenSeq] type.
source§

const SIGNATURE: &'static str = "TooManyProofs()"

The error’s ABI signature.
source§

const SELECTOR: [u8; 4] = _

The error selector: keccak256(SIGNATURE)[0..4]
source§

fn new<'a>(tuple: <Self::Parameters<'a> as SolType>::RustType) -> Self

Convert from the tuple type used for ABI encoding and decoding.
source§

fn tokenize(&self) -> Self::Token<'_>

Convert to the token type used for EIP-712 encoding and decoding.
§

fn abi_encoded_size(&self) -> usize

The size of the error params when encoded in bytes, without the +selector.
§

fn abi_decode_raw(data: &[u8], validate: bool) -> Result<Self, Error>

ABI decode this call’s arguments from the given slice, without its +selector.
§

fn abi_decode(data: &[u8], validate: bool) -> Result<Self, Error>

ABI decode this error’s arguments from the given slice, with the +selector.
§

fn abi_encode_raw(&self, out: &mut Vec<u8>)

ABI encode the error to the given buffer without its selector.
§

fn abi_encode(&self) -> Vec<u8>

ABI encode the error to the given buffer with its selector.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/chain_connector/Capacity/struct.getGlobalNonceCall.html b/chain_connector/Capacity/struct.getGlobalNonceCall.html new file mode 100644 index 0000000000..ac0741e351 --- /dev/null +++ b/chain_connector/Capacity/struct.getGlobalNonceCall.html @@ -0,0 +1,42 @@ +getGlobalNonceCall in chain_connector::Capacity - Rust
pub struct getGlobalNonceCall {}
Expand description

Function with signature getGlobalNonce() and selector 0x92163b4b.

+
function getGlobalNonce() external view returns (bytes32);
+

Trait Implementations§

source§

impl Clone for getGlobalNonceCall

source§

fn clone(&self) -> getGlobalNonceCall

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl SolCall for getGlobalNonceCall

§

type Parameters<'a> = ()

The underlying tuple type which represents this type’s arguments. Read more
§

type Token<'a> = <<getGlobalNonceCall as SolCall>::Parameters<'a> as SolType>::Token<'a>

The arguments’ corresponding [TokenSeq] type.
§

type Return = getGlobalNonceReturn

The function’s return struct.
§

type ReturnTuple<'a> = (FixedBytes<32>,)

The underlying tuple type which represents this type’s return values. Read more
§

type ReturnToken<'a> = <<getGlobalNonceCall as SolCall>::ReturnTuple<'a> as SolType>::Token<'a>

The returns’ corresponding [TokenSeq] type.
source§

const SIGNATURE: &'static str = "getGlobalNonce()"

The function’s ABI signature.
source§

const SELECTOR: [u8; 4] = _

The function selector: keccak256(SIGNATURE)[0..4]
source§

fn new<'a>(tuple: <Self::Parameters<'a> as SolType>::RustType) -> Self

Convert from the tuple type used for ABI encoding and decoding.
source§

fn tokenize(&self) -> Self::Token<'_>

Tokenize the call’s arguments.
source§

fn abi_decode_returns(data: &[u8], validate: bool) -> Result<Self::Return>

ABI decode this call’s return values from the given slice.
§

fn abi_encoded_size(&self) -> usize

The size of the encoded data in bytes, without its selector.
§

fn abi_decode_raw(data: &[u8], validate: bool) -> Result<Self, Error>

ABI decode this call’s arguments from the given slice, without its +selector.
§

fn abi_decode(data: &[u8], validate: bool) -> Result<Self, Error>

ABI decode this call’s arguments from the given slice, with the +selector.
§

fn abi_encode_raw(&self, out: &mut Vec<u8>)

ABI encode the call to the given buffer without its selector.
§

fn abi_encode(&self) -> Vec<u8>

ABI encode the call to the given buffer with its selector.
§

fn abi_encode_returns<'a, E>(e: &'a E) -> Vec<u8> where + E: SolTypeValue<Self::ReturnTuple<'a>>,

ABI encode the call’s return values.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/chain_connector/Capacity/struct.getGlobalNonceReturn.html b/chain_connector/Capacity/struct.getGlobalNonceReturn.html new file mode 100644 index 0000000000..01d6307981 --- /dev/null +++ b/chain_connector/Capacity/struct.getGlobalNonceReturn.html @@ -0,0 +1,40 @@ +getGlobalNonceReturn in chain_connector::Capacity - Rust
pub struct getGlobalNonceReturn {
+    pub _0: FixedBytes<32>,
+}
Expand description

Container type for the return parameters of the getGlobalNonce() function.

+

Fields§

§_0: FixedBytes<32>

Trait Implementations§

source§

impl Clone for getGlobalNonceReturn

source§

fn clone(&self) -> getGlobalNonceReturn

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/chain_connector/Capacity/struct.getStatusCall.html b/chain_connector/Capacity/struct.getStatusCall.html new file mode 100644 index 0000000000..24564fc49a --- /dev/null +++ b/chain_connector/Capacity/struct.getStatusCall.html @@ -0,0 +1,47 @@ +getStatusCall in chain_connector::Capacity - Rust
pub struct getStatusCall {
+    pub commitmentId: FixedBytes<32>,
+}
Expand description

@dev Returns the commitment status +@param commitmentId Commitment id +@return status commitment status +Function with signature getStatus(bytes32) and selector 0x5de28ae0.

+
function getStatus(bytes32 commitmentId) external view returns (CCStatus);
+

Fields§

§commitmentId: FixedBytes<32>

Trait Implementations§

source§

impl Clone for getStatusCall

source§

fn clone(&self) -> getStatusCall

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl SolCall for getStatusCall

§

type Parameters<'a> = (FixedBytes<32>,)

The underlying tuple type which represents this type’s arguments. Read more
§

type Token<'a> = <<getStatusCall as SolCall>::Parameters<'a> as SolType>::Token<'a>

The arguments’ corresponding [TokenSeq] type.
§

type Return = getStatusReturn

The function’s return struct.
§

type ReturnTuple<'a> = (CCStatus,)

The underlying tuple type which represents this type’s return values. Read more
§

type ReturnToken<'a> = <<getStatusCall as SolCall>::ReturnTuple<'a> as SolType>::Token<'a>

The returns’ corresponding [TokenSeq] type.
source§

const SIGNATURE: &'static str = "getStatus(bytes32)"

The function’s ABI signature.
source§

const SELECTOR: [u8; 4] = _

The function selector: keccak256(SIGNATURE)[0..4]
source§

fn new<'a>(tuple: <Self::Parameters<'a> as SolType>::RustType) -> Self

Convert from the tuple type used for ABI encoding and decoding.
source§

fn tokenize(&self) -> Self::Token<'_>

Tokenize the call’s arguments.
source§

fn abi_decode_returns(data: &[u8], validate: bool) -> Result<Self::Return>

ABI decode this call’s return values from the given slice.
§

fn abi_encoded_size(&self) -> usize

The size of the encoded data in bytes, without its selector.
§

fn abi_decode_raw(data: &[u8], validate: bool) -> Result<Self, Error>

ABI decode this call’s arguments from the given slice, without its +selector.
§

fn abi_decode(data: &[u8], validate: bool) -> Result<Self, Error>

ABI decode this call’s arguments from the given slice, with the +selector.
§

fn abi_encode_raw(&self, out: &mut Vec<u8>)

ABI encode the call to the given buffer without its selector.
§

fn abi_encode(&self) -> Vec<u8>

ABI encode the call to the given buffer with its selector.
§

fn abi_encode_returns<'a, E>(e: &'a E) -> Vec<u8> where + E: SolTypeValue<Self::ReturnTuple<'a>>,

ABI encode the call’s return values.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/chain_connector/Capacity/struct.getStatusReturn.html b/chain_connector/Capacity/struct.getStatusReturn.html new file mode 100644 index 0000000000..b4b9460e75 --- /dev/null +++ b/chain_connector/Capacity/struct.getStatusReturn.html @@ -0,0 +1,43 @@ +getStatusReturn in chain_connector::Capacity - Rust
pub struct getStatusReturn {
+    pub _0: <CCStatus as SolType>::RustType,
+}
Expand description

@dev Returns the commitment status +@param commitmentId Commitment id +@return status commitment status +Container type for the return parameters of the getStatus(bytes32) function.

+

Fields§

§_0: <CCStatus as SolType>::RustType

Trait Implementations§

source§

impl Clone for getStatusReturn

source§

fn clone(&self) -> getStatusReturn

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/chain_connector/Capacity/struct.submitProofCall.html b/chain_connector/Capacity/struct.submitProofCall.html new file mode 100644 index 0000000000..fc80aae300 --- /dev/null +++ b/chain_connector/Capacity/struct.submitProofCall.html @@ -0,0 +1,50 @@ +submitProofCall in chain_connector::Capacity - Rust
pub struct submitProofCall {
+    pub unitId: FixedBytes<32>,
+    pub localUnitNonce: FixedBytes<32>,
+    pub resultHash: FixedBytes<32>,
+}
Expand description

@dev Submits a proof for the commitment +@param unitId Compute unit id which provied the proof +@param localUnitNonce The local nonce of the unit for calculating the target hash. It’s the proof +@param resultHash The target hash of this proof +Function with signature submitProof(bytes32,bytes32,bytes32) and selector 0x4ece5685.

+
function submitProof(bytes32 unitId, bytes32 localUnitNonce, bytes32 resultHash) external;
+

Fields§

§unitId: FixedBytes<32>§localUnitNonce: FixedBytes<32>§resultHash: FixedBytes<32>

Trait Implementations§

source§

impl Clone for submitProofCall

source§

fn clone(&self) -> submitProofCall

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl SolCall for submitProofCall

§

type Parameters<'a> = (FixedBytes<32>, FixedBytes<32>, FixedBytes<32>)

The underlying tuple type which represents this type’s arguments. Read more
§

type Token<'a> = <<submitProofCall as SolCall>::Parameters<'a> as SolType>::Token<'a>

The arguments’ corresponding [TokenSeq] type.
§

type Return = submitProofReturn

The function’s return struct.
§

type ReturnTuple<'a> = ()

The underlying tuple type which represents this type’s return values. Read more
§

type ReturnToken<'a> = <<submitProofCall as SolCall>::ReturnTuple<'a> as SolType>::Token<'a>

The returns’ corresponding [TokenSeq] type.
source§

const SIGNATURE: &'static str = "submitProof(bytes32,bytes32,bytes32)"

The function’s ABI signature.
source§

const SELECTOR: [u8; 4] = _

The function selector: keccak256(SIGNATURE)[0..4]
source§

fn new<'a>(tuple: <Self::Parameters<'a> as SolType>::RustType) -> Self

Convert from the tuple type used for ABI encoding and decoding.
source§

fn tokenize(&self) -> Self::Token<'_>

Tokenize the call’s arguments.
source§

fn abi_decode_returns(data: &[u8], validate: bool) -> Result<Self::Return>

ABI decode this call’s return values from the given slice.
§

fn abi_encoded_size(&self) -> usize

The size of the encoded data in bytes, without its selector.
§

fn abi_decode_raw(data: &[u8], validate: bool) -> Result<Self, Error>

ABI decode this call’s arguments from the given slice, without its +selector.
§

fn abi_decode(data: &[u8], validate: bool) -> Result<Self, Error>

ABI decode this call’s arguments from the given slice, with the +selector.
§

fn abi_encode_raw(&self, out: &mut Vec<u8>)

ABI encode the call to the given buffer without its selector.
§

fn abi_encode(&self) -> Vec<u8>

ABI encode the call to the given buffer with its selector.
§

fn abi_encode_returns<'a, E>(e: &'a E) -> Vec<u8> where + E: SolTypeValue<Self::ReturnTuple<'a>>,

ABI encode the call’s return values.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/chain_connector/Capacity/struct.submitProofReturn.html b/chain_connector/Capacity/struct.submitProofReturn.html new file mode 100644 index 0000000000..41bbd05685 --- /dev/null +++ b/chain_connector/Capacity/struct.submitProofReturn.html @@ -0,0 +1,42 @@ +submitProofReturn in chain_connector::Capacity - Rust
pub struct submitProofReturn {}
Expand description

@dev Submits a proof for the commitment +@param unitId Compute unit id which provied the proof +@param localUnitNonce The local nonce of the unit for calculating the target hash. It’s the proof +@param resultHash The target hash of this proof +Container type for the return parameters of the submitProof(bytes32,bytes32,bytes32) function.

+

Trait Implementations§

source§

impl Clone for submitProofReturn

source§

fn clone(&self) -> submitProofReturn

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/chain_connector/Capacity/struct.submitProofsCall.html b/chain_connector/Capacity/struct.submitProofsCall.html new file mode 100644 index 0000000000..2294710c09 --- /dev/null +++ b/chain_connector/Capacity/struct.submitProofsCall.html @@ -0,0 +1,50 @@ +submitProofsCall in chain_connector::Capacity - Rust
pub struct submitProofsCall {
+    pub unitIds: Vec<FixedBytes<32>>,
+    pub localUnitNonces: Vec<FixedBytes<32>>,
+    pub resultHashes: Vec<FixedBytes<32>>,
+}
Expand description

@dev Submits proofs for the commitment +@param unitIds Compute unit ids which provide the proof +@param localUnitNonces Local nonces of the units for calculating the target hashes. It’s the proof +@param resultHashes Target hashes of this proof +Function with signature submitProofs(bytes32[],bytes32[],bytes32[]) and selector 0x64b75e31.

+
function submitProofs(bytes32[] memory unitIds, bytes32[] memory localUnitNonces, bytes32[] memory resultHashes) external;
+

Fields§

§unitIds: Vec<FixedBytes<32>>§localUnitNonces: Vec<FixedBytes<32>>§resultHashes: Vec<FixedBytes<32>>

Trait Implementations§

source§

impl Clone for submitProofsCall

source§

fn clone(&self) -> submitProofsCall

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl SolCall for submitProofsCall

§

type Parameters<'a> = (Array<FixedBytes<32>>, Array<FixedBytes<32>>, Array<FixedBytes<32>>)

The underlying tuple type which represents this type’s arguments. Read more
§

type Token<'a> = <<submitProofsCall as SolCall>::Parameters<'a> as SolType>::Token<'a>

The arguments’ corresponding [TokenSeq] type.
§

type Return = submitProofsReturn

The function’s return struct.
§

type ReturnTuple<'a> = ()

The underlying tuple type which represents this type’s return values. Read more
§

type ReturnToken<'a> = <<submitProofsCall as SolCall>::ReturnTuple<'a> as SolType>::Token<'a>

The returns’ corresponding [TokenSeq] type.
source§

const SIGNATURE: &'static str = "submitProofs(bytes32[],bytes32[],bytes32[])"

The function’s ABI signature.
source§

const SELECTOR: [u8; 4] = _

The function selector: keccak256(SIGNATURE)[0..4]
source§

fn new<'a>(tuple: <Self::Parameters<'a> as SolType>::RustType) -> Self

Convert from the tuple type used for ABI encoding and decoding.
source§

fn tokenize(&self) -> Self::Token<'_>

Tokenize the call’s arguments.
source§

fn abi_decode_returns(data: &[u8], validate: bool) -> Result<Self::Return>

ABI decode this call’s return values from the given slice.
§

fn abi_encoded_size(&self) -> usize

The size of the encoded data in bytes, without its selector.
§

fn abi_decode_raw(data: &[u8], validate: bool) -> Result<Self, Error>

ABI decode this call’s arguments from the given slice, without its +selector.
§

fn abi_decode(data: &[u8], validate: bool) -> Result<Self, Error>

ABI decode this call’s arguments from the given slice, with the +selector.
§

fn abi_encode_raw(&self, out: &mut Vec<u8>)

ABI encode the call to the given buffer without its selector.
§

fn abi_encode(&self) -> Vec<u8>

ABI encode the call to the given buffer with its selector.
§

fn abi_encode_returns<'a, E>(e: &'a E) -> Vec<u8> where + E: SolTypeValue<Self::ReturnTuple<'a>>,

ABI encode the call’s return values.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/chain_connector/Capacity/struct.submitProofsReturn.html b/chain_connector/Capacity/struct.submitProofsReturn.html new file mode 100644 index 0000000000..204f7dfbf2 --- /dev/null +++ b/chain_connector/Capacity/struct.submitProofsReturn.html @@ -0,0 +1,42 @@ +submitProofsReturn in chain_connector::Capacity - Rust
pub struct submitProofsReturn {}
Expand description

@dev Submits proofs for the commitment +@param unitIds Compute unit ids which provide the proof +@param localUnitNonces Local nonces of the units for calculating the target hashes. It’s the proof +@param resultHashes Target hashes of this proof +Container type for the return parameters of the submitProofs(bytes32[],bytes32[],bytes32[]) function.

+

Trait Implementations§

source§

impl Clone for submitProofsReturn

source§

fn clone(&self) -> submitProofsReturn

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/chain_connector/Core/enum.CoreCalls.html b/chain_connector/Core/enum.CoreCalls.html new file mode 100644 index 0000000000..39190c45e0 --- /dev/null +++ b/chain_connector/Core/enum.CoreCalls.html @@ -0,0 +1,55 @@ +CoreCalls in chain_connector::Core - Rust
pub enum CoreCalls {
+    capacity(capacityCall),
+    market(marketCall),
+    currentEpoch(currentEpochCall),
+    epochDuration(epochDurationCall),
+    initTimestamp(initTimestampCall),
+    difficulty(difficultyCall),
+    minProofsPerEpoch(minProofsPerEpochCall),
+    maxProofsPerEpoch(maxProofsPerEpochCall),
+}
Expand description

Container for all the Core function calls.

+

Variants§

§

capacity(capacityCall)

§

market(marketCall)

§

currentEpoch(currentEpochCall)

§

epochDuration(epochDurationCall)

§

initTimestamp(initTimestampCall)

§

difficulty(difficultyCall)

§

minProofsPerEpoch(minProofsPerEpochCall)

§

maxProofsPerEpoch(maxProofsPerEpochCall)

Implementations§

source§

impl CoreCalls

source

pub const SELECTORS: &'static [[u8; 4]] = _

All the selectors of this enum.

+

Note that the selectors might not be in the same order as the variants. +No guarantees are made about the order of the selectors.

+

Prefer using SolInterface methods instead.

+

Trait Implementations§

source§

impl SolInterface for CoreCalls

source§

const NAME: &'static str = "CoreCalls"

The name of this type.
source§

const MIN_DATA_LENGTH: usize = 0usize

The minimum length of the data for this type. Read more
source§

const COUNT: usize = 8usize

The number of variants.
source§

fn selector(&self) -> [u8; 4]

The selector of this instance.
source§

fn selector_at(i: usize) -> Option<[u8; 4]>

The selector of this type at the given index, used in +selectors. Read more
source§

fn valid_selector(selector: [u8; 4]) -> bool

Returns true if the given selector is known to this type.
source§

fn abi_decode_raw( + selector: [u8; 4], + data: &[u8], + validate: bool +) -> Result<Self>

ABI-decodes the given data into one of the variants of self.
source§

fn abi_encoded_size(&self) -> usize

The size of the encoded data, without any selectors.
source§

fn abi_encode_raw(&self, out: &mut Vec<u8>)

ABI-encodes self into the given buffer, without any selectors.
§

fn type_check(selector: [u8; 4]) -> Result<(), Error>

Returns an error if the given selector is not known to this type.
§

fn selectors() -> Selectors<Self>

Returns an iterator over the selectors of this type.
§

fn abi_encode(&self) -> Vec<u8>

ABI-encodes self into the given buffer.
§

fn abi_decode(data: &[u8], validate: bool) -> Result<Self, Error>

ABI-decodes the given data into one of the variants of self.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/chain_connector/Core/index.html b/chain_connector/Core/index.html new file mode 100644 index 0000000000..adbb1d51db --- /dev/null +++ b/chain_connector/Core/index.html @@ -0,0 +1,32 @@ +chain_connector::Core - Rust

Module chain_connector::Core

source ·
Expand description

Module containing a contract’s types and functions.

+
contract Core {
+    function capacity() external view returns (address);
+    function market() external view returns (address);
+    function currentEpoch() external view returns (uint256);
+    function epochDuration() external view returns (uint256);
+    function initTimestamp() external view returns (uint256);
+    function difficulty() external view returns (bytes32);
+    function minProofsPerEpoch() external view returns (uint256);
+    function maxProofsPerEpoch() external view returns (uint256);
+}
+

Structs

  • Function with signature capacity() and selector 0x5cfc1a51.
  • Container type for the return parameters of the capacity() function.
  • @dev Returns current epoch +@return current epoch number +Function with signature currentEpoch() and selector 0x76671808.
  • @dev Returns current epoch +@return current epoch number +Container type for the return parameters of the currentEpoch() function.
  • @dev Returns the difficulty for CCP +Function with signature difficulty() and selector 0x19cae462.
  • @dev Returns the difficulty for CCP +Container type for the return parameters of the difficulty() function.
  • @dev Returns epoch duration +@return epochDuration in seconds +Function with signature epochDuration() and selector 0x4ff0876a.
  • @dev Returns epoch duration +@return epochDuration in seconds +Container type for the return parameters of the epochDuration() function.
  • @dev Returns epoch init timestamp +@return initTimestamp in seconds +Function with signature initTimestamp() and selector 0x7358c57a.
  • @dev Returns epoch init timestamp +@return initTimestamp in seconds +Container type for the return parameters of the initTimestamp() function.
  • Function with signature market() and selector 0x80f55605.
  • Container type for the return parameters of the market() function.
  • @dev Returns the max randomX proofs per epoch +Function with signature maxProofsPerEpoch() and selector 0x280c5e51.
  • @dev Returns the max randomX proofs per epoch +Container type for the return parameters of the maxProofsPerEpoch() function.
  • @dev Returns the min required randomX proofs per epoch for the 1 CU. +@dev If lower than this - CU is failed and CC slashed. +Function with signature minProofsPerEpoch() and selector 0xe79c6270.
  • @dev Returns the min required randomX proofs per epoch for the 1 CU. +@dev If lower than this - CU is failed and CC slashed. +Container type for the return parameters of the minProofsPerEpoch() function.

Enums

\ No newline at end of file diff --git a/chain_connector/Core/sidebar-items.js b/chain_connector/Core/sidebar-items.js new file mode 100644 index 0000000000..34f1fdaf8a --- /dev/null +++ b/chain_connector/Core/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["CoreCalls"],"struct":["capacityCall","capacityReturn","currentEpochCall","currentEpochReturn","difficultyCall","difficultyReturn","epochDurationCall","epochDurationReturn","initTimestampCall","initTimestampReturn","marketCall","marketReturn","maxProofsPerEpochCall","maxProofsPerEpochReturn","minProofsPerEpochCall","minProofsPerEpochReturn"]}; \ No newline at end of file diff --git a/chain_connector/Core/struct.capacityCall.html b/chain_connector/Core/struct.capacityCall.html new file mode 100644 index 0000000000..efbee89b86 --- /dev/null +++ b/chain_connector/Core/struct.capacityCall.html @@ -0,0 +1,42 @@ +capacityCall in chain_connector::Core - Rust
pub struct capacityCall {}
Expand description

Function with signature capacity() and selector 0x5cfc1a51.

+
function capacity() external view returns (address);
+

Trait Implementations§

source§

impl Clone for capacityCall

source§

fn clone(&self) -> capacityCall

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl SolCall for capacityCall

§

type Parameters<'a> = ()

The underlying tuple type which represents this type’s arguments. Read more
§

type Token<'a> = <<capacityCall as SolCall>::Parameters<'a> as SolType>::Token<'a>

The arguments’ corresponding [TokenSeq] type.
§

type Return = capacityReturn

The function’s return struct.
§

type ReturnTuple<'a> = (Address,)

The underlying tuple type which represents this type’s return values. Read more
§

type ReturnToken<'a> = <<capacityCall as SolCall>::ReturnTuple<'a> as SolType>::Token<'a>

The returns’ corresponding [TokenSeq] type.
source§

const SIGNATURE: &'static str = "capacity()"

The function’s ABI signature.
source§

const SELECTOR: [u8; 4] = _

The function selector: keccak256(SIGNATURE)[0..4]
source§

fn new<'a>(tuple: <Self::Parameters<'a> as SolType>::RustType) -> Self

Convert from the tuple type used for ABI encoding and decoding.
source§

fn tokenize(&self) -> Self::Token<'_>

Tokenize the call’s arguments.
source§

fn abi_decode_returns(data: &[u8], validate: bool) -> Result<Self::Return>

ABI decode this call’s return values from the given slice.
§

fn abi_encoded_size(&self) -> usize

The size of the encoded data in bytes, without its selector.
§

fn abi_decode_raw(data: &[u8], validate: bool) -> Result<Self, Error>

ABI decode this call’s arguments from the given slice, without its +selector.
§

fn abi_decode(data: &[u8], validate: bool) -> Result<Self, Error>

ABI decode this call’s arguments from the given slice, with the +selector.
§

fn abi_encode_raw(&self, out: &mut Vec<u8>)

ABI encode the call to the given buffer without its selector.
§

fn abi_encode(&self) -> Vec<u8>

ABI encode the call to the given buffer with its selector.
§

fn abi_encode_returns<'a, E>(e: &'a E) -> Vec<u8> where + E: SolTypeValue<Self::ReturnTuple<'a>>,

ABI encode the call’s return values.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/chain_connector/Core/struct.capacityReturn.html b/chain_connector/Core/struct.capacityReturn.html new file mode 100644 index 0000000000..173286d34d --- /dev/null +++ b/chain_connector/Core/struct.capacityReturn.html @@ -0,0 +1,40 @@ +capacityReturn in chain_connector::Core - Rust
pub struct capacityReturn {
+    pub _0: Address,
+}
Expand description

Container type for the return parameters of the capacity() function.

+

Fields§

§_0: Address

Trait Implementations§

source§

impl Clone for capacityReturn

source§

fn clone(&self) -> capacityReturn

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/chain_connector/Core/struct.currentEpochCall.html b/chain_connector/Core/struct.currentEpochCall.html new file mode 100644 index 0000000000..109e7b60db --- /dev/null +++ b/chain_connector/Core/struct.currentEpochCall.html @@ -0,0 +1,44 @@ +currentEpochCall in chain_connector::Core - Rust
pub struct currentEpochCall {}
Expand description

@dev Returns current epoch +@return current epoch number +Function with signature currentEpoch() and selector 0x76671808.

+
function currentEpoch() external view returns (uint256);
+

Trait Implementations§

source§

impl Clone for currentEpochCall

source§

fn clone(&self) -> currentEpochCall

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl SolCall for currentEpochCall

§

type Parameters<'a> = ()

The underlying tuple type which represents this type’s arguments. Read more
§

type Token<'a> = <<currentEpochCall as SolCall>::Parameters<'a> as SolType>::Token<'a>

The arguments’ corresponding [TokenSeq] type.
§

type Return = currentEpochReturn

The function’s return struct.
§

type ReturnTuple<'a> = (Uint<256>,)

The underlying tuple type which represents this type’s return values. Read more
§

type ReturnToken<'a> = <<currentEpochCall as SolCall>::ReturnTuple<'a> as SolType>::Token<'a>

The returns’ corresponding [TokenSeq] type.
source§

const SIGNATURE: &'static str = "currentEpoch()"

The function’s ABI signature.
source§

const SELECTOR: [u8; 4] = _

The function selector: keccak256(SIGNATURE)[0..4]
source§

fn new<'a>(tuple: <Self::Parameters<'a> as SolType>::RustType) -> Self

Convert from the tuple type used for ABI encoding and decoding.
source§

fn tokenize(&self) -> Self::Token<'_>

Tokenize the call’s arguments.
source§

fn abi_decode_returns(data: &[u8], validate: bool) -> Result<Self::Return>

ABI decode this call’s return values from the given slice.
§

fn abi_encoded_size(&self) -> usize

The size of the encoded data in bytes, without its selector.
§

fn abi_decode_raw(data: &[u8], validate: bool) -> Result<Self, Error>

ABI decode this call’s arguments from the given slice, without its +selector.
§

fn abi_decode(data: &[u8], validate: bool) -> Result<Self, Error>

ABI decode this call’s arguments from the given slice, with the +selector.
§

fn abi_encode_raw(&self, out: &mut Vec<u8>)

ABI encode the call to the given buffer without its selector.
§

fn abi_encode(&self) -> Vec<u8>

ABI encode the call to the given buffer with its selector.
§

fn abi_encode_returns<'a, E>(e: &'a E) -> Vec<u8> where + E: SolTypeValue<Self::ReturnTuple<'a>>,

ABI encode the call’s return values.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/chain_connector/Core/struct.currentEpochReturn.html b/chain_connector/Core/struct.currentEpochReturn.html new file mode 100644 index 0000000000..2d6990099e --- /dev/null +++ b/chain_connector/Core/struct.currentEpochReturn.html @@ -0,0 +1,42 @@ +currentEpochReturn in chain_connector::Core - Rust
pub struct currentEpochReturn {
+    pub _0: U256,
+}
Expand description

@dev Returns current epoch +@return current epoch number +Container type for the return parameters of the currentEpoch() function.

+

Fields§

§_0: U256

Trait Implementations§

source§

impl Clone for currentEpochReturn

source§

fn clone(&self) -> currentEpochReturn

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/chain_connector/Core/struct.difficultyCall.html b/chain_connector/Core/struct.difficultyCall.html new file mode 100644 index 0000000000..aa63a3fbd5 --- /dev/null +++ b/chain_connector/Core/struct.difficultyCall.html @@ -0,0 +1,43 @@ +difficultyCall in chain_connector::Core - Rust
pub struct difficultyCall {}
Expand description

@dev Returns the difficulty for CCP +Function with signature difficulty() and selector 0x19cae462.

+
function difficulty() external view returns (bytes32);
+

Trait Implementations§

source§

impl Clone for difficultyCall

source§

fn clone(&self) -> difficultyCall

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl SolCall for difficultyCall

§

type Parameters<'a> = ()

The underlying tuple type which represents this type’s arguments. Read more
§

type Token<'a> = <<difficultyCall as SolCall>::Parameters<'a> as SolType>::Token<'a>

The arguments’ corresponding [TokenSeq] type.
§

type Return = difficultyReturn

The function’s return struct.
§

type ReturnTuple<'a> = (FixedBytes<32>,)

The underlying tuple type which represents this type’s return values. Read more
§

type ReturnToken<'a> = <<difficultyCall as SolCall>::ReturnTuple<'a> as SolType>::Token<'a>

The returns’ corresponding [TokenSeq] type.
source§

const SIGNATURE: &'static str = "difficulty()"

The function’s ABI signature.
source§

const SELECTOR: [u8; 4] = _

The function selector: keccak256(SIGNATURE)[0..4]
source§

fn new<'a>(tuple: <Self::Parameters<'a> as SolType>::RustType) -> Self

Convert from the tuple type used for ABI encoding and decoding.
source§

fn tokenize(&self) -> Self::Token<'_>

Tokenize the call’s arguments.
source§

fn abi_decode_returns(data: &[u8], validate: bool) -> Result<Self::Return>

ABI decode this call’s return values from the given slice.
§

fn abi_encoded_size(&self) -> usize

The size of the encoded data in bytes, without its selector.
§

fn abi_decode_raw(data: &[u8], validate: bool) -> Result<Self, Error>

ABI decode this call’s arguments from the given slice, without its +selector.
§

fn abi_decode(data: &[u8], validate: bool) -> Result<Self, Error>

ABI decode this call’s arguments from the given slice, with the +selector.
§

fn abi_encode_raw(&self, out: &mut Vec<u8>)

ABI encode the call to the given buffer without its selector.
§

fn abi_encode(&self) -> Vec<u8>

ABI encode the call to the given buffer with its selector.
§

fn abi_encode_returns<'a, E>(e: &'a E) -> Vec<u8> where + E: SolTypeValue<Self::ReturnTuple<'a>>,

ABI encode the call’s return values.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/chain_connector/Core/struct.difficultyReturn.html b/chain_connector/Core/struct.difficultyReturn.html new file mode 100644 index 0000000000..bf4ef8ca05 --- /dev/null +++ b/chain_connector/Core/struct.difficultyReturn.html @@ -0,0 +1,41 @@ +difficultyReturn in chain_connector::Core - Rust
pub struct difficultyReturn {
+    pub _0: FixedBytes<32>,
+}
Expand description

@dev Returns the difficulty for CCP +Container type for the return parameters of the difficulty() function.

+

Fields§

§_0: FixedBytes<32>

Trait Implementations§

source§

impl Clone for difficultyReturn

source§

fn clone(&self) -> difficultyReturn

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/chain_connector/Core/struct.epochDurationCall.html b/chain_connector/Core/struct.epochDurationCall.html new file mode 100644 index 0000000000..8452e81853 --- /dev/null +++ b/chain_connector/Core/struct.epochDurationCall.html @@ -0,0 +1,44 @@ +epochDurationCall in chain_connector::Core - Rust
pub struct epochDurationCall {}
Expand description

@dev Returns epoch duration +@return epochDuration in seconds +Function with signature epochDuration() and selector 0x4ff0876a.

+
function epochDuration() external view returns (uint256);
+

Trait Implementations§

source§

impl Clone for epochDurationCall

source§

fn clone(&self) -> epochDurationCall

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl SolCall for epochDurationCall

§

type Parameters<'a> = ()

The underlying tuple type which represents this type’s arguments. Read more
§

type Token<'a> = <<epochDurationCall as SolCall>::Parameters<'a> as SolType>::Token<'a>

The arguments’ corresponding [TokenSeq] type.
§

type Return = epochDurationReturn

The function’s return struct.
§

type ReturnTuple<'a> = (Uint<256>,)

The underlying tuple type which represents this type’s return values. Read more
§

type ReturnToken<'a> = <<epochDurationCall as SolCall>::ReturnTuple<'a> as SolType>::Token<'a>

The returns’ corresponding [TokenSeq] type.
source§

const SIGNATURE: &'static str = "epochDuration()"

The function’s ABI signature.
source§

const SELECTOR: [u8; 4] = _

The function selector: keccak256(SIGNATURE)[0..4]
source§

fn new<'a>(tuple: <Self::Parameters<'a> as SolType>::RustType) -> Self

Convert from the tuple type used for ABI encoding and decoding.
source§

fn tokenize(&self) -> Self::Token<'_>

Tokenize the call’s arguments.
source§

fn abi_decode_returns(data: &[u8], validate: bool) -> Result<Self::Return>

ABI decode this call’s return values from the given slice.
§

fn abi_encoded_size(&self) -> usize

The size of the encoded data in bytes, without its selector.
§

fn abi_decode_raw(data: &[u8], validate: bool) -> Result<Self, Error>

ABI decode this call’s arguments from the given slice, without its +selector.
§

fn abi_decode(data: &[u8], validate: bool) -> Result<Self, Error>

ABI decode this call’s arguments from the given slice, with the +selector.
§

fn abi_encode_raw(&self, out: &mut Vec<u8>)

ABI encode the call to the given buffer without its selector.
§

fn abi_encode(&self) -> Vec<u8>

ABI encode the call to the given buffer with its selector.
§

fn abi_encode_returns<'a, E>(e: &'a E) -> Vec<u8> where + E: SolTypeValue<Self::ReturnTuple<'a>>,

ABI encode the call’s return values.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/chain_connector/Core/struct.epochDurationReturn.html b/chain_connector/Core/struct.epochDurationReturn.html new file mode 100644 index 0000000000..195784fca2 --- /dev/null +++ b/chain_connector/Core/struct.epochDurationReturn.html @@ -0,0 +1,42 @@ +epochDurationReturn in chain_connector::Core - Rust
pub struct epochDurationReturn {
+    pub _0: U256,
+}
Expand description

@dev Returns epoch duration +@return epochDuration in seconds +Container type for the return parameters of the epochDuration() function.

+

Fields§

§_0: U256

Trait Implementations§

source§

impl Clone for epochDurationReturn

source§

fn clone(&self) -> epochDurationReturn

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/chain_connector/Core/struct.initTimestampCall.html b/chain_connector/Core/struct.initTimestampCall.html new file mode 100644 index 0000000000..24f6bbe476 --- /dev/null +++ b/chain_connector/Core/struct.initTimestampCall.html @@ -0,0 +1,44 @@ +initTimestampCall in chain_connector::Core - Rust
pub struct initTimestampCall {}
Expand description

@dev Returns epoch init timestamp +@return initTimestamp in seconds +Function with signature initTimestamp() and selector 0x7358c57a.

+
function initTimestamp() external view returns (uint256);
+

Trait Implementations§

source§

impl Clone for initTimestampCall

source§

fn clone(&self) -> initTimestampCall

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl SolCall for initTimestampCall

§

type Parameters<'a> = ()

The underlying tuple type which represents this type’s arguments. Read more
§

type Token<'a> = <<initTimestampCall as SolCall>::Parameters<'a> as SolType>::Token<'a>

The arguments’ corresponding [TokenSeq] type.
§

type Return = initTimestampReturn

The function’s return struct.
§

type ReturnTuple<'a> = (Uint<256>,)

The underlying tuple type which represents this type’s return values. Read more
§

type ReturnToken<'a> = <<initTimestampCall as SolCall>::ReturnTuple<'a> as SolType>::Token<'a>

The returns’ corresponding [TokenSeq] type.
source§

const SIGNATURE: &'static str = "initTimestamp()"

The function’s ABI signature.
source§

const SELECTOR: [u8; 4] = _

The function selector: keccak256(SIGNATURE)[0..4]
source§

fn new<'a>(tuple: <Self::Parameters<'a> as SolType>::RustType) -> Self

Convert from the tuple type used for ABI encoding and decoding.
source§

fn tokenize(&self) -> Self::Token<'_>

Tokenize the call’s arguments.
source§

fn abi_decode_returns(data: &[u8], validate: bool) -> Result<Self::Return>

ABI decode this call’s return values from the given slice.
§

fn abi_encoded_size(&self) -> usize

The size of the encoded data in bytes, without its selector.
§

fn abi_decode_raw(data: &[u8], validate: bool) -> Result<Self, Error>

ABI decode this call’s arguments from the given slice, without its +selector.
§

fn abi_decode(data: &[u8], validate: bool) -> Result<Self, Error>

ABI decode this call’s arguments from the given slice, with the +selector.
§

fn abi_encode_raw(&self, out: &mut Vec<u8>)

ABI encode the call to the given buffer without its selector.
§

fn abi_encode(&self) -> Vec<u8>

ABI encode the call to the given buffer with its selector.
§

fn abi_encode_returns<'a, E>(e: &'a E) -> Vec<u8> where + E: SolTypeValue<Self::ReturnTuple<'a>>,

ABI encode the call’s return values.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/chain_connector/Core/struct.initTimestampReturn.html b/chain_connector/Core/struct.initTimestampReturn.html new file mode 100644 index 0000000000..3e6d1e9296 --- /dev/null +++ b/chain_connector/Core/struct.initTimestampReturn.html @@ -0,0 +1,42 @@ +initTimestampReturn in chain_connector::Core - Rust
pub struct initTimestampReturn {
+    pub _0: U256,
+}
Expand description

@dev Returns epoch init timestamp +@return initTimestamp in seconds +Container type for the return parameters of the initTimestamp() function.

+

Fields§

§_0: U256

Trait Implementations§

source§

impl Clone for initTimestampReturn

source§

fn clone(&self) -> initTimestampReturn

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/chain_connector/Core/struct.marketCall.html b/chain_connector/Core/struct.marketCall.html new file mode 100644 index 0000000000..71054ee448 --- /dev/null +++ b/chain_connector/Core/struct.marketCall.html @@ -0,0 +1,42 @@ +marketCall in chain_connector::Core - Rust
pub struct marketCall {}
Expand description

Function with signature market() and selector 0x80f55605.

+
function market() external view returns (address);
+

Trait Implementations§

source§

impl Clone for marketCall

source§

fn clone(&self) -> marketCall

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl SolCall for marketCall

§

type Parameters<'a> = ()

The underlying tuple type which represents this type’s arguments. Read more
§

type Token<'a> = <<marketCall as SolCall>::Parameters<'a> as SolType>::Token<'a>

The arguments’ corresponding [TokenSeq] type.
§

type Return = marketReturn

The function’s return struct.
§

type ReturnTuple<'a> = (Address,)

The underlying tuple type which represents this type’s return values. Read more
§

type ReturnToken<'a> = <<marketCall as SolCall>::ReturnTuple<'a> as SolType>::Token<'a>

The returns’ corresponding [TokenSeq] type.
source§

const SIGNATURE: &'static str = "market()"

The function’s ABI signature.
source§

const SELECTOR: [u8; 4] = _

The function selector: keccak256(SIGNATURE)[0..4]
source§

fn new<'a>(tuple: <Self::Parameters<'a> as SolType>::RustType) -> Self

Convert from the tuple type used for ABI encoding and decoding.
source§

fn tokenize(&self) -> Self::Token<'_>

Tokenize the call’s arguments.
source§

fn abi_decode_returns(data: &[u8], validate: bool) -> Result<Self::Return>

ABI decode this call’s return values from the given slice.
§

fn abi_encoded_size(&self) -> usize

The size of the encoded data in bytes, without its selector.
§

fn abi_decode_raw(data: &[u8], validate: bool) -> Result<Self, Error>

ABI decode this call’s arguments from the given slice, without its +selector.
§

fn abi_decode(data: &[u8], validate: bool) -> Result<Self, Error>

ABI decode this call’s arguments from the given slice, with the +selector.
§

fn abi_encode_raw(&self, out: &mut Vec<u8>)

ABI encode the call to the given buffer without its selector.
§

fn abi_encode(&self) -> Vec<u8>

ABI encode the call to the given buffer with its selector.
§

fn abi_encode_returns<'a, E>(e: &'a E) -> Vec<u8> where + E: SolTypeValue<Self::ReturnTuple<'a>>,

ABI encode the call’s return values.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/chain_connector/Core/struct.marketReturn.html b/chain_connector/Core/struct.marketReturn.html new file mode 100644 index 0000000000..abb9e1404b --- /dev/null +++ b/chain_connector/Core/struct.marketReturn.html @@ -0,0 +1,40 @@ +marketReturn in chain_connector::Core - Rust
pub struct marketReturn {
+    pub _0: Address,
+}
Expand description

Container type for the return parameters of the market() function.

+

Fields§

§_0: Address

Trait Implementations§

source§

impl Clone for marketReturn

source§

fn clone(&self) -> marketReturn

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/chain_connector/Core/struct.maxProofsPerEpochCall.html b/chain_connector/Core/struct.maxProofsPerEpochCall.html new file mode 100644 index 0000000000..20e344cbb3 --- /dev/null +++ b/chain_connector/Core/struct.maxProofsPerEpochCall.html @@ -0,0 +1,43 @@ +maxProofsPerEpochCall in chain_connector::Core - Rust
pub struct maxProofsPerEpochCall {}
Expand description

@dev Returns the max randomX proofs per epoch +Function with signature maxProofsPerEpoch() and selector 0x280c5e51.

+
function maxProofsPerEpoch() external view returns (uint256);
+

Trait Implementations§

source§

impl Clone for maxProofsPerEpochCall

source§

fn clone(&self) -> maxProofsPerEpochCall

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl SolCall for maxProofsPerEpochCall

§

type Parameters<'a> = ()

The underlying tuple type which represents this type’s arguments. Read more
§

type Token<'a> = <<maxProofsPerEpochCall as SolCall>::Parameters<'a> as SolType>::Token<'a>

The arguments’ corresponding [TokenSeq] type.
§

type Return = maxProofsPerEpochReturn

The function’s return struct.
§

type ReturnTuple<'a> = (Uint<256>,)

The underlying tuple type which represents this type’s return values. Read more
§

type ReturnToken<'a> = <<maxProofsPerEpochCall as SolCall>::ReturnTuple<'a> as SolType>::Token<'a>

The returns’ corresponding [TokenSeq] type.
source§

const SIGNATURE: &'static str = "maxProofsPerEpoch()"

The function’s ABI signature.
source§

const SELECTOR: [u8; 4] = _

The function selector: keccak256(SIGNATURE)[0..4]
source§

fn new<'a>(tuple: <Self::Parameters<'a> as SolType>::RustType) -> Self

Convert from the tuple type used for ABI encoding and decoding.
source§

fn tokenize(&self) -> Self::Token<'_>

Tokenize the call’s arguments.
source§

fn abi_decode_returns(data: &[u8], validate: bool) -> Result<Self::Return>

ABI decode this call’s return values from the given slice.
§

fn abi_encoded_size(&self) -> usize

The size of the encoded data in bytes, without its selector.
§

fn abi_decode_raw(data: &[u8], validate: bool) -> Result<Self, Error>

ABI decode this call’s arguments from the given slice, without its +selector.
§

fn abi_decode(data: &[u8], validate: bool) -> Result<Self, Error>

ABI decode this call’s arguments from the given slice, with the +selector.
§

fn abi_encode_raw(&self, out: &mut Vec<u8>)

ABI encode the call to the given buffer without its selector.
§

fn abi_encode(&self) -> Vec<u8>

ABI encode the call to the given buffer with its selector.
§

fn abi_encode_returns<'a, E>(e: &'a E) -> Vec<u8> where + E: SolTypeValue<Self::ReturnTuple<'a>>,

ABI encode the call’s return values.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/chain_connector/Core/struct.maxProofsPerEpochReturn.html b/chain_connector/Core/struct.maxProofsPerEpochReturn.html new file mode 100644 index 0000000000..99deed713f --- /dev/null +++ b/chain_connector/Core/struct.maxProofsPerEpochReturn.html @@ -0,0 +1,41 @@ +maxProofsPerEpochReturn in chain_connector::Core - Rust
pub struct maxProofsPerEpochReturn {
+    pub _0: U256,
+}
Expand description

@dev Returns the max randomX proofs per epoch +Container type for the return parameters of the maxProofsPerEpoch() function.

+

Fields§

§_0: U256

Trait Implementations§

source§

impl Clone for maxProofsPerEpochReturn

source§

fn clone(&self) -> maxProofsPerEpochReturn

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/chain_connector/Core/struct.minProofsPerEpochCall.html b/chain_connector/Core/struct.minProofsPerEpochCall.html new file mode 100644 index 0000000000..2de354c492 --- /dev/null +++ b/chain_connector/Core/struct.minProofsPerEpochCall.html @@ -0,0 +1,44 @@ +minProofsPerEpochCall in chain_connector::Core - Rust
pub struct minProofsPerEpochCall {}
Expand description

@dev Returns the min required randomX proofs per epoch for the 1 CU. +@dev If lower than this - CU is failed and CC slashed. +Function with signature minProofsPerEpoch() and selector 0xe79c6270.

+
function minProofsPerEpoch() external view returns (uint256);
+

Trait Implementations§

source§

impl Clone for minProofsPerEpochCall

source§

fn clone(&self) -> minProofsPerEpochCall

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl SolCall for minProofsPerEpochCall

§

type Parameters<'a> = ()

The underlying tuple type which represents this type’s arguments. Read more
§

type Token<'a> = <<minProofsPerEpochCall as SolCall>::Parameters<'a> as SolType>::Token<'a>

The arguments’ corresponding [TokenSeq] type.
§

type Return = minProofsPerEpochReturn

The function’s return struct.
§

type ReturnTuple<'a> = (Uint<256>,)

The underlying tuple type which represents this type’s return values. Read more
§

type ReturnToken<'a> = <<minProofsPerEpochCall as SolCall>::ReturnTuple<'a> as SolType>::Token<'a>

The returns’ corresponding [TokenSeq] type.
source§

const SIGNATURE: &'static str = "minProofsPerEpoch()"

The function’s ABI signature.
source§

const SELECTOR: [u8; 4] = _

The function selector: keccak256(SIGNATURE)[0..4]
source§

fn new<'a>(tuple: <Self::Parameters<'a> as SolType>::RustType) -> Self

Convert from the tuple type used for ABI encoding and decoding.
source§

fn tokenize(&self) -> Self::Token<'_>

Tokenize the call’s arguments.
source§

fn abi_decode_returns(data: &[u8], validate: bool) -> Result<Self::Return>

ABI decode this call’s return values from the given slice.
§

fn abi_encoded_size(&self) -> usize

The size of the encoded data in bytes, without its selector.
§

fn abi_decode_raw(data: &[u8], validate: bool) -> Result<Self, Error>

ABI decode this call’s arguments from the given slice, without its +selector.
§

fn abi_decode(data: &[u8], validate: bool) -> Result<Self, Error>

ABI decode this call’s arguments from the given slice, with the +selector.
§

fn abi_encode_raw(&self, out: &mut Vec<u8>)

ABI encode the call to the given buffer without its selector.
§

fn abi_encode(&self) -> Vec<u8>

ABI encode the call to the given buffer with its selector.
§

fn abi_encode_returns<'a, E>(e: &'a E) -> Vec<u8> where + E: SolTypeValue<Self::ReturnTuple<'a>>,

ABI encode the call’s return values.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/chain_connector/Core/struct.minProofsPerEpochReturn.html b/chain_connector/Core/struct.minProofsPerEpochReturn.html new file mode 100644 index 0000000000..cc1100acdd --- /dev/null +++ b/chain_connector/Core/struct.minProofsPerEpochReturn.html @@ -0,0 +1,42 @@ +minProofsPerEpochReturn in chain_connector::Core - Rust
pub struct minProofsPerEpochReturn {
+    pub _0: U256,
+}
Expand description

@dev Returns the min required randomX proofs per epoch for the 1 CU. +@dev If lower than this - CU is failed and CC slashed. +Container type for the return parameters of the minProofsPerEpoch() function.

+

Fields§

§_0: U256

Trait Implementations§

source§

impl Clone for minProofsPerEpochReturn

source§

fn clone(&self) -> minProofsPerEpochReturn

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/chain_connector/Deal/enum.DealCalls.html b/chain_connector/Deal/enum.DealCalls.html new file mode 100644 index 0000000000..1a75f47d1d --- /dev/null +++ b/chain_connector/Deal/enum.DealCalls.html @@ -0,0 +1,51 @@ +DealCalls in chain_connector::Deal - Rust
pub enum DealCalls {
+    getStatus(getStatusCall),
+    appCID(appCIDCall),
+    setWorker(setWorkerCall),
+    getComputeUnits(getComputeUnitsCall),
+}
Expand description

Container for all the Deal function calls.

+

Variants§

§

getStatus(getStatusCall)

§

appCID(appCIDCall)

§

setWorker(setWorkerCall)

§

getComputeUnits(getComputeUnitsCall)

Implementations§

source§

impl DealCalls

source

pub const SELECTORS: &'static [[u8; 4]] = _

All the selectors of this enum.

+

Note that the selectors might not be in the same order as the variants. +No guarantees are made about the order of the selectors.

+

Prefer using SolInterface methods instead.

+

Trait Implementations§

source§

impl SolInterface for DealCalls

source§

const NAME: &'static str = "DealCalls"

The name of this type.
source§

const MIN_DATA_LENGTH: usize = 0usize

The minimum length of the data for this type. Read more
source§

const COUNT: usize = 4usize

The number of variants.
source§

fn selector(&self) -> [u8; 4]

The selector of this instance.
source§

fn selector_at(i: usize) -> Option<[u8; 4]>

The selector of this type at the given index, used in +selectors. Read more
source§

fn valid_selector(selector: [u8; 4]) -> bool

Returns true if the given selector is known to this type.
source§

fn abi_decode_raw( + selector: [u8; 4], + data: &[u8], + validate: bool +) -> Result<Self>

ABI-decodes the given data into one of the variants of self.
source§

fn abi_encoded_size(&self) -> usize

The size of the encoded data, without any selectors.
source§

fn abi_encode_raw(&self, out: &mut Vec<u8>)

ABI-encodes self into the given buffer, without any selectors.
§

fn type_check(selector: [u8; 4]) -> Result<(), Error>

Returns an error if the given selector is not known to this type.
§

fn selectors() -> Selectors<Self>

Returns an iterator over the selectors of this type.
§

fn abi_encode(&self) -> Vec<u8>

ABI-encodes self into the given buffer.
§

fn abi_decode(data: &[u8], validate: bool) -> Result<Self, Error>

ABI-decodes the given data into one of the variants of self.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/chain_connector/Deal/enum.Status.html b/chain_connector/Deal/enum.Status.html new file mode 100644 index 0000000000..0ecad98ad7 --- /dev/null +++ b/chain_connector/Deal/enum.Status.html @@ -0,0 +1,94 @@ +Status in chain_connector::Deal - Rust
#[repr(u8)]
pub enum Status { + INSUFFICIENT_FUNDS, + ACTIVE, + ENDED, + NOT_ENOUGH_WORKERS, + SMALL_BALANCE, + // some variants omitted +}
Expand description
enum Status { INSUFFICIENT_FUNDS, ACTIVE, ENDED, NOT_ENOUGH_WORKERS, SMALL_BALANCE }
+

Variants§

§

INSUFFICIENT_FUNDS

§

ACTIVE

§

ENDED

§

NOT_ENOUGH_WORKERS

§

SMALL_BALANCE

Implementations§

Trait Implementations§

source§

impl Clone for Status

source§

fn clone(&self) -> Status

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Status

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for Status

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl EventTopic for Status

source§

fn topic_preimage_length(rust: &Self::RustType) -> usize

The number of bytes this type occupies in another topic’s preimage, +usually a multiple of 32. Read more
source§

fn encode_topic_preimage(rust: &Self::RustType, out: &mut Vec<u8>)

Encodes this type as preimage bytes which are then hashed in +complex types’ [encode_topic][EventTopic::encode_topic]. Read more
source§

fn encode_topic(rust: &Self::RustType) -> WordToken

Indexed event parameter encoding. Read more
source§

impl From<Status> for u8

source§

fn from(v: Status) -> Self

Converts to this type from the input type.
source§

impl PartialEq for Status

source§

fn eq(&self, other: &Status) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Serialize for Status

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl SolEnum for Status

source§

const COUNT: usize = 5usize

The number of variants in the enum. Read more
§

fn tokenize(self) -> WordToken

Tokenize the enum.
§

fn abi_decode(data: &[u8], validate: bool) -> Result<Self, Error>

ABI decode the enum from the given buffer.
§

fn abi_encode_raw(self, out: &mut Vec<u8>)

ABI encode the enum into the given buffer.
§

fn abi_encode(self) -> Vec<u8>

ABI encode the enum.
source§

impl SolType for Status

§

type RustType = Status

The corresponding Rust type.
§

type Token<'a> = <Uint<8> as SolType>::Token<'a>

The corresponding ABI token type. Read more
source§

const SOL_NAME: &'static str = <alloy_sol_types::sol_data::Uint<8> as alloy_sol_types::SolType>::SOL_NAME

The name of this type in Solidity.
source§

const ENCODED_SIZE: Option<usize> = <alloy_sol_types::sol_data::Uint<8> as alloy_sol_types::SolType>::ENCODED_SIZE

The statically-known ABI-encoded size of the type. Read more
source§

fn valid_token(token: &Self::Token<'_>) -> bool

Returns true if the given token can be detokenized with this type.
source§

fn type_check(token: &Self::Token<'_>) -> Result<()>

Returns an error if the given token cannot be detokenized with this +type.
source§

fn detokenize(token: Self::Token<'_>) -> Self::RustType

Detokenize this type’s value from the given token. Read more
§

const DYNAMIC: bool = _

Whether the ABI-encoded size is dynamic. Read more
§

fn sol_type_name() -> Cow<'static, str>

👎Deprecated since 0.6.3: use SOL_NAME instead
Returns the name of this type in Solidity.
§

fn abi_encoded_size<E>(rust: &E) -> usizewhere + E: SolTypeValue<Self> + ?Sized,

Calculate the ABI-encoded size of the data, counting both head and tail +words. For a single-word type this will always be 32.
§

fn tokenize<E>(rust: &E) -> Self::Token<'_>where + E: SolTypeValue<Self> + ?Sized,

Tokenizes the given value into this type’s token. Read more
§

fn eip712_data_word<E>(rust: &E) -> FixedBytes<32>where + E: SolTypeValue<Self> + ?Sized,

Encode this data according to EIP-712 encodeData rules, and hash it +if necessary. Read more
§

fn abi_encode_packed_to<E>(rust: &E, out: &mut Vec<u8>)where + E: SolTypeValue<Self> + ?Sized,

Non-standard Packed Mode ABI encoding. Read more
§

fn abi_encode_packed<E>(rust: &E) -> Vec<u8> where + E: SolTypeValue<Self> + ?Sized,

Non-standard Packed Mode ABI encoding. Read more
§

fn abi_encode<E>(rust: &E) -> Vec<u8> where + E: SolTypeValue<Self> + ?Sized,

Tokenizes and ABI-encodes the given value by wrapping it in a +single-element sequence. Read more
§

fn abi_decode(data: &[u8], validate: bool) -> Result<Self::RustType, Error>

Decodes this type’s value from an ABI blob by interpreting it as a +single-element sequence. Read more
§

fn abi_decode_params<'de>( + data: &'de [u8], + validate: bool +) -> Result<Self::RustType, Error>where + Self::Token<'de>: TokenSeq<'de>,

Decodes this type’s value from an ABI blob by interpreting it as +function parameters. Read more
§

fn abi_decode_sequence<'de>( + data: &'de [u8], + validate: bool +) -> Result<Self::RustType, Error>where + Self::Token<'de>: TokenSeq<'de>,

Decodes this type’s value from an ABI blob by interpreting it as a +sequence. Read more
source§

impl SolTypeValue<Status> for Status

source§

fn stv_to_tokens(&self) -> <Uint<8> as SolType>::Token<'_>

source§

fn stv_eip712_data_word(&self) -> Word

source§

fn stv_abi_encode_packed_to(&self, out: &mut Vec<u8>)

§

fn stv_abi_encoded_size(&self) -> usize

source§

impl SolValue for Status

§

type SolType = Status

The Solidity type that this type corresponds to.
§

fn sol_name(&self) -> &'static str

The name of the associated Solidity type. Read more
§

fn sol_type_name(&self) -> Cow<'static, str>

👎Deprecated since 0.6.3: use sol_name instead
The name of the associated Solidity type. Read more
§

fn tokenize(&self) -> <Self::SolType as SolType>::Token<'_>

Tokenizes the given value into this type’s token. Read more
§

fn detokenize(token: <Self::SolType as SolType>::Token<'_>) -> Selfwhere + Self: From<<Self::SolType as SolType>::RustType>,

Detokenize a value from the given token. Read more
§

fn abi_encoded_size(&self) -> usize

Calculate the ABI-encoded size of the data. Read more
§

fn eip712_data_word(&self) -> FixedBytes<32>

Encode this data according to EIP-712 encodeData rules, and hash it +if necessary. Read more
§

fn abi_encode_packed_to(&self, out: &mut Vec<u8>)

Non-standard Packed Mode ABI encoding. Read more
§

fn abi_encode_packed(&self) -> Vec<u8>

Non-standard Packed Mode ABI encoding. Read more
§

fn abi_encode(&self) -> Vec<u8>

ABI-encodes the value. Read more
§

fn abi_decode(data: &[u8], validate: bool) -> Result<Self, Error>where + Self: From<<Self::SolType as SolType>::RustType>,

ABI-decode this type from the given data. Read more
§

fn abi_decode_params<'de>( + data: &'de [u8], + validate: bool +) -> Result<Self, Error>where + Self: From<<Self::SolType as SolType>::RustType>, + <Self::SolType as SolType>::Token<'de>: TokenSeq<'de>,

ABI-decode this type from the given data. Read more
§

fn abi_decode_sequence<'de>( + data: &'de [u8], + validate: bool +) -> Result<Self, Error>where + Self: From<<Self::SolType as SolType>::RustType>, + <Self::SolType as SolType>::Token<'de>: TokenSeq<'de>,

ABI-decode this type from the given data. Read more
source§

impl TryFrom<u8> for Status

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(v: u8) -> Result<Self>

Performs the conversion.
source§

impl Copy for Status

source§

impl Eq for Status

source§

impl StructuralEq for Status

source§

impl StructuralPartialEq for Status

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
source§

impl<T> DeserializeOwned for Twhere + T: for<'de> Deserialize<'de>,

§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/chain_connector/Deal/index.html b/chain_connector/Deal/index.html new file mode 100644 index 0000000000..1c7b13bd39 --- /dev/null +++ b/chain_connector/Deal/index.html @@ -0,0 +1,19 @@ +chain_connector::Deal - Rust

Module chain_connector::Deal

source ·
Expand description

Module containing a contract’s types and functions.

+
contract Deal {
+    struct CIDV1 { bytes4 prefixes; bytes32 hash; }
+    enum Status { INSUFFICIENT_FUNDS, ACTIVE, ENDED, NOT_ENOUGH_WORKERS, SMALL_BALANCE }
+    struct ComputeUnit { bytes32 id; bytes32 workerId; bytes32 peerId; address provider; uint256 joinedEpoch; }
+    function getStatus() external view returns (Status);
+    function appCID() external view returns (CIDV1 memory);
+    function setWorker(bytes32 computeUnitId, bytes32 workerId) external;
+    function getComputeUnits() public view returns (ComputeUnit[] memory);
+}
+

Structs

  • @dev Returns the app CID +Function with signature appCID() and selector 0x9bc66868.
  • @dev Returns the app CID +Container type for the return parameters of the appCID() function.
  • @dev Returns the compute units info by provider +Function with signature getComputeUnits() and selector 0x4b66a309.
  • @dev Returns the compute units info by provider +Container type for the return parameters of the getComputeUnits() function.
  • @dev Returns the status of the deal +Function with signature getStatus() and selector 0x4e69d560.
  • @dev Returns the status of the deal +Container type for the return parameters of the getStatus() function.
  • @dev Set worker ID for a compute unit. Compute unit can have only one worker ID +Function with signature setWorker(bytes32,bytes32) and selector 0xd5053ab0.
  • @dev Set worker ID for a compute unit. Compute unit can have only one worker ID +Container type for the return parameters of the setWorker(bytes32,bytes32) function.

Enums

\ No newline at end of file diff --git a/chain_connector/Deal/sidebar-items.js b/chain_connector/Deal/sidebar-items.js new file mode 100644 index 0000000000..149eb5bc08 --- /dev/null +++ b/chain_connector/Deal/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["DealCalls","Status"],"struct":["CIDV1","ComputeUnit","appCIDCall","appCIDReturn","getComputeUnitsCall","getComputeUnitsReturn","getStatusCall","getStatusReturn","setWorkerCall","setWorkerReturn"]}; \ No newline at end of file diff --git a/chain_connector/Deal/struct.CIDV1.html b/chain_connector/Deal/struct.CIDV1.html new file mode 100644 index 0000000000..39a5ead3b1 --- /dev/null +++ b/chain_connector/Deal/struct.CIDV1.html @@ -0,0 +1,87 @@ +CIDV1 in chain_connector::Deal - Rust

Struct chain_connector::Deal::CIDV1

source ·
pub struct CIDV1 {
+    pub prefixes: FixedBytes<4>,
+    pub hash: FixedBytes<32>,
+}
Expand description
struct CIDV1 { bytes4 prefixes; bytes32 hash; }
+

Fields§

§prefixes: FixedBytes<4>§hash: FixedBytes<32>

Implementations§

Trait Implementations§

source§

impl Clone for CIDV1

source§

fn clone(&self) -> CIDV1

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl EventTopic for CIDV1

source§

fn topic_preimage_length(rust: &Self::RustType) -> usize

The number of bytes this type occupies in another topic’s preimage, +usually a multiple of 32. Read more
source§

fn encode_topic_preimage(rust: &Self::RustType, out: &mut Vec<u8>)

Encodes this type as preimage bytes which are then hashed in +complex types’ [encode_topic][EventTopic::encode_topic]. Read more
source§

fn encode_topic(rust: &Self::RustType) -> WordToken

Indexed event parameter encoding. Read more
source§

impl SolStruct for CIDV1

source§

const NAME: &'static str = "CIDV1"

The struct name. Read more
source§

fn eip712_root_type() -> Cow<'static, str>

Return the root EIP-712 type. This type is used to construct the +encodeType string.
source§

fn eip712_components() -> Vec<Cow<'static, str>>

Returns component EIP-712 types. These types are used to construct +the encodeType string. These are the types of the struct’s fields, +and should not include the root type.
source§

fn eip712_encode_type() -> Cow<'static, str>

The EIP-712-encoded type string. Read more
source§

fn eip712_encode_data(&self) -> Vec<u8>

Encodes this domain using EIP-712 encodeData.
§

fn eip712_type_hash(&self) -> FixedBytes<32>

Calculates the EIP-712 typeHash +for this struct. Read more
§

fn eip712_hash_struct(&self) -> FixedBytes<32>

Hashes this struct according to EIP-712 hashStruct.
§

fn eip712_signing_hash(&self, domain: &Eip712Domain) -> FixedBytes<32>

Does something. Read more
source§

impl SolType for CIDV1

§

type RustType = CIDV1

The corresponding Rust type.
§

type Token<'a> = <(FixedBytes<4>, FixedBytes<32>) as SolType>::Token<'a>

The corresponding ABI token type. Read more
source§

const SOL_NAME: &'static str = <Self as alloy_sol_types::SolStruct>::NAME

The name of this type in Solidity.
source§

const ENCODED_SIZE: Option<usize> = <UnderlyingSolTuple as alloy_sol_types::SolType>::ENCODED_SIZE

The statically-known ABI-encoded size of the type. Read more
source§

fn valid_token(token: &Self::Token<'_>) -> bool

Returns true if the given token can be detokenized with this type.
source§

fn detokenize(token: Self::Token<'_>) -> Self::RustType

Detokenize this type’s value from the given token. Read more
§

const DYNAMIC: bool = _

Whether the ABI-encoded size is dynamic. Read more
§

fn sol_type_name() -> Cow<'static, str>

👎Deprecated since 0.6.3: use SOL_NAME instead
Returns the name of this type in Solidity.
§

fn abi_encoded_size<E>(rust: &E) -> usizewhere + E: SolTypeValue<Self> + ?Sized,

Calculate the ABI-encoded size of the data, counting both head and tail +words. For a single-word type this will always be 32.
§

fn type_check(token: &Self::Token<'_>) -> Result<(), Error>

Returns an error if the given token cannot be detokenized with this +type.
§

fn tokenize<E>(rust: &E) -> Self::Token<'_>where + E: SolTypeValue<Self> + ?Sized,

Tokenizes the given value into this type’s token. Read more
§

fn eip712_data_word<E>(rust: &E) -> FixedBytes<32>where + E: SolTypeValue<Self> + ?Sized,

Encode this data according to EIP-712 encodeData rules, and hash it +if necessary. Read more
§

fn abi_encode_packed_to<E>(rust: &E, out: &mut Vec<u8>)where + E: SolTypeValue<Self> + ?Sized,

Non-standard Packed Mode ABI encoding. Read more
§

fn abi_encode_packed<E>(rust: &E) -> Vec<u8> where + E: SolTypeValue<Self> + ?Sized,

Non-standard Packed Mode ABI encoding. Read more
§

fn abi_encode<E>(rust: &E) -> Vec<u8> where + E: SolTypeValue<Self> + ?Sized,

Tokenizes and ABI-encodes the given value by wrapping it in a +single-element sequence. Read more
§

fn abi_encode_params<E>(rust: &E) -> Vec<u8> where + E: SolTypeValue<Self> + ?Sized, + Self::Token<'a>: for<'a> TokenSeq<'a>,

Tokenizes and ABI-encodes the given value as function parameters. Read more
§

fn abi_encode_sequence<E>(rust: &E) -> Vec<u8> where + E: SolTypeValue<Self> + ?Sized, + Self::Token<'a>: for<'a> TokenSeq<'a>,

Tokenizes and ABI-encodes the given value as a sequence. Read more
§

fn abi_decode(data: &[u8], validate: bool) -> Result<Self::RustType, Error>

Decodes this type’s value from an ABI blob by interpreting it as a +single-element sequence. Read more
§

fn abi_decode_params<'de>( + data: &'de [u8], + validate: bool +) -> Result<Self::RustType, Error>where + Self::Token<'de>: TokenSeq<'de>,

Decodes this type’s value from an ABI blob by interpreting it as +function parameters. Read more
§

fn abi_decode_sequence<'de>( + data: &'de [u8], + validate: bool +) -> Result<Self::RustType, Error>where + Self::Token<'de>: TokenSeq<'de>,

Decodes this type’s value from an ABI blob by interpreting it as a +sequence. Read more
source§

impl SolTypeValue<CIDV1> for CIDV1

source§

fn stv_to_tokens(&self) -> <Self as SolType>::Token<'_>

source§

fn stv_abi_encoded_size(&self) -> usize

source§

fn stv_eip712_data_word(&self) -> Word

source§

fn stv_abi_encode_packed_to(&self, out: &mut Vec<u8>)

source§

impl SolValue for CIDV1

§

type SolType = CIDV1

The Solidity type that this type corresponds to.
§

fn sol_name(&self) -> &'static str

The name of the associated Solidity type. Read more
§

fn sol_type_name(&self) -> Cow<'static, str>

👎Deprecated since 0.6.3: use sol_name instead
The name of the associated Solidity type. Read more
§

fn tokenize(&self) -> <Self::SolType as SolType>::Token<'_>

Tokenizes the given value into this type’s token. Read more
§

fn detokenize(token: <Self::SolType as SolType>::Token<'_>) -> Selfwhere + Self: From<<Self::SolType as SolType>::RustType>,

Detokenize a value from the given token. Read more
§

fn abi_encoded_size(&self) -> usize

Calculate the ABI-encoded size of the data. Read more
§

fn eip712_data_word(&self) -> FixedBytes<32>

Encode this data according to EIP-712 encodeData rules, and hash it +if necessary. Read more
§

fn abi_encode_packed_to(&self, out: &mut Vec<u8>)

Non-standard Packed Mode ABI encoding. Read more
§

fn abi_encode_packed(&self) -> Vec<u8>

Non-standard Packed Mode ABI encoding. Read more
§

fn abi_encode(&self) -> Vec<u8>

ABI-encodes the value. Read more
§

fn abi_encode_sequence(&self) -> Vec<u8> where + <Self::SolType as SolType>::Token<'a>: for<'a> TokenSeq<'a>,

Encodes an ABI sequence. Read more
§

fn abi_encode_params(&self) -> Vec<u8> where + <Self::SolType as SolType>::Token<'a>: for<'a> TokenSeq<'a>,

Encodes an ABI sequence suitable for function parameters. Read more
§

fn abi_decode(data: &[u8], validate: bool) -> Result<Self, Error>where + Self: From<<Self::SolType as SolType>::RustType>,

ABI-decode this type from the given data. Read more
§

fn abi_decode_params<'de>( + data: &'de [u8], + validate: bool +) -> Result<Self, Error>where + Self: From<<Self::SolType as SolType>::RustType>, + <Self::SolType as SolType>::Token<'de>: TokenSeq<'de>,

ABI-decode this type from the given data. Read more
§

fn abi_decode_sequence<'de>( + data: &'de [u8], + validate: bool +) -> Result<Self, Error>where + Self: From<<Self::SolType as SolType>::RustType>, + <Self::SolType as SolType>::Token<'de>: TokenSeq<'de>,

ABI-decode this type from the given data. Read more

Auto Trait Implementations§

§

impl RefUnwindSafe for CIDV1

§

impl Send for CIDV1

§

impl Sync for CIDV1

§

impl Unpin for CIDV1

§

impl UnwindSafe for CIDV1

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/chain_connector/Deal/struct.ComputeUnit.html b/chain_connector/Deal/struct.ComputeUnit.html new file mode 100644 index 0000000000..91d490046a --- /dev/null +++ b/chain_connector/Deal/struct.ComputeUnit.html @@ -0,0 +1,90 @@ +ComputeUnit in chain_connector::Deal - Rust
pub struct ComputeUnit {
+    pub id: FixedBytes<32>,
+    pub workerId: FixedBytes<32>,
+    pub peerId: FixedBytes<32>,
+    pub provider: Address,
+    pub joinedEpoch: U256,
+}
Expand description
struct ComputeUnit { bytes32 id; bytes32 workerId; bytes32 peerId; address provider; uint256 joinedEpoch; }
+

Fields§

§id: FixedBytes<32>§workerId: FixedBytes<32>§peerId: FixedBytes<32>§provider: Address§joinedEpoch: U256

Trait Implementations§

source§

impl Clone for ComputeUnit

source§

fn clone(&self) -> ComputeUnit

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl EventTopic for ComputeUnit

source§

fn topic_preimage_length(rust: &Self::RustType) -> usize

The number of bytes this type occupies in another topic’s preimage, +usually a multiple of 32. Read more
source§

fn encode_topic_preimage(rust: &Self::RustType, out: &mut Vec<u8>)

Encodes this type as preimage bytes which are then hashed in +complex types’ [encode_topic][EventTopic::encode_topic]. Read more
source§

fn encode_topic(rust: &Self::RustType) -> WordToken

Indexed event parameter encoding. Read more
source§

impl SolStruct for ComputeUnit

source§

const NAME: &'static str = "ComputeUnit"

The struct name. Read more
source§

fn eip712_root_type() -> Cow<'static, str>

Return the root EIP-712 type. This type is used to construct the +encodeType string.
source§

fn eip712_components() -> Vec<Cow<'static, str>>

Returns component EIP-712 types. These types are used to construct +the encodeType string. These are the types of the struct’s fields, +and should not include the root type.
source§

fn eip712_encode_type() -> Cow<'static, str>

The EIP-712-encoded type string. Read more
source§

fn eip712_encode_data(&self) -> Vec<u8>

Encodes this domain using EIP-712 encodeData.
§

fn eip712_type_hash(&self) -> FixedBytes<32>

Calculates the EIP-712 typeHash +for this struct. Read more
§

fn eip712_hash_struct(&self) -> FixedBytes<32>

Hashes this struct according to EIP-712 hashStruct.
§

fn eip712_signing_hash(&self, domain: &Eip712Domain) -> FixedBytes<32>

Does something. Read more
source§

impl SolType for ComputeUnit

§

type RustType = ComputeUnit

The corresponding Rust type.
§

type Token<'a> = <(FixedBytes<32>, FixedBytes<32>, FixedBytes<32>, Address, Uint<256>) as SolType>::Token<'a>

The corresponding ABI token type. Read more
source§

const SOL_NAME: &'static str = <Self as alloy_sol_types::SolStruct>::NAME

The name of this type in Solidity.
source§

const ENCODED_SIZE: Option<usize> = <UnderlyingSolTuple as alloy_sol_types::SolType>::ENCODED_SIZE

The statically-known ABI-encoded size of the type. Read more
source§

fn valid_token(token: &Self::Token<'_>) -> bool

Returns true if the given token can be detokenized with this type.
source§

fn detokenize(token: Self::Token<'_>) -> Self::RustType

Detokenize this type’s value from the given token. Read more
§

const DYNAMIC: bool = _

Whether the ABI-encoded size is dynamic. Read more
§

fn sol_type_name() -> Cow<'static, str>

👎Deprecated since 0.6.3: use SOL_NAME instead
Returns the name of this type in Solidity.
§

fn abi_encoded_size<E>(rust: &E) -> usizewhere + E: SolTypeValue<Self> + ?Sized,

Calculate the ABI-encoded size of the data, counting both head and tail +words. For a single-word type this will always be 32.
§

fn type_check(token: &Self::Token<'_>) -> Result<(), Error>

Returns an error if the given token cannot be detokenized with this +type.
§

fn tokenize<E>(rust: &E) -> Self::Token<'_>where + E: SolTypeValue<Self> + ?Sized,

Tokenizes the given value into this type’s token. Read more
§

fn eip712_data_word<E>(rust: &E) -> FixedBytes<32>where + E: SolTypeValue<Self> + ?Sized,

Encode this data according to EIP-712 encodeData rules, and hash it +if necessary. Read more
§

fn abi_encode_packed_to<E>(rust: &E, out: &mut Vec<u8>)where + E: SolTypeValue<Self> + ?Sized,

Non-standard Packed Mode ABI encoding. Read more
§

fn abi_encode_packed<E>(rust: &E) -> Vec<u8> where + E: SolTypeValue<Self> + ?Sized,

Non-standard Packed Mode ABI encoding. Read more
§

fn abi_encode<E>(rust: &E) -> Vec<u8> where + E: SolTypeValue<Self> + ?Sized,

Tokenizes and ABI-encodes the given value by wrapping it in a +single-element sequence. Read more
§

fn abi_encode_params<E>(rust: &E) -> Vec<u8> where + E: SolTypeValue<Self> + ?Sized, + Self::Token<'a>: for<'a> TokenSeq<'a>,

Tokenizes and ABI-encodes the given value as function parameters. Read more
§

fn abi_encode_sequence<E>(rust: &E) -> Vec<u8> where + E: SolTypeValue<Self> + ?Sized, + Self::Token<'a>: for<'a> TokenSeq<'a>,

Tokenizes and ABI-encodes the given value as a sequence. Read more
§

fn abi_decode(data: &[u8], validate: bool) -> Result<Self::RustType, Error>

Decodes this type’s value from an ABI blob by interpreting it as a +single-element sequence. Read more
§

fn abi_decode_params<'de>( + data: &'de [u8], + validate: bool +) -> Result<Self::RustType, Error>where + Self::Token<'de>: TokenSeq<'de>,

Decodes this type’s value from an ABI blob by interpreting it as +function parameters. Read more
§

fn abi_decode_sequence<'de>( + data: &'de [u8], + validate: bool +) -> Result<Self::RustType, Error>where + Self::Token<'de>: TokenSeq<'de>,

Decodes this type’s value from an ABI blob by interpreting it as a +sequence. Read more
source§

impl SolTypeValue<ComputeUnit> for ComputeUnit

source§

fn stv_to_tokens(&self) -> <Self as SolType>::Token<'_>

source§

fn stv_abi_encoded_size(&self) -> usize

source§

fn stv_eip712_data_word(&self) -> Word

source§

fn stv_abi_encode_packed_to(&self, out: &mut Vec<u8>)

source§

impl SolValue for ComputeUnit

§

type SolType = ComputeUnit

The Solidity type that this type corresponds to.
§

fn sol_name(&self) -> &'static str

The name of the associated Solidity type. Read more
§

fn sol_type_name(&self) -> Cow<'static, str>

👎Deprecated since 0.6.3: use sol_name instead
The name of the associated Solidity type. Read more
§

fn tokenize(&self) -> <Self::SolType as SolType>::Token<'_>

Tokenizes the given value into this type’s token. Read more
§

fn detokenize(token: <Self::SolType as SolType>::Token<'_>) -> Selfwhere + Self: From<<Self::SolType as SolType>::RustType>,

Detokenize a value from the given token. Read more
§

fn abi_encoded_size(&self) -> usize

Calculate the ABI-encoded size of the data. Read more
§

fn eip712_data_word(&self) -> FixedBytes<32>

Encode this data according to EIP-712 encodeData rules, and hash it +if necessary. Read more
§

fn abi_encode_packed_to(&self, out: &mut Vec<u8>)

Non-standard Packed Mode ABI encoding. Read more
§

fn abi_encode_packed(&self) -> Vec<u8>

Non-standard Packed Mode ABI encoding. Read more
§

fn abi_encode(&self) -> Vec<u8>

ABI-encodes the value. Read more
§

fn abi_encode_sequence(&self) -> Vec<u8> where + <Self::SolType as SolType>::Token<'a>: for<'a> TokenSeq<'a>,

Encodes an ABI sequence. Read more
§

fn abi_encode_params(&self) -> Vec<u8> where + <Self::SolType as SolType>::Token<'a>: for<'a> TokenSeq<'a>,

Encodes an ABI sequence suitable for function parameters. Read more
§

fn abi_decode(data: &[u8], validate: bool) -> Result<Self, Error>where + Self: From<<Self::SolType as SolType>::RustType>,

ABI-decode this type from the given data. Read more
§

fn abi_decode_params<'de>( + data: &'de [u8], + validate: bool +) -> Result<Self, Error>where + Self: From<<Self::SolType as SolType>::RustType>, + <Self::SolType as SolType>::Token<'de>: TokenSeq<'de>,

ABI-decode this type from the given data. Read more
§

fn abi_decode_sequence<'de>( + data: &'de [u8], + validate: bool +) -> Result<Self, Error>where + Self: From<<Self::SolType as SolType>::RustType>, + <Self::SolType as SolType>::Token<'de>: TokenSeq<'de>,

ABI-decode this type from the given data. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/chain_connector/Deal/struct.appCIDCall.html b/chain_connector/Deal/struct.appCIDCall.html new file mode 100644 index 0000000000..53a0b2be10 --- /dev/null +++ b/chain_connector/Deal/struct.appCIDCall.html @@ -0,0 +1,43 @@ +appCIDCall in chain_connector::Deal - Rust
pub struct appCIDCall {}
Expand description

@dev Returns the app CID +Function with signature appCID() and selector 0x9bc66868.

+
function appCID() external view returns (CIDV1 memory);
+

Trait Implementations§

source§

impl Clone for appCIDCall

source§

fn clone(&self) -> appCIDCall

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl SolCall for appCIDCall

§

type Parameters<'a> = ()

The underlying tuple type which represents this type’s arguments. Read more
§

type Token<'a> = <<appCIDCall as SolCall>::Parameters<'a> as SolType>::Token<'a>

The arguments’ corresponding [TokenSeq] type.
§

type Return = appCIDReturn

The function’s return struct.
§

type ReturnTuple<'a> = (CIDV1,)

The underlying tuple type which represents this type’s return values. Read more
§

type ReturnToken<'a> = <<appCIDCall as SolCall>::ReturnTuple<'a> as SolType>::Token<'a>

The returns’ corresponding [TokenSeq] type.
source§

const SIGNATURE: &'static str = "appCID()"

The function’s ABI signature.
source§

const SELECTOR: [u8; 4] = _

The function selector: keccak256(SIGNATURE)[0..4]
source§

fn new<'a>(tuple: <Self::Parameters<'a> as SolType>::RustType) -> Self

Convert from the tuple type used for ABI encoding and decoding.
source§

fn tokenize(&self) -> Self::Token<'_>

Tokenize the call’s arguments.
source§

fn abi_decode_returns(data: &[u8], validate: bool) -> Result<Self::Return>

ABI decode this call’s return values from the given slice.
§

fn abi_encoded_size(&self) -> usize

The size of the encoded data in bytes, without its selector.
§

fn abi_decode_raw(data: &[u8], validate: bool) -> Result<Self, Error>

ABI decode this call’s arguments from the given slice, without its +selector.
§

fn abi_decode(data: &[u8], validate: bool) -> Result<Self, Error>

ABI decode this call’s arguments from the given slice, with the +selector.
§

fn abi_encode_raw(&self, out: &mut Vec<u8>)

ABI encode the call to the given buffer without its selector.
§

fn abi_encode(&self) -> Vec<u8>

ABI encode the call to the given buffer with its selector.
§

fn abi_encode_returns<'a, E>(e: &'a E) -> Vec<u8> where + E: SolTypeValue<Self::ReturnTuple<'a>>,

ABI encode the call’s return values.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/chain_connector/Deal/struct.appCIDReturn.html b/chain_connector/Deal/struct.appCIDReturn.html new file mode 100644 index 0000000000..bb6991f192 --- /dev/null +++ b/chain_connector/Deal/struct.appCIDReturn.html @@ -0,0 +1,41 @@ +appCIDReturn in chain_connector::Deal - Rust
pub struct appCIDReturn {
+    pub _0: <CIDV1 as SolType>::RustType,
+}
Expand description

@dev Returns the app CID +Container type for the return parameters of the appCID() function.

+

Fields§

§_0: <CIDV1 as SolType>::RustType

Trait Implementations§

source§

impl Clone for appCIDReturn

source§

fn clone(&self) -> appCIDReturn

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/chain_connector/Deal/struct.getComputeUnitsCall.html b/chain_connector/Deal/struct.getComputeUnitsCall.html new file mode 100644 index 0000000000..6c26a73240 --- /dev/null +++ b/chain_connector/Deal/struct.getComputeUnitsCall.html @@ -0,0 +1,43 @@ +getComputeUnitsCall in chain_connector::Deal - Rust
pub struct getComputeUnitsCall {}
Expand description

@dev Returns the compute units info by provider +Function with signature getComputeUnits() and selector 0x4b66a309.

+
function getComputeUnits() public view returns (ComputeUnit[] memory);
+

Trait Implementations§

source§

impl Clone for getComputeUnitsCall

source§

fn clone(&self) -> getComputeUnitsCall

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl SolCall for getComputeUnitsCall

§

type Parameters<'a> = ()

The underlying tuple type which represents this type’s arguments. Read more
§

type Token<'a> = <<getComputeUnitsCall as SolCall>::Parameters<'a> as SolType>::Token<'a>

The arguments’ corresponding [TokenSeq] type.
§

type Return = getComputeUnitsReturn

The function’s return struct.
§

type ReturnTuple<'a> = (Array<ComputeUnit>,)

The underlying tuple type which represents this type’s return values. Read more
§

type ReturnToken<'a> = <<getComputeUnitsCall as SolCall>::ReturnTuple<'a> as SolType>::Token<'a>

The returns’ corresponding [TokenSeq] type.
source§

const SIGNATURE: &'static str = "getComputeUnits()"

The function’s ABI signature.
source§

const SELECTOR: [u8; 4] = _

The function selector: keccak256(SIGNATURE)[0..4]
source§

fn new<'a>(tuple: <Self::Parameters<'a> as SolType>::RustType) -> Self

Convert from the tuple type used for ABI encoding and decoding.
source§

fn tokenize(&self) -> Self::Token<'_>

Tokenize the call’s arguments.
source§

fn abi_decode_returns(data: &[u8], validate: bool) -> Result<Self::Return>

ABI decode this call’s return values from the given slice.
§

fn abi_encoded_size(&self) -> usize

The size of the encoded data in bytes, without its selector.
§

fn abi_decode_raw(data: &[u8], validate: bool) -> Result<Self, Error>

ABI decode this call’s arguments from the given slice, without its +selector.
§

fn abi_decode(data: &[u8], validate: bool) -> Result<Self, Error>

ABI decode this call’s arguments from the given slice, with the +selector.
§

fn abi_encode_raw(&self, out: &mut Vec<u8>)

ABI encode the call to the given buffer without its selector.
§

fn abi_encode(&self) -> Vec<u8>

ABI encode the call to the given buffer with its selector.
§

fn abi_encode_returns<'a, E>(e: &'a E) -> Vec<u8> where + E: SolTypeValue<Self::ReturnTuple<'a>>,

ABI encode the call’s return values.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/chain_connector/Deal/struct.getComputeUnitsReturn.html b/chain_connector/Deal/struct.getComputeUnitsReturn.html new file mode 100644 index 0000000000..08950a97e7 --- /dev/null +++ b/chain_connector/Deal/struct.getComputeUnitsReturn.html @@ -0,0 +1,41 @@ +getComputeUnitsReturn in chain_connector::Deal - Rust
pub struct getComputeUnitsReturn {
+    pub _0: Vec<<ComputeUnit as SolType>::RustType>,
+}
Expand description

@dev Returns the compute units info by provider +Container type for the return parameters of the getComputeUnits() function.

+

Fields§

§_0: Vec<<ComputeUnit as SolType>::RustType>

Trait Implementations§

source§

impl Clone for getComputeUnitsReturn

source§

fn clone(&self) -> getComputeUnitsReturn

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/chain_connector/Deal/struct.getStatusCall.html b/chain_connector/Deal/struct.getStatusCall.html new file mode 100644 index 0000000000..7fe63b6386 --- /dev/null +++ b/chain_connector/Deal/struct.getStatusCall.html @@ -0,0 +1,43 @@ +getStatusCall in chain_connector::Deal - Rust
pub struct getStatusCall {}
Expand description

@dev Returns the status of the deal +Function with signature getStatus() and selector 0x4e69d560.

+
function getStatus() external view returns (Status);
+

Trait Implementations§

source§

impl Clone for getStatusCall

source§

fn clone(&self) -> getStatusCall

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl SolCall for getStatusCall

§

type Parameters<'a> = ()

The underlying tuple type which represents this type’s arguments. Read more
§

type Token<'a> = <<getStatusCall as SolCall>::Parameters<'a> as SolType>::Token<'a>

The arguments’ corresponding [TokenSeq] type.
§

type Return = getStatusReturn

The function’s return struct.
§

type ReturnTuple<'a> = (Status,)

The underlying tuple type which represents this type’s return values. Read more
§

type ReturnToken<'a> = <<getStatusCall as SolCall>::ReturnTuple<'a> as SolType>::Token<'a>

The returns’ corresponding [TokenSeq] type.
source§

const SIGNATURE: &'static str = "getStatus()"

The function’s ABI signature.
source§

const SELECTOR: [u8; 4] = _

The function selector: keccak256(SIGNATURE)[0..4]
source§

fn new<'a>(tuple: <Self::Parameters<'a> as SolType>::RustType) -> Self

Convert from the tuple type used for ABI encoding and decoding.
source§

fn tokenize(&self) -> Self::Token<'_>

Tokenize the call’s arguments.
source§

fn abi_decode_returns(data: &[u8], validate: bool) -> Result<Self::Return>

ABI decode this call’s return values from the given slice.
§

fn abi_encoded_size(&self) -> usize

The size of the encoded data in bytes, without its selector.
§

fn abi_decode_raw(data: &[u8], validate: bool) -> Result<Self, Error>

ABI decode this call’s arguments from the given slice, without its +selector.
§

fn abi_decode(data: &[u8], validate: bool) -> Result<Self, Error>

ABI decode this call’s arguments from the given slice, with the +selector.
§

fn abi_encode_raw(&self, out: &mut Vec<u8>)

ABI encode the call to the given buffer without its selector.
§

fn abi_encode(&self) -> Vec<u8>

ABI encode the call to the given buffer with its selector.
§

fn abi_encode_returns<'a, E>(e: &'a E) -> Vec<u8> where + E: SolTypeValue<Self::ReturnTuple<'a>>,

ABI encode the call’s return values.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/chain_connector/Deal/struct.getStatusReturn.html b/chain_connector/Deal/struct.getStatusReturn.html new file mode 100644 index 0000000000..b7f8438973 --- /dev/null +++ b/chain_connector/Deal/struct.getStatusReturn.html @@ -0,0 +1,41 @@ +getStatusReturn in chain_connector::Deal - Rust
pub struct getStatusReturn {
+    pub _0: <Status as SolType>::RustType,
+}
Expand description

@dev Returns the status of the deal +Container type for the return parameters of the getStatus() function.

+

Fields§

§_0: <Status as SolType>::RustType

Trait Implementations§

source§

impl Clone for getStatusReturn

source§

fn clone(&self) -> getStatusReturn

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/chain_connector/Deal/struct.setWorkerCall.html b/chain_connector/Deal/struct.setWorkerCall.html new file mode 100644 index 0000000000..e94f5042f7 --- /dev/null +++ b/chain_connector/Deal/struct.setWorkerCall.html @@ -0,0 +1,46 @@ +setWorkerCall in chain_connector::Deal - Rust
pub struct setWorkerCall {
+    pub computeUnitId: FixedBytes<32>,
+    pub workerId: FixedBytes<32>,
+}
Expand description

@dev Set worker ID for a compute unit. Compute unit can have only one worker ID +Function with signature setWorker(bytes32,bytes32) and selector 0xd5053ab0.

+
function setWorker(bytes32 computeUnitId, bytes32 workerId) external;
+

Fields§

§computeUnitId: FixedBytes<32>§workerId: FixedBytes<32>

Trait Implementations§

source§

impl Clone for setWorkerCall

source§

fn clone(&self) -> setWorkerCall

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl SolCall for setWorkerCall

§

type Parameters<'a> = (FixedBytes<32>, FixedBytes<32>)

The underlying tuple type which represents this type’s arguments. Read more
§

type Token<'a> = <<setWorkerCall as SolCall>::Parameters<'a> as SolType>::Token<'a>

The arguments’ corresponding [TokenSeq] type.
§

type Return = setWorkerReturn

The function’s return struct.
§

type ReturnTuple<'a> = ()

The underlying tuple type which represents this type’s return values. Read more
§

type ReturnToken<'a> = <<setWorkerCall as SolCall>::ReturnTuple<'a> as SolType>::Token<'a>

The returns’ corresponding [TokenSeq] type.
source§

const SIGNATURE: &'static str = "setWorker(bytes32,bytes32)"

The function’s ABI signature.
source§

const SELECTOR: [u8; 4] = _

The function selector: keccak256(SIGNATURE)[0..4]
source§

fn new<'a>(tuple: <Self::Parameters<'a> as SolType>::RustType) -> Self

Convert from the tuple type used for ABI encoding and decoding.
source§

fn tokenize(&self) -> Self::Token<'_>

Tokenize the call’s arguments.
source§

fn abi_decode_returns(data: &[u8], validate: bool) -> Result<Self::Return>

ABI decode this call’s return values from the given slice.
§

fn abi_encoded_size(&self) -> usize

The size of the encoded data in bytes, without its selector.
§

fn abi_decode_raw(data: &[u8], validate: bool) -> Result<Self, Error>

ABI decode this call’s arguments from the given slice, without its +selector.
§

fn abi_decode(data: &[u8], validate: bool) -> Result<Self, Error>

ABI decode this call’s arguments from the given slice, with the +selector.
§

fn abi_encode_raw(&self, out: &mut Vec<u8>)

ABI encode the call to the given buffer without its selector.
§

fn abi_encode(&self) -> Vec<u8>

ABI encode the call to the given buffer with its selector.
§

fn abi_encode_returns<'a, E>(e: &'a E) -> Vec<u8> where + E: SolTypeValue<Self::ReturnTuple<'a>>,

ABI encode the call’s return values.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/chain_connector/Deal/struct.setWorkerReturn.html b/chain_connector/Deal/struct.setWorkerReturn.html new file mode 100644 index 0000000000..302b2dc4e2 --- /dev/null +++ b/chain_connector/Deal/struct.setWorkerReturn.html @@ -0,0 +1,39 @@ +setWorkerReturn in chain_connector::Deal - Rust
pub struct setWorkerReturn {}
Expand description

@dev Set worker ID for a compute unit. Compute unit can have only one worker ID +Container type for the return parameters of the setWorker(bytes32,bytes32) function.

+

Trait Implementations§

source§

impl Clone for setWorkerReturn

source§

fn clone(&self) -> setWorkerReturn

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/chain_connector/Offer/enum.OfferCalls.html b/chain_connector/Offer/enum.OfferCalls.html new file mode 100644 index 0000000000..2e437fc203 --- /dev/null +++ b/chain_connector/Offer/enum.OfferCalls.html @@ -0,0 +1,50 @@ +OfferCalls in chain_connector::Offer - Rust
pub enum OfferCalls {
+    getComputePeer(getComputePeerCall),
+    getComputeUnits(getComputeUnitsCall),
+    returnComputeUnitFromDeal(returnComputeUnitFromDealCall),
+}
Expand description

Container for all the Offer function calls.

+

Variants§

§

getComputePeer(getComputePeerCall)

§

getComputeUnits(getComputeUnitsCall)

§

returnComputeUnitFromDeal(returnComputeUnitFromDealCall)

Implementations§

source§

impl OfferCalls

source

pub const SELECTORS: &'static [[u8; 4]] = _

All the selectors of this enum.

+

Note that the selectors might not be in the same order as the variants. +No guarantees are made about the order of the selectors.

+

Prefer using SolInterface methods instead.

+

Trait Implementations§

source§

impl SolInterface for OfferCalls

source§

const NAME: &'static str = "OfferCalls"

The name of this type.
source§

const MIN_DATA_LENGTH: usize = 32usize

The minimum length of the data for this type. Read more
source§

const COUNT: usize = 3usize

The number of variants.
source§

fn selector(&self) -> [u8; 4]

The selector of this instance.
source§

fn selector_at(i: usize) -> Option<[u8; 4]>

The selector of this type at the given index, used in +selectors. Read more
source§

fn valid_selector(selector: [u8; 4]) -> bool

Returns true if the given selector is known to this type.
source§

fn abi_decode_raw( + selector: [u8; 4], + data: &[u8], + validate: bool +) -> Result<Self>

ABI-decodes the given data into one of the variants of self.
source§

fn abi_encoded_size(&self) -> usize

The size of the encoded data, without any selectors.
source§

fn abi_encode_raw(&self, out: &mut Vec<u8>)

ABI-encodes self into the given buffer, without any selectors.
§

fn type_check(selector: [u8; 4]) -> Result<(), Error>

Returns an error if the given selector is not known to this type.
§

fn selectors() -> Selectors<Self>

Returns an iterator over the selectors of this type.
§

fn abi_encode(&self) -> Vec<u8>

ABI-encodes self into the given buffer.
§

fn abi_decode(data: &[u8], validate: bool) -> Result<Self, Error>

ABI-decodes the given data into one of the variants of self.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/chain_connector/Offer/index.html b/chain_connector/Offer/index.html new file mode 100644 index 0000000000..69ed73ccdb --- /dev/null +++ b/chain_connector/Offer/index.html @@ -0,0 +1,15 @@ +chain_connector::Offer - Rust

Module chain_connector::Offer

source ·
Expand description

Module containing a contract’s types and functions.

+
contract Offer {
+    struct ComputePeer { bytes32 offerId; bytes32 commitmentId; uint256 unitCount; address owner; }
+    struct ComputeUnit { bytes32 id; address deal; uint256 startEpoch; }
+    function getComputePeer(bytes32 peerId) external view returns (ComputePeer memory);
+    function getComputeUnits(bytes32 peerId) external view returns (ComputeUnit[] memory);
+    function returnComputeUnitFromDeal(bytes32 unitId) external;
+}
+

Structs

Enums

\ No newline at end of file diff --git a/chain_connector/Offer/sidebar-items.js b/chain_connector/Offer/sidebar-items.js new file mode 100644 index 0000000000..580fc61597 --- /dev/null +++ b/chain_connector/Offer/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["OfferCalls"],"struct":["ComputePeer","ComputeUnit","getComputePeerCall","getComputePeerReturn","getComputeUnitsCall","getComputeUnitsReturn","returnComputeUnitFromDealCall","returnComputeUnitFromDealReturn"]}; \ No newline at end of file diff --git a/chain_connector/Offer/struct.ComputePeer.html b/chain_connector/Offer/struct.ComputePeer.html new file mode 100644 index 0000000000..7128465047 --- /dev/null +++ b/chain_connector/Offer/struct.ComputePeer.html @@ -0,0 +1,89 @@ +ComputePeer in chain_connector::Offer - Rust
pub struct ComputePeer {
+    pub offerId: FixedBytes<32>,
+    pub commitmentId: FixedBytes<32>,
+    pub unitCount: U256,
+    pub owner: Address,
+}
Expand description
struct ComputePeer { bytes32 offerId; bytes32 commitmentId; uint256 unitCount; address owner; }
+

Fields§

§offerId: FixedBytes<32>§commitmentId: FixedBytes<32>§unitCount: U256§owner: Address

Trait Implementations§

source§

impl Clone for ComputePeer

source§

fn clone(&self) -> ComputePeer

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl EventTopic for ComputePeer

source§

fn topic_preimage_length(rust: &Self::RustType) -> usize

The number of bytes this type occupies in another topic’s preimage, +usually a multiple of 32. Read more
source§

fn encode_topic_preimage(rust: &Self::RustType, out: &mut Vec<u8>)

Encodes this type as preimage bytes which are then hashed in +complex types’ [encode_topic][EventTopic::encode_topic]. Read more
source§

fn encode_topic(rust: &Self::RustType) -> WordToken

Indexed event parameter encoding. Read more
source§

impl SolStruct for ComputePeer

source§

const NAME: &'static str = "ComputePeer"

The struct name. Read more
source§

fn eip712_root_type() -> Cow<'static, str>

Return the root EIP-712 type. This type is used to construct the +encodeType string.
source§

fn eip712_components() -> Vec<Cow<'static, str>>

Returns component EIP-712 types. These types are used to construct +the encodeType string. These are the types of the struct’s fields, +and should not include the root type.
source§

fn eip712_encode_type() -> Cow<'static, str>

The EIP-712-encoded type string. Read more
source§

fn eip712_encode_data(&self) -> Vec<u8>

Encodes this domain using EIP-712 encodeData.
§

fn eip712_type_hash(&self) -> FixedBytes<32>

Calculates the EIP-712 typeHash +for this struct. Read more
§

fn eip712_hash_struct(&self) -> FixedBytes<32>

Hashes this struct according to EIP-712 hashStruct.
§

fn eip712_signing_hash(&self, domain: &Eip712Domain) -> FixedBytes<32>

Does something. Read more
source§

impl SolType for ComputePeer

§

type RustType = ComputePeer

The corresponding Rust type.
§

type Token<'a> = <(FixedBytes<32>, FixedBytes<32>, Uint<256>, Address) as SolType>::Token<'a>

The corresponding ABI token type. Read more
source§

const SOL_NAME: &'static str = <Self as alloy_sol_types::SolStruct>::NAME

The name of this type in Solidity.
source§

const ENCODED_SIZE: Option<usize> = <UnderlyingSolTuple as alloy_sol_types::SolType>::ENCODED_SIZE

The statically-known ABI-encoded size of the type. Read more
source§

fn valid_token(token: &Self::Token<'_>) -> bool

Returns true if the given token can be detokenized with this type.
source§

fn detokenize(token: Self::Token<'_>) -> Self::RustType

Detokenize this type’s value from the given token. Read more
§

const DYNAMIC: bool = _

Whether the ABI-encoded size is dynamic. Read more
§

fn sol_type_name() -> Cow<'static, str>

👎Deprecated since 0.6.3: use SOL_NAME instead
Returns the name of this type in Solidity.
§

fn abi_encoded_size<E>(rust: &E) -> usizewhere + E: SolTypeValue<Self> + ?Sized,

Calculate the ABI-encoded size of the data, counting both head and tail +words. For a single-word type this will always be 32.
§

fn type_check(token: &Self::Token<'_>) -> Result<(), Error>

Returns an error if the given token cannot be detokenized with this +type.
§

fn tokenize<E>(rust: &E) -> Self::Token<'_>where + E: SolTypeValue<Self> + ?Sized,

Tokenizes the given value into this type’s token. Read more
§

fn eip712_data_word<E>(rust: &E) -> FixedBytes<32>where + E: SolTypeValue<Self> + ?Sized,

Encode this data according to EIP-712 encodeData rules, and hash it +if necessary. Read more
§

fn abi_encode_packed_to<E>(rust: &E, out: &mut Vec<u8>)where + E: SolTypeValue<Self> + ?Sized,

Non-standard Packed Mode ABI encoding. Read more
§

fn abi_encode_packed<E>(rust: &E) -> Vec<u8> where + E: SolTypeValue<Self> + ?Sized,

Non-standard Packed Mode ABI encoding. Read more
§

fn abi_encode<E>(rust: &E) -> Vec<u8> where + E: SolTypeValue<Self> + ?Sized,

Tokenizes and ABI-encodes the given value by wrapping it in a +single-element sequence. Read more
§

fn abi_encode_params<E>(rust: &E) -> Vec<u8> where + E: SolTypeValue<Self> + ?Sized, + Self::Token<'a>: for<'a> TokenSeq<'a>,

Tokenizes and ABI-encodes the given value as function parameters. Read more
§

fn abi_encode_sequence<E>(rust: &E) -> Vec<u8> where + E: SolTypeValue<Self> + ?Sized, + Self::Token<'a>: for<'a> TokenSeq<'a>,

Tokenizes and ABI-encodes the given value as a sequence. Read more
§

fn abi_decode(data: &[u8], validate: bool) -> Result<Self::RustType, Error>

Decodes this type’s value from an ABI blob by interpreting it as a +single-element sequence. Read more
§

fn abi_decode_params<'de>( + data: &'de [u8], + validate: bool +) -> Result<Self::RustType, Error>where + Self::Token<'de>: TokenSeq<'de>,

Decodes this type’s value from an ABI blob by interpreting it as +function parameters. Read more
§

fn abi_decode_sequence<'de>( + data: &'de [u8], + validate: bool +) -> Result<Self::RustType, Error>where + Self::Token<'de>: TokenSeq<'de>,

Decodes this type’s value from an ABI blob by interpreting it as a +sequence. Read more
source§

impl SolTypeValue<ComputePeer> for ComputePeer

source§

fn stv_to_tokens(&self) -> <Self as SolType>::Token<'_>

source§

fn stv_abi_encoded_size(&self) -> usize

source§

fn stv_eip712_data_word(&self) -> Word

source§

fn stv_abi_encode_packed_to(&self, out: &mut Vec<u8>)

source§

impl SolValue for ComputePeer

§

type SolType = ComputePeer

The Solidity type that this type corresponds to.
§

fn sol_name(&self) -> &'static str

The name of the associated Solidity type. Read more
§

fn sol_type_name(&self) -> Cow<'static, str>

👎Deprecated since 0.6.3: use sol_name instead
The name of the associated Solidity type. Read more
§

fn tokenize(&self) -> <Self::SolType as SolType>::Token<'_>

Tokenizes the given value into this type’s token. Read more
§

fn detokenize(token: <Self::SolType as SolType>::Token<'_>) -> Selfwhere + Self: From<<Self::SolType as SolType>::RustType>,

Detokenize a value from the given token. Read more
§

fn abi_encoded_size(&self) -> usize

Calculate the ABI-encoded size of the data. Read more
§

fn eip712_data_word(&self) -> FixedBytes<32>

Encode this data according to EIP-712 encodeData rules, and hash it +if necessary. Read more
§

fn abi_encode_packed_to(&self, out: &mut Vec<u8>)

Non-standard Packed Mode ABI encoding. Read more
§

fn abi_encode_packed(&self) -> Vec<u8>

Non-standard Packed Mode ABI encoding. Read more
§

fn abi_encode(&self) -> Vec<u8>

ABI-encodes the value. Read more
§

fn abi_encode_sequence(&self) -> Vec<u8> where + <Self::SolType as SolType>::Token<'a>: for<'a> TokenSeq<'a>,

Encodes an ABI sequence. Read more
§

fn abi_encode_params(&self) -> Vec<u8> where + <Self::SolType as SolType>::Token<'a>: for<'a> TokenSeq<'a>,

Encodes an ABI sequence suitable for function parameters. Read more
§

fn abi_decode(data: &[u8], validate: bool) -> Result<Self, Error>where + Self: From<<Self::SolType as SolType>::RustType>,

ABI-decode this type from the given data. Read more
§

fn abi_decode_params<'de>( + data: &'de [u8], + validate: bool +) -> Result<Self, Error>where + Self: From<<Self::SolType as SolType>::RustType>, + <Self::SolType as SolType>::Token<'de>: TokenSeq<'de>,

ABI-decode this type from the given data. Read more
§

fn abi_decode_sequence<'de>( + data: &'de [u8], + validate: bool +) -> Result<Self, Error>where + Self: From<<Self::SolType as SolType>::RustType>, + <Self::SolType as SolType>::Token<'de>: TokenSeq<'de>,

ABI-decode this type from the given data. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/chain_connector/Offer/struct.ComputeUnit.html b/chain_connector/Offer/struct.ComputeUnit.html new file mode 100644 index 0000000000..58b4e3d09b --- /dev/null +++ b/chain_connector/Offer/struct.ComputeUnit.html @@ -0,0 +1,88 @@ +ComputeUnit in chain_connector::Offer - Rust
pub struct ComputeUnit {
+    pub id: FixedBytes<32>,
+    pub deal: Address,
+    pub startEpoch: U256,
+}
Expand description
struct ComputeUnit { bytes32 id; address deal; uint256 startEpoch; }
+

Fields§

§id: FixedBytes<32>§deal: Address§startEpoch: U256

Trait Implementations§

source§

impl Clone for ComputeUnit

source§

fn clone(&self) -> ComputeUnit

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ComputeUnit

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl EventTopic for ComputeUnit

source§

fn topic_preimage_length(rust: &Self::RustType) -> usize

The number of bytes this type occupies in another topic’s preimage, +usually a multiple of 32. Read more
source§

fn encode_topic_preimage(rust: &Self::RustType, out: &mut Vec<u8>)

Encodes this type as preimage bytes which are then hashed in +complex types’ [encode_topic][EventTopic::encode_topic]. Read more
source§

fn encode_topic(rust: &Self::RustType) -> WordToken

Indexed event parameter encoding. Read more
source§

impl From<ComputeUnit> for PendingUnit

source§

fn from(unit: ComputeUnit) -> Self

Converts to this type from the input type.
source§

impl SolStruct for ComputeUnit

source§

const NAME: &'static str = "ComputeUnit"

The struct name. Read more
source§

fn eip712_root_type() -> Cow<'static, str>

Return the root EIP-712 type. This type is used to construct the +encodeType string.
source§

fn eip712_components() -> Vec<Cow<'static, str>>

Returns component EIP-712 types. These types are used to construct +the encodeType string. These are the types of the struct’s fields, +and should not include the root type.
source§

fn eip712_encode_type() -> Cow<'static, str>

The EIP-712-encoded type string. Read more
source§

fn eip712_encode_data(&self) -> Vec<u8>

Encodes this domain using EIP-712 encodeData.
§

fn eip712_type_hash(&self) -> FixedBytes<32>

Calculates the EIP-712 typeHash +for this struct. Read more
§

fn eip712_hash_struct(&self) -> FixedBytes<32>

Hashes this struct according to EIP-712 hashStruct.
§

fn eip712_signing_hash(&self, domain: &Eip712Domain) -> FixedBytes<32>

Does something. Read more
source§

impl SolType for ComputeUnit

§

type RustType = ComputeUnit

The corresponding Rust type.
§

type Token<'a> = <(FixedBytes<32>, Address, Uint<256>) as SolType>::Token<'a>

The corresponding ABI token type. Read more
source§

const SOL_NAME: &'static str = <Self as alloy_sol_types::SolStruct>::NAME

The name of this type in Solidity.
source§

const ENCODED_SIZE: Option<usize> = <UnderlyingSolTuple as alloy_sol_types::SolType>::ENCODED_SIZE

The statically-known ABI-encoded size of the type. Read more
source§

fn valid_token(token: &Self::Token<'_>) -> bool

Returns true if the given token can be detokenized with this type.
source§

fn detokenize(token: Self::Token<'_>) -> Self::RustType

Detokenize this type’s value from the given token. Read more
§

const DYNAMIC: bool = _

Whether the ABI-encoded size is dynamic. Read more
§

fn sol_type_name() -> Cow<'static, str>

👎Deprecated since 0.6.3: use SOL_NAME instead
Returns the name of this type in Solidity.
§

fn abi_encoded_size<E>(rust: &E) -> usizewhere + E: SolTypeValue<Self> + ?Sized,

Calculate the ABI-encoded size of the data, counting both head and tail +words. For a single-word type this will always be 32.
§

fn type_check(token: &Self::Token<'_>) -> Result<(), Error>

Returns an error if the given token cannot be detokenized with this +type.
§

fn tokenize<E>(rust: &E) -> Self::Token<'_>where + E: SolTypeValue<Self> + ?Sized,

Tokenizes the given value into this type’s token. Read more
§

fn eip712_data_word<E>(rust: &E) -> FixedBytes<32>where + E: SolTypeValue<Self> + ?Sized,

Encode this data according to EIP-712 encodeData rules, and hash it +if necessary. Read more
§

fn abi_encode_packed_to<E>(rust: &E, out: &mut Vec<u8>)where + E: SolTypeValue<Self> + ?Sized,

Non-standard Packed Mode ABI encoding. Read more
§

fn abi_encode_packed<E>(rust: &E) -> Vec<u8> where + E: SolTypeValue<Self> + ?Sized,

Non-standard Packed Mode ABI encoding. Read more
§

fn abi_encode<E>(rust: &E) -> Vec<u8> where + E: SolTypeValue<Self> + ?Sized,

Tokenizes and ABI-encodes the given value by wrapping it in a +single-element sequence. Read more
§

fn abi_encode_params<E>(rust: &E) -> Vec<u8> where + E: SolTypeValue<Self> + ?Sized, + Self::Token<'a>: for<'a> TokenSeq<'a>,

Tokenizes and ABI-encodes the given value as function parameters. Read more
§

fn abi_encode_sequence<E>(rust: &E) -> Vec<u8> where + E: SolTypeValue<Self> + ?Sized, + Self::Token<'a>: for<'a> TokenSeq<'a>,

Tokenizes and ABI-encodes the given value as a sequence. Read more
§

fn abi_decode(data: &[u8], validate: bool) -> Result<Self::RustType, Error>

Decodes this type’s value from an ABI blob by interpreting it as a +single-element sequence. Read more
§

fn abi_decode_params<'de>( + data: &'de [u8], + validate: bool +) -> Result<Self::RustType, Error>where + Self::Token<'de>: TokenSeq<'de>,

Decodes this type’s value from an ABI blob by interpreting it as +function parameters. Read more
§

fn abi_decode_sequence<'de>( + data: &'de [u8], + validate: bool +) -> Result<Self::RustType, Error>where + Self::Token<'de>: TokenSeq<'de>,

Decodes this type’s value from an ABI blob by interpreting it as a +sequence. Read more
source§

impl SolTypeValue<ComputeUnit> for ComputeUnit

source§

fn stv_to_tokens(&self) -> <Self as SolType>::Token<'_>

source§

fn stv_abi_encoded_size(&self) -> usize

source§

fn stv_eip712_data_word(&self) -> Word

source§

fn stv_abi_encode_packed_to(&self, out: &mut Vec<u8>)

source§

impl SolValue for ComputeUnit

§

type SolType = ComputeUnit

The Solidity type that this type corresponds to.
§

fn sol_name(&self) -> &'static str

The name of the associated Solidity type. Read more
§

fn sol_type_name(&self) -> Cow<'static, str>

👎Deprecated since 0.6.3: use sol_name instead
The name of the associated Solidity type. Read more
§

fn tokenize(&self) -> <Self::SolType as SolType>::Token<'_>

Tokenizes the given value into this type’s token. Read more
§

fn detokenize(token: <Self::SolType as SolType>::Token<'_>) -> Selfwhere + Self: From<<Self::SolType as SolType>::RustType>,

Detokenize a value from the given token. Read more
§

fn abi_encoded_size(&self) -> usize

Calculate the ABI-encoded size of the data. Read more
§

fn eip712_data_word(&self) -> FixedBytes<32>

Encode this data according to EIP-712 encodeData rules, and hash it +if necessary. Read more
§

fn abi_encode_packed_to(&self, out: &mut Vec<u8>)

Non-standard Packed Mode ABI encoding. Read more
§

fn abi_encode_packed(&self) -> Vec<u8>

Non-standard Packed Mode ABI encoding. Read more
§

fn abi_encode(&self) -> Vec<u8>

ABI-encodes the value. Read more
§

fn abi_encode_sequence(&self) -> Vec<u8> where + <Self::SolType as SolType>::Token<'a>: for<'a> TokenSeq<'a>,

Encodes an ABI sequence. Read more
§

fn abi_encode_params(&self) -> Vec<u8> where + <Self::SolType as SolType>::Token<'a>: for<'a> TokenSeq<'a>,

Encodes an ABI sequence suitable for function parameters. Read more
§

fn abi_decode(data: &[u8], validate: bool) -> Result<Self, Error>where + Self: From<<Self::SolType as SolType>::RustType>,

ABI-decode this type from the given data. Read more
§

fn abi_decode_params<'de>( + data: &'de [u8], + validate: bool +) -> Result<Self, Error>where + Self: From<<Self::SolType as SolType>::RustType>, + <Self::SolType as SolType>::Token<'de>: TokenSeq<'de>,

ABI-decode this type from the given data. Read more
§

fn abi_decode_sequence<'de>( + data: &'de [u8], + validate: bool +) -> Result<Self, Error>where + Self: From<<Self::SolType as SolType>::RustType>, + <Self::SolType as SolType>::Token<'de>: TokenSeq<'de>,

ABI-decode this type from the given data. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/chain_connector/Offer/struct.getComputePeerCall.html b/chain_connector/Offer/struct.getComputePeerCall.html new file mode 100644 index 0000000000..577d5ca7c2 --- /dev/null +++ b/chain_connector/Offer/struct.getComputePeerCall.html @@ -0,0 +1,45 @@ +getComputePeerCall in chain_connector::Offer - Rust
pub struct getComputePeerCall {
+    pub peerId: FixedBytes<32>,
+}
Expand description

@dev Returns the compute peer info +Function with signature getComputePeer(bytes32) and selector 0x86e68254.

+
function getComputePeer(bytes32 peerId) external view returns (ComputePeer memory);
+

Fields§

§peerId: FixedBytes<32>

Trait Implementations§

source§

impl Clone for getComputePeerCall

source§

fn clone(&self) -> getComputePeerCall

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl SolCall for getComputePeerCall

§

type Parameters<'a> = (FixedBytes<32>,)

The underlying tuple type which represents this type’s arguments. Read more
§

type Token<'a> = <<getComputePeerCall as SolCall>::Parameters<'a> as SolType>::Token<'a>

The arguments’ corresponding [TokenSeq] type.
§

type Return = getComputePeerReturn

The function’s return struct.
§

type ReturnTuple<'a> = (ComputePeer,)

The underlying tuple type which represents this type’s return values. Read more
§

type ReturnToken<'a> = <<getComputePeerCall as SolCall>::ReturnTuple<'a> as SolType>::Token<'a>

The returns’ corresponding [TokenSeq] type.
source§

const SIGNATURE: &'static str = "getComputePeer(bytes32)"

The function’s ABI signature.
source§

const SELECTOR: [u8; 4] = _

The function selector: keccak256(SIGNATURE)[0..4]
source§

fn new<'a>(tuple: <Self::Parameters<'a> as SolType>::RustType) -> Self

Convert from the tuple type used for ABI encoding and decoding.
source§

fn tokenize(&self) -> Self::Token<'_>

Tokenize the call’s arguments.
source§

fn abi_decode_returns(data: &[u8], validate: bool) -> Result<Self::Return>

ABI decode this call’s return values from the given slice.
§

fn abi_encoded_size(&self) -> usize

The size of the encoded data in bytes, without its selector.
§

fn abi_decode_raw(data: &[u8], validate: bool) -> Result<Self, Error>

ABI decode this call’s arguments from the given slice, without its +selector.
§

fn abi_decode(data: &[u8], validate: bool) -> Result<Self, Error>

ABI decode this call’s arguments from the given slice, with the +selector.
§

fn abi_encode_raw(&self, out: &mut Vec<u8>)

ABI encode the call to the given buffer without its selector.
§

fn abi_encode(&self) -> Vec<u8>

ABI encode the call to the given buffer with its selector.
§

fn abi_encode_returns<'a, E>(e: &'a E) -> Vec<u8> where + E: SolTypeValue<Self::ReturnTuple<'a>>,

ABI encode the call’s return values.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/chain_connector/Offer/struct.getComputePeerReturn.html b/chain_connector/Offer/struct.getComputePeerReturn.html new file mode 100644 index 0000000000..39c5b5c284 --- /dev/null +++ b/chain_connector/Offer/struct.getComputePeerReturn.html @@ -0,0 +1,41 @@ +getComputePeerReturn in chain_connector::Offer - Rust
pub struct getComputePeerReturn {
+    pub _0: <ComputePeer as SolType>::RustType,
+}
Expand description

@dev Returns the compute peer info +Container type for the return parameters of the getComputePeer(bytes32) function.

+

Fields§

§_0: <ComputePeer as SolType>::RustType

Trait Implementations§

source§

impl Clone for getComputePeerReturn

source§

fn clone(&self) -> getComputePeerReturn

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/chain_connector/Offer/struct.getComputeUnitsCall.html b/chain_connector/Offer/struct.getComputeUnitsCall.html new file mode 100644 index 0000000000..2b666a7efd --- /dev/null +++ b/chain_connector/Offer/struct.getComputeUnitsCall.html @@ -0,0 +1,45 @@ +getComputeUnitsCall in chain_connector::Offer - Rust
pub struct getComputeUnitsCall {
+    pub peerId: FixedBytes<32>,
+}
Expand description

@dev Returns the compute units info of a peer +Function with signature getComputeUnits(bytes32) and selector 0xb6015c6e.

+
function getComputeUnits(bytes32 peerId) external view returns (ComputeUnit[] memory);
+

Fields§

§peerId: FixedBytes<32>

Trait Implementations§

source§

impl Clone for getComputeUnitsCall

source§

fn clone(&self) -> getComputeUnitsCall

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl SolCall for getComputeUnitsCall

§

type Parameters<'a> = (FixedBytes<32>,)

The underlying tuple type which represents this type’s arguments. Read more
§

type Token<'a> = <<getComputeUnitsCall as SolCall>::Parameters<'a> as SolType>::Token<'a>

The arguments’ corresponding [TokenSeq] type.
§

type Return = getComputeUnitsReturn

The function’s return struct.
§

type ReturnTuple<'a> = (Array<ComputeUnit>,)

The underlying tuple type which represents this type’s return values. Read more
§

type ReturnToken<'a> = <<getComputeUnitsCall as SolCall>::ReturnTuple<'a> as SolType>::Token<'a>

The returns’ corresponding [TokenSeq] type.
source§

const SIGNATURE: &'static str = "getComputeUnits(bytes32)"

The function’s ABI signature.
source§

const SELECTOR: [u8; 4] = _

The function selector: keccak256(SIGNATURE)[0..4]
source§

fn new<'a>(tuple: <Self::Parameters<'a> as SolType>::RustType) -> Self

Convert from the tuple type used for ABI encoding and decoding.
source§

fn tokenize(&self) -> Self::Token<'_>

Tokenize the call’s arguments.
source§

fn abi_decode_returns(data: &[u8], validate: bool) -> Result<Self::Return>

ABI decode this call’s return values from the given slice.
§

fn abi_encoded_size(&self) -> usize

The size of the encoded data in bytes, without its selector.
§

fn abi_decode_raw(data: &[u8], validate: bool) -> Result<Self, Error>

ABI decode this call’s arguments from the given slice, without its +selector.
§

fn abi_decode(data: &[u8], validate: bool) -> Result<Self, Error>

ABI decode this call’s arguments from the given slice, with the +selector.
§

fn abi_encode_raw(&self, out: &mut Vec<u8>)

ABI encode the call to the given buffer without its selector.
§

fn abi_encode(&self) -> Vec<u8>

ABI encode the call to the given buffer with its selector.
§

fn abi_encode_returns<'a, E>(e: &'a E) -> Vec<u8> where + E: SolTypeValue<Self::ReturnTuple<'a>>,

ABI encode the call’s return values.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/chain_connector/Offer/struct.getComputeUnitsReturn.html b/chain_connector/Offer/struct.getComputeUnitsReturn.html new file mode 100644 index 0000000000..ed778dadc5 --- /dev/null +++ b/chain_connector/Offer/struct.getComputeUnitsReturn.html @@ -0,0 +1,41 @@ +getComputeUnitsReturn in chain_connector::Offer - Rust
pub struct getComputeUnitsReturn {
+    pub _0: Vec<<ComputeUnit as SolType>::RustType>,
+}
Expand description

@dev Returns the compute units info of a peer +Container type for the return parameters of the getComputeUnits(bytes32) function.

+

Fields§

§_0: Vec<<ComputeUnit as SolType>::RustType>

Trait Implementations§

source§

impl Clone for getComputeUnitsReturn

source§

fn clone(&self) -> getComputeUnitsReturn

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/chain_connector/Offer/struct.returnComputeUnitFromDealCall.html b/chain_connector/Offer/struct.returnComputeUnitFromDealCall.html new file mode 100644 index 0000000000..a744af2e9a --- /dev/null +++ b/chain_connector/Offer/struct.returnComputeUnitFromDealCall.html @@ -0,0 +1,45 @@ +returnComputeUnitFromDealCall in chain_connector::Offer - Rust
pub struct returnComputeUnitFromDealCall {
+    pub unitId: FixedBytes<32>,
+}
Expand description

@dev Return the compute unit from a deal +Function with signature returnComputeUnitFromDeal(bytes32) and selector 0x14afcd52.

+
function returnComputeUnitFromDeal(bytes32 unitId) external;
+

Fields§

§unitId: FixedBytes<32>

Trait Implementations§

source§

impl Clone for returnComputeUnitFromDealCall

source§

fn clone(&self) -> returnComputeUnitFromDealCall

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl SolCall for returnComputeUnitFromDealCall

§

type Parameters<'a> = (FixedBytes<32>,)

The underlying tuple type which represents this type’s arguments. Read more
§

type Token<'a> = <<returnComputeUnitFromDealCall as SolCall>::Parameters<'a> as SolType>::Token<'a>

The arguments’ corresponding [TokenSeq] type.
§

type Return = returnComputeUnitFromDealReturn

The function’s return struct.
§

type ReturnTuple<'a> = ()

The underlying tuple type which represents this type’s return values. Read more
§

type ReturnToken<'a> = <<returnComputeUnitFromDealCall as SolCall>::ReturnTuple<'a> as SolType>::Token<'a>

The returns’ corresponding [TokenSeq] type.
source§

const SIGNATURE: &'static str = "returnComputeUnitFromDeal(bytes32)"

The function’s ABI signature.
source§

const SELECTOR: [u8; 4] = _

The function selector: keccak256(SIGNATURE)[0..4]
source§

fn new<'a>(tuple: <Self::Parameters<'a> as SolType>::RustType) -> Self

Convert from the tuple type used for ABI encoding and decoding.
source§

fn tokenize(&self) -> Self::Token<'_>

Tokenize the call’s arguments.
source§

fn abi_decode_returns(data: &[u8], validate: bool) -> Result<Self::Return>

ABI decode this call’s return values from the given slice.
§

fn abi_encoded_size(&self) -> usize

The size of the encoded data in bytes, without its selector.
§

fn abi_decode_raw(data: &[u8], validate: bool) -> Result<Self, Error>

ABI decode this call’s arguments from the given slice, without its +selector.
§

fn abi_decode(data: &[u8], validate: bool) -> Result<Self, Error>

ABI decode this call’s arguments from the given slice, with the +selector.
§

fn abi_encode_raw(&self, out: &mut Vec<u8>)

ABI encode the call to the given buffer without its selector.
§

fn abi_encode(&self) -> Vec<u8>

ABI encode the call to the given buffer with its selector.
§

fn abi_encode_returns<'a, E>(e: &'a E) -> Vec<u8> where + E: SolTypeValue<Self::ReturnTuple<'a>>,

ABI encode the call’s return values.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/chain_connector/Offer/struct.returnComputeUnitFromDealReturn.html b/chain_connector/Offer/struct.returnComputeUnitFromDealReturn.html new file mode 100644 index 0000000000..97a359c4c0 --- /dev/null +++ b/chain_connector/Offer/struct.returnComputeUnitFromDealReturn.html @@ -0,0 +1,39 @@ +returnComputeUnitFromDealReturn in chain_connector::Offer - Rust
pub struct returnComputeUnitFromDealReturn {}
Expand description

@dev Return the compute unit from a deal +Container type for the return parameters of the returnComputeUnitFromDeal(bytes32) function.

+

Trait Implementations§

source§

impl Clone for returnComputeUnitFromDealReturn

source§

fn clone(&self) -> returnComputeUnitFromDealReturn

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/chain_connector/all.html b/chain_connector/all.html new file mode 100644 index 0000000000..44349e1658 --- /dev/null +++ b/chain_connector/all.html @@ -0,0 +1 @@ +List of all items in this crate

List of all items

Structs

Enums

Traits

Functions

Constants

\ No newline at end of file diff --git a/chain_connector/connector/struct.HttpChainConnector.html b/chain_connector/connector/struct.HttpChainConnector.html new file mode 100644 index 0000000000..a431da3312 --- /dev/null +++ b/chain_connector/connector/struct.HttpChainConnector.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../chain_connector/struct.HttpChainConnector.html...

+ + + \ No newline at end of file diff --git a/chain_connector/connector/trait.ChainConnector.html b/chain_connector/connector/trait.ChainConnector.html new file mode 100644 index 0000000000..a4bcf31ab2 --- /dev/null +++ b/chain_connector/connector/trait.ChainConnector.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../chain_connector/trait.ChainConnector.html...

+ + + \ No newline at end of file diff --git a/chain_connector/constant.PEER_NOT_EXISTS.html b/chain_connector/constant.PEER_NOT_EXISTS.html new file mode 100644 index 0000000000..8bbbd31e3e --- /dev/null +++ b/chain_connector/constant.PEER_NOT_EXISTS.html @@ -0,0 +1,2 @@ +PEER_NOT_EXISTS in chain_connector - Rust
pub const PEER_NOT_EXISTS: &str = "08c379a0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000125065657220646f65736e27742065786973740000000000000000000000000000";
Expand description

“Peer doesn’t exists” in Market.sol

+
\ No newline at end of file diff --git a/chain_connector/enum.CCStatus.html b/chain_connector/enum.CCStatus.html new file mode 100644 index 0000000000..f8c923b618 --- /dev/null +++ b/chain_connector/enum.CCStatus.html @@ -0,0 +1,84 @@ +CCStatus in chain_connector - Rust
#[repr(u8)]
pub enum CCStatus { + Inactive, + Active, + WaitDelegation, + WaitStart, + Failed, + Removed, + // some variants omitted +}
Expand description
enum CCStatus { Inactive, Active, WaitDelegation, WaitStart, Failed, Removed }
+

Variants§

§

Inactive

§

Active

§

WaitDelegation

§

WaitStart

§

Failed

§

Removed

Trait Implementations§

source§

impl Clone for CCStatus

source§

fn clone(&self) -> CCStatus

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for CCStatus

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl EventTopic for CCStatus

source§

fn topic_preimage_length(rust: &Self::RustType) -> usize

The number of bytes this type occupies in another topic’s preimage, +usually a multiple of 32. Read more
source§

fn encode_topic_preimage(rust: &Self::RustType, out: &mut Vec<u8>)

Encodes this type as preimage bytes which are then hashed in +complex types’ [encode_topic][EventTopic::encode_topic]. Read more
source§

fn encode_topic(rust: &Self::RustType) -> WordToken

Indexed event parameter encoding. Read more
source§

impl From<CCStatus> for u8

source§

fn from(v: CCStatus) -> Self

Converts to this type from the input type.
source§

impl PartialEq for CCStatus

source§

fn eq(&self, other: &CCStatus) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl SolEnum for CCStatus

source§

const COUNT: usize = 6usize

The number of variants in the enum. Read more
§

fn tokenize(self) -> WordToken

Tokenize the enum.
§

fn abi_decode(data: &[u8], validate: bool) -> Result<Self, Error>

ABI decode the enum from the given buffer.
§

fn abi_encode_raw(self, out: &mut Vec<u8>)

ABI encode the enum into the given buffer.
§

fn abi_encode(self) -> Vec<u8>

ABI encode the enum.
source§

impl SolType for CCStatus

§

type RustType = CCStatus

The corresponding Rust type.
§

type Token<'a> = <Uint<8> as SolType>::Token<'a>

The corresponding ABI token type. Read more
source§

const SOL_NAME: &'static str = <alloy_sol_types::sol_data::Uint<8> as alloy_sol_types::SolType>::SOL_NAME

The name of this type in Solidity.
source§

const ENCODED_SIZE: Option<usize> = <alloy_sol_types::sol_data::Uint<8> as alloy_sol_types::SolType>::ENCODED_SIZE

The statically-known ABI-encoded size of the type. Read more
source§

fn valid_token(token: &Self::Token<'_>) -> bool

Returns true if the given token can be detokenized with this type.
source§

fn type_check(token: &Self::Token<'_>) -> Result<()>

Returns an error if the given token cannot be detokenized with this +type.
source§

fn detokenize(token: Self::Token<'_>) -> Self::RustType

Detokenize this type’s value from the given token. Read more
§

const DYNAMIC: bool = _

Whether the ABI-encoded size is dynamic. Read more
§

fn sol_type_name() -> Cow<'static, str>

👎Deprecated since 0.6.3: use SOL_NAME instead
Returns the name of this type in Solidity.
§

fn abi_encoded_size<E>(rust: &E) -> usizewhere + E: SolTypeValue<Self> + ?Sized,

Calculate the ABI-encoded size of the data, counting both head and tail +words. For a single-word type this will always be 32.
§

fn tokenize<E>(rust: &E) -> Self::Token<'_>where + E: SolTypeValue<Self> + ?Sized,

Tokenizes the given value into this type’s token. Read more
§

fn eip712_data_word<E>(rust: &E) -> FixedBytes<32>where + E: SolTypeValue<Self> + ?Sized,

Encode this data according to EIP-712 encodeData rules, and hash it +if necessary. Read more
§

fn abi_encode_packed_to<E>(rust: &E, out: &mut Vec<u8>)where + E: SolTypeValue<Self> + ?Sized,

Non-standard Packed Mode ABI encoding. Read more
§

fn abi_encode_packed<E>(rust: &E) -> Vec<u8> where + E: SolTypeValue<Self> + ?Sized,

Non-standard Packed Mode ABI encoding. Read more
§

fn abi_encode<E>(rust: &E) -> Vec<u8> where + E: SolTypeValue<Self> + ?Sized,

Tokenizes and ABI-encodes the given value by wrapping it in a +single-element sequence. Read more
§

fn abi_decode(data: &[u8], validate: bool) -> Result<Self::RustType, Error>

Decodes this type’s value from an ABI blob by interpreting it as a +single-element sequence. Read more
§

fn abi_decode_params<'de>( + data: &'de [u8], + validate: bool +) -> Result<Self::RustType, Error>where + Self::Token<'de>: TokenSeq<'de>,

Decodes this type’s value from an ABI blob by interpreting it as +function parameters. Read more
§

fn abi_decode_sequence<'de>( + data: &'de [u8], + validate: bool +) -> Result<Self::RustType, Error>where + Self::Token<'de>: TokenSeq<'de>,

Decodes this type’s value from an ABI blob by interpreting it as a +sequence. Read more
source§

impl SolTypeValue<CCStatus> for CCStatus

source§

fn stv_to_tokens(&self) -> <Uint<8> as SolType>::Token<'_>

source§

fn stv_eip712_data_word(&self) -> Word

source§

fn stv_abi_encode_packed_to(&self, out: &mut Vec<u8>)

§

fn stv_abi_encoded_size(&self) -> usize

source§

impl SolValue for CCStatus

§

type SolType = CCStatus

The Solidity type that this type corresponds to.
§

fn sol_name(&self) -> &'static str

The name of the associated Solidity type. Read more
§

fn sol_type_name(&self) -> Cow<'static, str>

👎Deprecated since 0.6.3: use sol_name instead
The name of the associated Solidity type. Read more
§

fn tokenize(&self) -> <Self::SolType as SolType>::Token<'_>

Tokenizes the given value into this type’s token. Read more
§

fn detokenize(token: <Self::SolType as SolType>::Token<'_>) -> Selfwhere + Self: From<<Self::SolType as SolType>::RustType>,

Detokenize a value from the given token. Read more
§

fn abi_encoded_size(&self) -> usize

Calculate the ABI-encoded size of the data. Read more
§

fn eip712_data_word(&self) -> FixedBytes<32>

Encode this data according to EIP-712 encodeData rules, and hash it +if necessary. Read more
§

fn abi_encode_packed_to(&self, out: &mut Vec<u8>)

Non-standard Packed Mode ABI encoding. Read more
§

fn abi_encode_packed(&self) -> Vec<u8>

Non-standard Packed Mode ABI encoding. Read more
§

fn abi_encode(&self) -> Vec<u8>

ABI-encodes the value. Read more
§

fn abi_decode(data: &[u8], validate: bool) -> Result<Self, Error>where + Self: From<<Self::SolType as SolType>::RustType>,

ABI-decode this type from the given data. Read more
§

fn abi_decode_params<'de>( + data: &'de [u8], + validate: bool +) -> Result<Self, Error>where + Self: From<<Self::SolType as SolType>::RustType>, + <Self::SolType as SolType>::Token<'de>: TokenSeq<'de>,

ABI-decode this type from the given data. Read more
§

fn abi_decode_sequence<'de>( + data: &'de [u8], + validate: bool +) -> Result<Self, Error>where + Self: From<<Self::SolType as SolType>::RustType>, + <Self::SolType as SolType>::Token<'de>: TokenSeq<'de>,

ABI-decode this type from the given data. Read more
source§

impl TryFrom<u8> for CCStatus

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(v: u8) -> Result<Self>

Performs the conversion.
source§

impl Copy for CCStatus

source§

impl StructuralPartialEq for CCStatus

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/chain_connector/enum.ConnectorError.html b/chain_connector/enum.ConnectorError.html new file mode 100644 index 0000000000..d06bd536da --- /dev/null +++ b/chain_connector/enum.ConnectorError.html @@ -0,0 +1,61 @@ +ConnectorError in chain_connector - Rust
pub enum ConnectorError {
+
Show 16 variants IpcInternalNetworkError(ErrorObjectOwned), + RpcError(Error), + RpcCallError { + code: i32, + message: String, + data: String, + }, + ParseChainDataFailed(ChainDataError), + ParseChainDataFailedAlloy(Error), + RpcChainData(ErrorObjectOwned), + ConvertCid(Error), + AddressParseError(Error), + DecodeHex(FromHexError), + EmptyData(String), + DecodeConstHex(FromHexError), + DecodeData(FromUtf8Error), + InvalidU256(String, String), + ResponseParseError(String), + FieldNotFound(&'static str), + ParseError(Error), +
}

Variants§

§

IpcInternalNetworkError(ErrorObjectOwned)

§

RpcError(Error)

§

RpcCallError

Fields

§code: i32

Code

+
§message: String

Message

+
§data: String

Optional data

+
§

ParseChainDataFailed(ChainDataError)

§

ParseChainDataFailedAlloy(Error)

§

RpcChainData(ErrorObjectOwned)

§

ConvertCid(Error)

§

AddressParseError(Error)

§

DecodeHex(FromHexError)

§

EmptyData(String)

§

DecodeConstHex(FromHexError)

§

DecodeData(FromUtf8Error)

§

InvalidU256(String, String)

§

ResponseParseError(String)

§

FieldNotFound(&'static str)

§

ParseError(Error)

Trait Implementations§

source§

impl Debug for ConnectorError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for ConnectorError

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for ConnectorError

source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl From<ChainDataError> for ConnectorError

source§

fn from(source: ChainDataError) -> Self

Converts to this type from the input type.
source§

impl From<Error> for ConnectorError

source§

fn from(source: RPCError) -> Self

Converts to this type from the input type.
source§

impl From<Error> for ConnectorError

source§

fn from(source: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for ConnectorError

source§

fn from(source: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for ConnectorError

source§

fn from(source: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for ConnectorError

source§

fn from(source: Error) -> Self

Converts to this type from the input type.
source§

impl From<ErrorObject<'static>> for ConnectorError

source§

fn from(source: ErrorObjectOwned) -> Self

Converts to this type from the input type.
source§

impl From<FromHexError> for ConnectorError

source§

fn from(source: FromHexError) -> Self

Converts to this type from the input type.
source§

impl From<FromHexError> for ConnectorError

source§

fn from(source: FromHexError) -> Self

Converts to this type from the input type.
source§

impl From<FromUtf8Error> for ConnectorError

source§

fn from(source: FromUtf8Error) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/chain_connector/error/enum.ConnectorError.html b/chain_connector/error/enum.ConnectorError.html new file mode 100644 index 0000000000..1463ba5940 --- /dev/null +++ b/chain_connector/error/enum.ConnectorError.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../chain_connector/enum.ConnectorError.html...

+ + + \ No newline at end of file diff --git a/chain_connector/fn.is_commitment_not_active.html b/chain_connector/fn.is_commitment_not_active.html new file mode 100644 index 0000000000..858b90420b --- /dev/null +++ b/chain_connector/fn.is_commitment_not_active.html @@ -0,0 +1 @@ +is_commitment_not_active in chain_connector - Rust
pub fn is_commitment_not_active(data: &str) -> bool
\ No newline at end of file diff --git a/chain_connector/fn.is_too_many_proofs.html b/chain_connector/fn.is_too_many_proofs.html new file mode 100644 index 0000000000..c71b340aeb --- /dev/null +++ b/chain_connector/fn.is_too_many_proofs.html @@ -0,0 +1 @@ +is_too_many_proofs in chain_connector - Rust
pub fn is_too_many_proofs(data: &str) -> bool
\ No newline at end of file diff --git a/chain_connector/function/capacity/Capacity/enum.CapacityCalls.html b/chain_connector/function/capacity/Capacity/enum.CapacityCalls.html new file mode 100644 index 0000000000..90ac82f486 --- /dev/null +++ b/chain_connector/function/capacity/Capacity/enum.CapacityCalls.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../chain_connector/Capacity/enum.CapacityCalls.html...

+ + + \ No newline at end of file diff --git a/chain_connector/function/capacity/Capacity/enum.CapacityErrors.html b/chain_connector/function/capacity/Capacity/enum.CapacityErrors.html new file mode 100644 index 0000000000..28b015e68b --- /dev/null +++ b/chain_connector/function/capacity/Capacity/enum.CapacityErrors.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../chain_connector/Capacity/enum.CapacityErrors.html...

+ + + \ No newline at end of file diff --git a/chain_connector/function/capacity/Capacity/index.html b/chain_connector/function/capacity/Capacity/index.html new file mode 100644 index 0000000000..7a386dabb0 --- /dev/null +++ b/chain_connector/function/capacity/Capacity/index.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../chain_connector/Capacity/index.html...

+ + + \ No newline at end of file diff --git a/chain_connector/function/capacity/Capacity/struct.CapacityCommitmentIsNotActive.html b/chain_connector/function/capacity/Capacity/struct.CapacityCommitmentIsNotActive.html new file mode 100644 index 0000000000..c9cc237de5 --- /dev/null +++ b/chain_connector/function/capacity/Capacity/struct.CapacityCommitmentIsNotActive.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../chain_connector/Capacity/struct.CapacityCommitmentIsNotActive.html...

+ + + \ No newline at end of file diff --git a/chain_connector/function/capacity/Capacity/struct.TooManyProofs.html b/chain_connector/function/capacity/Capacity/struct.TooManyProofs.html new file mode 100644 index 0000000000..c315db16fd --- /dev/null +++ b/chain_connector/function/capacity/Capacity/struct.TooManyProofs.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../chain_connector/Capacity/struct.TooManyProofs.html...

+ + + \ No newline at end of file diff --git a/chain_connector/function/capacity/Capacity/struct.getGlobalNonceCall.html b/chain_connector/function/capacity/Capacity/struct.getGlobalNonceCall.html new file mode 100644 index 0000000000..4e2b2146f1 --- /dev/null +++ b/chain_connector/function/capacity/Capacity/struct.getGlobalNonceCall.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../chain_connector/Capacity/struct.getGlobalNonceCall.html...

+ + + \ No newline at end of file diff --git a/chain_connector/function/capacity/Capacity/struct.getGlobalNonceReturn.html b/chain_connector/function/capacity/Capacity/struct.getGlobalNonceReturn.html new file mode 100644 index 0000000000..43a95096c4 --- /dev/null +++ b/chain_connector/function/capacity/Capacity/struct.getGlobalNonceReturn.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../chain_connector/Capacity/struct.getGlobalNonceReturn.html...

+ + + \ No newline at end of file diff --git a/chain_connector/function/capacity/Capacity/struct.getStatusCall.html b/chain_connector/function/capacity/Capacity/struct.getStatusCall.html new file mode 100644 index 0000000000..beb9b02919 --- /dev/null +++ b/chain_connector/function/capacity/Capacity/struct.getStatusCall.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../chain_connector/Capacity/struct.getStatusCall.html...

+ + + \ No newline at end of file diff --git a/chain_connector/function/capacity/Capacity/struct.getStatusReturn.html b/chain_connector/function/capacity/Capacity/struct.getStatusReturn.html new file mode 100644 index 0000000000..3610c5a548 --- /dev/null +++ b/chain_connector/function/capacity/Capacity/struct.getStatusReturn.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../chain_connector/Capacity/struct.getStatusReturn.html...

+ + + \ No newline at end of file diff --git a/chain_connector/function/capacity/Capacity/struct.submitProofCall.html b/chain_connector/function/capacity/Capacity/struct.submitProofCall.html new file mode 100644 index 0000000000..c8a9490d82 --- /dev/null +++ b/chain_connector/function/capacity/Capacity/struct.submitProofCall.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../chain_connector/Capacity/struct.submitProofCall.html...

+ + + \ No newline at end of file diff --git a/chain_connector/function/capacity/Capacity/struct.submitProofReturn.html b/chain_connector/function/capacity/Capacity/struct.submitProofReturn.html new file mode 100644 index 0000000000..8399367d0d --- /dev/null +++ b/chain_connector/function/capacity/Capacity/struct.submitProofReturn.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../chain_connector/Capacity/struct.submitProofReturn.html...

+ + + \ No newline at end of file diff --git a/chain_connector/function/capacity/Capacity/struct.submitProofsCall.html b/chain_connector/function/capacity/Capacity/struct.submitProofsCall.html new file mode 100644 index 0000000000..266abd729e --- /dev/null +++ b/chain_connector/function/capacity/Capacity/struct.submitProofsCall.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../chain_connector/Capacity/struct.submitProofsCall.html...

+ + + \ No newline at end of file diff --git a/chain_connector/function/capacity/Capacity/struct.submitProofsReturn.html b/chain_connector/function/capacity/Capacity/struct.submitProofsReturn.html new file mode 100644 index 0000000000..5f56fcf5f6 --- /dev/null +++ b/chain_connector/function/capacity/Capacity/struct.submitProofsReturn.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../chain_connector/Capacity/struct.submitProofsReturn.html...

+ + + \ No newline at end of file diff --git a/chain_connector/function/capacity/enum.CCStatus.html b/chain_connector/function/capacity/enum.CCStatus.html new file mode 100644 index 0000000000..987c186bec --- /dev/null +++ b/chain_connector/function/capacity/enum.CCStatus.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../chain_connector/enum.CCStatus.html...

+ + + \ No newline at end of file diff --git a/chain_connector/function/capacity/fn.is_commitment_not_active.html b/chain_connector/function/capacity/fn.is_commitment_not_active.html new file mode 100644 index 0000000000..9671929016 --- /dev/null +++ b/chain_connector/function/capacity/fn.is_commitment_not_active.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../chain_connector/fn.is_commitment_not_active.html...

+ + + \ No newline at end of file diff --git a/chain_connector/function/capacity/fn.is_too_many_proofs.html b/chain_connector/function/capacity/fn.is_too_many_proofs.html new file mode 100644 index 0000000000..4311dee5e2 --- /dev/null +++ b/chain_connector/function/capacity/fn.is_too_many_proofs.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../chain_connector/fn.is_too_many_proofs.html...

+ + + \ No newline at end of file diff --git a/chain_connector/function/capacity/struct.CommitmentId.html b/chain_connector/function/capacity/struct.CommitmentId.html new file mode 100644 index 0000000000..7a439d5ef8 --- /dev/null +++ b/chain_connector/function/capacity/struct.CommitmentId.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../chain_connector/struct.CommitmentId.html...

+ + + \ No newline at end of file diff --git a/chain_connector/function/core/Core/enum.CoreCalls.html b/chain_connector/function/core/Core/enum.CoreCalls.html new file mode 100644 index 0000000000..b4ca6f8ac2 --- /dev/null +++ b/chain_connector/function/core/Core/enum.CoreCalls.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../chain_connector/Core/enum.CoreCalls.html...

+ + + \ No newline at end of file diff --git a/chain_connector/function/core/Core/index.html b/chain_connector/function/core/Core/index.html new file mode 100644 index 0000000000..444488e66d --- /dev/null +++ b/chain_connector/function/core/Core/index.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../chain_connector/Core/index.html...

+ + + \ No newline at end of file diff --git a/chain_connector/function/core/Core/struct.capacityCall.html b/chain_connector/function/core/Core/struct.capacityCall.html new file mode 100644 index 0000000000..3f328fea5c --- /dev/null +++ b/chain_connector/function/core/Core/struct.capacityCall.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../chain_connector/Core/struct.capacityCall.html...

+ + + \ No newline at end of file diff --git a/chain_connector/function/core/Core/struct.capacityReturn.html b/chain_connector/function/core/Core/struct.capacityReturn.html new file mode 100644 index 0000000000..3ee60b82d7 --- /dev/null +++ b/chain_connector/function/core/Core/struct.capacityReturn.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../chain_connector/Core/struct.capacityReturn.html...

+ + + \ No newline at end of file diff --git a/chain_connector/function/core/Core/struct.currentEpochCall.html b/chain_connector/function/core/Core/struct.currentEpochCall.html new file mode 100644 index 0000000000..001c4ff662 --- /dev/null +++ b/chain_connector/function/core/Core/struct.currentEpochCall.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../chain_connector/Core/struct.currentEpochCall.html...

+ + + \ No newline at end of file diff --git a/chain_connector/function/core/Core/struct.currentEpochReturn.html b/chain_connector/function/core/Core/struct.currentEpochReturn.html new file mode 100644 index 0000000000..1235976c2b --- /dev/null +++ b/chain_connector/function/core/Core/struct.currentEpochReturn.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../chain_connector/Core/struct.currentEpochReturn.html...

+ + + \ No newline at end of file diff --git a/chain_connector/function/core/Core/struct.difficultyCall.html b/chain_connector/function/core/Core/struct.difficultyCall.html new file mode 100644 index 0000000000..54ae3f7dfb --- /dev/null +++ b/chain_connector/function/core/Core/struct.difficultyCall.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../chain_connector/Core/struct.difficultyCall.html...

+ + + \ No newline at end of file diff --git a/chain_connector/function/core/Core/struct.difficultyReturn.html b/chain_connector/function/core/Core/struct.difficultyReturn.html new file mode 100644 index 0000000000..0a6c25a1b9 --- /dev/null +++ b/chain_connector/function/core/Core/struct.difficultyReturn.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../chain_connector/Core/struct.difficultyReturn.html...

+ + + \ No newline at end of file diff --git a/chain_connector/function/core/Core/struct.epochDurationCall.html b/chain_connector/function/core/Core/struct.epochDurationCall.html new file mode 100644 index 0000000000..52104e8cf6 --- /dev/null +++ b/chain_connector/function/core/Core/struct.epochDurationCall.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../chain_connector/Core/struct.epochDurationCall.html...

+ + + \ No newline at end of file diff --git a/chain_connector/function/core/Core/struct.epochDurationReturn.html b/chain_connector/function/core/Core/struct.epochDurationReturn.html new file mode 100644 index 0000000000..3f870c9405 --- /dev/null +++ b/chain_connector/function/core/Core/struct.epochDurationReturn.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../chain_connector/Core/struct.epochDurationReturn.html...

+ + + \ No newline at end of file diff --git a/chain_connector/function/core/Core/struct.initTimestampCall.html b/chain_connector/function/core/Core/struct.initTimestampCall.html new file mode 100644 index 0000000000..2187bf22d3 --- /dev/null +++ b/chain_connector/function/core/Core/struct.initTimestampCall.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../chain_connector/Core/struct.initTimestampCall.html...

+ + + \ No newline at end of file diff --git a/chain_connector/function/core/Core/struct.initTimestampReturn.html b/chain_connector/function/core/Core/struct.initTimestampReturn.html new file mode 100644 index 0000000000..d263041138 --- /dev/null +++ b/chain_connector/function/core/Core/struct.initTimestampReturn.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../chain_connector/Core/struct.initTimestampReturn.html...

+ + + \ No newline at end of file diff --git a/chain_connector/function/core/Core/struct.marketCall.html b/chain_connector/function/core/Core/struct.marketCall.html new file mode 100644 index 0000000000..57f3a512c0 --- /dev/null +++ b/chain_connector/function/core/Core/struct.marketCall.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../chain_connector/Core/struct.marketCall.html...

+ + + \ No newline at end of file diff --git a/chain_connector/function/core/Core/struct.marketReturn.html b/chain_connector/function/core/Core/struct.marketReturn.html new file mode 100644 index 0000000000..5c7aed5355 --- /dev/null +++ b/chain_connector/function/core/Core/struct.marketReturn.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../chain_connector/Core/struct.marketReturn.html...

+ + + \ No newline at end of file diff --git a/chain_connector/function/core/Core/struct.maxProofsPerEpochCall.html b/chain_connector/function/core/Core/struct.maxProofsPerEpochCall.html new file mode 100644 index 0000000000..807fb7f147 --- /dev/null +++ b/chain_connector/function/core/Core/struct.maxProofsPerEpochCall.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../chain_connector/Core/struct.maxProofsPerEpochCall.html...

+ + + \ No newline at end of file diff --git a/chain_connector/function/core/Core/struct.maxProofsPerEpochReturn.html b/chain_connector/function/core/Core/struct.maxProofsPerEpochReturn.html new file mode 100644 index 0000000000..21c076d8d3 --- /dev/null +++ b/chain_connector/function/core/Core/struct.maxProofsPerEpochReturn.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../chain_connector/Core/struct.maxProofsPerEpochReturn.html...

+ + + \ No newline at end of file diff --git a/chain_connector/function/core/Core/struct.minProofsPerEpochCall.html b/chain_connector/function/core/Core/struct.minProofsPerEpochCall.html new file mode 100644 index 0000000000..0e9d8efd48 --- /dev/null +++ b/chain_connector/function/core/Core/struct.minProofsPerEpochCall.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../chain_connector/Core/struct.minProofsPerEpochCall.html...

+ + + \ No newline at end of file diff --git a/chain_connector/function/core/Core/struct.minProofsPerEpochReturn.html b/chain_connector/function/core/Core/struct.minProofsPerEpochReturn.html new file mode 100644 index 0000000000..bc18cbd040 --- /dev/null +++ b/chain_connector/function/core/Core/struct.minProofsPerEpochReturn.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../chain_connector/Core/struct.minProofsPerEpochReturn.html...

+ + + \ No newline at end of file diff --git a/chain_connector/function/deal/Deal/enum.DealCalls.html b/chain_connector/function/deal/Deal/enum.DealCalls.html new file mode 100644 index 0000000000..c83354d532 --- /dev/null +++ b/chain_connector/function/deal/Deal/enum.DealCalls.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../chain_connector/Deal/enum.DealCalls.html...

+ + + \ No newline at end of file diff --git a/chain_connector/function/deal/Deal/enum.Status.html b/chain_connector/function/deal/Deal/enum.Status.html new file mode 100644 index 0000000000..1c4afc7791 --- /dev/null +++ b/chain_connector/function/deal/Deal/enum.Status.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../chain_connector/Deal/enum.Status.html...

+ + + \ No newline at end of file diff --git a/chain_connector/function/deal/Deal/index.html b/chain_connector/function/deal/Deal/index.html new file mode 100644 index 0000000000..eecee79a3d --- /dev/null +++ b/chain_connector/function/deal/Deal/index.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../chain_connector/Deal/index.html...

+ + + \ No newline at end of file diff --git a/chain_connector/function/deal/Deal/struct.CIDV1.html b/chain_connector/function/deal/Deal/struct.CIDV1.html new file mode 100644 index 0000000000..d79b2f232f --- /dev/null +++ b/chain_connector/function/deal/Deal/struct.CIDV1.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../chain_connector/Deal/struct.CIDV1.html...

+ + + \ No newline at end of file diff --git a/chain_connector/function/deal/Deal/struct.ComputeUnit.html b/chain_connector/function/deal/Deal/struct.ComputeUnit.html new file mode 100644 index 0000000000..b087abcc9f --- /dev/null +++ b/chain_connector/function/deal/Deal/struct.ComputeUnit.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../chain_connector/Deal/struct.ComputeUnit.html...

+ + + \ No newline at end of file diff --git a/chain_connector/function/deal/Deal/struct.appCIDCall.html b/chain_connector/function/deal/Deal/struct.appCIDCall.html new file mode 100644 index 0000000000..3e143925e3 --- /dev/null +++ b/chain_connector/function/deal/Deal/struct.appCIDCall.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../chain_connector/Deal/struct.appCIDCall.html...

+ + + \ No newline at end of file diff --git a/chain_connector/function/deal/Deal/struct.appCIDReturn.html b/chain_connector/function/deal/Deal/struct.appCIDReturn.html new file mode 100644 index 0000000000..89a608c9e5 --- /dev/null +++ b/chain_connector/function/deal/Deal/struct.appCIDReturn.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../chain_connector/Deal/struct.appCIDReturn.html...

+ + + \ No newline at end of file diff --git a/chain_connector/function/deal/Deal/struct.getComputeUnitsCall.html b/chain_connector/function/deal/Deal/struct.getComputeUnitsCall.html new file mode 100644 index 0000000000..91ca1585e2 --- /dev/null +++ b/chain_connector/function/deal/Deal/struct.getComputeUnitsCall.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../chain_connector/Deal/struct.getComputeUnitsCall.html...

+ + + \ No newline at end of file diff --git a/chain_connector/function/deal/Deal/struct.getComputeUnitsReturn.html b/chain_connector/function/deal/Deal/struct.getComputeUnitsReturn.html new file mode 100644 index 0000000000..2e09a76e59 --- /dev/null +++ b/chain_connector/function/deal/Deal/struct.getComputeUnitsReturn.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../chain_connector/Deal/struct.getComputeUnitsReturn.html...

+ + + \ No newline at end of file diff --git a/chain_connector/function/deal/Deal/struct.getStatusCall.html b/chain_connector/function/deal/Deal/struct.getStatusCall.html new file mode 100644 index 0000000000..13b9fe0e70 --- /dev/null +++ b/chain_connector/function/deal/Deal/struct.getStatusCall.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../chain_connector/Deal/struct.getStatusCall.html...

+ + + \ No newline at end of file diff --git a/chain_connector/function/deal/Deal/struct.getStatusReturn.html b/chain_connector/function/deal/Deal/struct.getStatusReturn.html new file mode 100644 index 0000000000..3ead541d93 --- /dev/null +++ b/chain_connector/function/deal/Deal/struct.getStatusReturn.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../chain_connector/Deal/struct.getStatusReturn.html...

+ + + \ No newline at end of file diff --git a/chain_connector/function/deal/Deal/struct.setWorkerCall.html b/chain_connector/function/deal/Deal/struct.setWorkerCall.html new file mode 100644 index 0000000000..70522ed0f4 --- /dev/null +++ b/chain_connector/function/deal/Deal/struct.setWorkerCall.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../chain_connector/Deal/struct.setWorkerCall.html...

+ + + \ No newline at end of file diff --git a/chain_connector/function/deal/Deal/struct.setWorkerReturn.html b/chain_connector/function/deal/Deal/struct.setWorkerReturn.html new file mode 100644 index 0000000000..cfbe649cd0 --- /dev/null +++ b/chain_connector/function/deal/Deal/struct.setWorkerReturn.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../chain_connector/Deal/struct.setWorkerReturn.html...

+ + + \ No newline at end of file diff --git a/chain_connector/function/offer/Offer/enum.OfferCalls.html b/chain_connector/function/offer/Offer/enum.OfferCalls.html new file mode 100644 index 0000000000..7d76a6c1b9 --- /dev/null +++ b/chain_connector/function/offer/Offer/enum.OfferCalls.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../chain_connector/Offer/enum.OfferCalls.html...

+ + + \ No newline at end of file diff --git a/chain_connector/function/offer/Offer/index.html b/chain_connector/function/offer/Offer/index.html new file mode 100644 index 0000000000..cd9b7fe51f --- /dev/null +++ b/chain_connector/function/offer/Offer/index.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../chain_connector/Offer/index.html...

+ + + \ No newline at end of file diff --git a/chain_connector/function/offer/Offer/struct.ComputePeer.html b/chain_connector/function/offer/Offer/struct.ComputePeer.html new file mode 100644 index 0000000000..74721ca04e --- /dev/null +++ b/chain_connector/function/offer/Offer/struct.ComputePeer.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../chain_connector/Offer/struct.ComputePeer.html...

+ + + \ No newline at end of file diff --git a/chain_connector/function/offer/Offer/struct.ComputeUnit.html b/chain_connector/function/offer/Offer/struct.ComputeUnit.html new file mode 100644 index 0000000000..d4b36f3895 --- /dev/null +++ b/chain_connector/function/offer/Offer/struct.ComputeUnit.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../chain_connector/Offer/struct.ComputeUnit.html...

+ + + \ No newline at end of file diff --git a/chain_connector/function/offer/Offer/struct.getComputePeerCall.html b/chain_connector/function/offer/Offer/struct.getComputePeerCall.html new file mode 100644 index 0000000000..09d6bd062b --- /dev/null +++ b/chain_connector/function/offer/Offer/struct.getComputePeerCall.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../chain_connector/Offer/struct.getComputePeerCall.html...

+ + + \ No newline at end of file diff --git a/chain_connector/function/offer/Offer/struct.getComputePeerReturn.html b/chain_connector/function/offer/Offer/struct.getComputePeerReturn.html new file mode 100644 index 0000000000..a0a1fe575b --- /dev/null +++ b/chain_connector/function/offer/Offer/struct.getComputePeerReturn.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../chain_connector/Offer/struct.getComputePeerReturn.html...

+ + + \ No newline at end of file diff --git a/chain_connector/function/offer/Offer/struct.getComputeUnitsCall.html b/chain_connector/function/offer/Offer/struct.getComputeUnitsCall.html new file mode 100644 index 0000000000..a881ecfcfc --- /dev/null +++ b/chain_connector/function/offer/Offer/struct.getComputeUnitsCall.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../chain_connector/Offer/struct.getComputeUnitsCall.html...

+ + + \ No newline at end of file diff --git a/chain_connector/function/offer/Offer/struct.getComputeUnitsReturn.html b/chain_connector/function/offer/Offer/struct.getComputeUnitsReturn.html new file mode 100644 index 0000000000..36e5c191f2 --- /dev/null +++ b/chain_connector/function/offer/Offer/struct.getComputeUnitsReturn.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../chain_connector/Offer/struct.getComputeUnitsReturn.html...

+ + + \ No newline at end of file diff --git a/chain_connector/function/offer/Offer/struct.returnComputeUnitFromDealCall.html b/chain_connector/function/offer/Offer/struct.returnComputeUnitFromDealCall.html new file mode 100644 index 0000000000..36ca1fe49f --- /dev/null +++ b/chain_connector/function/offer/Offer/struct.returnComputeUnitFromDealCall.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../chain_connector/Offer/struct.returnComputeUnitFromDealCall.html...

+ + + \ No newline at end of file diff --git a/chain_connector/function/offer/Offer/struct.returnComputeUnitFromDealReturn.html b/chain_connector/function/offer/Offer/struct.returnComputeUnitFromDealReturn.html new file mode 100644 index 0000000000..de93ecc295 --- /dev/null +++ b/chain_connector/function/offer/Offer/struct.returnComputeUnitFromDealReturn.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../chain_connector/Offer/struct.returnComputeUnitFromDealReturn.html...

+ + + \ No newline at end of file diff --git a/chain_connector/function/offer/constant.PEER_NOT_EXISTS.html b/chain_connector/function/offer/constant.PEER_NOT_EXISTS.html new file mode 100644 index 0000000000..27a25af78d --- /dev/null +++ b/chain_connector/function/offer/constant.PEER_NOT_EXISTS.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../chain_connector/constant.PEER_NOT_EXISTS.html...

+ + + \ No newline at end of file diff --git a/chain_connector/function/offer/struct.PendingUnit.html b/chain_connector/function/offer/struct.PendingUnit.html new file mode 100644 index 0000000000..456f5d61c5 --- /dev/null +++ b/chain_connector/function/offer/struct.PendingUnit.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../chain_connector/struct.PendingUnit.html...

+ + + \ No newline at end of file diff --git a/chain_connector/index.html b/chain_connector/index.html new file mode 100644 index 0000000000..b77ddbb7c6 --- /dev/null +++ b/chain_connector/index.html @@ -0,0 +1,2 @@ +chain_connector - Rust

Crate chain_connector

source ·

Modules

  • Module containing a contract’s types and functions.
  • Module containing a contract’s types and functions.
  • Module containing a contract’s types and functions.
  • Module containing a contract’s types and functions.

Structs

Enums

Constants

Traits

Functions

\ No newline at end of file diff --git a/chain_connector/sidebar-items.js b/chain_connector/sidebar-items.js new file mode 100644 index 0000000000..6832cd1790 --- /dev/null +++ b/chain_connector/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"constant":["PEER_NOT_EXISTS"],"enum":["CCStatus","ConnectorError"],"fn":["is_commitment_not_active","is_too_many_proofs"],"mod":["Capacity","Core","Deal","Offer"],"struct":["CCInitParams","CommitmentId","HttpChainConnector","PendingUnit","SubnetResolveResult"],"trait":["ChainConnector"]}; \ No newline at end of file diff --git a/chain_connector/struct.CCInitParams.html b/chain_connector/struct.CCInitParams.html new file mode 100644 index 0000000000..d745687fd9 --- /dev/null +++ b/chain_connector/struct.CCInitParams.html @@ -0,0 +1,45 @@ +CCInitParams in chain_connector - Rust
pub struct CCInitParams {
+    pub difficulty: Difficulty,
+    pub init_timestamp: U256,
+    pub current_timestamp: U256,
+    pub global_nonce: GlobalNonce,
+    pub current_epoch: U256,
+    pub epoch_duration: U256,
+    pub min_proofs_per_epoch: U256,
+    pub max_proofs_per_epoch: U256,
+}

Fields§

§difficulty: Difficulty§init_timestamp: U256§current_timestamp: U256§global_nonce: GlobalNonce§current_epoch: U256§epoch_duration: U256§min_proofs_per_epoch: U256§max_proofs_per_epoch: U256

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/chain_connector/struct.CommitmentId.html b/chain_connector/struct.CommitmentId.html new file mode 100644 index 0000000000..969f1be44c --- /dev/null +++ b/chain_connector/struct.CommitmentId.html @@ -0,0 +1,56 @@ +CommitmentId in chain_connector - Rust
pub struct CommitmentId(pub [u8; 32]);

Tuple Fields§

§0: [u8; 32]

Implementations§

source§

impl CommitmentId

source

pub fn new(data: [u8; 32]) -> Option<Self>

Trait Implementations§

source§

impl Clone for CommitmentId

source§

fn clone(&self) -> CommitmentId

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for CommitmentId

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for CommitmentId

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Display for CommitmentId

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Hash for CommitmentId

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for CommitmentId

source§

fn eq(&self, other: &CommitmentId) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Serialize for CommitmentId

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Eq for CommitmentId

source§

impl StructuralEq for CommitmentId

source§

impl StructuralPartialEq for CommitmentId

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> CallHasher for Twhere + T: Hash + ?Sized,

§

default fn get_hash<H, B>(value: &H, build_hasher: &B) -> u64where + H: Hash + ?Sized, + B: BuildHasher,

§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
source§

impl<T> DeserializeOwned for Twhere + T: for<'de> Deserialize<'de>,

§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/chain_connector/struct.HttpChainConnector.html b/chain_connector/struct.HttpChainConnector.html new file mode 100644 index 0000000000..19e3e74026 --- /dev/null +++ b/chain_connector/struct.HttpChainConnector.html @@ -0,0 +1,103 @@ +HttpChainConnector in chain_connector - Rust
pub struct HttpChainConnector { /* private fields */ }

Implementations§

source§

impl HttpChainConnector

source

pub fn new( + config: ChainConfig, + host_id: PeerId +) -> Result<(Arc<Self>, HashMap<String, CustomService>)>

source

pub async fn get_app_cid( + &self, + deals: impl Iterator<Item = &DealId> +) -> Result<Vec<String>, ConnectorError>

source

pub async fn send_tx( + &self, + data: Vec<u8>, + to: &str +) -> Result<String, ConnectorError>

source

pub async fn register_worker( + &self, + deal_id: &DealId, + worker_id: WorkerId, + cu_id: CUID +) -> Result<String, ConnectorError>

source

pub async fn get_deal_compute_units( + &self, + deal_id: &DealId +) -> Result<Vec<ComputeUnit>, ConnectorError>

Trait Implementations§

source§

impl ChainConnector for HttpChainConnector

source§

fn get_current_commitment_id<'life0, 'async_trait>( + &'life0 self +) -> Pin<Box<dyn Future<Output = Result<Option<CommitmentId>, ConnectorError>> + Send + 'async_trait>>where + Self: 'async_trait, + 'life0: 'async_trait,

source§

fn get_cc_init_params<'life0, 'async_trait>( + &'life0 self +) -> Pin<Box<dyn Future<Output = Result<CCInitParams>> + Send + 'async_trait>>where + Self: 'async_trait, + 'life0: 'async_trait,

source§

fn get_compute_units<'life0, 'async_trait>( + &'life0 self +) -> Pin<Box<dyn Future<Output = Result<Vec<ComputeUnit>, ConnectorError>> + Send + 'async_trait>>where + Self: 'async_trait, + 'life0: 'async_trait,

source§

fn get_commitment_status<'life0, 'async_trait>( + &'life0 self, + commitment_id: CommitmentId +) -> Pin<Box<dyn Future<Output = Result<CCStatus, ConnectorError>> + Send + 'async_trait>>where + Self: 'async_trait, + 'life0: 'async_trait,

source§

fn get_global_nonce<'life0, 'async_trait>( + &'life0 self +) -> Pin<Box<dyn Future<Output = Result<GlobalNonce, ConnectorError>> + Send + 'async_trait>>where + Self: 'async_trait, + 'life0: 'async_trait,

source§

fn submit_proofs<'life0, 'async_trait>( + &'life0 self, + unit_ids: Vec<CUID>, + local_nonces: Vec<LocalNonce>, + result_hashes: Vec<ResultHash> +) -> Pin<Box<dyn Future<Output = Result<String, ConnectorError>> + Send + 'async_trait>>where + Self: 'async_trait, + 'life0: 'async_trait,

source§

fn get_deal_statuses<'life0, 'async_trait>( + &'life0 self, + deal_ids: Vec<DealId> +) -> Pin<Box<dyn Future<Output = Result<Vec<Result<Status, ConnectorError>>, ConnectorError>> + Send + 'async_trait>>where + Self: 'async_trait, + 'life0: 'async_trait,

source§

fn exit_deal<'life0, 'life1, 'async_trait>( + &'life0 self, + cu_id: &'life1 CUID +) -> Pin<Box<dyn Future<Output = Result<String, ConnectorError>> + Send + 'async_trait>>where + Self: 'async_trait, + 'life0: 'async_trait, + 'life1: 'async_trait,

source§

fn get_tx_statuses<'life0, 'async_trait>( + &'life0 self, + tx_hashes: Vec<String> +) -> Pin<Box<dyn Future<Output = Result<Vec<Result<Option<bool>, ConnectorError>>, ConnectorError>> + Send + 'async_trait>>where + Self: 'async_trait, + 'life0: 'async_trait,

source§

fn get_tx_receipts<'life0, 'async_trait>( + &'life0 self, + tx_hashes: Vec<String> +) -> Pin<Box<dyn Future<Output = Result<Vec<Result<TxStatus, ConnectorError>>, ConnectorError>> + Send + 'async_trait>>where + Self: 'async_trait, + 'life0: 'async_trait,

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/chain_connector/struct.PendingUnit.html b/chain_connector/struct.PendingUnit.html new file mode 100644 index 0000000000..5615806a9d --- /dev/null +++ b/chain_connector/struct.PendingUnit.html @@ -0,0 +1,61 @@ +PendingUnit in chain_connector - Rust
pub struct PendingUnit {
+    pub id: CUID,
+    pub start_epoch: U256,
+}

Fields§

§id: CUID§start_epoch: U256

Implementations§

source§

impl PendingUnit

source

pub fn new(id: CUID, start_epoch: U256) -> Self

Trait Implementations§

source§

impl Debug for PendingUnit

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<ComputeUnit> for PendingUnit

source§

fn from(unit: ComputeUnit) -> Self

Converts to this type from the input type.
source§

impl Hash for PendingUnit

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Ord for PendingUnit

source§

fn cmp(&self, other: &PendingUnit) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Selfwhere + Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Selfwhere + Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Selfwhere + Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for PendingUnit

source§

fn eq(&self, other: &PendingUnit) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for PendingUnit

source§

fn partial_cmp(&self, other: &PendingUnit) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

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 more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= +operator. Read more
source§

impl Eq for PendingUnit

source§

impl StructuralEq for PendingUnit

source§

impl StructuralPartialEq for PendingUnit

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> CallHasher for Twhere + T: Hash + ?Sized,

§

default fn get_hash<H, B>(value: &H, build_hasher: &B) -> u64where + H: Hash + ?Sized, + B: BuildHasher,

§

impl<Q, K> Comparable<K> for Qwhere + Q: Ord + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/chain_connector/struct.SubnetResolveResult.html b/chain_connector/struct.SubnetResolveResult.html new file mode 100644 index 0000000000..867202aff6 --- /dev/null +++ b/chain_connector/struct.SubnetResolveResult.html @@ -0,0 +1,46 @@ +SubnetResolveResult in chain_connector - Rust
pub struct SubnetResolveResult {
+    pub success: bool,
+    pub workers: Vec<Worker>,
+    pub error: Vec<String>,
+}

Fields§

§success: bool§workers: Vec<Worker>§error: Vec<String>

Trait Implementations§

source§

impl Clone for SubnetResolveResult

source§

fn clone(&self) -> SubnetResolveResult

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for SubnetResolveResult

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for SubnetResolveResult

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl PartialEq for SubnetResolveResult

source§

fn eq(&self, other: &SubnetResolveResult) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Serialize for SubnetResolveResult

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl StructuralPartialEq for SubnetResolveResult

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
source§

impl<T> DeserializeOwned for Twhere + T: for<'de> Deserialize<'de>,

§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/chain_connector/trait.ChainConnector.html b/chain_connector/trait.ChainConnector.html new file mode 100644 index 0000000000..3e4f9e2221 --- /dev/null +++ b/chain_connector/trait.ChainConnector.html @@ -0,0 +1,111 @@ +ChainConnector in chain_connector - Rust
pub trait ChainConnector: Send + Sync {
+    // Required methods
+    fn get_current_commitment_id<'life0, 'async_trait>(
+        &'life0 self
+    ) -> Pin<Box<dyn Future<Output = Result<Option<CommitmentId>, ConnectorError>> + Send + 'async_trait>>
+       where Self: 'async_trait,
+             'life0: 'async_trait;
+    fn get_cc_init_params<'life0, 'async_trait>(
+        &'life0 self
+    ) -> Pin<Box<dyn Future<Output = Result<CCInitParams>> + Send + 'async_trait>>
+       where Self: 'async_trait,
+             'life0: 'async_trait;
+    fn get_compute_units<'life0, 'async_trait>(
+        &'life0 self
+    ) -> Pin<Box<dyn Future<Output = Result<Vec<ComputeUnit>, ConnectorError>> + Send + 'async_trait>>
+       where Self: 'async_trait,
+             'life0: 'async_trait;
+    fn get_commitment_status<'life0, 'async_trait>(
+        &'life0 self,
+        commitment_id: CommitmentId
+    ) -> Pin<Box<dyn Future<Output = Result<CCStatus, ConnectorError>> + Send + 'async_trait>>
+       where Self: 'async_trait,
+             'life0: 'async_trait;
+    fn get_global_nonce<'life0, 'async_trait>(
+        &'life0 self
+    ) -> Pin<Box<dyn Future<Output = Result<GlobalNonce, ConnectorError>> + Send + 'async_trait>>
+       where Self: 'async_trait,
+             'life0: 'async_trait;
+    fn submit_proofs<'life0, 'async_trait>(
+        &'life0 self,
+        unit_ids: Vec<CUID>,
+        local_nonces: Vec<LocalNonce>,
+        result_hashes: Vec<ResultHash>
+    ) -> Pin<Box<dyn Future<Output = Result<String, ConnectorError>> + Send + 'async_trait>>
+       where Self: 'async_trait,
+             'life0: 'async_trait;
+    fn get_deal_statuses<'life0, 'async_trait>(
+        &'life0 self,
+        deal_ids: Vec<DealId>
+    ) -> Pin<Box<dyn Future<Output = Result<Vec<Result<Status, ConnectorError>>, ConnectorError>> + Send + 'async_trait>>
+       where Self: 'async_trait,
+             'life0: 'async_trait;
+    fn exit_deal<'life0, 'life1, 'async_trait>(
+        &'life0 self,
+        cu_id: &'life1 CUID
+    ) -> Pin<Box<dyn Future<Output = Result<String, ConnectorError>> + Send + 'async_trait>>
+       where Self: 'async_trait,
+             'life0: 'async_trait,
+             'life1: 'async_trait;
+    fn get_tx_statuses<'life0, 'async_trait>(
+        &'life0 self,
+        tx_hashes: Vec<String>
+    ) -> Pin<Box<dyn Future<Output = Result<Vec<Result<Option<bool>, ConnectorError>>, ConnectorError>> + Send + 'async_trait>>
+       where Self: 'async_trait,
+             'life0: 'async_trait;
+    fn get_tx_receipts<'life0, 'async_trait>(
+        &'life0 self,
+        tx_hashes: Vec<String>
+    ) -> Pin<Box<dyn Future<Output = Result<Vec<Result<TxStatus, ConnectorError>>, ConnectorError>> + Send + 'async_trait>>
+       where Self: 'async_trait,
+             'life0: 'async_trait;
+}

Required Methods§

source

fn get_current_commitment_id<'life0, 'async_trait>( + &'life0 self +) -> Pin<Box<dyn Future<Output = Result<Option<CommitmentId>, ConnectorError>> + Send + 'async_trait>>where + Self: 'async_trait, + 'life0: 'async_trait,

source

fn get_cc_init_params<'life0, 'async_trait>( + &'life0 self +) -> Pin<Box<dyn Future<Output = Result<CCInitParams>> + Send + 'async_trait>>where + Self: 'async_trait, + 'life0: 'async_trait,

source

fn get_compute_units<'life0, 'async_trait>( + &'life0 self +) -> Pin<Box<dyn Future<Output = Result<Vec<ComputeUnit>, ConnectorError>> + Send + 'async_trait>>where + Self: 'async_trait, + 'life0: 'async_trait,

source

fn get_commitment_status<'life0, 'async_trait>( + &'life0 self, + commitment_id: CommitmentId +) -> Pin<Box<dyn Future<Output = Result<CCStatus, ConnectorError>> + Send + 'async_trait>>where + Self: 'async_trait, + 'life0: 'async_trait,

source

fn get_global_nonce<'life0, 'async_trait>( + &'life0 self +) -> Pin<Box<dyn Future<Output = Result<GlobalNonce, ConnectorError>> + Send + 'async_trait>>where + Self: 'async_trait, + 'life0: 'async_trait,

source

fn submit_proofs<'life0, 'async_trait>( + &'life0 self, + unit_ids: Vec<CUID>, + local_nonces: Vec<LocalNonce>, + result_hashes: Vec<ResultHash> +) -> Pin<Box<dyn Future<Output = Result<String, ConnectorError>> + Send + 'async_trait>>where + Self: 'async_trait, + 'life0: 'async_trait,

source

fn get_deal_statuses<'life0, 'async_trait>( + &'life0 self, + deal_ids: Vec<DealId> +) -> Pin<Box<dyn Future<Output = Result<Vec<Result<Status, ConnectorError>>, ConnectorError>> + Send + 'async_trait>>where + Self: 'async_trait, + 'life0: 'async_trait,

source

fn exit_deal<'life0, 'life1, 'async_trait>( + &'life0 self, + cu_id: &'life1 CUID +) -> Pin<Box<dyn Future<Output = Result<String, ConnectorError>> + Send + 'async_trait>>where + Self: 'async_trait, + 'life0: 'async_trait, + 'life1: 'async_trait,

source

fn get_tx_statuses<'life0, 'async_trait>( + &'life0 self, + tx_hashes: Vec<String> +) -> Pin<Box<dyn Future<Output = Result<Vec<Result<Option<bool>, ConnectorError>>, ConnectorError>> + Send + 'async_trait>>where + Self: 'async_trait, + 'life0: 'async_trait,

source

fn get_tx_receipts<'life0, 'async_trait>( + &'life0 self, + tx_hashes: Vec<String> +) -> Pin<Box<dyn Future<Output = Result<Vec<Result<TxStatus, ConnectorError>>, ConnectorError>> + Send + 'async_trait>>where + Self: 'async_trait, + 'life0: 'async_trait,

Implementors§

\ No newline at end of file diff --git a/chain_connector/types/struct.CCInitParams.html b/chain_connector/types/struct.CCInitParams.html new file mode 100644 index 0000000000..b272d8fb5b --- /dev/null +++ b/chain_connector/types/struct.CCInitParams.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../chain_connector/struct.CCInitParams.html...

+ + + \ No newline at end of file diff --git a/chain_connector/types/struct.SubnetResolveResult.html b/chain_connector/types/struct.SubnetResolveResult.html new file mode 100644 index 0000000000..2eb437eee8 --- /dev/null +++ b/chain_connector/types/struct.SubnetResolveResult.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../chain_connector/struct.SubnetResolveResult.html...

+ + + \ No newline at end of file diff --git a/chain_data/all.html b/chain_data/all.html new file mode 100644 index 0000000000..1736ca209f --- /dev/null +++ b/chain_data/all.html @@ -0,0 +1 @@ +List of all items in this crate

List of all items

Structs

Enums

Traits

Functions

\ No newline at end of file diff --git a/chain_data/block_header/struct.BlockHeader.html b/chain_data/block_header/struct.BlockHeader.html new file mode 100644 index 0000000000..a9f3a6ac09 --- /dev/null +++ b/chain_data/block_header/struct.BlockHeader.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../chain_data/struct.BlockHeader.html...

+ + + \ No newline at end of file diff --git a/chain_data/chain_data/enum.EventField.html b/chain_data/chain_data/enum.EventField.html new file mode 100644 index 0000000000..0316f09668 --- /dev/null +++ b/chain_data/chain_data/enum.EventField.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../chain_data/enum.EventField.html...

+ + + \ No newline at end of file diff --git a/chain_data/chain_data/fn.parse_chain_data.html b/chain_data/chain_data/fn.parse_chain_data.html new file mode 100644 index 0000000000..28fece2c39 --- /dev/null +++ b/chain_data/chain_data/fn.parse_chain_data.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../chain_data/fn.parse_chain_data.html...

+ + + \ No newline at end of file diff --git a/chain_data/chain_data/trait.ChainData.html b/chain_data/chain_data/trait.ChainData.html new file mode 100644 index 0000000000..f7ba576c76 --- /dev/null +++ b/chain_data/chain_data/trait.ChainData.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../chain_data/trait.ChainData.html...

+ + + \ No newline at end of file diff --git a/chain_data/chain_data/trait.ChainEvent.html b/chain_data/chain_data/trait.ChainEvent.html new file mode 100644 index 0000000000..2fc94bb9f4 --- /dev/null +++ b/chain_data/chain_data/trait.ChainEvent.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../chain_data/trait.ChainEvent.html...

+ + + \ No newline at end of file diff --git a/chain_data/data_tokens/fn.next.html b/chain_data/data_tokens/fn.next.html new file mode 100644 index 0000000000..223505ffe9 --- /dev/null +++ b/chain_data/data_tokens/fn.next.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../chain_data/fn.next.html...

+ + + \ No newline at end of file diff --git a/chain_data/data_tokens/fn.next_opt.html b/chain_data/data_tokens/fn.next_opt.html new file mode 100644 index 0000000000..95c97143f3 --- /dev/null +++ b/chain_data/data_tokens/fn.next_opt.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../chain_data/fn.next_opt.html...

+ + + \ No newline at end of file diff --git a/chain_data/enum.ChainDataError.html b/chain_data/enum.ChainDataError.html new file mode 100644 index 0000000000..b522c96e25 --- /dev/null +++ b/chain_data/enum.ChainDataError.html @@ -0,0 +1,26 @@ +ChainDataError in chain_data - Rust
pub enum ChainDataError {
+    Empty,
+    MissingParsedToken(&'static str),
+    InvalidParsedToken(&'static str),
+    InvalidComputePeerId(ParseError),
+    DecodeHex(FromHexError),
+    EthError(Error),
+    InvalidTokenSize,
+}

Variants§

§

Empty

§

MissingParsedToken(&'static str)

§

InvalidParsedToken(&'static str)

§

InvalidComputePeerId(ParseError)

§

DecodeHex(FromHexError)

§

EthError(Error)

§

InvalidTokenSize

Trait Implementations§

source§

impl Debug for ChainDataError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for ChainDataError

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for ChainDataError

source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl From<ChainDataError> for LogParseError

source§

fn from(source: ChainDataError) -> Self

Converts to this type from the input type.
source§

impl From<Error> for ChainDataError

source§

fn from(source: Error) -> Self

Converts to this type from the input type.
source§

impl From<ParseError> for ChainDataError

source§

fn from(source: ParseError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/chain_data/enum.EventField.html b/chain_data/enum.EventField.html new file mode 100644 index 0000000000..24cd793a01 --- /dev/null +++ b/chain_data/enum.EventField.html @@ -0,0 +1,26 @@ +EventField in chain_data - Rust
pub enum EventField {
+    Indexed(ParamType),
+    NotIndexed(ParamType),
+}
Expand description

Kind of the field in Chain Event

+

Variants§

§

Indexed(ParamType)

If field is indexed, it’s passed among topics

+
§

NotIndexed(ParamType)

If field is not indexed, it’s passed in log.data

+

Implementations§

source§

impl EventField

source

pub fn param_type(self) -> ParamType

Trait Implementations§

source§

impl Clone for EventField

source§

fn clone(&self) -> EventField

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for EventField

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq for EventField

source§

fn eq(&self, other: &EventField) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl StructuralPartialEq for EventField

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/chain_data/enum.LogParseError.html b/chain_data/enum.LogParseError.html new file mode 100644 index 0000000000..928a9f7166 --- /dev/null +++ b/chain_data/enum.LogParseError.html @@ -0,0 +1,35 @@ +LogParseError in chain_data - Rust
pub enum LogParseError {
+    EthError(Error),
+    DecodeHex(FromHexError),
+    DecodeConstHex(FromHexError),
+    MissingToken {
+        position: usize,
+        event_field: EventField,
+    },
+    MissingTopic {
+        position: usize,
+        event_field: EventField,
+    },
+    MissingParsedToken(&'static str),
+    InvalidParsedToken(&'static str),
+    InvalidComputePeerId(ParseError),
+    ChainData(ChainDataError),
+    NoTokens,
+}

Variants§

§

EthError(Error)

§

DecodeHex(FromHexError)

§

DecodeConstHex(FromHexError)

§

MissingToken

Fields

§position: usize
§event_field: EventField
§

MissingTopic

Fields

§position: usize
§event_field: EventField
§

MissingParsedToken(&'static str)

§

InvalidParsedToken(&'static str)

§

InvalidComputePeerId(ParseError)

§

ChainData(ChainDataError)

§

NoTokens

Trait Implementations§

source§

impl Debug for LogParseError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for LogParseError

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for LogParseError

source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl From<ChainDataError> for LogParseError

source§

fn from(source: ChainDataError) -> Self

Converts to this type from the input type.
source§

impl From<Error> for LogParseError

source§

fn from(source: Error) -> Self

Converts to this type from the input type.
source§

impl From<FromHexError> for LogParseError

source§

fn from(source: FromHexError) -> Self

Converts to this type from the input type.
source§

impl From<FromHexError> for LogParseError

source§

fn from(source: FromHexError) -> Self

Converts to this type from the input type.
source§

impl From<ParseError> for LogParseError

source§

fn from(source: ParseError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/chain_data/error/enum.ChainDataError.html b/chain_data/error/enum.ChainDataError.html new file mode 100644 index 0000000000..22cab58575 --- /dev/null +++ b/chain_data/error/enum.ChainDataError.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../chain_data/enum.ChainDataError.html...

+ + + \ No newline at end of file diff --git a/chain_data/fn.next.html b/chain_data/fn.next.html new file mode 100644 index 0000000000..b1347e911b --- /dev/null +++ b/chain_data/fn.next.html @@ -0,0 +1,5 @@ +next in chain_data - Rust

Function chain_data::next

source ·
pub fn next<T>(
+    data_tokens: &mut impl Iterator<Item = Token>,
+    name: &'static str,
+    f: impl Fn(Token) -> T
+) -> Result<T, ChainDataError>
\ No newline at end of file diff --git a/chain_data/fn.next_opt.html b/chain_data/fn.next_opt.html new file mode 100644 index 0000000000..936f43c97a --- /dev/null +++ b/chain_data/fn.next_opt.html @@ -0,0 +1,5 @@ +next_opt in chain_data - Rust

Function chain_data::next_opt

source ·
pub fn next_opt<T>(
+    data_tokens: &mut impl Iterator<Item = Token>,
+    name: &'static str,
+    f: impl Fn(Token) -> Option<T>
+) -> Result<T, ChainDataError>
\ No newline at end of file diff --git a/chain_data/fn.parse_chain_data.html b/chain_data/fn.parse_chain_data.html new file mode 100644 index 0000000000..7738e36fd5 --- /dev/null +++ b/chain_data/fn.parse_chain_data.html @@ -0,0 +1,5 @@ +parse_chain_data in chain_data - Rust
pub fn parse_chain_data(
+    data: &str,
+    signature: &[ParamType]
+) -> Result<Vec<Token>, ChainDataError>
Expand description

Parse data from chain. Accepts data with and without “0x” prefix.

+
\ No newline at end of file diff --git a/chain_data/fn.parse_log.html b/chain_data/fn.parse_log.html new file mode 100644 index 0000000000..8a798151a6 --- /dev/null +++ b/chain_data/fn.parse_log.html @@ -0,0 +1 @@ +parse_log in chain_data - Rust

Function chain_data::parse_log

source ·
pub fn parse_log<T: SolEvent>(log: Log) -> Result<T, LogParseError>
\ No newline at end of file diff --git a/chain_data/fn.parse_peer_id.html b/chain_data/fn.parse_peer_id.html new file mode 100644 index 0000000000..aeb1bafd03 --- /dev/null +++ b/chain_data/fn.parse_peer_id.html @@ -0,0 +1 @@ +parse_peer_id in chain_data - Rust

Function chain_data::parse_peer_id

source ·
pub fn parse_peer_id(bytes: &[u8]) -> Result<PeerId, ParseError>
\ No newline at end of file diff --git a/chain_data/fn.peer_id_from_hex.html b/chain_data/fn.peer_id_from_hex.html new file mode 100644 index 0000000000..e9a5b28d7f --- /dev/null +++ b/chain_data/fn.peer_id_from_hex.html @@ -0,0 +1 @@ +peer_id_from_hex in chain_data - Rust
pub fn peer_id_from_hex(hex: &str) -> Result<PeerId>
\ No newline at end of file diff --git a/chain_data/fn.peer_id_to_bytes.html b/chain_data/fn.peer_id_to_bytes.html new file mode 100644 index 0000000000..8f07f3e5ae --- /dev/null +++ b/chain_data/fn.peer_id_to_bytes.html @@ -0,0 +1,2 @@ +peer_id_to_bytes in chain_data - Rust
pub fn peer_id_to_bytes(peer_id: PeerId) -> [u8; 32]
Expand description

This code works only for PeerId generated from ed25519 public key, the size assumptions is wrong

+
\ No newline at end of file diff --git a/chain_data/fn.peer_id_to_hex.html b/chain_data/fn.peer_id_to_hex.html new file mode 100644 index 0000000000..ebf68cd4d5 --- /dev/null +++ b/chain_data/fn.peer_id_to_hex.html @@ -0,0 +1 @@ +peer_id_to_hex in chain_data - Rust

Function chain_data::peer_id_to_hex

source ·
pub fn peer_id_to_hex(peer_id: PeerId) -> String
\ No newline at end of file diff --git a/chain_data/index.html b/chain_data/index.html new file mode 100644 index 0000000000..1f1198c2c5 --- /dev/null +++ b/chain_data/index.html @@ -0,0 +1,2 @@ +chain_data - Rust

Crate chain_data

source ·

Structs

Enums

Traits

Functions

\ No newline at end of file diff --git a/chain_data/log/enum.LogParseError.html b/chain_data/log/enum.LogParseError.html new file mode 100644 index 0000000000..30d6b3b08f --- /dev/null +++ b/chain_data/log/enum.LogParseError.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../chain_data/enum.LogParseError.html...

+ + + \ No newline at end of file diff --git a/chain_data/log/fn.parse_log.html b/chain_data/log/fn.parse_log.html new file mode 100644 index 0000000000..cd4c3a8df0 --- /dev/null +++ b/chain_data/log/fn.parse_log.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../chain_data/fn.parse_log.html...

+ + + \ No newline at end of file diff --git a/chain_data/log/struct.Log.html b/chain_data/log/struct.Log.html new file mode 100644 index 0000000000..9805366376 --- /dev/null +++ b/chain_data/log/struct.Log.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../chain_data/struct.Log.html...

+ + + \ No newline at end of file diff --git a/chain_data/sidebar-items.js b/chain_data/sidebar-items.js new file mode 100644 index 0000000000..9fdb083101 --- /dev/null +++ b/chain_data/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["ChainDataError","EventField","LogParseError"],"fn":["next","next_opt","parse_chain_data","parse_log","parse_peer_id","peer_id_from_hex","peer_id_to_bytes","peer_id_to_hex"],"struct":["BlockHeader","Log"],"trait":["ChainData","ChainEvent"]}; \ No newline at end of file diff --git a/chain_data/struct.BlockHeader.html b/chain_data/struct.BlockHeader.html new file mode 100644 index 0000000000..5bfcfd68e9 --- /dev/null +++ b/chain_data/struct.BlockHeader.html @@ -0,0 +1,22 @@ +BlockHeader in chain_data - Rust

Struct chain_data::BlockHeader

source ·
pub struct BlockHeader {
+    pub number: U64,
+    pub timestamp: U256,
+}

Fields§

§number: U64§timestamp: U256

Implementations§

source§

impl BlockHeader

source

pub fn from_json(json: Value) -> Result<Self>

Trait Implementations§

source§

impl Debug for BlockHeader

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for BlockHeader

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
source§

impl<T> DeserializeOwned for Twhere + T: for<'de> Deserialize<'de>,

\ No newline at end of file diff --git a/chain_data/struct.Log.html b/chain_data/struct.Log.html new file mode 100644 index 0000000000..b55bee58f7 --- /dev/null +++ b/chain_data/struct.Log.html @@ -0,0 +1,26 @@ +Log in chain_data - Rust

Struct chain_data::Log

source ·
pub struct Log {
+    pub data: String,
+    pub block_number: String,
+    pub removed: bool,
+    pub topics: Vec<String>,
+}

Fields§

§data: String§block_number: String§removed: bool§topics: Vec<String>

Trait Implementations§

source§

impl Clone for Log

source§

fn clone(&self) -> Log

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Log

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for Log

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Serialize for Log

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl RefUnwindSafe for Log

§

impl Send for Log

§

impl Sync for Log

§

impl Unpin for Log

§

impl UnwindSafe for Log

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
source§

impl<T> DeserializeOwned for Twhere + T: for<'de> Deserialize<'de>,

\ No newline at end of file diff --git a/chain_data/trait.ChainData.html b/chain_data/trait.ChainData.html new file mode 100644 index 0000000000..28541b1dc7 --- /dev/null +++ b/chain_data/trait.ChainData.html @@ -0,0 +1,15 @@ +ChainData in chain_data - Rust

Trait chain_data::ChainData

source ·
pub trait ChainData {
+    // Required methods
+    fn event_name() -> &'static str;
+    fn signature() -> Vec<EventField>;
+    fn parse(
+        data_tokens: &mut impl Iterator<Item = Token>
+    ) -> Result<Self, ChainDataError>
+       where Self: Sized;
+
+    // Provided method
+    fn topic() -> String { ... }
+}

Required Methods§

source

fn event_name() -> &'static str

source

fn signature() -> Vec<EventField>

source

fn parse( + data_tokens: &mut impl Iterator<Item = Token> +) -> Result<Self, ChainDataError>where + Self: Sized,

Provided Methods§

Object Safety§

This trait is not object safe.

Implementors§

\ No newline at end of file diff --git a/chain_data/trait.ChainEvent.html b/chain_data/trait.ChainEvent.html new file mode 100644 index 0000000000..6857d6e151 --- /dev/null +++ b/chain_data/trait.ChainEvent.html @@ -0,0 +1,4 @@ +ChainEvent in chain_data - Rust
pub trait ChainEvent<ChainData> {
+    // Required method
+    fn new(block_number: String, data: ChainData) -> Self;
+}

Required Methods§

source

fn new(block_number: String, data: ChainData) -> Self

Object Safety§

This trait is not object safe.

Implementors§

\ No newline at end of file diff --git a/chain_data/utils/fn.parse_peer_id.html b/chain_data/utils/fn.parse_peer_id.html new file mode 100644 index 0000000000..a057889ede --- /dev/null +++ b/chain_data/utils/fn.parse_peer_id.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../chain_data/fn.parse_peer_id.html...

+ + + \ No newline at end of file diff --git a/chain_data/utils/fn.peer_id_from_hex.html b/chain_data/utils/fn.peer_id_from_hex.html new file mode 100644 index 0000000000..c8444bbe66 --- /dev/null +++ b/chain_data/utils/fn.peer_id_from_hex.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../chain_data/fn.peer_id_from_hex.html...

+ + + \ No newline at end of file diff --git a/chain_data/utils/fn.peer_id_to_bytes.html b/chain_data/utils/fn.peer_id_to_bytes.html new file mode 100644 index 0000000000..26b4431c52 --- /dev/null +++ b/chain_data/utils/fn.peer_id_to_bytes.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../chain_data/fn.peer_id_to_bytes.html...

+ + + \ No newline at end of file diff --git a/chain_data/utils/fn.peer_id_to_hex.html b/chain_data/utils/fn.peer_id_to_hex.html new file mode 100644 index 0000000000..6f2e3a805e --- /dev/null +++ b/chain_data/utils/fn.peer_id_to_hex.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../chain_data/fn.peer_id_to_hex.html...

+ + + \ No newline at end of file diff --git a/chain_listener/all.html b/chain_listener/all.html new file mode 100644 index 0000000000..d34a8ed981 --- /dev/null +++ b/chain_listener/all.html @@ -0,0 +1 @@ +List of all items in this crate

List of all items

Structs

\ No newline at end of file diff --git a/chain_listener/event/cc_activated/struct.CommitmentActivated.html b/chain_listener/event/cc_activated/struct.CommitmentActivated.html new file mode 100644 index 0000000000..5f6d0210d0 --- /dev/null +++ b/chain_listener/event/cc_activated/struct.CommitmentActivated.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../chain_listener/struct.CommitmentActivated.html...

+ + + \ No newline at end of file diff --git a/chain_listener/event/compute_unit_matched/struct.CIDV1.html b/chain_listener/event/compute_unit_matched/struct.CIDV1.html new file mode 100644 index 0000000000..a382365079 --- /dev/null +++ b/chain_listener/event/compute_unit_matched/struct.CIDV1.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../chain_listener/struct.CIDV1.html...

+ + + \ No newline at end of file diff --git a/chain_listener/event/compute_unit_matched/struct.ComputeUnitMatched.html b/chain_listener/event/compute_unit_matched/struct.ComputeUnitMatched.html new file mode 100644 index 0000000000..6571ecdeca --- /dev/null +++ b/chain_listener/event/compute_unit_matched/struct.ComputeUnitMatched.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../chain_listener/struct.ComputeUnitMatched.html...

+ + + \ No newline at end of file diff --git a/chain_listener/event/unit_activated/struct.UnitActivated.html b/chain_listener/event/unit_activated/struct.UnitActivated.html new file mode 100644 index 0000000000..7aa44dbd41 --- /dev/null +++ b/chain_listener/event/unit_activated/struct.UnitActivated.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../chain_listener/struct.UnitActivated.html...

+ + + \ No newline at end of file diff --git a/chain_listener/event/unit_deactivated/struct.UnitDeactivated.html b/chain_listener/event/unit_deactivated/struct.UnitDeactivated.html new file mode 100644 index 0000000000..5639cce88d --- /dev/null +++ b/chain_listener/event/unit_deactivated/struct.UnitDeactivated.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../chain_listener/struct.UnitDeactivated.html...

+ + + \ No newline at end of file diff --git a/chain_listener/index.html b/chain_listener/index.html new file mode 100644 index 0000000000..9f580c3cf0 --- /dev/null +++ b/chain_listener/index.html @@ -0,0 +1,15 @@ +chain_listener - Rust

Crate chain_listener

source ·

Structs

  • @dev Emitted when a commitment is activated. Commitment can be activated only if delegator deposited collateral. +@param peerId Peer id which linked to the commitment +@param commitmentId Commitment id which activated +@param startEpoch The start epoch of the commitment +@param endEpoch The end epoch of the commitment +@param unitIds Compute unit ids which linked to the commitment +Event with signature CommitmentActivated(bytes32,bytes32,uint256,uint256,bytes32[]) and selector 0x0b0a4688a90d1b24732d05ddf4925af69f02cd7d9a921b1cdcd4a7c2b6d57d68.
  • Event with signature ComputeUnitMatched(bytes32,address,bytes32,uint256,(bytes4,bytes32)) and selector 0xb1c5a9179c3104a43de668491f14c45778f00ec34d5deee023af204820483bdb.
  • @dev Emitted when a unit activated. +Unit is activated when it returned from deal +@param commitmentId Commitment id +@param unitId Compute unit id which activated +Event with signature UnitActivated(bytes32,bytes32,uint256) and selector 0x8e4b27eeb3194deef0b3140997e6b82f53eb7350daceb9355268009b92f70add.
  • @dev Emitted when a unit deactivated. Unit is deactivated when it moved to deal +@param commitmentId Commitment id +@param unitId Compute unit id which deactivated +Event with signature UnitDeactivated(bytes32,bytes32) and selector 0xbd9cde1bbc961036d34368ae328c38917036a98eacfb025a1ff6d2c6235d0a14.
\ No newline at end of file diff --git a/chain_listener/listener/struct.ChainListener.html b/chain_listener/listener/struct.ChainListener.html new file mode 100644 index 0000000000..c596e18d83 --- /dev/null +++ b/chain_listener/listener/struct.ChainListener.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../chain_listener/struct.ChainListener.html...

+ + + \ No newline at end of file diff --git a/chain_listener/sidebar-items.js b/chain_listener/sidebar-items.js new file mode 100644 index 0000000000..b7d4bbbefa --- /dev/null +++ b/chain_listener/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":["CIDV1","ChainListener","CommitmentActivated","ComputeUnitMatched","UnitActivated","UnitDeactivated"]}; \ No newline at end of file diff --git a/chain_listener/struct.CIDV1.html b/chain_listener/struct.CIDV1.html new file mode 100644 index 0000000000..07bd462c3c --- /dev/null +++ b/chain_listener/struct.CIDV1.html @@ -0,0 +1,87 @@ +CIDV1 in chain_listener - Rust

Struct chain_listener::CIDV1

source ·
pub struct CIDV1 {
+    pub prefixes: FixedBytes<4>,
+    pub hash: FixedBytes<32>,
+}
Expand description
struct CIDV1 { bytes4 prefixes; bytes32 hash; }
+

Fields§

§prefixes: FixedBytes<4>§hash: FixedBytes<32>

Trait Implementations§

source§

impl Clone for CIDV1

source§

fn clone(&self) -> CIDV1

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl EventTopic for CIDV1

source§

fn topic_preimage_length(rust: &Self::RustType) -> usize

The number of bytes this type occupies in another topic’s preimage, +usually a multiple of 32. Read more
source§

fn encode_topic_preimage(rust: &Self::RustType, out: &mut Vec<u8>)

Encodes this type as preimage bytes which are then hashed in +complex types’ [encode_topic][EventTopic::encode_topic]. Read more
source§

fn encode_topic(rust: &Self::RustType) -> WordToken

Indexed event parameter encoding. Read more
source§

impl SolStruct for CIDV1

source§

const NAME: &'static str = "CIDV1"

The struct name. Read more
source§

fn eip712_root_type() -> Cow<'static, str>

Return the root EIP-712 type. This type is used to construct the +encodeType string.
source§

fn eip712_components() -> Vec<Cow<'static, str>>

Returns component EIP-712 types. These types are used to construct +the encodeType string. These are the types of the struct’s fields, +and should not include the root type.
source§

fn eip712_encode_type() -> Cow<'static, str>

The EIP-712-encoded type string. Read more
source§

fn eip712_encode_data(&self) -> Vec<u8>

Encodes this domain using EIP-712 encodeData.
§

fn eip712_type_hash(&self) -> FixedBytes<32>

Calculates the EIP-712 typeHash +for this struct. Read more
§

fn eip712_hash_struct(&self) -> FixedBytes<32>

Hashes this struct according to EIP-712 hashStruct.
§

fn eip712_signing_hash(&self, domain: &Eip712Domain) -> FixedBytes<32>

Does something. Read more
source§

impl SolType for CIDV1

§

type RustType = CIDV1

The corresponding Rust type.
§

type Token<'a> = <(FixedBytes<4>, FixedBytes<32>) as SolType>::Token<'a>

The corresponding ABI token type. Read more
source§

const SOL_NAME: &'static str = <Self as alloy_sol_types::SolStruct>::NAME

The name of this type in Solidity.
source§

const ENCODED_SIZE: Option<usize> = <UnderlyingSolTuple as alloy_sol_types::SolType>::ENCODED_SIZE

The statically-known ABI-encoded size of the type. Read more
source§

fn valid_token(token: &Self::Token<'_>) -> bool

Returns true if the given token can be detokenized with this type.
source§

fn detokenize(token: Self::Token<'_>) -> Self::RustType

Detokenize this type’s value from the given token. Read more
§

const DYNAMIC: bool = _

Whether the ABI-encoded size is dynamic. Read more
§

fn sol_type_name() -> Cow<'static, str>

👎Deprecated since 0.6.3: use SOL_NAME instead
Returns the name of this type in Solidity.
§

fn abi_encoded_size<E>(rust: &E) -> usizewhere + E: SolTypeValue<Self> + ?Sized,

Calculate the ABI-encoded size of the data, counting both head and tail +words. For a single-word type this will always be 32.
§

fn type_check(token: &Self::Token<'_>) -> Result<(), Error>

Returns an error if the given token cannot be detokenized with this +type.
§

fn tokenize<E>(rust: &E) -> Self::Token<'_>where + E: SolTypeValue<Self> + ?Sized,

Tokenizes the given value into this type’s token. Read more
§

fn eip712_data_word<E>(rust: &E) -> FixedBytes<32>where + E: SolTypeValue<Self> + ?Sized,

Encode this data according to EIP-712 encodeData rules, and hash it +if necessary. Read more
§

fn abi_encode_packed_to<E>(rust: &E, out: &mut Vec<u8>)where + E: SolTypeValue<Self> + ?Sized,

Non-standard Packed Mode ABI encoding. Read more
§

fn abi_encode_packed<E>(rust: &E) -> Vec<u8> where + E: SolTypeValue<Self> + ?Sized,

Non-standard Packed Mode ABI encoding. Read more
§

fn abi_encode<E>(rust: &E) -> Vec<u8> where + E: SolTypeValue<Self> + ?Sized,

Tokenizes and ABI-encodes the given value by wrapping it in a +single-element sequence. Read more
§

fn abi_encode_params<E>(rust: &E) -> Vec<u8> where + E: SolTypeValue<Self> + ?Sized, + Self::Token<'a>: for<'a> TokenSeq<'a>,

Tokenizes and ABI-encodes the given value as function parameters. Read more
§

fn abi_encode_sequence<E>(rust: &E) -> Vec<u8> where + E: SolTypeValue<Self> + ?Sized, + Self::Token<'a>: for<'a> TokenSeq<'a>,

Tokenizes and ABI-encodes the given value as a sequence. Read more
§

fn abi_decode(data: &[u8], validate: bool) -> Result<Self::RustType, Error>

Decodes this type’s value from an ABI blob by interpreting it as a +single-element sequence. Read more
§

fn abi_decode_params<'de>( + data: &'de [u8], + validate: bool +) -> Result<Self::RustType, Error>where + Self::Token<'de>: TokenSeq<'de>,

Decodes this type’s value from an ABI blob by interpreting it as +function parameters. Read more
§

fn abi_decode_sequence<'de>( + data: &'de [u8], + validate: bool +) -> Result<Self::RustType, Error>where + Self::Token<'de>: TokenSeq<'de>,

Decodes this type’s value from an ABI blob by interpreting it as a +sequence. Read more
source§

impl SolTypeValue<CIDV1> for CIDV1

source§

fn stv_to_tokens(&self) -> <Self as SolType>::Token<'_>

source§

fn stv_abi_encoded_size(&self) -> usize

source§

fn stv_eip712_data_word(&self) -> Word

source§

fn stv_abi_encode_packed_to(&self, out: &mut Vec<u8>)

source§

impl SolValue for CIDV1

§

type SolType = CIDV1

The Solidity type that this type corresponds to.
§

fn sol_name(&self) -> &'static str

The name of the associated Solidity type. Read more
§

fn sol_type_name(&self) -> Cow<'static, str>

👎Deprecated since 0.6.3: use sol_name instead
The name of the associated Solidity type. Read more
§

fn tokenize(&self) -> <Self::SolType as SolType>::Token<'_>

Tokenizes the given value into this type’s token. Read more
§

fn detokenize(token: <Self::SolType as SolType>::Token<'_>) -> Selfwhere + Self: From<<Self::SolType as SolType>::RustType>,

Detokenize a value from the given token. Read more
§

fn abi_encoded_size(&self) -> usize

Calculate the ABI-encoded size of the data. Read more
§

fn eip712_data_word(&self) -> FixedBytes<32>

Encode this data according to EIP-712 encodeData rules, and hash it +if necessary. Read more
§

fn abi_encode_packed_to(&self, out: &mut Vec<u8>)

Non-standard Packed Mode ABI encoding. Read more
§

fn abi_encode_packed(&self) -> Vec<u8>

Non-standard Packed Mode ABI encoding. Read more
§

fn abi_encode(&self) -> Vec<u8>

ABI-encodes the value. Read more
§

fn abi_encode_sequence(&self) -> Vec<u8> where + <Self::SolType as SolType>::Token<'a>: for<'a> TokenSeq<'a>,

Encodes an ABI sequence. Read more
§

fn abi_encode_params(&self) -> Vec<u8> where + <Self::SolType as SolType>::Token<'a>: for<'a> TokenSeq<'a>,

Encodes an ABI sequence suitable for function parameters. Read more
§

fn abi_decode(data: &[u8], validate: bool) -> Result<Self, Error>where + Self: From<<Self::SolType as SolType>::RustType>,

ABI-decode this type from the given data. Read more
§

fn abi_decode_params<'de>( + data: &'de [u8], + validate: bool +) -> Result<Self, Error>where + Self: From<<Self::SolType as SolType>::RustType>, + <Self::SolType as SolType>::Token<'de>: TokenSeq<'de>,

ABI-decode this type from the given data. Read more
§

fn abi_decode_sequence<'de>( + data: &'de [u8], + validate: bool +) -> Result<Self, Error>where + Self: From<<Self::SolType as SolType>::RustType>, + <Self::SolType as SolType>::Token<'de>: TokenSeq<'de>,

ABI-decode this type from the given data. Read more

Auto Trait Implementations§

§

impl RefUnwindSafe for CIDV1

§

impl Send for CIDV1

§

impl Sync for CIDV1

§

impl Unpin for CIDV1

§

impl UnwindSafe for CIDV1

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/chain_listener/struct.ChainListener.html b/chain_listener/struct.ChainListener.html new file mode 100644 index 0000000000..ac51b5129b --- /dev/null +++ b/chain_listener/struct.ChainListener.html @@ -0,0 +1,46 @@ +ChainListener in chain_listener - Rust
pub struct ChainListener { /* private fields */ }

Implementations§

source§

impl ChainListener

source

pub fn new( + chain_config: ChainConfig, + ws_client: WsClient, + listener_config: ChainListenerConfig, + host_id: PeerId, + chain_connector: Arc<dyn ChainConnector>, + core_distributor: Arc<dyn CoreDistributor>, + ccp_client: Option<CCPRpcHttpClient>, + persisted_proof_id_dir: PathBuf, + metrics: Option<ChainListenerMetrics> +) -> Self

source

pub fn start(self) -> JoinHandle<()>

source

pub async fn create_ws_client(ws_endpoint: &str) -> Result<WsClient, Error>

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/chain_listener/struct.CommitmentActivated.html b/chain_listener/struct.CommitmentActivated.html new file mode 100644 index 0000000000..d1f4123bde --- /dev/null +++ b/chain_listener/struct.CommitmentActivated.html @@ -0,0 +1,69 @@ +CommitmentActivated in chain_listener - Rust
pub struct CommitmentActivated {
+    pub peerId: FixedBytes<32>,
+    pub commitmentId: FixedBytes<32>,
+    pub startEpoch: U256,
+    pub endEpoch: U256,
+    pub unitIds: Vec<FixedBytes<32>>,
+}
Expand description

@dev Emitted when a commitment is activated. Commitment can be activated only if delegator deposited collateral. +@param peerId Peer id which linked to the commitment +@param commitmentId Commitment id which activated +@param startEpoch The start epoch of the commitment +@param endEpoch The end epoch of the commitment +@param unitIds Compute unit ids which linked to the commitment +Event with signature CommitmentActivated(bytes32,bytes32,uint256,uint256,bytes32[]) and selector 0x0b0a4688a90d1b24732d05ddf4925af69f02cd7d9a921b1cdcd4a7c2b6d57d68.

+
event CommitmentActivated(bytes32 indexed peerId, bytes32 indexed commitmentId, uint256 startEpoch, uint256 endEpoch, bytes32[] unitIds);
+

Fields§

§peerId: FixedBytes<32>§commitmentId: FixedBytes<32>§startEpoch: U256§endEpoch: U256§unitIds: Vec<FixedBytes<32>>

Trait Implementations§

source§

impl Clone for CommitmentActivated

source§

fn clone(&self) -> CommitmentActivated

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for CommitmentActivated

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<&CommitmentActivated> for LogData

source§

fn from(this: &CommitmentActivated) -> LogData

Converts to this type from the input type.
source§

impl SolEvent for CommitmentActivated

§

type DataTuple<'a> = (Uint<256>, Uint<256>, Array<FixedBytes<32>>)

The underlying tuple type which represents this event’s non-indexed +parameters. These parameters are ABI encoded and included in the log +body. Read more
§

type DataToken<'a> = <<CommitmentActivated as SolEvent>::DataTuple<'a> as SolType>::Token<'a>

The [TokenSeq] type corresponding to the tuple.
§

type TopicList = (FixedBytes<32>, FixedBytes<32>, FixedBytes<32>)

The underlying tuple type which represents this event’s topics. Read more
source§

const SIGNATURE: &'static str = "CommitmentActivated(bytes32,bytes32,uint256,uint256,bytes32[])"

The event’s ABI signature. Read more
source§

const SIGNATURE_HASH: B256 = _

The event’s ABI signature hash, or selector: keccak256(SIGNATURE) Read more
source§

const ANONYMOUS: bool = false

Whether the event is anonymous.
source§

fn new( + topics: <Self::TopicList as SolType>::RustType, + data: <Self::DataTuple<'_> as SolType>::RustType +) -> Self

Convert decoded rust data to the event type.
source§

fn tokenize_body(&self) -> Self::DataToken<'_>

Tokenize the event’s non-indexed parameters.
source§

fn topics(&self) -> <Self::TopicList as SolType>::RustType

The event’s topics.
source§

fn encode_topics_raw(&self, out: &mut [WordToken]) -> Result<()>

Encode the topics of this event into the given buffer. Read more
§

fn abi_encoded_size(&self) -> usize

The size of the ABI-encoded dynamic data in bytes.
§

fn encode_data_to(&self, out: &mut Vec<u8>)

ABI-encode the dynamic data of this event into the given buffer.
§

fn encode_data(&self) -> Vec<u8>

ABI-encode the dynamic data of this event.
§

fn encode_topics(&self) -> Vec<WordToken>

Encode the topics of this event. Read more
§

fn encode_topics_array<const LEN: usize>(&self) -> [WordToken; LEN]

Encode the topics of this event into a fixed-size array. Read more
§

fn decode_topics<I, D>( + topics: I +) -> Result<<Self::TopicList as SolType>::RustType, Error>where + I: IntoIterator<Item = D>, + D: Into<WordToken>,

Decode the topics of this event from the given data.
§

fn abi_decode_data<'a>( + data: &'a [u8], + validate: bool +) -> Result<<Self::DataTuple<'a> as SolType>::RustType, Error>

ABI-decodes the dynamic data of this event from the given buffer.
§

fn decode_raw_log<I, D>( + topics: I, + data: &[u8], + validate: bool +) -> Result<Self, Error>where + I: IntoIterator<Item = D>, + D: Into<WordToken>,

Decode the event from the given log info.
§

fn decode_log_data(log: &LogData, validate: bool) -> Result<Self, Error>

Decode the event from the given log object.
§

fn decode_log(log: &Log, validate: bool) -> Result<Log<Self>, Error>

Decode the event from the given log object.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/chain_listener/struct.ComputeUnitMatched.html b/chain_listener/struct.ComputeUnitMatched.html new file mode 100644 index 0000000000..a1795f45ef --- /dev/null +++ b/chain_listener/struct.ComputeUnitMatched.html @@ -0,0 +1,63 @@ +ComputeUnitMatched in chain_listener - Rust
pub struct ComputeUnitMatched {
+    pub peerId: FixedBytes<32>,
+    pub deal: Address,
+    pub unitId: FixedBytes<32>,
+    pub dealCreationBlock: U256,
+    pub appCID: <CIDV1 as SolType>::RustType,
+}
Expand description

Event with signature ComputeUnitMatched(bytes32,address,bytes32,uint256,(bytes4,bytes32)) and selector 0xb1c5a9179c3104a43de668491f14c45778f00ec34d5deee023af204820483bdb.

+
event ComputeUnitMatched(bytes32 indexed peerId, address deal, bytes32 unitId, uint256 dealCreationBlock, CIDV1 appCID);
+

Fields§

§peerId: FixedBytes<32>§deal: Address§unitId: FixedBytes<32>§dealCreationBlock: U256§appCID: <CIDV1 as SolType>::RustType

Trait Implementations§

source§

impl Clone for ComputeUnitMatched

source§

fn clone(&self) -> ComputeUnitMatched

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<&ComputeUnitMatched> for LogData

source§

fn from(this: &ComputeUnitMatched) -> LogData

Converts to this type from the input type.
source§

impl SolEvent for ComputeUnitMatched

§

type DataTuple<'a> = (Address, FixedBytes<32>, Uint<256>, CIDV1)

The underlying tuple type which represents this event’s non-indexed +parameters. These parameters are ABI encoded and included in the log +body. Read more
§

type DataToken<'a> = <<ComputeUnitMatched as SolEvent>::DataTuple<'a> as SolType>::Token<'a>

The [TokenSeq] type corresponding to the tuple.
§

type TopicList = (FixedBytes<32>, FixedBytes<32>)

The underlying tuple type which represents this event’s topics. Read more
source§

const SIGNATURE: &'static str = "ComputeUnitMatched(bytes32,address,bytes32,uint256,(bytes4,bytes32))"

The event’s ABI signature. Read more
source§

const SIGNATURE_HASH: B256 = _

The event’s ABI signature hash, or selector: keccak256(SIGNATURE) Read more
source§

const ANONYMOUS: bool = false

Whether the event is anonymous.
source§

fn new( + topics: <Self::TopicList as SolType>::RustType, + data: <Self::DataTuple<'_> as SolType>::RustType +) -> Self

Convert decoded rust data to the event type.
source§

fn tokenize_body(&self) -> Self::DataToken<'_>

Tokenize the event’s non-indexed parameters.
source§

fn topics(&self) -> <Self::TopicList as SolType>::RustType

The event’s topics.
source§

fn encode_topics_raw(&self, out: &mut [WordToken]) -> Result<()>

Encode the topics of this event into the given buffer. Read more
§

fn abi_encoded_size(&self) -> usize

The size of the ABI-encoded dynamic data in bytes.
§

fn encode_data_to(&self, out: &mut Vec<u8>)

ABI-encode the dynamic data of this event into the given buffer.
§

fn encode_data(&self) -> Vec<u8>

ABI-encode the dynamic data of this event.
§

fn encode_topics(&self) -> Vec<WordToken>

Encode the topics of this event. Read more
§

fn encode_topics_array<const LEN: usize>(&self) -> [WordToken; LEN]

Encode the topics of this event into a fixed-size array. Read more
§

fn decode_topics<I, D>( + topics: I +) -> Result<<Self::TopicList as SolType>::RustType, Error>where + I: IntoIterator<Item = D>, + D: Into<WordToken>,

Decode the topics of this event from the given data.
§

fn abi_decode_data<'a>( + data: &'a [u8], + validate: bool +) -> Result<<Self::DataTuple<'a> as SolType>::RustType, Error>

ABI-decodes the dynamic data of this event from the given buffer.
§

fn decode_raw_log<I, D>( + topics: I, + data: &[u8], + validate: bool +) -> Result<Self, Error>where + I: IntoIterator<Item = D>, + D: Into<WordToken>,

Decode the event from the given log info.
§

fn decode_log_data(log: &LogData, validate: bool) -> Result<Self, Error>

Decode the event from the given log object.
§

fn decode_log(log: &Log, validate: bool) -> Result<Log<Self>, Error>

Decode the event from the given log object.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/chain_listener/struct.UnitActivated.html b/chain_listener/struct.UnitActivated.html new file mode 100644 index 0000000000..bf8cd09688 --- /dev/null +++ b/chain_listener/struct.UnitActivated.html @@ -0,0 +1,65 @@ +UnitActivated in chain_listener - Rust
pub struct UnitActivated {
+    pub commitmentId: FixedBytes<32>,
+    pub unitId: FixedBytes<32>,
+    pub startEpoch: U256,
+}
Expand description

@dev Emitted when a unit activated. +Unit is activated when it returned from deal +@param commitmentId Commitment id +@param unitId Compute unit id which activated +Event with signature UnitActivated(bytes32,bytes32,uint256) and selector 0x8e4b27eeb3194deef0b3140997e6b82f53eb7350daceb9355268009b92f70add.

+
event UnitActivated(bytes32 indexed commitmentId, bytes32 indexed unitId, uint256 startEpoch);
+

Fields§

§commitmentId: FixedBytes<32>§unitId: FixedBytes<32>§startEpoch: U256

Trait Implementations§

source§

impl Clone for UnitActivated

source§

fn clone(&self) -> UnitActivated

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for UnitActivated

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<&UnitActivated> for LogData

source§

fn from(this: &UnitActivated) -> LogData

Converts to this type from the input type.
source§

impl From<UnitActivated> for PendingUnit

source§

fn from(data: UnitActivated) -> Self

Converts to this type from the input type.
source§

impl SolEvent for UnitActivated

§

type DataTuple<'a> = (Uint<256>,)

The underlying tuple type which represents this event’s non-indexed +parameters. These parameters are ABI encoded and included in the log +body. Read more
§

type DataToken<'a> = <<UnitActivated as SolEvent>::DataTuple<'a> as SolType>::Token<'a>

The [TokenSeq] type corresponding to the tuple.
§

type TopicList = (FixedBytes<32>, FixedBytes<32>, FixedBytes<32>)

The underlying tuple type which represents this event’s topics. Read more
source§

const SIGNATURE: &'static str = "UnitActivated(bytes32,bytes32,uint256)"

The event’s ABI signature. Read more
source§

const SIGNATURE_HASH: B256 = _

The event’s ABI signature hash, or selector: keccak256(SIGNATURE) Read more
source§

const ANONYMOUS: bool = false

Whether the event is anonymous.
source§

fn new( + topics: <Self::TopicList as SolType>::RustType, + data: <Self::DataTuple<'_> as SolType>::RustType +) -> Self

Convert decoded rust data to the event type.
source§

fn tokenize_body(&self) -> Self::DataToken<'_>

Tokenize the event’s non-indexed parameters.
source§

fn topics(&self) -> <Self::TopicList as SolType>::RustType

The event’s topics.
source§

fn encode_topics_raw(&self, out: &mut [WordToken]) -> Result<()>

Encode the topics of this event into the given buffer. Read more
§

fn abi_encoded_size(&self) -> usize

The size of the ABI-encoded dynamic data in bytes.
§

fn encode_data_to(&self, out: &mut Vec<u8>)

ABI-encode the dynamic data of this event into the given buffer.
§

fn encode_data(&self) -> Vec<u8>

ABI-encode the dynamic data of this event.
§

fn encode_topics(&self) -> Vec<WordToken>

Encode the topics of this event. Read more
§

fn encode_topics_array<const LEN: usize>(&self) -> [WordToken; LEN]

Encode the topics of this event into a fixed-size array. Read more
§

fn decode_topics<I, D>( + topics: I +) -> Result<<Self::TopicList as SolType>::RustType, Error>where + I: IntoIterator<Item = D>, + D: Into<WordToken>,

Decode the topics of this event from the given data.
§

fn abi_decode_data<'a>( + data: &'a [u8], + validate: bool +) -> Result<<Self::DataTuple<'a> as SolType>::RustType, Error>

ABI-decodes the dynamic data of this event from the given buffer.
§

fn decode_raw_log<I, D>( + topics: I, + data: &[u8], + validate: bool +) -> Result<Self, Error>where + I: IntoIterator<Item = D>, + D: Into<WordToken>,

Decode the event from the given log info.
§

fn decode_log_data(log: &LogData, validate: bool) -> Result<Self, Error>

Decode the event from the given log object.
§

fn decode_log(log: &Log, validate: bool) -> Result<Log<Self>, Error>

Decode the event from the given log object.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/chain_listener/struct.UnitDeactivated.html b/chain_listener/struct.UnitDeactivated.html new file mode 100644 index 0000000000..cd4074ccdf --- /dev/null +++ b/chain_listener/struct.UnitDeactivated.html @@ -0,0 +1,63 @@ +UnitDeactivated in chain_listener - Rust
pub struct UnitDeactivated {
+    pub commitmentId: FixedBytes<32>,
+    pub unitId: FixedBytes<32>,
+}
Expand description

@dev Emitted when a unit deactivated. Unit is deactivated when it moved to deal +@param commitmentId Commitment id +@param unitId Compute unit id which deactivated +Event with signature UnitDeactivated(bytes32,bytes32) and selector 0xbd9cde1bbc961036d34368ae328c38917036a98eacfb025a1ff6d2c6235d0a14.

+
event UnitDeactivated(bytes32 indexed commitmentId, bytes32 indexed unitId);
+

Fields§

§commitmentId: FixedBytes<32>§unitId: FixedBytes<32>

Trait Implementations§

source§

impl Clone for UnitDeactivated

source§

fn clone(&self) -> UnitDeactivated

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for UnitDeactivated

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<&UnitDeactivated> for LogData

source§

fn from(this: &UnitDeactivated) -> LogData

Converts to this type from the input type.
source§

impl SolEvent for UnitDeactivated

§

type DataTuple<'a> = ()

The underlying tuple type which represents this event’s non-indexed +parameters. These parameters are ABI encoded and included in the log +body. Read more
§

type DataToken<'a> = <<UnitDeactivated as SolEvent>::DataTuple<'a> as SolType>::Token<'a>

The [TokenSeq] type corresponding to the tuple.
§

type TopicList = (FixedBytes<32>, FixedBytes<32>, FixedBytes<32>)

The underlying tuple type which represents this event’s topics. Read more
source§

const SIGNATURE: &'static str = "UnitDeactivated(bytes32,bytes32)"

The event’s ABI signature. Read more
source§

const SIGNATURE_HASH: B256 = _

The event’s ABI signature hash, or selector: keccak256(SIGNATURE) Read more
source§

const ANONYMOUS: bool = false

Whether the event is anonymous.
source§

fn new( + topics: <Self::TopicList as SolType>::RustType, + data: <Self::DataTuple<'_> as SolType>::RustType +) -> Self

Convert decoded rust data to the event type.
source§

fn tokenize_body(&self) -> Self::DataToken<'_>

Tokenize the event’s non-indexed parameters.
source§

fn topics(&self) -> <Self::TopicList as SolType>::RustType

The event’s topics.
source§

fn encode_topics_raw(&self, out: &mut [WordToken]) -> Result<()>

Encode the topics of this event into the given buffer. Read more
§

fn abi_encoded_size(&self) -> usize

The size of the ABI-encoded dynamic data in bytes.
§

fn encode_data_to(&self, out: &mut Vec<u8>)

ABI-encode the dynamic data of this event into the given buffer.
§

fn encode_data(&self) -> Vec<u8>

ABI-encode the dynamic data of this event.
§

fn encode_topics(&self) -> Vec<WordToken>

Encode the topics of this event. Read more
§

fn encode_topics_array<const LEN: usize>(&self) -> [WordToken; LEN]

Encode the topics of this event into a fixed-size array. Read more
§

fn decode_topics<I, D>( + topics: I +) -> Result<<Self::TopicList as SolType>::RustType, Error>where + I: IntoIterator<Item = D>, + D: Into<WordToken>,

Decode the topics of this event from the given data.
§

fn abi_decode_data<'a>( + data: &'a [u8], + validate: bool +) -> Result<<Self::DataTuple<'a> as SolType>::RustType, Error>

ABI-decodes the dynamic data of this event from the given buffer.
§

fn decode_raw_log<I, D>( + topics: I, + data: &[u8], + validate: bool +) -> Result<Self, Error>where + I: IntoIterator<Item = D>, + D: Into<WordToken>,

Decode the event from the given log info.
§

fn decode_log_data(log: &LogData, validate: bool) -> Result<Self, Error>

Decode the event from the given log object.
§

fn decode_log(log: &Log, validate: bool) -> Result<Log<Self>, Error>

Decode the event from the given log object.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/cid_utils/all.html b/cid_utils/all.html new file mode 100644 index 0000000000..380370aa41 --- /dev/null +++ b/cid_utils/all.html @@ -0,0 +1 @@ +List of all items in this crate

List of all items

Structs

\ No newline at end of file diff --git a/cid_utils/hash/struct.Hash.html b/cid_utils/hash/struct.Hash.html new file mode 100644 index 0000000000..26041307f9 --- /dev/null +++ b/cid_utils/hash/struct.Hash.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../cid_utils/struct.Hash.html...

+ + + \ No newline at end of file diff --git a/cid_utils/index.html b/cid_utils/index.html new file mode 100644 index 0000000000..0d6914fc6b --- /dev/null +++ b/cid_utils/index.html @@ -0,0 +1,2 @@ +cid_utils - Rust

Crate cid_utils

source ·

Structs

\ No newline at end of file diff --git a/cid_utils/sidebar-items.js b/cid_utils/sidebar-items.js new file mode 100644 index 0000000000..780b53725e --- /dev/null +++ b/cid_utils/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":["Hash"]}; \ No newline at end of file diff --git a/cid_utils/struct.Hash.html b/cid_utils/struct.Hash.html new file mode 100644 index 0000000000..baa0b915c8 --- /dev/null +++ b/cid_utils/struct.Hash.html @@ -0,0 +1,29 @@ +Hash in cid_utils - Rust

Struct cid_utils::Hash

source ·
pub struct Hash(pub Cid);

Tuple Fields§

§0: Cid

Implementations§

source§

impl Hash

source

pub fn new(bytes: &[u8]) -> Result<Self>

source

pub fn as_bytes(&self) -> Vec<u8>

source

pub fn from_string(s: &str) -> Result<Self, Error>

Trait Implementations§

source§

impl Clone for Hash

source§

fn clone(&self) -> Hash

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Hash

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for Hash

source§

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where + D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Display for Hash

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Hash for Hash

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for Hash

source§

fn eq(&self, other: &Hash) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Serialize for Hash

source§

fn serialize<S>( + &self, + s: S +) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where + S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Eq for Hash

source§

impl StructuralEq for Hash

source§

impl StructuralPartialEq for Hash

Auto Trait Implementations§

§

impl RefUnwindSafe for Hash

§

impl Send for Hash

§

impl Sync for Hash

§

impl Unpin for Hash

§

impl UnwindSafe for Hash

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> DeserializeOwned for Twhere + T: for<'de> Deserialize<'de>,

\ No newline at end of file diff --git a/config_utils/all.html b/config_utils/all.html new file mode 100644 index 0000000000..73b1bd1d57 --- /dev/null +++ b/config_utils/all.html @@ -0,0 +1 @@ +List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/config_utils/config/fn.blueprint_dir.html b/config_utils/config/fn.blueprint_dir.html new file mode 100644 index 0000000000..b4104d766f --- /dev/null +++ b/config_utils/config/fn.blueprint_dir.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../config_utils/fn.blueprint_dir.html...

+ + + \ No newline at end of file diff --git a/config_utils/config/fn.modules_dir.html b/config_utils/config/fn.modules_dir.html new file mode 100644 index 0000000000..8565f4b219 --- /dev/null +++ b/config_utils/config/fn.modules_dir.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../config_utils/fn.modules_dir.html...

+ + + \ No newline at end of file diff --git a/config_utils/config/fn.particles_anomaly_dir.html b/config_utils/config/fn.particles_anomaly_dir.html new file mode 100644 index 0000000000..8423b8cf56 --- /dev/null +++ b/config_utils/config/fn.particles_anomaly_dir.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../config_utils/fn.particles_anomaly_dir.html...

+ + + \ No newline at end of file diff --git a/config_utils/config/fn.particles_dir.html b/config_utils/config/fn.particles_dir.html new file mode 100644 index 0000000000..c6cefd2896 --- /dev/null +++ b/config_utils/config/fn.particles_dir.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../config_utils/fn.particles_dir.html...

+ + + \ No newline at end of file diff --git a/config_utils/config/fn.particles_vault_dir.html b/config_utils/config/fn.particles_vault_dir.html new file mode 100644 index 0000000000..75b9fb9cf7 --- /dev/null +++ b/config_utils/config/fn.particles_vault_dir.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../config_utils/fn.particles_vault_dir.html...

+ + + \ No newline at end of file diff --git a/config_utils/config/fn.services_dir.html b/config_utils/config/fn.services_dir.html new file mode 100644 index 0000000000..7f3234f08c --- /dev/null +++ b/config_utils/config/fn.services_dir.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../config_utils/fn.services_dir.html...

+ + + \ No newline at end of file diff --git a/config_utils/config/fn.to_peer_id.html b/config_utils/config/fn.to_peer_id.html new file mode 100644 index 0000000000..5784758595 --- /dev/null +++ b/config_utils/config/fn.to_peer_id.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../config_utils/fn.to_peer_id.html...

+ + + \ No newline at end of file diff --git a/config_utils/config/fn.workdir.html b/config_utils/config/fn.workdir.html new file mode 100644 index 0000000000..e0d09d39fe --- /dev/null +++ b/config_utils/config/fn.workdir.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../config_utils/fn.workdir.html...

+ + + \ No newline at end of file diff --git a/config_utils/fn.blueprint_dir.html b/config_utils/fn.blueprint_dir.html new file mode 100644 index 0000000000..ff5dba6ca2 --- /dev/null +++ b/config_utils/fn.blueprint_dir.html @@ -0,0 +1 @@ +blueprint_dir in config_utils - Rust
pub fn blueprint_dir(base_dir: &Path) -> PathBuf
\ No newline at end of file diff --git a/config_utils/fn.modules_dir.html b/config_utils/fn.modules_dir.html new file mode 100644 index 0000000000..6b9eaad2ab --- /dev/null +++ b/config_utils/fn.modules_dir.html @@ -0,0 +1 @@ +modules_dir in config_utils - Rust

Function config_utils::modules_dir

source ·
pub fn modules_dir(base_dir: &Path) -> PathBuf
\ No newline at end of file diff --git a/config_utils/fn.particles_anomaly_dir.html b/config_utils/fn.particles_anomaly_dir.html new file mode 100644 index 0000000000..d20b731baa --- /dev/null +++ b/config_utils/fn.particles_anomaly_dir.html @@ -0,0 +1 @@ +particles_anomaly_dir in config_utils - Rust
pub fn particles_anomaly_dir(base_dir: &Path) -> PathBuf
\ No newline at end of file diff --git a/config_utils/fn.particles_dir.html b/config_utils/fn.particles_dir.html new file mode 100644 index 0000000000..062c0e39f0 --- /dev/null +++ b/config_utils/fn.particles_dir.html @@ -0,0 +1 @@ +particles_dir in config_utils - Rust
pub fn particles_dir(base_dir: &Path) -> PathBuf
\ No newline at end of file diff --git a/config_utils/fn.particles_vault_dir.html b/config_utils/fn.particles_vault_dir.html new file mode 100644 index 0000000000..ffe1520bc7 --- /dev/null +++ b/config_utils/fn.particles_vault_dir.html @@ -0,0 +1 @@ +particles_vault_dir in config_utils - Rust
pub fn particles_vault_dir(base_dir: &Path) -> PathBuf
\ No newline at end of file diff --git a/config_utils/fn.services_dir.html b/config_utils/fn.services_dir.html new file mode 100644 index 0000000000..a229226373 --- /dev/null +++ b/config_utils/fn.services_dir.html @@ -0,0 +1 @@ +services_dir in config_utils - Rust

Function config_utils::services_dir

source ·
pub fn services_dir(base_dir: &Path) -> PathBuf
\ No newline at end of file diff --git a/config_utils/fn.to_peer_id.html b/config_utils/fn.to_peer_id.html new file mode 100644 index 0000000000..15ed16e2e9 --- /dev/null +++ b/config_utils/fn.to_peer_id.html @@ -0,0 +1 @@ +to_peer_id in config_utils - Rust

Function config_utils::to_peer_id

source ·
pub fn to_peer_id(kp: &Keypair) -> PeerId
\ No newline at end of file diff --git a/config_utils/fn.workdir.html b/config_utils/fn.workdir.html new file mode 100644 index 0000000000..31faa66c91 --- /dev/null +++ b/config_utils/fn.workdir.html @@ -0,0 +1 @@ +workdir in config_utils - Rust

Function config_utils::workdir

source ·
pub fn workdir(base_dir: &Path) -> PathBuf
\ No newline at end of file diff --git a/config_utils/index.html b/config_utils/index.html new file mode 100644 index 0000000000..44b1a43408 --- /dev/null +++ b/config_utils/index.html @@ -0,0 +1,2 @@ +config_utils - Rust

Crate config_utils

source ·

Functions

\ No newline at end of file diff --git a/config_utils/sidebar-items.js b/config_utils/sidebar-items.js new file mode 100644 index 0000000000..2371cd4ad9 --- /dev/null +++ b/config_utils/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"fn":["blueprint_dir","modules_dir","particles_anomaly_dir","particles_dir","particles_vault_dir","services_dir","to_peer_id","workdir"]}; \ No newline at end of file diff --git a/connected_client/all.html b/connected_client/all.html new file mode 100644 index 0000000000..65c4ebc79e --- /dev/null +++ b/connected_client/all.html @@ -0,0 +1 @@ +List of all items in this crate

List of all items

Structs

Enums

\ No newline at end of file diff --git a/connected_client/command/enum.ClientCommand.html b/connected_client/command/enum.ClientCommand.html new file mode 100644 index 0000000000..0022368852 --- /dev/null +++ b/connected_client/command/enum.ClientCommand.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../connected_client/enum.ClientCommand.html...

+ + + \ No newline at end of file diff --git a/connected_client/connected_client/struct.ConnectedClient.html b/connected_client/connected_client/struct.ConnectedClient.html new file mode 100644 index 0000000000..1ab0c6f8e1 --- /dev/null +++ b/connected_client/connected_client/struct.ConnectedClient.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../connected_client/struct.ConnectedClient.html...

+ + + \ No newline at end of file diff --git a/connected_client/enum.ClientCommand.html b/connected_client/enum.ClientCommand.html new file mode 100644 index 0000000000..5ea25c5b04 --- /dev/null +++ b/connected_client/enum.ClientCommand.html @@ -0,0 +1,43 @@ +ClientCommand in connected_client - Rust
pub enum ClientCommand {
+    Particle {
+        particle: Particle,
+    },
+}
Expand description

Describes commands sent from client to relay node; also see ToNodeNetworkMsg

+

Variants§

§

Particle

Fields

§particle: Particle

Trait Implementations§

source§

impl Clone for ClientCommand

source§

fn clone(&self) -> ClientCommand

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ClientCommand

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for ClientCommand

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl From<ClientCommand> for Particle

source§

fn from(command: ClientCommand) -> Particle

Converts to this type from the input type.
source§

impl Serialize for ClientCommand

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
source§

impl<T> DeserializeOwned for Twhere + T: for<'de> Deserialize<'de>,

\ No newline at end of file diff --git a/connected_client/enum.ClientEvent.html b/connected_client/enum.ClientEvent.html new file mode 100644 index 0000000000..2d0ba9baab --- /dev/null +++ b/connected_client/enum.ClientEvent.html @@ -0,0 +1,43 @@ +ClientEvent in connected_client - Rust
pub enum ClientEvent {
+    Particle {
+        sender: PeerId,
+        particle: Particle,
+    },
+    NewConnection {
+        peer_id: PeerId,
+        multiaddr: Multiaddr,
+    },
+}

Variants§

§

Particle

Fields

§sender: PeerId
§particle: Particle
§

NewConnection

Fields

§peer_id: PeerId
§multiaddr: Multiaddr

Trait Implementations§

source§

impl Debug for ClientEvent

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/connected_client/event/enum.ClientEvent.html b/connected_client/event/enum.ClientEvent.html new file mode 100644 index 0000000000..f1d5249858 --- /dev/null +++ b/connected_client/event/enum.ClientEvent.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../connected_client/enum.ClientEvent.html...

+ + + \ No newline at end of file diff --git a/connected_client/index.html b/connected_client/index.html new file mode 100644 index 0000000000..c776b292e9 --- /dev/null +++ b/connected_client/index.html @@ -0,0 +1,2 @@ +connected_client - Rust

Crate connected_client

source ·

Structs

Enums

\ No newline at end of file diff --git a/connected_client/sidebar-items.js b/connected_client/sidebar-items.js new file mode 100644 index 0000000000..0585d7b7b3 --- /dev/null +++ b/connected_client/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["ClientCommand","ClientEvent"],"struct":["ConnectedClient"]}; \ No newline at end of file diff --git a/connected_client/struct.ConnectedClient.html b/connected_client/struct.ConnectedClient.html new file mode 100644 index 0000000000..6c3203b84b --- /dev/null +++ b/connected_client/struct.ConnectedClient.html @@ -0,0 +1,85 @@ +ConnectedClient in connected_client - Rust
pub struct ConnectedClient {
+    pub client: Client,
+    pub node: PeerId,
+    pub node_address: Multiaddr,
+    pub timeout: Duration,
+    pub short_timeout: Duration,
+    pub local_vm: OnceCell<Mutex<AVMRunner<WasmtimeWasmBackend>>>,
+    pub data_store: Arc<ParticleDataStore>,
+    pub particle_ttl: Duration,
+    pub tmp_dir: TempDir,
+}

Fields§

§client: Client§node: PeerId§node_address: Multiaddr§timeout: Duration§short_timeout: Duration§local_vm: OnceCell<Mutex<AVMRunner<WasmtimeWasmBackend>>>§data_store: Arc<ParticleDataStore>§particle_ttl: Duration§tmp_dir: TempDir

Implementations§

source§

impl ConnectedClient

source

pub fn timeout(&self) -> Duration

source

pub fn short_timeout(&self) -> Duration

source

pub fn particle_ttl(&self) -> Duration

source

pub fn set_particle_ttl(&mut self, particle_ttl: Duration)

source§

impl ConnectedClient

source

pub async fn connect_to(node_address: Multiaddr) -> Result<Self>

source

pub async fn connect_to_with_timeout( + node_address: Multiaddr, + timeout: Duration, + idle_connection_timeout: Duration, + particle_ttl: Option<Duration> +) -> Result<Self>

source

pub async fn connect_with_keypair( + node_address: Multiaddr, + key_pair: Option<KeyPair> +) -> Result<Self>

source

pub async fn connect_with_timeout( + node_address: Multiaddr, + key_pair: Option<KeyPair>, + timeout: Duration, + idle_connection_timeout: Duration, + particle_ttl: Option<Duration>, + reconnect_enabled: bool +) -> Result<Self>

source

pub async fn get_local_vm(&self) -> &Mutex<AVMRunner<WasmtimeWasmBackend>>

source

pub fn get_data_store(&self) -> Arc<ParticleDataStore>

source

pub async fn new( + client: Client, + node: PeerId, + node_address: Multiaddr, + particle_ttl: Option<Duration> +) -> Self

source

pub async fn send(&self, particle: Particle)

source

pub async fn send_particle( + &mut self, + script: impl Into<String>, + data: HashMap<&str, JValue> +) -> String

source

pub async fn execute_particle( + &mut self, + script: impl Into<String>, + data: HashMap<&str, JValue> +) -> Result<Vec<JValue>>

source

pub async fn send_particle_ext( + &mut self, + script: impl Into<String>, + data: HashMap<&str, JValue>, + generated: bool +) -> String

source

pub async fn maybe_receive(&mut self) -> Option<Particle>

source

pub async fn receive(&mut self) -> Result<Particle>

source

pub async fn receive_args(&mut self) -> Result<Vec<JValue>>

source

pub async fn wait_particle_args( + &mut self, + particle_id: impl AsRef<str> +) -> Result<Vec<JValue>>

Wait for a particle with specified particle_id, and read “op” “return” result from it

+
source

pub async fn listen_for_n<O: Default, F: Fn(Result<Vec<JValue>, Vec<JValue>>) -> O>( + &mut self, + n: usize, + f: F +) -> O

Trait Implementations§

source§

impl Deref for ConnectedClient

§

type Target = Client

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl DerefMut for ConnectedClient

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/connection_pool/all.html b/connection_pool/all.html new file mode 100644 index 0000000000..af9ae97300 --- /dev/null +++ b/connection_pool/all.html @@ -0,0 +1 @@ +List of all items in this crate

List of all items

Structs

Enums

Traits

\ No newline at end of file diff --git a/connection_pool/api/enum.Command.html b/connection_pool/api/enum.Command.html new file mode 100644 index 0000000000..3e96e86264 --- /dev/null +++ b/connection_pool/api/enum.Command.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../connection_pool/enum.Command.html...

+ + + \ No newline at end of file diff --git a/connection_pool/api/struct.ConnectionPoolApi.html b/connection_pool/api/struct.ConnectionPoolApi.html new file mode 100644 index 0000000000..644ff90c24 --- /dev/null +++ b/connection_pool/api/struct.ConnectionPoolApi.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../connection_pool/struct.ConnectionPoolApi.html...

+ + + \ No newline at end of file diff --git a/connection_pool/behaviour/struct.ConnectionPoolBehaviour.html b/connection_pool/behaviour/struct.ConnectionPoolBehaviour.html new file mode 100644 index 0000000000..4dd6a18e7c --- /dev/null +++ b/connection_pool/behaviour/struct.ConnectionPoolBehaviour.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../connection_pool/struct.ConnectionPoolBehaviour.html...

+ + + \ No newline at end of file diff --git a/connection_pool/connection_pool/enum.LifecycleEvent.html b/connection_pool/connection_pool/enum.LifecycleEvent.html new file mode 100644 index 0000000000..be107b00f3 --- /dev/null +++ b/connection_pool/connection_pool/enum.LifecycleEvent.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../connection_pool/enum.LifecycleEvent.html...

+ + + \ No newline at end of file diff --git a/connection_pool/connection_pool/trait.ConnectionPoolT.html b/connection_pool/connection_pool/trait.ConnectionPoolT.html new file mode 100644 index 0000000000..a07605c948 --- /dev/null +++ b/connection_pool/connection_pool/trait.ConnectionPoolT.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../connection_pool/trait.ConnectionPoolT.html...

+ + + \ No newline at end of file diff --git a/connection_pool/enum.Command.html b/connection_pool/enum.Command.html new file mode 100644 index 0000000000..7cfd3e0bb1 --- /dev/null +++ b/connection_pool/enum.Command.html @@ -0,0 +1,62 @@ +Command in connection_pool - Rust
pub enum Command {
+    Connect {
+        contact: Contact,
+        out: Sender<bool>,
+    },
+    Send {
+        to: Contact,
+        particle: ExtendedParticle,
+        out: Sender<SendStatus>,
+    },
+    Dial {
+        addr: Multiaddr,
+        out: Sender<Option<Contact>>,
+    },
+    Disconnect {
+        peer_id: PeerId,
+        out: Sender<bool>,
+    },
+    IsConnected {
+        peer_id: PeerId,
+        out: Sender<bool>,
+    },
+    GetContact {
+        peer_id: PeerId,
+        out: Sender<Option<Contact>>,
+    },
+    CountConnections {
+        out: Sender<usize>,
+    },
+    LifecycleEvents {
+        out: UnboundedSender<LifecycleEvent>,
+    },
+}

Variants§

§

Connect

Fields

§contact: Contact
§out: Sender<bool>
§

Send

Fields

§out: Sender<SendStatus>
§

Dial

Fields

§addr: Multiaddr
§out: Sender<Option<Contact>>
§

Disconnect

Fields

§peer_id: PeerId
§out: Sender<bool>
§

IsConnected

Fields

§peer_id: PeerId
§out: Sender<bool>
§

GetContact

Fields

§peer_id: PeerId
§out: Sender<Option<Contact>>
§

CountConnections

Fields

§out: Sender<usize>
§

LifecycleEvents

Fields

§out: UnboundedSender<LifecycleEvent>

Trait Implementations§

source§

impl Debug for Command

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/connection_pool/enum.LifecycleEvent.html b/connection_pool/enum.LifecycleEvent.html new file mode 100644 index 0000000000..695a193480 --- /dev/null +++ b/connection_pool/enum.LifecycleEvent.html @@ -0,0 +1,35 @@ +LifecycleEvent in connection_pool - Rust
pub enum LifecycleEvent {
+    Connected(Contact),
+    Disconnected(Contact),
+}

Variants§

§

Connected(Contact)

§

Disconnected(Contact)

Trait Implementations§

source§

impl Clone for LifecycleEvent

source§

fn clone(&self) -> LifecycleEvent

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for LifecycleEvent

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for LifecycleEvent

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/connection_pool/index.html b/connection_pool/index.html new file mode 100644 index 0000000000..4b68007587 --- /dev/null +++ b/connection_pool/index.html @@ -0,0 +1,2 @@ +connection_pool - Rust

Crate connection_pool

source ·

Structs

Enums

Traits

\ No newline at end of file diff --git a/connection_pool/sidebar-items.js b/connection_pool/sidebar-items.js new file mode 100644 index 0000000000..18d5839a7b --- /dev/null +++ b/connection_pool/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["Command","LifecycleEvent"],"struct":["ConnectionPoolApi","ConnectionPoolBehaviour"],"trait":["ConnectionPoolT"]}; \ No newline at end of file diff --git a/connection_pool/struct.ConnectionPoolApi.html b/connection_pool/struct.ConnectionPoolApi.html new file mode 100644 index 0000000000..84062ca0fa --- /dev/null +++ b/connection_pool/struct.ConnectionPoolApi.html @@ -0,0 +1,38 @@ +ConnectionPoolApi in connection_pool - Rust
pub struct ConnectionPoolApi {
+    pub outlet: UnboundedSender<Command>,
+    pub send_timeout: Duration,
+}

Fields§

§outlet: UnboundedSender<Command>§send_timeout: Duration

Trait Implementations§

source§

impl Clone for ConnectionPoolApi

source§

fn clone(&self) -> ConnectionPoolApi

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl ConnectionPoolT for ConnectionPoolApi

source§

fn dial(&self, addr: Multiaddr) -> BoxFuture<'static, Option<Contact>>

source§

fn connect(&self, contact: Contact) -> BoxFuture<'static, bool>

source§

fn disconnect(&self, peer_id: PeerId) -> BoxFuture<'static, bool>

source§

fn is_connected(&self, peer_id: PeerId) -> BoxFuture<'static, bool>

source§

fn get_contact(&self, peer_id: PeerId) -> BoxFuture<'static, Option<Contact>>

source§

fn send( + &self, + to: Contact, + particle: ExtendedParticle +) -> BoxFuture<'static, SendStatus>

source§

fn count_connections(&self) -> BoxFuture<'static, usize>

source§

fn lifecycle_events(&self) -> BoxStream<'static, LifecycleEvent>

source§

impl Debug for ConnectionPoolApi

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/connection_pool/struct.ConnectionPoolBehaviour.html b/connection_pool/struct.ConnectionPoolBehaviour.html new file mode 100644 index 0000000000..e5f9d313ed --- /dev/null +++ b/connection_pool/struct.ConnectionPoolBehaviour.html @@ -0,0 +1,84 @@ +ConnectionPoolBehaviour in connection_pool - Rust
pub struct ConnectionPoolBehaviour { /* private fields */ }

Implementations§

source§

impl ConnectionPoolBehaviour

source

pub fn dial(&mut self, address: Multiaddr, out: Sender<Option<Contact>>)

Dial address, and send contact back on success +None means something prevented us from connecting - dial reach failure or something else

+
source

pub fn connect(&mut self, new_contact: Contact, outlet: Sender<bool>)

Connect to the contact by all of its known addresses and return whether connection succeeded +If contact is already being dialed and there are no new addresses in Contact, don’t dial +If contact is already connected, return true immediately

+
source

pub fn disconnect(&mut self, peer_id: PeerId, outlet: Sender<bool>)

source

pub fn is_connected(&self, peer_id: PeerId, outlet: Sender<bool>)

Returns whether given peer is connected or not

+
source

pub fn get_contact(&self, peer_id: PeerId, outlet: Sender<Option<Contact>>)

Returns contact for a given peer if it is known

+
source

pub fn send( + &mut self, + to: Contact, + particle: ExtendedParticle, + outlet: Sender<SendStatus> +)

Sends a particle to a connected contact. Returns whether sending succeeded or not +Result is sent to channel inside upgrade_outbound in ProtocolHandler

+
source

pub fn count_connections(&mut self, outlet: Sender<usize>)

Returns number of connected contacts

+
source

pub fn add_subscriber(&mut self, outlet: UnboundedSender<LifecycleEvent>)

Subscribes given channel for all LifecycleEvents

+
source

pub fn add_discovered_addresses( + &mut self, + peer_id: PeerId, + addresses: Vec<Multiaddr> +)

source§

impl ConnectionPoolBehaviour

source

pub fn new( + buffer: usize, + protocol_config: ProtocolConfig, + peer_id: PeerId, + metrics: Option<ConnectionPoolMetrics> +) -> (Self, Receiver<ExtendedParticle>, ConnectionPoolApi)

Trait Implementations§

source§

impl NetworkBehaviour for ConnectionPoolBehaviour

§

type ConnectionHandler = OneShotHandler<ProtocolConfig, HandlerMessage, HandlerMessage>

Handler for all the protocols the network behaviour supports.
§

type ToSwarm = ()

Event generated by the NetworkBehaviour and that the swarm will report back.
source§

fn handle_pending_inbound_connection( + &mut self, + _connection_id: ConnectionId, + _local_addr: &Multiaddr, + _remote_addr: &Multiaddr +) -> Result<(), ConnectionDenied>

Callback that is invoked for every new inbound connection. Read more
source§

fn handle_established_inbound_connection( + &mut self, + _connection_id: ConnectionId, + peer_id: PeerId, + _local_addr: &Multiaddr, + remote_addr: &Multiaddr +) -> Result<THandler<Self>, ConnectionDenied>

Callback that is invoked for every established inbound connection. Read more
source§

fn handle_pending_outbound_connection( + &mut self, + _connection_id: ConnectionId, + maybe_peer: Option<PeerId>, + _addresses: &[Multiaddr], + _effective_role: Endpoint +) -> Result<Vec<Multiaddr>, ConnectionDenied>

Callback that is invoked for every outbound connection attempt. Read more
source§

fn handle_established_outbound_connection( + &mut self, + _connection_id: ConnectionId, + peer_id: PeerId, + addr: &Multiaddr, + _role_override: Endpoint +) -> Result<THandler<Self>, ConnectionDenied>

Callback that is invoked for every established outbound connection. Read more
source§

fn on_swarm_event(&mut self, event: FromSwarm<'_>)

Informs the behaviour about an event from the Swarm.
source§

fn on_connection_handler_event( + &mut self, + from: PeerId, + _connection_id: ConnectionId, + event: THandlerOutEvent<Self> +)

Informs the behaviour about an event generated by the [ConnectionHandler] +dedicated to the peer identified by peer_id. for the behaviour. Read more
source§

fn poll(&mut self, cx: &mut Context<'_>) -> Poll<ToSwarm<(), HandlerMessage>>

Polls for things that swarm should do. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/connection_pool/trait.ConnectionPoolT.html b/connection_pool/trait.ConnectionPoolT.html new file mode 100644 index 0000000000..6718be8e1d --- /dev/null +++ b/connection_pool/trait.ConnectionPoolT.html @@ -0,0 +1,22 @@ +ConnectionPoolT in connection_pool - Rust
pub trait ConnectionPoolT {
+    // Required methods
+    fn dial(&self, addr: Multiaddr) -> BoxFuture<'static, Option<Contact>>;
+    fn connect(&self, contact: Contact) -> BoxFuture<'static, bool>;
+    fn disconnect(&self, peer_id: PeerId) -> BoxFuture<'static, bool>;
+    fn is_connected(&self, peer_id: PeerId) -> BoxFuture<'static, bool>;
+    fn get_contact(
+        &self,
+        peer_id: PeerId
+    ) -> BoxFuture<'static, Option<Contact>>;
+    fn send(
+        &self,
+        to: Contact,
+        particle: ExtendedParticle
+    ) -> BoxFuture<'static, SendStatus>;
+    fn count_connections(&self) -> BoxFuture<'static, usize>;
+    fn lifecycle_events(&self) -> BoxStream<'static, LifecycleEvent>;
+}

Required Methods§

source

fn dial(&self, addr: Multiaddr) -> BoxFuture<'static, Option<Contact>>

source

fn connect(&self, contact: Contact) -> BoxFuture<'static, bool>

source

fn disconnect(&self, peer_id: PeerId) -> BoxFuture<'static, bool>

source

fn is_connected(&self, peer_id: PeerId) -> BoxFuture<'static, bool>

source

fn get_contact(&self, peer_id: PeerId) -> BoxFuture<'static, Option<Contact>>

source

fn send( + &self, + to: Contact, + particle: ExtendedParticle +) -> BoxFuture<'static, SendStatus>

source

fn count_connections(&self) -> BoxFuture<'static, usize>

source

fn lifecycle_events(&self) -> BoxStream<'static, LifecycleEvent>

Implementors§

\ No newline at end of file diff --git a/control_macro/all.html b/control_macro/all.html new file mode 100644 index 0000000000..66bf83db4d --- /dev/null +++ b/control_macro/all.html @@ -0,0 +1 @@ +List of all items in this crate

List of all items

Macros

\ No newline at end of file diff --git a/control_macro/index.html b/control_macro/index.html new file mode 100644 index 0000000000..5fc31ab2e5 --- /dev/null +++ b/control_macro/index.html @@ -0,0 +1,3 @@ +control_macro - Rust

Crate control_macro

source ·

Macros

  • Retrieves value from Some, returns on None
  • Takes option as an argument, unwraps if Some, exit function with Ok(default) otherwise +Ought to make it easier to short-circuit in functions returning Result<Option<_>>
  • Retrieves value from Some, returns on None
\ No newline at end of file diff --git a/control_macro/macro.get_return!.html b/control_macro/macro.get_return!.html new file mode 100644 index 0000000000..f6a1672e73 --- /dev/null +++ b/control_macro/macro.get_return!.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to macro.get_return.html...

+ + + \ No newline at end of file diff --git a/control_macro/macro.get_return.html b/control_macro/macro.get_return.html new file mode 100644 index 0000000000..7a745e831d --- /dev/null +++ b/control_macro/macro.get_return.html @@ -0,0 +1,4 @@ +get_return in control_macro - Rust
macro_rules! get_return {
+    ($opt:expr) => { ... };
+}
Expand description

Retrieves value from Some, returns on None

+
\ No newline at end of file diff --git a/control_macro/macro.measure!.html b/control_macro/macro.measure!.html new file mode 100644 index 0000000000..b42570df05 --- /dev/null +++ b/control_macro/macro.measure!.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to macro.measure.html...

+ + + \ No newline at end of file diff --git a/control_macro/macro.measure.html b/control_macro/macro.measure.html new file mode 100644 index 0000000000..8db3e82f6a --- /dev/null +++ b/control_macro/macro.measure.html @@ -0,0 +1,3 @@ +measure in control_macro - Rust
macro_rules! measure {
+    ($val:expr) => { ... };
+}
\ No newline at end of file diff --git a/control_macro/macro.ok_get!.html b/control_macro/macro.ok_get!.html new file mode 100644 index 0000000000..991497b3ac --- /dev/null +++ b/control_macro/macro.ok_get!.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to macro.ok_get.html...

+ + + \ No newline at end of file diff --git a/control_macro/macro.ok_get.html b/control_macro/macro.ok_get.html new file mode 100644 index 0000000000..eb5e8812a2 --- /dev/null +++ b/control_macro/macro.ok_get.html @@ -0,0 +1,5 @@ +ok_get in control_macro - Rust

Macro control_macro::ok_get

source ·
macro_rules! ok_get {
+    ($opt:expr) => { ... };
+}
Expand description

Takes option as an argument, unwraps if Some, exit function with Ok(default) otherwise +Ought to make it easier to short-circuit in functions returning Result<Option<_>>

+
\ No newline at end of file diff --git a/control_macro/macro.unwrap_return!.html b/control_macro/macro.unwrap_return!.html new file mode 100644 index 0000000000..f51074e1d9 --- /dev/null +++ b/control_macro/macro.unwrap_return!.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to macro.unwrap_return.html...

+ + + \ No newline at end of file diff --git a/control_macro/macro.unwrap_return.html b/control_macro/macro.unwrap_return.html new file mode 100644 index 0000000000..b53bb23894 --- /dev/null +++ b/control_macro/macro.unwrap_return.html @@ -0,0 +1,4 @@ +unwrap_return in control_macro - Rust
macro_rules! unwrap_return {
+    ($opt:expr, $alternative:expr) => { ... };
+}
Expand description

Retrieves value from Some, returns on None

+
\ No newline at end of file diff --git a/control_macro/sidebar-items.js b/control_macro/sidebar-items.js new file mode 100644 index 0000000000..e69293e13b --- /dev/null +++ b/control_macro/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"macro":["get_return","measure","ok_get","unwrap_return"]}; \ No newline at end of file diff --git a/core_distributor/all.html b/core_distributor/all.html new file mode 100644 index 0000000000..55dfe8315e --- /dev/null +++ b/core_distributor/all.html @@ -0,0 +1 @@ +List of all items in this crate

List of all items

Structs

Enums

Traits

Type Aliases

\ No newline at end of file diff --git a/core_distributor/core_range/struct.CoreRange.html b/core_distributor/core_range/struct.CoreRange.html new file mode 100644 index 0000000000..bbe6a0c1f5 --- /dev/null +++ b/core_distributor/core_range/struct.CoreRange.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../core_distributor/struct.CoreRange.html...

+ + + \ No newline at end of file diff --git a/core_distributor/distributor/struct.PersistentCoreDistributor.html b/core_distributor/distributor/struct.PersistentCoreDistributor.html new file mode 100644 index 0000000000..203ca0c072 --- /dev/null +++ b/core_distributor/distributor/struct.PersistentCoreDistributor.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../core_distributor/struct.PersistentCoreDistributor.html...

+ + + \ No newline at end of file diff --git a/core_distributor/distributor/trait.CoreDistributor.html b/core_distributor/distributor/trait.CoreDistributor.html new file mode 100644 index 0000000000..8e3cda0d5e --- /dev/null +++ b/core_distributor/distributor/trait.CoreDistributor.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../core_distributor/trait.CoreDistributor.html...

+ + + \ No newline at end of file diff --git a/core_distributor/dummy/index.html b/core_distributor/dummy/index.html new file mode 100644 index 0000000000..ef56de6548 --- /dev/null +++ b/core_distributor/dummy/index.html @@ -0,0 +1 @@ +core_distributor::dummy - Rust

Module core_distributor::dummy

source ·

Structs

\ No newline at end of file diff --git a/core_distributor/dummy/sidebar-items.js b/core_distributor/dummy/sidebar-items.js new file mode 100644 index 0000000000..6f2b15f704 --- /dev/null +++ b/core_distributor/dummy/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":["DummyCoreDistibutor"]}; \ No newline at end of file diff --git a/core_distributor/dummy/struct.DummyCoreDistibutor.html b/core_distributor/dummy/struct.DummyCoreDistibutor.html new file mode 100644 index 0000000000..534c6cb6c0 --- /dev/null +++ b/core_distributor/dummy/struct.DummyCoreDistibutor.html @@ -0,0 +1,29 @@ +DummyCoreDistibutor in core_distributor::dummy - Rust
pub struct DummyCoreDistibutor;

Implementations§

Trait Implementations§

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/core_distributor/enum.AcquireStrategy.html b/core_distributor/enum.AcquireStrategy.html new file mode 100644 index 0000000000..79495f1a4f --- /dev/null +++ b/core_distributor/enum.AcquireStrategy.html @@ -0,0 +1,29 @@ +AcquireStrategy in core_distributor - Rust
pub enum AcquireStrategy {
+    Strict,
+    RoundRobin,
+}

Variants§

§

Strict

§

RoundRobin

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/core_distributor/errors/enum.AcquireError.html b/core_distributor/errors/enum.AcquireError.html new file mode 100644 index 0000000000..f6598e4e74 --- /dev/null +++ b/core_distributor/errors/enum.AcquireError.html @@ -0,0 +1,36 @@ +AcquireError in core_distributor::errors - Rust
pub enum AcquireError {
+    NotFoundAvailableCores {
+        required: usize,
+        available: usize,
+        acquire_request: AcquireRequest,
+        current_assignment: CurrentAssignment,
+    },
+}

Variants§

§

NotFoundAvailableCores

Fields

§required: usize
§available: usize
§acquire_request: AcquireRequest
§current_assignment: CurrentAssignment

Trait Implementations§

source§

impl Debug for AcquireError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for AcquireError

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for AcquireError

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl PartialEq for AcquireError

source§

fn eq(&self, other: &AcquireError) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl StructuralPartialEq for AcquireError

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/core_distributor/errors/enum.CreateError.html b/core_distributor/errors/enum.CreateError.html new file mode 100644 index 0000000000..cb4a81f203 --- /dev/null +++ b/core_distributor/errors/enum.CreateError.html @@ -0,0 +1,42 @@ +CreateError in core_distributor::errors - Rust
pub enum CreateError {
+    IllegalSystemCoreCount,
+    NotEnoughCores {
+        available: usize,
+        required: usize,
+    },
+    CreateTopology {
+        err: CPUTopologyError,
+    },
+    CollectCoresData {
+        err: CPUTopologyError,
+    },
+    WrongCoreRange {
+        core_range: CoreRange,
+    },
+}

Variants§

§

IllegalSystemCoreCount

§

NotEnoughCores

Fields

§available: usize
§required: usize
§

CreateTopology

Fields

§err: CPUTopologyError
§

CollectCoresData

Fields

§err: CPUTopologyError
§

WrongCoreRange

Fields

§core_range: CoreRange

Trait Implementations§

source§

impl Debug for CreateError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for CreateError

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for CreateError

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl From<CreateError> for LoadingError

source§

fn from(source: CreateError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/core_distributor/errors/enum.LoadingError.html b/core_distributor/errors/enum.LoadingError.html new file mode 100644 index 0000000000..83affde4e5 --- /dev/null +++ b/core_distributor/errors/enum.LoadingError.html @@ -0,0 +1,43 @@ +LoadingError in core_distributor::errors - Rust
pub enum LoadingError {
+    CreateCoreDistributor {
+        err: CreateError,
+    },
+    IoError {
+        err: Error,
+    },
+    DecodeError {
+        err: Utf8Error,
+    },
+    DeserializationError {
+        err: Error,
+    },
+    PersistError {
+        err: PersistError,
+    },
+}

Variants§

§

CreateCoreDistributor

Fields

§

IoError

Fields

§err: Error
§

DecodeError

Fields

§

DeserializationError

Fields

§err: Error
§

PersistError

Fields

Trait Implementations§

source§

impl Debug for LoadingError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for LoadingError

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for LoadingError

source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl From<CreateError> for LoadingError

source§

fn from(source: CreateError) -> Self

Converts to this type from the input type.
source§

impl From<Error> for LoadingError

source§

fn from(source: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for LoadingError

source§

fn from(source: Error) -> Self

Converts to this type from the input type.
source§

impl From<PersistError> for LoadingError

source§

fn from(source: PersistError) -> Self

Converts to this type from the input type.
source§

impl From<Utf8Error> for LoadingError

source§

fn from(source: Utf8Error) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/core_distributor/errors/enum.PersistError.html b/core_distributor/errors/enum.PersistError.html new file mode 100644 index 0000000000..b7915fc3ae --- /dev/null +++ b/core_distributor/errors/enum.PersistError.html @@ -0,0 +1,34 @@ +PersistError in core_distributor::errors - Rust
pub enum PersistError {
+    IoError {
+        err: Error,
+    },
+    SerializationError {
+        err: Error,
+    },
+}

Variants§

§

IoError

Fields

§err: Error
§

SerializationError

Fields

§err: Error

Trait Implementations§

source§

impl Debug for PersistError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for PersistError

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for PersistError

source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl From<Error> for PersistError

source§

fn from(source: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for PersistError

source§

fn from(source: Error) -> Self

Converts to this type from the input type.
source§

impl From<PersistError> for LoadingError

source§

fn from(source: PersistError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/core_distributor/errors/index.html b/core_distributor/errors/index.html new file mode 100644 index 0000000000..154036d1fa --- /dev/null +++ b/core_distributor/errors/index.html @@ -0,0 +1 @@ +core_distributor::errors - Rust

Structs

Enums

\ No newline at end of file diff --git a/core_distributor/errors/sidebar-items.js b/core_distributor/errors/sidebar-items.js new file mode 100644 index 0000000000..0697e4efc7 --- /dev/null +++ b/core_distributor/errors/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["AcquireError","CreateError","LoadingError","PersistError"],"struct":["CurrentAssignment"]}; \ No newline at end of file diff --git a/core_distributor/errors/struct.CurrentAssignment.html b/core_distributor/errors/struct.CurrentAssignment.html new file mode 100644 index 0000000000..62c4850119 --- /dev/null +++ b/core_distributor/errors/struct.CurrentAssignment.html @@ -0,0 +1,29 @@ +CurrentAssignment in core_distributor::errors - Rust
pub struct CurrentAssignment { /* private fields */ }

Implementations§

Trait Implementations§

source§

impl Debug for CurrentAssignment

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for CurrentAssignment

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq for CurrentAssignment

source§

fn eq(&self, other: &CurrentAssignment) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl StructuralPartialEq for CurrentAssignment

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/core_distributor/index.html b/core_distributor/index.html new file mode 100644 index 0000000000..f452e8955d --- /dev/null +++ b/core_distributor/index.html @@ -0,0 +1,4 @@ +core_distributor - Rust

Crate core_distributor

source ·

Modules

Structs

  • An opaque type that represents a CPU logical core.
  • PersistentCoreDistributor is a CPU core distributor responsible for allocating and releasing CPU cores +based on workload requirements. It maintains the state of core allocations, persists +the state to disk, and provides methods for acquiring and releasing cores.
  • An opaque type that represents a CPU physical core.

Enums

Traits

Type Aliases

\ No newline at end of file diff --git a/core_distributor/persistence/struct.PersistenceTask.html b/core_distributor/persistence/struct.PersistenceTask.html new file mode 100644 index 0000000000..cf84a59466 --- /dev/null +++ b/core_distributor/persistence/struct.PersistenceTask.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../core_distributor/struct.PersistenceTask.html...

+ + + \ No newline at end of file diff --git a/core_distributor/sidebar-items.js b/core_distributor/sidebar-items.js new file mode 100644 index 0000000000..b908c7ba59 --- /dev/null +++ b/core_distributor/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["AcquireStrategy"],"mod":["dummy","errors","types"],"struct":["CUID","CoreRange","LogicalCoreId","PersistenceTask","PersistentCoreDistributor","PhysicalCoreId"],"trait":["CoreDistributor","ThreadPinner"],"type":["Map"]}; \ No newline at end of file diff --git a/core_distributor/strategy/enum.AcquireStrategy.html b/core_distributor/strategy/enum.AcquireStrategy.html new file mode 100644 index 0000000000..c123bae8d3 --- /dev/null +++ b/core_distributor/strategy/enum.AcquireStrategy.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../core_distributor/enum.AcquireStrategy.html...

+ + + \ No newline at end of file diff --git a/core_distributor/struct.CUID.html b/core_distributor/struct.CUID.html new file mode 100644 index 0000000000..0abd208c0f --- /dev/null +++ b/core_distributor/struct.CUID.html @@ -0,0 +1,61 @@ +CUID in core_distributor - Rust

Struct core_distributor::CUID

pub struct CUID(/* private fields */);

Implementations§

§

impl CUID

pub const fn new(inner: [u8; 32]) -> CUID

Trait Implementations§

§

impl AsRef<[u8; 32]> for CUID

§

fn as_ref(&self) -> &[u8; 32]

Converts this type into a shared reference of the (usually inferred) input type.
§

impl Clone for CUID

§

fn clone(&self) -> CUID

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for CUID

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Default for CUID

§

fn default() -> CUID

Returns the “default value” for a type. Read more
§

impl<'de> Deserialize<'de> for CUIDwhere + CUID: FromStr, + <CUID as FromStr>::Err: Display,

§

fn deserialize<__D>( + deserializer: __D +) -> Result<CUID, <__D as Deserializer<'de>>::Error>where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
§

impl Display for CUID

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl FromHex for CUID

§

type Error = <[u8; 32] as FromHex>::Error

§

fn from_hex<T>(hex: T) -> Result<CUID, <CUID as FromHex>::Error>where + T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails +with a custom error type. Read more
§

impl FromStr for CUID

§

type Err = FromHexError

The associated error which can be returned from parsing.
§

fn from_str(s: &str) -> Result<CUID, <CUID as FromStr>::Err>

Parses a string s to return a value of this type. Read more
§

impl Hash for CUID

§

fn hash<__H>(&self, state: &mut __H)where + __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
§

impl Ord for CUID

§

fn cmp(&self, other: &CUID) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Selfwhere + Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Selfwhere + Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Selfwhere + Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
§

impl PartialEq for CUID

§

fn eq(&self, other: &CUID) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
§

impl PartialOrd for CUID

§

fn partial_cmp(&self, other: &CUID) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

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 more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= +operator. Read more
§

impl Serialize for CUIDwhere + CUID: Display,

§

fn serialize<__S>( + &self, + serializer: __S +) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more
§

impl ToHex for CUID

§

fn encode_hex<T>(&self) -> Twhere + T: FromIterator<char>,

Encode the hex strict representing self into the result. Lower case +letters are used (e.g. f9b4ca)
§

fn encode_hex_upper<T>(&self) -> Twhere + T: FromIterator<char>,

Encode the hex strict representing self into the result. Upper case +letters are used (e.g. F9B4CA)
§

impl Copy for CUID

§

impl Eq for CUID

§

impl StructuralEq for CUID

§

impl StructuralPartialEq for CUID

Auto Trait Implementations§

§

impl RefUnwindSafe for CUID

§

impl Send for CUID

§

impl Sync for CUID

§

impl Unpin for CUID

§

impl UnwindSafe for CUID

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<Q, K> Comparable<K> for Qwhere + Q: Ord + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
source§

impl<T> DeserializeOwned for Twhere + T: for<'de> Deserialize<'de>,

\ No newline at end of file diff --git a/core_distributor/struct.CoreRange.html b/core_distributor/struct.CoreRange.html new file mode 100644 index 0000000000..fb21537160 --- /dev/null +++ b/core_distributor/struct.CoreRange.html @@ -0,0 +1,34 @@ +CoreRange in core_distributor - Rust
pub struct CoreRange(/* private fields */);

Implementations§

source§

impl CoreRange

source

pub fn is_subset(&self, cores: &NonEmpty<PhysicalCoreId>) -> bool

Trait Implementations§

source§

impl Clone for CoreRange

source§

fn clone(&self) -> CoreRange

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for CoreRange

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for CoreRange

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for CoreRange

source§

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where + D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Display for CoreRange

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl FromStr for CoreRange

source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parse CoreRange from string like “1,2-30,31”

+
§

type Err = ParseError

The associated error which can be returned from parsing.
source§

impl PartialEq for CoreRange

source§

fn eq(&self, other: &CoreRange) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Serialize for CoreRange

source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>where + S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl TryFrom<&[usize]> for CoreRange

§

type Error = ParseError

The type returned in the event of a conversion error.
source§

fn try_from(value: &[usize]) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl StructuralPartialEq for CoreRange

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
source§

impl<T> DeserializeOwned for Twhere + T: for<'de> Deserialize<'de>,

\ No newline at end of file diff --git a/core_distributor/struct.LogicalCoreId.html b/core_distributor/struct.LogicalCoreId.html new file mode 100644 index 0000000000..20d1671d45 --- /dev/null +++ b/core_distributor/struct.LogicalCoreId.html @@ -0,0 +1,53 @@ +LogicalCoreId in core_distributor - Rust
pub struct LogicalCoreId(/* private fields */);
Expand description

An opaque type that represents a CPU logical core.

+

Implementations§

§

impl LogicalCoreId

pub const fn new(core_id: u32) -> LogicalCoreId

Trait Implementations§

§

impl Clone for LogicalCoreId

§

fn clone(&self) -> LogicalCoreId

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for LogicalCoreId

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl<'de> Deserialize<'de> for LogicalCoreId

§

fn deserialize<__D>( + __deserializer: __D +) -> Result<LogicalCoreId, <__D as Deserializer<'de>>::Error>where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
§

impl Display for LogicalCoreId

§

fn fmt(&self, fmt: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl From<u32> for LogicalCoreId

§

fn from(v: u32) -> LogicalCoreId

Converts to this type from the input type.
§

impl Hash for LogicalCoreId

§

fn hash<__H>(&self, state: &mut __H)where + __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
§

impl Ord for LogicalCoreId

§

fn cmp(&self, other: &LogicalCoreId) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Selfwhere + Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Selfwhere + Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Selfwhere + Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
§

impl PartialEq for LogicalCoreId

§

fn eq(&self, other: &LogicalCoreId) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
§

impl PartialOrd for LogicalCoreId

§

fn partial_cmp(&self, other: &LogicalCoreId) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

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 more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= +operator. Read more
§

impl Serialize for LogicalCoreId

§

fn serialize<__S>( + &self, + __serializer: __S +) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more
§

impl Copy for LogicalCoreId

§

impl Eq for LogicalCoreId

§

impl StructuralEq for LogicalCoreId

§

impl StructuralPartialEq for LogicalCoreId

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<Q, K> Comparable<K> for Qwhere + Q: Ord + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
source§

impl<T> DeserializeOwned for Twhere + T: for<'de> Deserialize<'de>,

\ No newline at end of file diff --git a/core_distributor/struct.PersistenceTask.html b/core_distributor/struct.PersistenceTask.html new file mode 100644 index 0000000000..4dcdca4a36 --- /dev/null +++ b/core_distributor/struct.PersistenceTask.html @@ -0,0 +1,26 @@ +PersistenceTask in core_distributor - Rust
pub struct PersistenceTask { /* private fields */ }

Implementations§

source§

impl PersistenceTask

source

pub async fn run(self)

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/core_distributor/struct.PersistentCoreDistributor.html b/core_distributor/struct.PersistentCoreDistributor.html new file mode 100644 index 0000000000..492a9b2a1c --- /dev/null +++ b/core_distributor/struct.PersistentCoreDistributor.html @@ -0,0 +1,39 @@ +PersistentCoreDistributor in core_distributor - Rust
pub struct PersistentCoreDistributor { /* private fields */ }
Expand description

PersistentCoreDistributor is a CPU core distributor responsible for allocating and releasing CPU cores +based on workload requirements. It maintains the state of core allocations, persists +the state to disk, and provides methods for acquiring and releasing cores.

+

Implementations§

source§

impl PersistentCoreDistributor

source

pub fn from_path( + file_path: PathBuf, + system_cpu_count: usize, + core_range: CoreRange, + acquire_strategy: AcquireStrategy, + cpu_topology: &dyn CPUTopology +) -> Result<(Arc<Self>, PersistenceTask), LoadingError>

Loads the state from file_name if exists. If not creates a new empty state

+

Trait Implementations§

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/core_distributor/struct.PhysicalCoreId.html b/core_distributor/struct.PhysicalCoreId.html new file mode 100644 index 0000000000..14ec4653be --- /dev/null +++ b/core_distributor/struct.PhysicalCoreId.html @@ -0,0 +1,53 @@ +PhysicalCoreId in core_distributor - Rust
pub struct PhysicalCoreId(/* private fields */);
Expand description

An opaque type that represents a CPU physical core.

+

Implementations§

§

impl PhysicalCoreId

pub const fn new(core_id: u32) -> PhysicalCoreId

Trait Implementations§

§

impl Clone for PhysicalCoreId

§

fn clone(&self) -> PhysicalCoreId

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for PhysicalCoreId

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl<'de> Deserialize<'de> for PhysicalCoreId

§

fn deserialize<__D>( + __deserializer: __D +) -> Result<PhysicalCoreId, <__D as Deserializer<'de>>::Error>where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
§

impl Display for PhysicalCoreId

§

fn fmt(&self, fmt: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl From<u32> for PhysicalCoreId

§

fn from(v: u32) -> PhysicalCoreId

Converts to this type from the input type.
§

impl Hash for PhysicalCoreId

§

fn hash<__H>(&self, state: &mut __H)where + __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
§

impl Ord for PhysicalCoreId

§

fn cmp(&self, other: &PhysicalCoreId) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Selfwhere + Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Selfwhere + Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Selfwhere + Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
§

impl PartialEq for PhysicalCoreId

§

fn eq(&self, other: &PhysicalCoreId) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
§

impl PartialOrd for PhysicalCoreId

§

fn partial_cmp(&self, other: &PhysicalCoreId) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

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 more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= +operator. Read more
§

impl Serialize for PhysicalCoreId

§

fn serialize<__S>( + &self, + __serializer: __S +) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more
§

impl Copy for PhysicalCoreId

§

impl Eq for PhysicalCoreId

§

impl StructuralEq for PhysicalCoreId

§

impl StructuralPartialEq for PhysicalCoreId

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<Q, K> Comparable<K> for Qwhere + Q: Ord + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
source§

impl<T> DeserializeOwned for Twhere + T: for<'de> Deserialize<'de>,

\ No newline at end of file diff --git a/core_distributor/trait.CoreDistributor.html b/core_distributor/trait.CoreDistributor.html new file mode 100644 index 0000000000..afabfc457f --- /dev/null +++ b/core_distributor/trait.CoreDistributor.html @@ -0,0 +1,12 @@ +CoreDistributor in core_distributor - Rust
pub trait CoreDistributor: Send + Sync {
+    // Required methods
+    fn acquire_worker_cores(
+        &self,
+        acquire_request: AcquireRequest
+    ) -> Result<Assignment, AcquireError>;
+    fn release_worker_cores(&self, unit_ids: &[CUID]);
+    fn get_system_cpu_assignment(&self) -> SystemAssignment;
+}

Required Methods§

Implementors§

\ No newline at end of file diff --git a/core_distributor/trait.ThreadPinner.html b/core_distributor/trait.ThreadPinner.html new file mode 100644 index 0000000000..613343a0bb --- /dev/null +++ b/core_distributor/trait.ThreadPinner.html @@ -0,0 +1,5 @@ +ThreadPinner in core_distributor - Rust
pub trait ThreadPinner: Send + Sync {
+    // Required methods
+    fn pin_current_thread_to(&self, core_id: LogicalCoreId) -> bool;
+    fn pin_current_thread_to_cpuset(&self, core_ids: &[LogicalCoreId]) -> bool;
+}

Required Methods§

Implementors§

§

impl ThreadPinner for DefaultThreadPinner

§

impl ThreadPinner for MockThreadPinner

\ No newline at end of file diff --git a/core_distributor/type.Map.html b/core_distributor/type.Map.html new file mode 100644 index 0000000000..d8e726e361 --- /dev/null +++ b/core_distributor/type.Map.html @@ -0,0 +1 @@ +Map in core_distributor - Rust

Type Alias core_distributor::Map

source ·
pub type Map<K, V> = HashMap<K, V, BuildHasherDefault<FxHasher>>;

Aliased Type§

struct Map<K, V> { /* private fields */ }
\ No newline at end of file diff --git a/core_distributor/types/enum.WorkType.html b/core_distributor/types/enum.WorkType.html new file mode 100644 index 0000000000..c9f82963b3 --- /dev/null +++ b/core_distributor/types/enum.WorkType.html @@ -0,0 +1,41 @@ +WorkType in core_distributor::types - Rust
pub enum WorkType {
+    CapacityCommitment,
+    Deal,
+}

Variants§

§

CapacityCommitment

§

Deal

Trait Implementations§

source§

impl Clone for WorkType

source§

fn clone(&self) -> WorkType

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for WorkType

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for WorkType

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Hash for WorkType

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for WorkType

source§

fn eq(&self, other: &WorkType) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Serialize for WorkType

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Copy for WorkType

source§

impl Eq for WorkType

source§

impl StructuralEq for WorkType

source§

impl StructuralPartialEq for WorkType

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
source§

impl<T> DeserializeOwned for Twhere + T: for<'de> Deserialize<'de>,

\ No newline at end of file diff --git a/core_distributor/types/index.html b/core_distributor/types/index.html new file mode 100644 index 0000000000..84791424fa --- /dev/null +++ b/core_distributor/types/index.html @@ -0,0 +1 @@ +core_distributor::types - Rust

Module core_distributor::types

source ·

Structs

Enums

\ No newline at end of file diff --git a/core_distributor/types/sidebar-items.js b/core_distributor/types/sidebar-items.js new file mode 100644 index 0000000000..a7c476b500 --- /dev/null +++ b/core_distributor/types/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["WorkType"],"struct":["AcquireRequest","Assignment","Cores","SystemAssignment"]}; \ No newline at end of file diff --git a/core_distributor/types/struct.AcquireRequest.html b/core_distributor/types/struct.AcquireRequest.html new file mode 100644 index 0000000000..b3cef70b1f --- /dev/null +++ b/core_distributor/types/struct.AcquireRequest.html @@ -0,0 +1,30 @@ +AcquireRequest in core_distributor::types - Rust
pub struct AcquireRequest { /* private fields */ }

Implementations§

source§

impl AcquireRequest

source

pub fn new(unit_ids: Vec<CUID>, worker_type: WorkType) -> Self

Trait Implementations§

source§

impl Clone for AcquireRequest

source§

fn clone(&self) -> AcquireRequest

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for AcquireRequest

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for AcquireRequest

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq for AcquireRequest

source§

fn eq(&self, other: &AcquireRequest) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl StructuralPartialEq for AcquireRequest

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/core_distributor/types/struct.Assignment.html b/core_distributor/types/struct.Assignment.html new file mode 100644 index 0000000000..25d6e95508 --- /dev/null +++ b/core_distributor/types/struct.Assignment.html @@ -0,0 +1,35 @@ +Assignment in core_distributor::types - Rust
pub struct Assignment {
+    pub cuid_cores: Map<CUID, Cores>,
+}

Fields§

§cuid_cores: Map<CUID, Cores>

Implementations§

Trait Implementations§

source§

impl Clone for Assignment

source§

fn clone(&self) -> Assignment

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Assignment

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq for Assignment

source§

fn eq(&self, other: &Assignment) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for Assignment

source§

impl StructuralEq for Assignment

source§

impl StructuralPartialEq for Assignment

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/core_distributor/types/struct.Cores.html b/core_distributor/types/struct.Cores.html new file mode 100644 index 0000000000..840bc08a8d --- /dev/null +++ b/core_distributor/types/struct.Cores.html @@ -0,0 +1,36 @@ +Cores in core_distributor::types - Rust
pub struct Cores {
+    pub physical_core_id: PhysicalCoreId,
+    pub logical_core_ids: Vec<LogicalCoreId>,
+}

Fields§

§physical_core_id: PhysicalCoreId§logical_core_ids: Vec<LogicalCoreId>

Trait Implementations§

source§

impl Clone for Cores

source§

fn clone(&self) -> Cores

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Cores

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq for Cores

source§

fn eq(&self, other: &Cores) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for Cores

source§

impl StructuralEq for Cores

source§

impl StructuralPartialEq for Cores

Auto Trait Implementations§

§

impl RefUnwindSafe for Cores

§

impl Send for Cores

§

impl Sync for Cores

§

impl Unpin for Cores

§

impl UnwindSafe for Cores

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/core_distributor/types/struct.SystemAssignment.html b/core_distributor/types/struct.SystemAssignment.html new file mode 100644 index 0000000000..94cbeb512c --- /dev/null +++ b/core_distributor/types/struct.SystemAssignment.html @@ -0,0 +1,29 @@ +SystemAssignment in core_distributor::types - Rust
pub struct SystemAssignment {
+    pub physical_core_ids: Vec<PhysicalCoreId>,
+    pub logical_core_ids: Vec<LogicalCoreId>,
+}

Fields§

§physical_core_ids: Vec<PhysicalCoreId>§logical_core_ids: Vec<LogicalCoreId>

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/crates.js b/crates.js new file mode 100644 index 0000000000..46cae69ad8 --- /dev/null +++ b/crates.js @@ -0,0 +1 @@ +window.ALL_CRATES = ["air_interpreter_fs","aquamarine","async_unlock","chain_connector","chain_data","chain_listener","cid_utils","config_utils","connected_client","connection_pool","control_macro","core_distributor","created_swarm","fluence_libp2p","fs_utils","health","hex_utils","ivalue_utils","json_utils","kademlia","local_vm","log_format","log_utils","now_millis","nox","particle_args","particle_builtins","particle_execution","particle_modules","particle_protocol","particle_services","peer_metrics","server_config","service_modules","sorcerer","spell_event_bus","spell_service_api","spell_storage","system_services","test_constants","test_utils","toml_utils","toy_vms","types","uuid_utils","vm_utils","workers"]; \ No newline at end of file diff --git a/created_swarm/all.html b/created_swarm/all.html new file mode 100644 index 0000000000..b17ece7768 --- /dev/null +++ b/created_swarm/all.html @@ -0,0 +1 @@ +List of all items in this crate

List of all items

Structs

Enums

Functions

\ No newline at end of file diff --git a/created_swarm/enum.FunctionOutcome.html b/created_swarm/enum.FunctionOutcome.html new file mode 100644 index 0000000000..6282a9073e --- /dev/null +++ b/created_swarm/enum.FunctionOutcome.html @@ -0,0 +1,62 @@ +FunctionOutcome in created_swarm - Rust
pub enum FunctionOutcome {
+    NotDefined {
+        args: Args,
+        params: ParticleParams,
+    },
+    Empty,
+    Ok(Value),
+    Err(JError),
+}

Variants§

§

NotDefined

Fields

§args: Args
§

Empty

§

Ok(Value)

§

Err(JError)

Implementations§

source§

impl FunctionOutcome

source

pub fn is_defined(&self) -> bool

Returns false if variant is [NotDefined]

+
source

pub fn not_err(&self) -> bool

Returns false if variant is Err

+
source

pub fn or_else( + self, + f: impl FnOnce(Args, ParticleParams) -> FunctionOutcome +) -> FunctionOutcome

Trait Implementations§

source§

impl Clone for FunctionOutcome

source§

fn clone(&self) -> FunctionOutcome

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for FunctionOutcome

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl<E> From<E> for FunctionOutcomewhere + E: Error,

source§

fn from(err: E) -> FunctionOutcome

Converts to this type from the input type.
source§

impl<E> FromResidual<Result<Infallible, E>> for FunctionOutcomewhere + E: Into<JError>,

source§

fn from_residual(residual: Result<Infallible, E>) -> FunctionOutcome

🔬This is a nightly-only experimental API. (try_trait_v2)
Constructs the type from a compatible Residual type. Read more
source§

impl FromResidual for FunctionOutcome

source§

fn from_residual(residual: JError) -> FunctionOutcome

🔬This is a nightly-only experimental API. (try_trait_v2)
Constructs the type from a compatible Residual type. Read more
source§

impl Try for FunctionOutcome

§

type Output = Option<Value>

🔬This is a nightly-only experimental API. (try_trait_v2)
The type of the value produced by ? when not short-circuiting.
§

type Residual = JError

🔬This is a nightly-only experimental API. (try_trait_v2)
The type of the value passed to FromResidual::from_residual +as part of ? when short-circuiting. Read more
source§

fn from_output(output: <FunctionOutcome as Try>::Output) -> FunctionOutcome

🔬This is a nightly-only experimental API. (try_trait_v2)
Constructs the type from its Output type. Read more
source§

fn branch( + self +) -> ControlFlow<<FunctionOutcome as Try>::Residual, <FunctionOutcome as Try>::Output>

🔬This is a nightly-only experimental API. (try_trait_v2)
Used in ? to decide whether the operator should produce a value +(because this returned ControlFlow::Continue) +or propagate a value back to the caller +(because this returned ControlFlow::Break). Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<!> for T

source§

fn from(t: !) -> T

Converts to this type from the input type.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> FromRef<T> for Twhere + T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> FromRef<T> for Twhere + T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> FutureExt for T

§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext +wrapper. Read more
§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext +wrapper. Read more
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
source§

impl<T> IntoRequest<T> for T

source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/created_swarm/fn.add_print.html b/created_swarm/fn.add_print.html new file mode 100644 index 0000000000..04892260f0 --- /dev/null +++ b/created_swarm/fn.add_print.html @@ -0,0 +1 @@ +add_print in created_swarm - Rust

Function created_swarm::add_print

source ·
pub async fn add_print<'a>(swarms: impl Iterator<Item = &'a mut CreatedSwarm>)
\ No newline at end of file diff --git a/created_swarm/fn.aqua_vm_config.html b/created_swarm/fn.aqua_vm_config.html new file mode 100644 index 0000000000..6d42535189 --- /dev/null +++ b/created_swarm/fn.aqua_vm_config.html @@ -0,0 +1,3 @@ +aqua_vm_config in created_swarm - Rust
pub fn aqua_vm_config(
+    vm_config: BaseVmConfig
+) -> <AVMRunner as AquaRuntime>::Config
\ No newline at end of file diff --git a/created_swarm/fn.create_swarm.html b/created_swarm/fn.create_swarm.html new file mode 100644 index 0000000000..b99fef7fb4 --- /dev/null +++ b/created_swarm/fn.create_swarm.html @@ -0,0 +1,3 @@ +create_swarm in created_swarm - Rust
pub async fn create_swarm(
+    config: SwarmConfig
+) -> (PeerId, Box<Node<AVMRunner>>, KeyPair, SwarmConfig, ResolvedConfig, Span, PersistenceTask)
\ No newline at end of file diff --git a/created_swarm/fn.create_swarm_with_runtime.html b/created_swarm/fn.create_swarm_with_runtime.html new file mode 100644 index 0000000000..6a97150d13 --- /dev/null +++ b/created_swarm/fn.create_swarm_with_runtime.html @@ -0,0 +1,4 @@ +create_swarm_with_runtime in created_swarm - Rust
pub async fn create_swarm_with_runtime<RT: AquaRuntime>(
+    config: SwarmConfig,
+    vm_config: impl Fn(BaseVmConfig) -> RT::Config
+) -> (PeerId, Box<Node<RT>>, KeyPair, SwarmConfig, ResolvedConfig, Span, PersistenceTask)
\ No newline at end of file diff --git a/created_swarm/fn.make_swarms.html b/created_swarm/fn.make_swarms.html new file mode 100644 index 0000000000..1408c2ddd5 --- /dev/null +++ b/created_swarm/fn.make_swarms.html @@ -0,0 +1 @@ +make_swarms in created_swarm - Rust

Function created_swarm::make_swarms

source ·
pub async fn make_swarms(n: usize) -> Vec<CreatedSwarm>
\ No newline at end of file diff --git a/created_swarm/fn.make_swarms_with.html b/created_swarm/fn.make_swarms_with.html new file mode 100644 index 0000000000..d4df643d07 --- /dev/null +++ b/created_swarm/fn.make_swarms_with.html @@ -0,0 +1,11 @@ +make_swarms_with in created_swarm - Rust
pub async fn make_swarms_with<RT: AquaRuntime, F, FF, M, B>(
+    n: usize,
+    create_node: F,
+    create_maddr: M,
+    bootstraps: B,
+    wait_connected: bool
+) -> Vec<CreatedSwarm>where
+    FF: Future<Output = (PeerId, Box<Node<RT>>, KeyPair, SwarmConfig, ResolvedConfig, Span, PersistenceTask)>,
+    F: FnMut(Vec<Multiaddr>, Multiaddr) -> FF,
+    M: FnMut() -> Multiaddr,
+    B: FnMut(Vec<Multiaddr>) -> Vec<Multiaddr>,
\ No newline at end of file diff --git a/created_swarm/fn.make_swarms_with_cfg.html b/created_swarm/fn.make_swarms_with_cfg.html new file mode 100644 index 0000000000..2fa311dc1b --- /dev/null +++ b/created_swarm/fn.make_swarms_with_cfg.html @@ -0,0 +1,5 @@ +make_swarms_with_cfg in created_swarm - Rust
pub async fn make_swarms_with_cfg<F>(
+    n: usize,
+    update_cfg: F
+) -> Vec<CreatedSwarm>where
+    F: FnMut(SwarmConfig) -> SwarmConfig,
\ No newline at end of file diff --git a/created_swarm/fn.make_swarms_with_keypair.html b/created_swarm/fn.make_swarms_with_keypair.html new file mode 100644 index 0000000000..fa7952290e --- /dev/null +++ b/created_swarm/fn.make_swarms_with_keypair.html @@ -0,0 +1,4 @@ +make_swarms_with_keypair in created_swarm - Rust
pub async fn make_swarms_with_keypair(
+    n: usize,
+    host_keypair: KeyPair
+) -> Vec<CreatedSwarm>
\ No newline at end of file diff --git a/created_swarm/fn.make_swarms_with_mocked_vm.html b/created_swarm/fn.make_swarms_with_mocked_vm.html new file mode 100644 index 0000000000..c1d22b0a43 --- /dev/null +++ b/created_swarm/fn.make_swarms_with_mocked_vm.html @@ -0,0 +1,8 @@ +make_swarms_with_mocked_vm in created_swarm - Rust
pub async fn make_swarms_with_mocked_vm<F, B>(
+    n: usize,
+    update_cfg: F,
+    delay: Option<Duration>,
+    bootstraps: B
+) -> Vec<CreatedSwarm>where
+    F: FnMut(SwarmConfig) -> SwarmConfig,
+    B: FnMut(Vec<Multiaddr>) -> Vec<Multiaddr>,
\ No newline at end of file diff --git a/created_swarm/fn.make_swarms_with_transport_and_mocked_vm.html b/created_swarm/fn.make_swarms_with_transport_and_mocked_vm.html new file mode 100644 index 0000000000..3e2216ecbb --- /dev/null +++ b/created_swarm/fn.make_swarms_with_transport_and_mocked_vm.html @@ -0,0 +1,4 @@ +make_swarms_with_transport_and_mocked_vm in created_swarm - Rust
pub async fn make_swarms_with_transport_and_mocked_vm(
+    n: usize,
+    transport: Transport
+) -> Vec<CreatedSwarm>
\ No newline at end of file diff --git a/created_swarm/index.html b/created_swarm/index.html new file mode 100644 index 0000000000..531d542b85 --- /dev/null +++ b/created_swarm/index.html @@ -0,0 +1,4 @@ +created_swarm - Rust

Crate created_swarm

source ·

Re-exports

  • pub use fluence_app_service;
  • pub use fluence_keypair;
  • pub use fluence_spell_dtos;

Modules

Structs

Enums

Functions

\ No newline at end of file diff --git a/created_swarm/services/fn.add_print.html b/created_swarm/services/fn.add_print.html new file mode 100644 index 0000000000..4466d79559 --- /dev/null +++ b/created_swarm/services/fn.add_print.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../created_swarm/fn.add_print.html...

+ + + \ No newline at end of file diff --git a/created_swarm/sidebar-items.js b/created_swarm/sidebar-items.js new file mode 100644 index 0000000000..b31407f33a --- /dev/null +++ b/created_swarm/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["FunctionOutcome"],"fn":["add_print","aqua_vm_config","create_swarm","create_swarm_with_runtime","make_swarms","make_swarms_with","make_swarms_with_cfg","make_swarms_with_keypair","make_swarms_with_mocked_vm","make_swarms_with_transport_and_mocked_vm"],"mod":["system_services_config"],"struct":["Args","BaseVmConfig","ChainConfig","CreatedSwarm","JError","NetworkKey","ParticleParams","SwarmConfig"]}; \ No newline at end of file diff --git a/created_swarm/struct.Args.html b/created_swarm/struct.Args.html new file mode 100644 index 0000000000..99ddc001c8 --- /dev/null +++ b/created_swarm/struct.Args.html @@ -0,0 +1,69 @@ +Args in created_swarm - Rust

Struct created_swarm::Args

source ·
pub struct Args {
+    pub service_id: String,
+    pub function_name: String,
+    pub function_args: Vec<Value>,
+    pub tetraplets: Vec<Vec<SecurityTetraplet>>,
+}
Expand description

Arguments passed by VM to host on call_service

+

Fields§

§service_id: String§function_name: String§function_args: Vec<Value>§tetraplets: Vec<Vec<SecurityTetraplet>>

Implementations§

source§

impl Args

source

pub fn next<T>( + field: &'static str, + args: &mut impl Iterator<Item = Value> +) -> Result<T, ArgsError>where + T: for<'de> Deserialize<'de>,

Retrieves next json value from iterator, parse it to T +field is to generate a more accurate error message

+
source

pub fn next_opt<T>( + field: &'static str, + args: &mut impl Iterator<Item = Value> +) -> Result<Option<T>, ArgsError>where + T: for<'de> Deserialize<'de>,

Retrieves a json value from iterator if it’s not empty, and parses it to Aqua’s option representation +Aqua’s option is expected to be an array of 1 or 0 elements. +For the sakes of backward compatibility, scalar value and absence of value are tolerated as well. +field is to generate a more accurate error message

+

In short, function returns:

+
    +
  • if next arg is T or [T] => Some(T)
  • +
  • if next arg is None or [] => None
  • +
  • if next arg is array of several elements => error
  • +
+

Trait Implementations§

source§

impl Clone for Args

source§

fn clone(&self) -> Args

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Args

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl TryFrom<CallRequestParams> for Args

§

type Error = ArgsError

The type returned in the event of a conversion error.
source§

fn try_from( + value: CallRequestParams +) -> Result<Args, <Args as TryFrom<CallRequestParams>>::Error>

Performs the conversion.

Auto Trait Implementations§

§

impl RefUnwindSafe for Args

§

impl Send for Args

§

impl Sync for Args

§

impl Unpin for Args

§

impl UnwindSafe for Args

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> FromRef<T> for Twhere + T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> FromRef<T> for Twhere + T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> FutureExt for T

§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext +wrapper. Read more
§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext +wrapper. Read more
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
source§

impl<T> IntoRequest<T> for T

source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/created_swarm/struct.BaseVmConfig.html b/created_swarm/struct.BaseVmConfig.html new file mode 100644 index 0000000000..96be7c7e1b --- /dev/null +++ b/created_swarm/struct.BaseVmConfig.html @@ -0,0 +1,43 @@ +BaseVmConfig in created_swarm - Rust
pub struct BaseVmConfig {
+    pub peer_id: PeerId,
+    pub tmp_dir: PathBuf,
+    pub listen_on: Multiaddr,
+    pub manager: PeerId,
+}

Fields§

§peer_id: PeerId§tmp_dir: PathBuf§listen_on: Multiaddr§manager: PeerId

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> FutureExt for T

§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext +wrapper. Read more
§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext +wrapper. Read more
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
source§

impl<T> IntoRequest<T> for T

source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/created_swarm/struct.ChainConfig.html b/created_swarm/struct.ChainConfig.html new file mode 100644 index 0000000000..14863254c1 --- /dev/null +++ b/created_swarm/struct.ChainConfig.html @@ -0,0 +1,58 @@ +ChainConfig in created_swarm - Rust
pub struct ChainConfig {
+    pub http_endpoint: String,
+    pub diamond_contract_address: String,
+    pub network_id: u64,
+    pub wallet_key: PrivateKey,
+    pub default_base_fee: Option<u64>,
+    pub default_priority_fee: Option<u64>,
+}

Fields§

§http_endpoint: String§diamond_contract_address: String§network_id: u64§wallet_key: PrivateKey§default_base_fee: Option<u64>

If none, comes from the chain

+
§default_priority_fee: Option<u64>

If none, comes from the chain

+

Trait Implementations§

§

impl Clone for ChainConfig

§

fn clone(&self) -> ChainConfig

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for ChainConfig

§

fn fmt(&self, __f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl<'de> Deserialize<'de> for ChainConfig

§

fn deserialize<__D>( + __deserializer: __D +) -> Result<ChainConfig, <__D as Deserializer<'de>>::Error>where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
§

impl Serialize for ChainConfig

§

fn serialize<__S>( + &self, + __serializer: __S +) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> FromRef<T> for Twhere + T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> FromRef<T> for Twhere + T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> FutureExt for T

§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext +wrapper. Read more
§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext +wrapper. Read more
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
source§

impl<T> IntoRequest<T> for T

source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
source§

impl<T> DeserializeOwned for Twhere + T: for<'de> Deserialize<'de>,

§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/created_swarm/struct.CreatedSwarm.html b/created_swarm/struct.CreatedSwarm.html new file mode 100644 index 0000000000..586980ee31 --- /dev/null +++ b/created_swarm/struct.CreatedSwarm.html @@ -0,0 +1,50 @@ +CreatedSwarm in created_swarm - Rust
pub struct CreatedSwarm {
+    pub config: ResolvedConfig,
+    pub peer_id: PeerId,
+    pub multiaddr: Multiaddr,
+    pub tmp_dir: Arc<TempDir>,
+    pub management_keypair: KeyPair,
+    pub exit_outlet: Sender<()>,
+    pub cancellation_token: CancellationToken,
+    pub connectivity: Connectivity,
+    pub aquamarine_api: AquamarineApi,
+    pub http_listen_addr: SocketAddr,
+    pub network_key: NetworkKey,
+}

Fields§

§config: ResolvedConfig§peer_id: PeerId§multiaddr: Multiaddr§tmp_dir: Arc<TempDir>§management_keypair: KeyPair§exit_outlet: Sender<()>§cancellation_token: CancellationToken§connectivity: Connectivity§aquamarine_api: AquamarineApi§http_listen_addr: SocketAddr§network_key: NetworkKey

Trait Implementations§

source§

impl Debug for CreatedSwarm

source§

fn fmt(&self, __f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> FutureExt for T

§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext +wrapper. Read more
§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext +wrapper. Read more
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
source§

impl<T> IntoRequest<T> for T

source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/created_swarm/struct.JError.html b/created_swarm/struct.JError.html new file mode 100644 index 0000000000..b4378b32ef --- /dev/null +++ b/created_swarm/struct.JError.html @@ -0,0 +1,45 @@ +JError in created_swarm - Rust

Struct created_swarm::JError

source ·
pub struct JError(pub Value);
Expand description

An error that can be created from any other error +Simplifies life by converting errors to be returnable from host closures

+

Tuple Fields§

§0: Value

Implementations§

source§

impl JError

source

pub fn new(msg: impl AsRef<str>) -> JError

source

pub fn from_eyre(err: Report) -> JError

Trait Implementations§

source§

impl Clone for JError

source§

fn clone(&self) -> JError

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for JError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Display for JError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl<E> From<E> for JErrorwhere + E: Error,

source§

fn from(err: E) -> JError

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<!> for T

source§

fn from(t: !) -> T

Converts to this type from the input type.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> FromRef<T> for Twhere + T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> FromRef<T> for Twhere + T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> FutureExt for T

§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext +wrapper. Read more
§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext +wrapper. Read more
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
source§

impl<T> IntoRequest<T> for T

source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/created_swarm/struct.NetworkKey.html b/created_swarm/struct.NetworkKey.html new file mode 100644 index 0000000000..3b15d7dda5 --- /dev/null +++ b/created_swarm/struct.NetworkKey.html @@ -0,0 +1,41 @@ +NetworkKey in created_swarm - Rust
pub struct NetworkKey(/* private fields */);

Implementations§

source§

impl NetworkKey

source

pub fn random() -> Self

Trait Implementations§

source§

impl Clone for NetworkKey

source§

fn clone(&self) -> NetworkKey

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for NetworkKey

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<[u8; 32]> for NetworkKey

source§

fn from(value: [u8; 32]) -> Self

Converts to this type from the input type.
source§

impl From<NetworkKey> for [u8; 32]

source§

fn from(value: NetworkKey) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> FromRef<T> for Twhere + T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> FromRef<T> for Twhere + T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> FutureExt for T

§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext +wrapper. Read more
§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext +wrapper. Read more
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
source§

impl<T> IntoRequest<T> for T

source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/created_swarm/struct.ParticleParams.html b/created_swarm/struct.ParticleParams.html new file mode 100644 index 0000000000..08889922d0 --- /dev/null +++ b/created_swarm/struct.ParticleParams.html @@ -0,0 +1,58 @@ +ParticleParams in created_swarm - Rust
pub struct ParticleParams {
+    pub id: String,
+    pub init_peer_id: PeerId,
+    pub peer_scope: PeerScope,
+    pub timestamp: u64,
+    pub ttl: u32,
+    pub script: String,
+    pub signature: Vec<u8>,
+    pub token: String,
+}
Expand description

Lightweight, static version of the [Particle] structure +It exists to avoid cloning [Particle::data] when possible

+

Fields§

§id: String§init_peer_id: PeerId§peer_scope: PeerScope§timestamp: u64

Unix timestamp in milliseconds

+
§ttl: u32

TTL in milliseconds

+
§script: String§signature: Vec<u8>§token: String

Implementations§

source§

impl ParticleParams

source

pub fn clone_from( + particle: &Particle, + peer_scope: PeerScope, + token: String +) -> ParticleParams

source

pub fn is_spell_particle(particle_id: &str) -> bool

source

pub fn get_spell_id(particle_id: &str) -> Option<String>

source

pub fn to_particle_parameters(self) -> ParticleParameters

Trait Implementations§

source§

impl Clone for ParticleParams

source§

fn clone(&self) -> ParticleParams

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ParticleParams

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> FromRef<T> for Twhere + T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> FromRef<T> for Twhere + T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> FutureExt for T

§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext +wrapper. Read more
§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext +wrapper. Read more
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
source§

impl<T> IntoRequest<T> for T

source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/created_swarm/struct.SwarmConfig.html b/created_swarm/struct.SwarmConfig.html new file mode 100644 index 0000000000..f395c32d2f --- /dev/null +++ b/created_swarm/struct.SwarmConfig.html @@ -0,0 +1,68 @@ +SwarmConfig in created_swarm - Rust
pub struct SwarmConfig {
Show 22 fields + pub keypair: KeyPair, + pub management_keypair: KeyPair, + pub builtins_keypair: KeyPair, + pub bootstraps: Vec<Multiaddr>, + pub listen_on: Multiaddr, + pub transport: Transport, + pub tmp_dir: Arc<TempDir>, + pub pool_size: Option<usize>, + pub builtins_dir: Option<PathBuf>, + pub spell_base_dir: Option<PathBuf>, + pub allowed_binaries: Vec<PathBuf>, + pub allowed_effectors: HashMap<String, HashMap<String, PathBuf>>, + pub enabled_system_services: Vec<String>, + pub extend_system_services: Vec<PackageDistro>, + pub override_system_services_config: Option<SystemServicesConfig>, + pub http_port: u16, + pub chain_config: Option<ChainConfig>, + pub chain_listener_config: Option<ChainListenerConfig>, + pub cc_events_dir: Option<PathBuf>, + pub network_key: NetworkKey, + pub cpu_cores_count: Option<u32>, + pub metrics_enabled: bool, +
}

Fields§

§keypair: KeyPair§management_keypair: KeyPair§builtins_keypair: KeyPair§bootstraps: Vec<Multiaddr>§listen_on: Multiaddr§transport: Transport§tmp_dir: Arc<TempDir>§pool_size: Option<usize>§builtins_dir: Option<PathBuf>§spell_base_dir: Option<PathBuf>§allowed_binaries: Vec<PathBuf>§allowed_effectors: HashMap<String, HashMap<String, PathBuf>>§enabled_system_services: Vec<String>§extend_system_services: Vec<PackageDistro>§override_system_services_config: Option<SystemServicesConfig>§http_port: u16§chain_config: Option<ChainConfig>§chain_listener_config: Option<ChainListenerConfig>§cc_events_dir: Option<PathBuf>§network_key: NetworkKey§cpu_cores_count: Option<u32>§metrics_enabled: bool

Implementations§

source§

impl SwarmConfig

source

pub fn new( + bootstraps: Vec<Multiaddr>, + listen_on: Multiaddr, + network_key: NetworkKey +) -> Self

Trait Implementations§

source§

impl Clone for SwarmConfig

source§

fn clone(&self) -> SwarmConfig

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for SwarmConfig

source§

fn fmt(&self, __f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> FromRef<T> for Twhere + T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> FromRef<T> for Twhere + T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> FutureExt for T

§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext +wrapper. Read more
§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext +wrapper. Read more
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
source§

impl<T> IntoRequest<T> for T

source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/created_swarm/swarm/fn.aqua_vm_config.html b/created_swarm/swarm/fn.aqua_vm_config.html new file mode 100644 index 0000000000..4acf6a6a2c --- /dev/null +++ b/created_swarm/swarm/fn.aqua_vm_config.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../created_swarm/fn.aqua_vm_config.html...

+ + + \ No newline at end of file diff --git a/created_swarm/swarm/fn.create_swarm.html b/created_swarm/swarm/fn.create_swarm.html new file mode 100644 index 0000000000..f70e3a6338 --- /dev/null +++ b/created_swarm/swarm/fn.create_swarm.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../created_swarm/fn.create_swarm.html...

+ + + \ No newline at end of file diff --git a/created_swarm/swarm/fn.create_swarm_with_runtime.html b/created_swarm/swarm/fn.create_swarm_with_runtime.html new file mode 100644 index 0000000000..85d67f6d22 --- /dev/null +++ b/created_swarm/swarm/fn.create_swarm_with_runtime.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../created_swarm/fn.create_swarm_with_runtime.html...

+ + + \ No newline at end of file diff --git a/created_swarm/swarm/fn.make_swarms.html b/created_swarm/swarm/fn.make_swarms.html new file mode 100644 index 0000000000..c1443408a3 --- /dev/null +++ b/created_swarm/swarm/fn.make_swarms.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../created_swarm/fn.make_swarms.html...

+ + + \ No newline at end of file diff --git a/created_swarm/swarm/fn.make_swarms_with.html b/created_swarm/swarm/fn.make_swarms_with.html new file mode 100644 index 0000000000..43c2890fde --- /dev/null +++ b/created_swarm/swarm/fn.make_swarms_with.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../created_swarm/fn.make_swarms_with.html...

+ + + \ No newline at end of file diff --git a/created_swarm/swarm/fn.make_swarms_with_cfg.html b/created_swarm/swarm/fn.make_swarms_with_cfg.html new file mode 100644 index 0000000000..2454dcef77 --- /dev/null +++ b/created_swarm/swarm/fn.make_swarms_with_cfg.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../created_swarm/fn.make_swarms_with_cfg.html...

+ + + \ No newline at end of file diff --git a/created_swarm/swarm/fn.make_swarms_with_keypair.html b/created_swarm/swarm/fn.make_swarms_with_keypair.html new file mode 100644 index 0000000000..125fcfce90 --- /dev/null +++ b/created_swarm/swarm/fn.make_swarms_with_keypair.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../created_swarm/fn.make_swarms_with_keypair.html...

+ + + \ No newline at end of file diff --git a/created_swarm/swarm/fn.make_swarms_with_mocked_vm.html b/created_swarm/swarm/fn.make_swarms_with_mocked_vm.html new file mode 100644 index 0000000000..543c76d036 --- /dev/null +++ b/created_swarm/swarm/fn.make_swarms_with_mocked_vm.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../created_swarm/fn.make_swarms_with_mocked_vm.html...

+ + + \ No newline at end of file diff --git a/created_swarm/swarm/fn.make_swarms_with_transport_and_mocked_vm.html b/created_swarm/swarm/fn.make_swarms_with_transport_and_mocked_vm.html new file mode 100644 index 0000000000..c08868ca1e --- /dev/null +++ b/created_swarm/swarm/fn.make_swarms_with_transport_and_mocked_vm.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../created_swarm/fn.make_swarms_with_transport_and_mocked_vm.html...

+ + + \ No newline at end of file diff --git a/created_swarm/swarm/struct.BaseVmConfig.html b/created_swarm/swarm/struct.BaseVmConfig.html new file mode 100644 index 0000000000..a52ef90e7b --- /dev/null +++ b/created_swarm/swarm/struct.BaseVmConfig.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../created_swarm/struct.BaseVmConfig.html...

+ + + \ No newline at end of file diff --git a/created_swarm/swarm/struct.CreatedSwarm.html b/created_swarm/swarm/struct.CreatedSwarm.html new file mode 100644 index 0000000000..a0b5abf695 --- /dev/null +++ b/created_swarm/swarm/struct.CreatedSwarm.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../created_swarm/struct.CreatedSwarm.html...

+ + + \ No newline at end of file diff --git a/created_swarm/swarm/struct.NetworkKey.html b/created_swarm/swarm/struct.NetworkKey.html new file mode 100644 index 0000000000..ba7e035394 --- /dev/null +++ b/created_swarm/swarm/struct.NetworkKey.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../created_swarm/struct.NetworkKey.html...

+ + + \ No newline at end of file diff --git a/created_swarm/swarm/struct.SwarmConfig.html b/created_swarm/swarm/struct.SwarmConfig.html new file mode 100644 index 0000000000..62043ed1c5 --- /dev/null +++ b/created_swarm/swarm/struct.SwarmConfig.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../created_swarm/struct.SwarmConfig.html...

+ + + \ No newline at end of file diff --git a/created_swarm/system_services_config/enum.ServiceKey.html b/created_swarm/system_services_config/enum.ServiceKey.html new file mode 100644 index 0000000000..68e918c968 --- /dev/null +++ b/created_swarm/system_services_config/enum.ServiceKey.html @@ -0,0 +1,71 @@ +ServiceKey in created_swarm::system_services_config - Rust
pub enum ServiceKey {
+    AquaIpfs,
+    TrustGraph,
+    Registry,
+    Decider,
+}

Variants§

§

AquaIpfs

§

TrustGraph

§

Registry

§

Decider

Implementations§

Trait Implementations§

§

impl Clone for ServiceKey

§

fn clone(&self) -> ServiceKey

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for ServiceKey

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl<'de> Deserialize<'de> for ServiceKey

§

fn deserialize<__D>( + __deserializer: __D +) -> Result<ServiceKey, <__D as Deserializer<'de>>::Error>where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
§

impl Display for ServiceKey

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Hash for ServiceKey

§

fn hash<__H>(&self, state: &mut __H)where + __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
§

impl PartialEq for ServiceKey

§

fn eq(&self, other: &ServiceKey) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
§

impl Serialize for ServiceKey

§

fn serialize<__S>( + &self, + __serializer: __S +) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more
§

impl Eq for ServiceKey

§

impl StructuralEq for ServiceKey

§

impl StructuralPartialEq for ServiceKey

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> CallHasher for Twhere + T: Hash + ?Sized,

§

default fn get_hash<H, B>(value: &H, build_hasher: &B) -> u64where + H: Hash + ?Sized, + B: BuildHasher,

§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> FromRef<T> for Twhere + T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> FromRef<T> for Twhere + T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> FutureExt for T

§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext +wrapper. Read more
§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext +wrapper. Read more
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
source§

impl<T> IntoRequest<T> for T

source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
source§

impl<T> DeserializeOwned for Twhere + T: for<'de> Deserialize<'de>,

§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/created_swarm/system_services_config/index.html b/created_swarm/system_services_config/index.html new file mode 100644 index 0000000000..814e98d97f --- /dev/null +++ b/created_swarm/system_services_config/index.html @@ -0,0 +1 @@ +created_swarm::system_services_config - Rust

Structs

Enums

\ No newline at end of file diff --git a/created_swarm/system_services_config/sidebar-items.js b/created_swarm/system_services_config/sidebar-items.js new file mode 100644 index 0000000000..2064d62624 --- /dev/null +++ b/created_swarm/system_services_config/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["ServiceKey"],"struct":["AquaIpfsConfig","ConnectorConfig","DeciderConfig","RegistryConfig","SystemServicesConfig"]}; \ No newline at end of file diff --git a/created_swarm/system_services_config/struct.AquaIpfsConfig.html b/created_swarm/system_services_config/struct.AquaIpfsConfig.html new file mode 100644 index 0000000000..50c9340e8d --- /dev/null +++ b/created_swarm/system_services_config/struct.AquaIpfsConfig.html @@ -0,0 +1,53 @@ +AquaIpfsConfig in created_swarm::system_services_config - Rust
pub struct AquaIpfsConfig {
+    pub external_api_multiaddr: String,
+    pub local_api_multiaddr: String,
+    pub ipfs_binary_path: PathBuf,
+}

Fields§

§external_api_multiaddr: String§local_api_multiaddr: String§ipfs_binary_path: PathBuf

Trait Implementations§

§

impl Clone for AquaIpfsConfig

§

fn clone(&self) -> AquaIpfsConfig

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for AquaIpfsConfig

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Default for AquaIpfsConfig

§

fn default() -> AquaIpfsConfig

Returns the “default value” for a type. Read more
§

impl<'de> Deserialize<'de> for AquaIpfsConfig

§

fn deserialize<__D>( + __deserializer: __D +) -> Result<AquaIpfsConfig, <__D as Deserializer<'de>>::Error>where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
§

impl Serialize for AquaIpfsConfig

§

fn serialize<__S>( + &self, + __serializer: __S +) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> FromRef<T> for Twhere + T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> FromRef<T> for Twhere + T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> FutureExt for T

§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext +wrapper. Read more
§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext +wrapper. Read more
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
source§

impl<T> IntoRequest<T> for T

source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
source§

impl<T> DeserializeOwned for Twhere + T: for<'de> Deserialize<'de>,

§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/created_swarm/system_services_config/struct.ConnectorConfig.html b/created_swarm/system_services_config/struct.ConnectorConfig.html new file mode 100644 index 0000000000..501be980c7 --- /dev/null +++ b/created_swarm/system_services_config/struct.ConnectorConfig.html @@ -0,0 +1,51 @@ +ConnectorConfig in created_swarm::system_services_config - Rust
pub struct ConnectorConfig {
+    pub curl_binary_path: PathBuf,
+}

Fields§

§curl_binary_path: PathBuf

Trait Implementations§

§

impl Clone for ConnectorConfig

§

fn clone(&self) -> ConnectorConfig

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for ConnectorConfig

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Default for ConnectorConfig

§

fn default() -> ConnectorConfig

Returns the “default value” for a type. Read more
§

impl<'de> Deserialize<'de> for ConnectorConfig

§

fn deserialize<__D>( + __deserializer: __D +) -> Result<ConnectorConfig, <__D as Deserializer<'de>>::Error>where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
§

impl Serialize for ConnectorConfig

§

fn serialize<__S>( + &self, + __serializer: __S +) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> FromRef<T> for Twhere + T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> FromRef<T> for Twhere + T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> FutureExt for T

§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext +wrapper. Read more
§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext +wrapper. Read more
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
source§

impl<T> IntoRequest<T> for T

source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
source§

impl<T> DeserializeOwned for Twhere + T: for<'de> Deserialize<'de>,

§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/created_swarm/system_services_config/struct.DeciderConfig.html b/created_swarm/system_services_config/struct.DeciderConfig.html new file mode 100644 index 0000000000..f6c3900839 --- /dev/null +++ b/created_swarm/system_services_config/struct.DeciderConfig.html @@ -0,0 +1,53 @@ +DeciderConfig in created_swarm::system_services_config - Rust
pub struct DeciderConfig {
+    pub decider_period_sec: u32,
+    pub worker_period_sec: u32,
+    pub worker_ipfs_multiaddr: String,
+}

Fields§

§decider_period_sec: u32§worker_period_sec: u32§worker_ipfs_multiaddr: String

Trait Implementations§

§

impl Clone for DeciderConfig

§

fn clone(&self) -> DeciderConfig

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for DeciderConfig

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Default for DeciderConfig

§

fn default() -> DeciderConfig

Returns the “default value” for a type. Read more
§

impl<'de> Deserialize<'de> for DeciderConfig

§

fn deserialize<__D>( + __deserializer: __D +) -> Result<DeciderConfig, <__D as Deserializer<'de>>::Error>where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
§

impl Serialize for DeciderConfig

§

fn serialize<__S>( + &self, + __serializer: __S +) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> FromRef<T> for Twhere + T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> FromRef<T> for Twhere + T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> FutureExt for T

§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext +wrapper. Read more
§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext +wrapper. Read more
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
source§

impl<T> IntoRequest<T> for T

source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
source§

impl<T> DeserializeOwned for Twhere + T: for<'de> Deserialize<'de>,

§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/created_swarm/system_services_config/struct.RegistryConfig.html b/created_swarm/system_services_config/struct.RegistryConfig.html new file mode 100644 index 0000000000..aa2b2e99f3 --- /dev/null +++ b/created_swarm/system_services_config/struct.RegistryConfig.html @@ -0,0 +1,54 @@ +RegistryConfig in created_swarm::system_services_config - Rust
pub struct RegistryConfig {
+    pub registry_period_sec: u32,
+    pub expired_period_sec: u32,
+    pub renew_period_sec: u32,
+    pub replicate_period_sec: u32,
+}

Fields§

§registry_period_sec: u32§expired_period_sec: u32§renew_period_sec: u32§replicate_period_sec: u32

Trait Implementations§

§

impl Clone for RegistryConfig

§

fn clone(&self) -> RegistryConfig

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for RegistryConfig

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Default for RegistryConfig

§

fn default() -> RegistryConfig

Returns the “default value” for a type. Read more
§

impl<'de> Deserialize<'de> for RegistryConfig

§

fn deserialize<__D>( + __deserializer: __D +) -> Result<RegistryConfig, <__D as Deserializer<'de>>::Error>where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
§

impl Serialize for RegistryConfig

§

fn serialize<__S>( + &self, + __serializer: __S +) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> FromRef<T> for Twhere + T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> FromRef<T> for Twhere + T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> FutureExt for T

§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext +wrapper. Read more
§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext +wrapper. Read more
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
source§

impl<T> IntoRequest<T> for T

source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
source§

impl<T> DeserializeOwned for Twhere + T: for<'de> Deserialize<'de>,

§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/created_swarm/system_services_config/struct.SystemServicesConfig.html b/created_swarm/system_services_config/struct.SystemServicesConfig.html new file mode 100644 index 0000000000..7c81340733 --- /dev/null +++ b/created_swarm/system_services_config/struct.SystemServicesConfig.html @@ -0,0 +1,55 @@ +SystemServicesConfig in created_swarm::system_services_config - Rust
pub struct SystemServicesConfig {
+    pub enable: Vec<ServiceKey>,
+    pub aqua_ipfs: AquaIpfsConfig,
+    pub decider: DeciderConfig,
+    pub registry: RegistryConfig,
+    pub connector: ConnectorConfig,
+}

Fields§

§enable: Vec<ServiceKey>§aqua_ipfs: AquaIpfsConfig§decider: DeciderConfig§registry: RegistryConfig§connector: ConnectorConfig

Trait Implementations§

§

impl Clone for SystemServicesConfig

§

fn clone(&self) -> SystemServicesConfig

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for SystemServicesConfig

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Default for SystemServicesConfig

§

fn default() -> SystemServicesConfig

Returns the “default value” for a type. Read more
§

impl<'de> Deserialize<'de> for SystemServicesConfig

§

fn deserialize<__D>( + __deserializer: __D +) -> Result<SystemServicesConfig, <__D as Deserializer<'de>>::Error>where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
§

impl Serialize for SystemServicesConfig

§

fn serialize<__S>( + &self, + __serializer: __S +) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> FromRef<T> for Twhere + T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> FromRef<T> for Twhere + T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> FutureExt for T

§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext +wrapper. Read more
§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext +wrapper. Read more
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
source§

impl<T> IntoRequest<T> for T

source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
source§

impl<T> DeserializeOwned for Twhere + T: for<'de> Deserialize<'de>,

§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/fluence_libp2p/all.html b/fluence_libp2p/all.html new file mode 100644 index 0000000000..1cbd51bd1e --- /dev/null +++ b/fluence_libp2p/all.html @@ -0,0 +1 @@ +List of all items in this crate

List of all items

Structs

Enums

Macros

Functions

\ No newline at end of file diff --git a/fluence_libp2p/connected_point/fn.remote_multiaddr.html b/fluence_libp2p/connected_point/fn.remote_multiaddr.html new file mode 100644 index 0000000000..71c75b89e3 --- /dev/null +++ b/fluence_libp2p/connected_point/fn.remote_multiaddr.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../fluence_libp2p/fn.remote_multiaddr.html...

+ + + \ No newline at end of file diff --git a/fluence_libp2p/enum.Transport.html b/fluence_libp2p/enum.Transport.html new file mode 100644 index 0000000000..8da0065594 --- /dev/null +++ b/fluence_libp2p/enum.Transport.html @@ -0,0 +1,31 @@ +Transport in fluence_libp2p - Rust
pub enum Transport {
+    Memory,
+    Network,
+}

Variants§

§

Memory

§

Network

Implementations§

source§

impl Transport

source

pub fn is_network(&self) -> bool

source

pub fn from_maddr(maddr: &Multiaddr) -> Self

Trait Implementations§

source§

impl Clone for Transport

source§

fn clone(&self) -> Transport

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Transport

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for Transport

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Serialize for Transport

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Copy for Transport

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
source§

impl<T> DeserializeOwned for Twhere + T: for<'de> Deserialize<'de>,

\ No newline at end of file diff --git a/fluence_libp2p/fn.build_memory_transport.html b/fluence_libp2p/fn.build_memory_transport.html new file mode 100644 index 0000000000..366039dcac --- /dev/null +++ b/fluence_libp2p/fn.build_memory_transport.html @@ -0,0 +1,4 @@ +build_memory_transport in fluence_libp2p - Rust
pub fn build_memory_transport(
+    key_pair: &Keypair,
+    transport_timeout: Duration
+) -> Boxed<(PeerId, StreamMuxerBox)>
\ No newline at end of file diff --git a/fluence_libp2p/fn.build_transport.html b/fluence_libp2p/fn.build_transport.html new file mode 100644 index 0000000000..4e48650e8e --- /dev/null +++ b/fluence_libp2p/fn.build_transport.html @@ -0,0 +1,5 @@ +build_transport in fluence_libp2p - Rust
pub fn build_transport(
+    transport: Transport,
+    key_pair: &Keypair,
+    timeout: Duration
+) -> Boxed<(PeerId, StreamMuxerBox)>
\ No newline at end of file diff --git a/fluence_libp2p/fn.remote_multiaddr.html b/fluence_libp2p/fn.remote_multiaddr.html new file mode 100644 index 0000000000..9d03e69261 --- /dev/null +++ b/fluence_libp2p/fn.remote_multiaddr.html @@ -0,0 +1,2 @@ +remote_multiaddr in fluence_libp2p - Rust
pub fn remote_multiaddr(cp: &ConnectedPoint) -> &Multiaddr
Expand description

Retrieves multiaddr of the remote peer

+
\ No newline at end of file diff --git a/fluence_libp2p/index.html b/fluence_libp2p/index.html new file mode 100644 index 0000000000..3187db66e9 --- /dev/null +++ b/fluence_libp2p/index.html @@ -0,0 +1,3 @@ +fluence_libp2p - Rust

Crate fluence_libp2p

source ·

Modules

Macros

Structs

Enums

Functions

\ No newline at end of file diff --git a/fluence_libp2p/macro.event_polling!.html b/fluence_libp2p/macro.event_polling!.html new file mode 100644 index 0000000000..aa2ab32b6f --- /dev/null +++ b/fluence_libp2p/macro.event_polling!.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to macro.event_polling.html...

+ + + \ No newline at end of file diff --git a/fluence_libp2p/macro.event_polling.html b/fluence_libp2p/macro.event_polling.html new file mode 100644 index 0000000000..aab66bcae8 --- /dev/null +++ b/fluence_libp2p/macro.event_polling.html @@ -0,0 +1,5 @@ +event_polling in fluence_libp2p - Rust
macro_rules! event_polling {
+    ($func_name:ident, $event_field_name:ident, $poll_type:ty$(, $tick:ident)?) => { ... };
+}
Expand description

Intended to simplify simple polling functions that just return internal events from a +internal queue.

+
\ No newline at end of file diff --git a/fluence_libp2p/macro.generate_swarm_event_type!.html b/fluence_libp2p/macro.generate_swarm_event_type!.html new file mode 100644 index 0000000000..75ba58101a --- /dev/null +++ b/fluence_libp2p/macro.generate_swarm_event_type!.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to macro.generate_swarm_event_type.html...

+ + + \ No newline at end of file diff --git a/fluence_libp2p/macro.generate_swarm_event_type.html b/fluence_libp2p/macro.generate_swarm_event_type.html new file mode 100644 index 0000000000..de4c27462c --- /dev/null +++ b/fluence_libp2p/macro.generate_swarm_event_type.html @@ -0,0 +1,4 @@ +generate_swarm_event_type in fluence_libp2p - Rust
macro_rules! generate_swarm_event_type {
+    ($swarm_type_name:ty) => { ... };
+}
Expand description

Generates a type of events produced by Swarm by its name

+
\ No newline at end of file diff --git a/fluence_libp2p/macro.poll_loop!.html b/fluence_libp2p/macro.poll_loop!.html new file mode 100644 index 0000000000..14f691cd06 --- /dev/null +++ b/fluence_libp2p/macro.poll_loop!.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to macro.poll_loop.html...

+ + + \ No newline at end of file diff --git a/fluence_libp2p/macro.poll_loop.html b/fluence_libp2p/macro.poll_loop.html new file mode 100644 index 0000000000..fd65d0824e --- /dev/null +++ b/fluence_libp2p/macro.poll_loop.html @@ -0,0 +1,3 @@ +poll_loop in fluence_libp2p - Rust
macro_rules! poll_loop {
+    ($self:expr,$behaviour:expr,$cx:expr,$params:expr$(,$into_event:expr)?) => { ... };
+}
\ No newline at end of file diff --git a/fluence_libp2p/peerid_serializer_opt/fn.deserialize.html b/fluence_libp2p/peerid_serializer_opt/fn.deserialize.html new file mode 100644 index 0000000000..fae119b000 --- /dev/null +++ b/fluence_libp2p/peerid_serializer_opt/fn.deserialize.html @@ -0,0 +1,2 @@ +deserialize in fluence_libp2p::peerid_serializer_opt - Rust
pub fn deserialize<'de, D>(deserializer: D) -> Result<Option<PeerId>, D::Error>where
+    D: Deserializer<'de>,
\ No newline at end of file diff --git a/fluence_libp2p/peerid_serializer_opt/fn.serialize.html b/fluence_libp2p/peerid_serializer_opt/fn.serialize.html new file mode 100644 index 0000000000..3c3b5c331d --- /dev/null +++ b/fluence_libp2p/peerid_serializer_opt/fn.serialize.html @@ -0,0 +1,5 @@ +serialize in fluence_libp2p::peerid_serializer_opt - Rust
pub fn serialize<S>(
+    value: &Option<PeerId>,
+    serializer: S
+) -> Result<S::Ok, S::Error>where
+    S: Serializer,
\ No newline at end of file diff --git a/fluence_libp2p/peerid_serializer_opt/index.html b/fluence_libp2p/peerid_serializer_opt/index.html new file mode 100644 index 0000000000..0befcc3c38 --- /dev/null +++ b/fluence_libp2p/peerid_serializer_opt/index.html @@ -0,0 +1 @@ +fluence_libp2p::peerid_serializer_opt - Rust

Functions

\ No newline at end of file diff --git a/fluence_libp2p/peerid_serializer_opt/sidebar-items.js b/fluence_libp2p/peerid_serializer_opt/sidebar-items.js new file mode 100644 index 0000000000..4ed511ecee --- /dev/null +++ b/fluence_libp2p/peerid_serializer_opt/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"fn":["deserialize","serialize"]}; \ No newline at end of file diff --git a/fluence_libp2p/random_multiaddr/fn.create_memory_maddr.html b/fluence_libp2p/random_multiaddr/fn.create_memory_maddr.html new file mode 100644 index 0000000000..deffbedf9d --- /dev/null +++ b/fluence_libp2p/random_multiaddr/fn.create_memory_maddr.html @@ -0,0 +1 @@ +create_memory_maddr in fluence_libp2p::random_multiaddr - Rust
pub fn create_memory_maddr() -> Multiaddr
\ No newline at end of file diff --git a/fluence_libp2p/random_multiaddr/fn.create_tcp_maddr.html b/fluence_libp2p/random_multiaddr/fn.create_tcp_maddr.html new file mode 100644 index 0000000000..2f6ede1604 --- /dev/null +++ b/fluence_libp2p/random_multiaddr/fn.create_tcp_maddr.html @@ -0,0 +1 @@ +create_tcp_maddr in fluence_libp2p::random_multiaddr - Rust
pub fn create_tcp_maddr() -> Multiaddr
\ No newline at end of file diff --git a/fluence_libp2p/random_multiaddr/index.html b/fluence_libp2p/random_multiaddr/index.html new file mode 100644 index 0000000000..c82c325abe --- /dev/null +++ b/fluence_libp2p/random_multiaddr/index.html @@ -0,0 +1 @@ +fluence_libp2p::random_multiaddr - Rust

Functions

\ No newline at end of file diff --git a/fluence_libp2p/random_multiaddr/sidebar-items.js b/fluence_libp2p/random_multiaddr/sidebar-items.js new file mode 100644 index 0000000000..3eca2c31aa --- /dev/null +++ b/fluence_libp2p/random_multiaddr/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"fn":["create_memory_maddr","create_tcp_maddr"]}; \ No newline at end of file diff --git a/fluence_libp2p/random_peer_id/struct.RandomPeerId.html b/fluence_libp2p/random_peer_id/struct.RandomPeerId.html new file mode 100644 index 0000000000..4dda223da1 --- /dev/null +++ b/fluence_libp2p/random_peer_id/struct.RandomPeerId.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../fluence_libp2p/struct.RandomPeerId.html...

+ + + \ No newline at end of file diff --git a/fluence_libp2p/serde/peerid_serializer_opt/fn.deserialize.html b/fluence_libp2p/serde/peerid_serializer_opt/fn.deserialize.html new file mode 100644 index 0000000000..b85e19ee5c --- /dev/null +++ b/fluence_libp2p/serde/peerid_serializer_opt/fn.deserialize.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../fluence_libp2p/peerid_serializer_opt/fn.deserialize.html...

+ + + \ No newline at end of file diff --git a/fluence_libp2p/serde/peerid_serializer_opt/fn.serialize.html b/fluence_libp2p/serde/peerid_serializer_opt/fn.serialize.html new file mode 100644 index 0000000000..deaa958f71 --- /dev/null +++ b/fluence_libp2p/serde/peerid_serializer_opt/fn.serialize.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../fluence_libp2p/peerid_serializer_opt/fn.serialize.html...

+ + + \ No newline at end of file diff --git a/fluence_libp2p/serde/peerid_serializer_opt/index.html b/fluence_libp2p/serde/peerid_serializer_opt/index.html new file mode 100644 index 0000000000..ea1e56efcb --- /dev/null +++ b/fluence_libp2p/serde/peerid_serializer_opt/index.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../fluence_libp2p/peerid_serializer_opt/index.html...

+ + + \ No newline at end of file diff --git a/fluence_libp2p/sidebar-items.js b/fluence_libp2p/sidebar-items.js new file mode 100644 index 0000000000..99b2a5dce0 --- /dev/null +++ b/fluence_libp2p/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["Transport"],"fn":["build_memory_transport","build_transport","remote_multiaddr"],"macro":["event_polling","generate_swarm_event_type","poll_loop"],"mod":["peerid_serializer_opt","random_multiaddr"],"struct":["PeerId","RandomPeerId"]}; \ No newline at end of file diff --git a/fluence_libp2p/struct.PeerId.html b/fluence_libp2p/struct.PeerId.html new file mode 100644 index 0000000000..b00ae7bd36 --- /dev/null +++ b/fluence_libp2p/struct.PeerId.html @@ -0,0 +1,55 @@ +PeerId in fluence_libp2p - Rust

Struct fluence_libp2p::PeerId

pub struct PeerId { /* private fields */ }
Expand description

Identifier of a peer of the network.

+

The data is a CIDv0 compatible multihash of the protobuf encoded public key of the peer +as specified in specs/peer-ids.

+

Implementations§

§

impl PeerId

pub fn from_public_key(key: &PublicKey) -> PeerId

Builds a PeerId from a public key.

+

pub fn from_bytes(data: &[u8]) -> Result<PeerId, ParseError>

Parses a PeerId from bytes.

+

pub fn from_multihash(multihash: Multihash<64>) -> Result<PeerId, Multihash<64>>

Tries to turn a Multihash into a PeerId.

+

If the multihash does not use a valid hashing algorithm for peer IDs, +or the hash value does not satisfy the constraints for a hashed +peer ID, it is returned as an Err.

+

pub fn random() -> PeerId

Generates a random peer ID from a cryptographically secure PRNG.

+

This is useful for randomly walking on a DHT, or for testing purposes.

+

pub fn to_bytes(self) -> Vec<u8>

Returns a raw bytes representation of this PeerId.

+

pub fn to_base58(self) -> String

Returns a base-58 encoded string of this PeerId.

+

Trait Implementations§

§

impl AsRef<Multihash<64>> for PeerId

§

fn as_ref(&self) -> &Multihash<64>

Converts this type into a shared reference of the (usually inferred) input type.
§

impl Clone for PeerId

§

fn clone(&self) -> PeerId

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for PeerId

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Display for PeerId

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl From<&PublicKey> for PeerId

§

fn from(key: &PublicKey) -> PeerId

Converts to this type from the input type.
§

impl From<PeerId> for Vec<u8>

§

fn from(peer_id: PeerId) -> Vec<u8>

Converts to this type from the input type.
§

impl From<PublicKey> for PeerId

§

fn from(key: PublicKey) -> PeerId

Converts to this type from the input type.
§

impl FromStr for PeerId

§

type Err = ParseError

The associated error which can be returned from parsing.
§

fn from_str(s: &str) -> Result<PeerId, <PeerId as FromStr>::Err>

Parses a string s to return a value of this type. Read more
§

impl Hash for PeerId

§

fn hash<__H>(&self, state: &mut __H)where + __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
§

impl Ord for PeerId

§

fn cmp(&self, other: &PeerId) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Selfwhere + Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Selfwhere + Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Selfwhere + Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
§

impl PartialEq for PeerId

§

fn eq(&self, other: &PeerId) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
§

impl PartialOrd for PeerId

§

fn partial_cmp(&self, other: &PeerId) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

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 more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= +operator. Read more
§

impl TryFrom<Multihash<64>> for PeerId

§

type Error = Multihash<64>

The type returned in the event of a conversion error.
§

fn try_from( + value: Multihash<64> +) -> Result<PeerId, <PeerId as TryFrom<Multihash<64>>>::Error>

Performs the conversion.
§

impl TryFrom<Vec<u8>> for PeerId

§

type Error = Vec<u8>

The type returned in the event of a conversion error.
§

fn try_from( + value: Vec<u8> +) -> Result<PeerId, <PeerId as TryFrom<Vec<u8>>>::Error>

Performs the conversion.
§

impl Copy for PeerId

§

impl Eq for PeerId

§

impl StructuralEq for PeerId

§

impl StructuralPartialEq for PeerId

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/fluence_libp2p/struct.RandomPeerId.html b/fluence_libp2p/struct.RandomPeerId.html new file mode 100644 index 0000000000..546a78bdc0 --- /dev/null +++ b/fluence_libp2p/struct.RandomPeerId.html @@ -0,0 +1,25 @@ +RandomPeerId in fluence_libp2p - Rust
pub struct RandomPeerId(/* private fields */);

Implementations§

source§

impl RandomPeerId

source

pub fn random() -> PeerId

Generates PeerId from random Ed25519 key

+

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/fluence_libp2p/transport/enum.Transport.html b/fluence_libp2p/transport/enum.Transport.html new file mode 100644 index 0000000000..40b17ffb4f --- /dev/null +++ b/fluence_libp2p/transport/enum.Transport.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../fluence_libp2p/enum.Transport.html...

+ + + \ No newline at end of file diff --git a/fluence_libp2p/transport/fn.build_memory_transport.html b/fluence_libp2p/transport/fn.build_memory_transport.html new file mode 100644 index 0000000000..62a5af0a80 --- /dev/null +++ b/fluence_libp2p/transport/fn.build_memory_transport.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../fluence_libp2p/fn.build_memory_transport.html...

+ + + \ No newline at end of file diff --git a/fluence_libp2p/transport/fn.build_transport.html b/fluence_libp2p/transport/fn.build_transport.html new file mode 100644 index 0000000000..2ac37c2835 --- /dev/null +++ b/fluence_libp2p/transport/fn.build_transport.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../fluence_libp2p/fn.build_transport.html...

+ + + \ No newline at end of file diff --git a/fs_utils/all.html b/fs_utils/all.html new file mode 100644 index 0000000000..eee301f55c --- /dev/null +++ b/fs_utils/all.html @@ -0,0 +1 @@ +List of all items in this crate

List of all items

Enums

Functions

\ No newline at end of file diff --git a/fs_utils/enum.LoadDataError.html b/fs_utils/enum.LoadDataError.html new file mode 100644 index 0000000000..83f7c55cf4 --- /dev/null +++ b/fs_utils/enum.LoadDataError.html @@ -0,0 +1,30 @@ +LoadDataError in fs_utils - Rust
pub enum LoadDataError {
+    CreateDir {
+        path: PathBuf,
+        err: Error,
+    },
+    ReadPersistedData {
+        path: PathBuf,
+        err: Error,
+    },
+    DeserializeData {
+        path: PathBuf,
+        err: Box<dyn Error + Send + Sync>,
+    },
+}

Variants§

§

CreateDir

Fields

§path: PathBuf
§err: Error
§

ReadPersistedData

Fields

§path: PathBuf
§err: Error
§

DeserializeData

Fields

§path: PathBuf
§err: Box<dyn Error + Send + Sync>

Trait Implementations§

source§

impl Debug for LoadDataError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for LoadDataError

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for LoadDataError

source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/fs_utils/fn.canonicalize.html b/fs_utils/fn.canonicalize.html new file mode 100644 index 0000000000..133e9448c6 --- /dev/null +++ b/fs_utils/fn.canonicalize.html @@ -0,0 +1 @@ +canonicalize in fs_utils - Rust

Function fs_utils::canonicalize

source ·
pub fn canonicalize(path: impl AsRef<Path>) -> Result<PathBuf>
\ No newline at end of file diff --git a/fs_utils/fn.copy_dir_all.html b/fs_utils/fn.copy_dir_all.html new file mode 100644 index 0000000000..cb1b8b5813 --- /dev/null +++ b/fs_utils/fn.copy_dir_all.html @@ -0,0 +1 @@ +copy_dir_all in fs_utils - Rust

Function fs_utils::copy_dir_all

source ·
pub fn copy_dir_all(src: impl AsRef<Path>, dst: impl AsRef<Path>) -> Result<()>
\ No newline at end of file diff --git a/fs_utils/fn.create_dir.html b/fs_utils/fn.create_dir.html new file mode 100644 index 0000000000..eb17f3b9d0 --- /dev/null +++ b/fs_utils/fn.create_dir.html @@ -0,0 +1 @@ +create_dir in fs_utils - Rust

Function fs_utils::create_dir

source ·
pub fn create_dir<P: AsRef<Path> + Debug>(dir: P) -> Result<(), Error>
\ No newline at end of file diff --git a/fs_utils/fn.create_dir_write_only.html b/fs_utils/fn.create_dir_write_only.html new file mode 100644 index 0000000000..31c701e97a --- /dev/null +++ b/fs_utils/fn.create_dir_write_only.html @@ -0,0 +1,3 @@ +create_dir_write_only in fs_utils - Rust
pub fn create_dir_write_only<P: AsRef<Path> + Debug>(
+    dir: P
+) -> Result<(), Error>
\ No newline at end of file diff --git a/fs_utils/fn.create_dirs.html b/fs_utils/fn.create_dirs.html new file mode 100644 index 0000000000..6a99577df4 --- /dev/null +++ b/fs_utils/fn.create_dirs.html @@ -0,0 +1,2 @@ +create_dirs in fs_utils - Rust

Function fs_utils::create_dirs

source ·
pub fn create_dirs<Item>(dirs: &[Item]) -> Result<(), Error>where
+    Item: AsRef<Path> + Debug,
\ No newline at end of file diff --git a/fs_utils/fn.file_name.html b/fs_utils/fn.file_name.html new file mode 100644 index 0000000000..6d83c088b5 --- /dev/null +++ b/fs_utils/fn.file_name.html @@ -0,0 +1 @@ +file_name in fs_utils - Rust

Function fs_utils::file_name

source ·
pub fn file_name(path: impl AsRef<Path>) -> Result<String>
\ No newline at end of file diff --git a/fs_utils/fn.file_stem.html b/fs_utils/fn.file_stem.html new file mode 100644 index 0000000000..60ee3c5001 --- /dev/null +++ b/fs_utils/fn.file_stem.html @@ -0,0 +1 @@ +file_stem in fs_utils - Rust

Function fs_utils::file_stem

source ·
pub fn file_stem(path: impl AsRef<Path>) -> Result<String>
\ No newline at end of file diff --git a/fs_utils/fn.list_files.html b/fs_utils/fn.list_files.html new file mode 100644 index 0000000000..6805661403 --- /dev/null +++ b/fs_utils/fn.list_files.html @@ -0,0 +1,2 @@ +list_files in fs_utils - Rust

Function fs_utils::list_files

source ·
pub fn list_files(dir: &Path) -> Option<impl Iterator<Item = PathBuf>>
Expand description

List files in directory

+
\ No newline at end of file diff --git a/fs_utils/fn.load_persisted_data.html b/fs_utils/fn.load_persisted_data.html new file mode 100644 index 0000000000..d1860f4616 --- /dev/null +++ b/fs_utils/fn.load_persisted_data.html @@ -0,0 +1,6 @@ +load_persisted_data in fs_utils - Rust
pub async fn load_persisted_data<T>(
+    data_dir: &Path,
+    filter: fn(_: &Path) -> bool,
+    de: fn(_: &[u8]) -> Result<T, Box<dyn Error + Send + Sync>>
+) -> Result<Vec<(T, PathBuf)>, LoadDataError>
Expand description

Load some data from disk in parallel

+
\ No newline at end of file diff --git a/fs_utils/fn.remove_dir.html b/fs_utils/fn.remove_dir.html new file mode 100644 index 0000000000..6bbcca2ea0 --- /dev/null +++ b/fs_utils/fn.remove_dir.html @@ -0,0 +1 @@ +remove_dir in fs_utils - Rust

Function fs_utils::remove_dir

source ·
pub fn remove_dir(dir: &Path) -> Result<(), Error>
\ No newline at end of file diff --git a/fs_utils/fn.remove_dirs.html b/fs_utils/fn.remove_dirs.html new file mode 100644 index 0000000000..f13fab582b --- /dev/null +++ b/fs_utils/fn.remove_dirs.html @@ -0,0 +1,2 @@ +remove_dirs in fs_utils - Rust

Function fs_utils::remove_dirs

source ·
pub fn remove_dirs<Item>(dirs: &[Item]) -> Result<(), Error>where
+    Item: AsRef<Path> + Debug,
\ No newline at end of file diff --git a/fs_utils/fn.remove_file.html b/fs_utils/fn.remove_file.html new file mode 100644 index 0000000000..5def91ad9d --- /dev/null +++ b/fs_utils/fn.remove_file.html @@ -0,0 +1 @@ +remove_file in fs_utils - Rust

Function fs_utils::remove_file

source ·
pub fn remove_file(file: &Path) -> Result<(), Error>
\ No newline at end of file diff --git a/fs_utils/fn.set_write_only.html b/fs_utils/fn.set_write_only.html new file mode 100644 index 0000000000..76286d5f3d --- /dev/null +++ b/fs_utils/fn.set_write_only.html @@ -0,0 +1 @@ +set_write_only in fs_utils - Rust

Function fs_utils::set_write_only

source ·
pub fn set_write_only(path: &Path) -> Result<(), Error>
\ No newline at end of file diff --git a/fs_utils/fn.to_abs_path.html b/fs_utils/fn.to_abs_path.html new file mode 100644 index 0000000000..b4c80e1206 --- /dev/null +++ b/fs_utils/fn.to_abs_path.html @@ -0,0 +1 @@ +to_abs_path in fs_utils - Rust

Function fs_utils::to_abs_path

source ·
pub fn to_abs_path(path: PathBuf) -> PathBuf
\ No newline at end of file diff --git a/fs_utils/index.html b/fs_utils/index.html new file mode 100644 index 0000000000..d268ec4b18 --- /dev/null +++ b/fs_utils/index.html @@ -0,0 +1,2 @@ +fs_utils - Rust

Crate fs_utils

source ·

Enums

Functions

\ No newline at end of file diff --git a/fs_utils/sidebar-items.js b/fs_utils/sidebar-items.js new file mode 100644 index 0000000000..a58aea6b49 --- /dev/null +++ b/fs_utils/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["LoadDataError"],"fn":["canonicalize","copy_dir_all","create_dir","create_dir_write_only","create_dirs","file_name","file_stem","list_files","load_persisted_data","remove_dir","remove_dirs","remove_file","set_write_only","to_abs_path"]}; \ No newline at end of file diff --git a/health/all.html b/health/all.html new file mode 100644 index 0000000000..4a09497a49 --- /dev/null +++ b/health/all.html @@ -0,0 +1 @@ +List of all items in this crate

List of all items

Structs

Enums

Traits

\ No newline at end of file diff --git a/health/enum.HealthStatus.html b/health/enum.HealthStatus.html new file mode 100644 index 0000000000..20956a7064 --- /dev/null +++ b/health/enum.HealthStatus.html @@ -0,0 +1,21 @@ +HealthStatus in health - Rust

Enum health::HealthStatus

source ·
pub enum HealthStatus {
+    Ok(Vec<&'static str>),
+    Warning(Vec<&'static str>, Vec<&'static str>),
+    Fail(Vec<&'static str>),
+}
Expand description

The result of the health check, which can be one of the following: +HealthCheckResult::Ok(oks): If all health checks pass successfully. oks is a vector containing the names of the passed health checks. +HealthCheckResult::Fail(fails): If all health checks fail. fails is a vector containing the names of the failed health checks. +HealthCheckResult::Warning(oks, fails): If some health checks pass while others fail. oks is a vector containing the names of the passed health checks, and fails is a vector containing the names of the failed health checks.

+

Variants§

§

Ok(Vec<&'static str>)

§

Warning(Vec<&'static str>, Vec<&'static str>)

§

Fail(Vec<&'static str>)

Trait Implementations§

source§

impl Debug for HealthStatus

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq for HealthStatus

source§

fn eq(&self, other: &HealthStatus) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl StructuralPartialEq for HealthStatus

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/health/index.html b/health/index.html new file mode 100644 index 0000000000..21aa6ef366 --- /dev/null +++ b/health/index.html @@ -0,0 +1,7 @@ +health - Rust

Crate health

source ·
Expand description

Health check registry implementation.

+

See HealthCheckRegistry for details.

+

Structs

Enums

  • The result of the health check, which can be one of the following: +HealthCheckResult::Ok(oks): If all health checks pass successfully. oks is a vector containing the names of the passed health checks. +HealthCheckResult::Fail(fails): If all health checks fail. fails is a vector containing the names of the failed health checks. +HealthCheckResult::Warning(oks, fails): If some health checks pass while others fail. oks is a vector containing the names of the passed health checks, and fails is a vector containing the names of the failed health checks.

Traits

\ No newline at end of file diff --git a/health/sidebar-items.js b/health/sidebar-items.js new file mode 100644 index 0000000000..a0c33de06e --- /dev/null +++ b/health/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["HealthStatus"],"struct":["HealthCheckRegistry"],"trait":["HealthCheck"]}; \ No newline at end of file diff --git a/health/struct.HealthCheckRegistry.html b/health/struct.HealthCheckRegistry.html new file mode 100644 index 0000000000..876cf32519 --- /dev/null +++ b/health/struct.HealthCheckRegistry.html @@ -0,0 +1,13 @@ +HealthCheckRegistry in health - Rust
pub struct HealthCheckRegistry { /* private fields */ }

Implementations§

source§

impl HealthCheckRegistry

A HealthCheckRegistry is a collection of health checks that can be registered and executed. +Each health check is associated with a name and is expected to implement the HealthCheck trait.

+
source

pub fn new() -> Self

source

pub fn register(&mut self, name: &'static str, check: impl HealthCheck)

source

pub fn status(&self) -> HealthStatus

Trait Implementations§

source§

impl Default for HealthCheckRegistry

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/health/trait.HealthCheck.html b/health/trait.HealthCheck.html new file mode 100644 index 0000000000..15ed493628 --- /dev/null +++ b/health/trait.HealthCheck.html @@ -0,0 +1,4 @@ +HealthCheck in health - Rust

Trait health::HealthCheck

source ·
pub trait HealthCheck: Send + Sync + 'static {
+    // Required method
+    fn status(&self) -> Result<()>;
+}

Required Methods§

source

fn status(&self) -> Result<()>

Implementors§

\ No newline at end of file diff --git a/help.html b/help.html new file mode 100644 index 0000000000..d6b603c48d --- /dev/null +++ b/help.html @@ -0,0 +1 @@ +Help

Rustdoc help

Back
\ No newline at end of file diff --git a/hex_utils/all.html b/hex_utils/all.html new file mode 100644 index 0000000000..3674f78bab --- /dev/null +++ b/hex_utils/all.html @@ -0,0 +1 @@ +List of all items in this crate

List of all items

Structs

Enums

Functions

\ No newline at end of file diff --git a/hex_utils/enum.FromHexError.html b/hex_utils/enum.FromHexError.html new file mode 100644 index 0000000000..9fbf09cfdb --- /dev/null +++ b/hex_utils/enum.FromHexError.html @@ -0,0 +1,30 @@ +FromHexError in hex_utils - Rust
pub enum FromHexError {
+    InvalidHexCharacter {
+        c: char,
+        index: usize,
+    },
+    OddLength,
+    InvalidStringLength,
+}
Expand description

The error type for decoding a hex string into Vec<u8> or [u8; N].

+

Variants§

§

InvalidHexCharacter

Fields

§index: usize

An invalid character was found. Valid ones are: 0...9, a...f +or A...F.

+
§

OddLength

A hex string’s length needs to be even, as two digits correspond to +one byte.

+
§

InvalidStringLength

If the hex string is decoded into a fixed sized container, such as an +array, the hex string’s length * 2 has to match the container’s +length.

+

Trait Implementations§

source§

impl Clone for FromHexError

source§

fn clone(&self) -> FromHexError

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for FromHexError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Display for FromHexError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Error for FromHexError

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl PartialEq for FromHexError

source§

fn eq(&self, other: &FromHexError) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Copy for FromHexError

source§

impl StructuralPartialEq for FromHexError

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/hex_utils/fn.decode_hex.html b/hex_utils/fn.decode_hex.html new file mode 100644 index 0000000000..4dfa25ed76 --- /dev/null +++ b/hex_utils/fn.decode_hex.html @@ -0,0 +1,2 @@ +decode_hex in hex_utils - Rust

Function hex_utils::decode_hex

source ·
pub fn decode_hex(h: &str) -> Result<Vec<u8>, FromHexError>
Expand description

Decode hex to bytes tolerating absence and presence of 0x prefix

+
\ No newline at end of file diff --git a/hex_utils/fn.encode_hex_0x.html b/hex_utils/fn.encode_hex_0x.html new file mode 100644 index 0000000000..c7f9e51ba2 --- /dev/null +++ b/hex_utils/fn.encode_hex_0x.html @@ -0,0 +1,2 @@ +encode_hex_0x in hex_utils - Rust

Function hex_utils::encode_hex_0x

source ·
pub fn encode_hex_0x<T: AsRef<[u8]>>(data: T) -> String
Expand description

Encode bytes to hex with 0x prefix

+
\ No newline at end of file diff --git a/hex_utils/fn.encode_hex_0x_zero_pad.html b/hex_utils/fn.encode_hex_0x_zero_pad.html new file mode 100644 index 0000000000..cf131bde96 --- /dev/null +++ b/hex_utils/fn.encode_hex_0x_zero_pad.html @@ -0,0 +1,2 @@ +encode_hex_0x_zero_pad in hex_utils - Rust
pub fn encode_hex_0x_zero_pad<T: AsRef<[u8]>>(data: T, width: usize) -> String
Expand description

Encode bytes to hex with 0x prefix and zero padding of a specified length

+
\ No newline at end of file diff --git a/hex_utils/fn.encode_hex_no_prefix.html b/hex_utils/fn.encode_hex_no_prefix.html new file mode 100644 index 0000000000..b2893f4798 --- /dev/null +++ b/hex_utils/fn.encode_hex_no_prefix.html @@ -0,0 +1,2 @@ +encode_hex_no_prefix in hex_utils - Rust
pub fn encode_hex_no_prefix<T: AsRef<[u8]>>(data: T) -> String
Expand description

A simple renaming to force to consider the absence of ‘0x’ prefix

+
\ No newline at end of file diff --git a/hex_utils/index.html b/hex_utils/index.html new file mode 100644 index 0000000000..7fd4bee63e --- /dev/null +++ b/hex_utils/index.html @@ -0,0 +1,2 @@ +hex_utils - Rust

Crate hex_utils

source ·

Modules

Enums

  • The error type for decoding a hex string into Vec<u8> or [u8; N].

Functions

\ No newline at end of file diff --git a/hex_utils/serde_as/index.html b/hex_utils/serde_as/index.html new file mode 100644 index 0000000000..3ebe2cdc7e --- /dev/null +++ b/hex_utils/serde_as/index.html @@ -0,0 +1 @@ +hex_utils::serde_as - Rust

Module hex_utils::serde_as

source ·

Structs

\ No newline at end of file diff --git a/hex_utils/serde_as/sidebar-items.js b/hex_utils/serde_as/sidebar-items.js new file mode 100644 index 0000000000..9d4942d182 --- /dev/null +++ b/hex_utils/serde_as/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":["Hex"]}; \ No newline at end of file diff --git a/hex_utils/serde_as/struct.Hex.html b/hex_utils/serde_as/struct.Hex.html new file mode 100644 index 0000000000..41772415d7 --- /dev/null +++ b/hex_utils/serde_as/struct.Hex.html @@ -0,0 +1,16 @@ +Hex in hex_utils::serde_as - Rust

Struct hex_utils::serde_as::Hex

source ·
pub struct Hex;

Trait Implementations§

source§

impl<'de, T> DeserializeAs<'de, T> for Hexwhere + T: FromHex, + T::Error: Display,

source§

fn deserialize_as<D>(deserializer: D) -> Result<T, D::Error>where + D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer.
source§

impl<T> SerializeAs<T> for Hexwhere + T: ToHex,

source§

fn serialize_as<S>(source: &T, serializer: S) -> Result<S::Ok, S::Error>where + S: Serializer,

Serialize this value into the given Serde serializer.

Auto Trait Implementations§

§

impl RefUnwindSafe for Hex

§

impl Send for Hex

§

impl Sync for Hex

§

impl Unpin for Hex

§

impl UnwindSafe for Hex

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/hex_utils/sidebar-items.js b/hex_utils/sidebar-items.js new file mode 100644 index 0000000000..41833c0ee9 --- /dev/null +++ b/hex_utils/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["FromHexError"],"fn":["decode_hex","encode_hex_0x","encode_hex_0x_zero_pad","encode_hex_no_prefix"],"mod":["serde_as"]}; \ No newline at end of file diff --git a/index.html b/index.html new file mode 100644 index 0000000000..1b8322443a --- /dev/null +++ b/index.html @@ -0,0 +1 @@ +Index of crates

List of all crates

\ No newline at end of file diff --git a/ivalue_utils/all.html b/ivalue_utils/all.html new file mode 100644 index 0000000000..c9e34c84c3 --- /dev/null +++ b/ivalue_utils/all.html @@ -0,0 +1 @@ +List of all items in this crate

List of all items

Enums

Functions

\ No newline at end of file diff --git a/ivalue_utils/enum.IType.html b/ivalue_utils/enum.IType.html new file mode 100644 index 0000000000..9448f78e7b --- /dev/null +++ b/ivalue_utils/enum.IType.html @@ -0,0 +1,69 @@ +IType in ivalue_utils - Rust

Enum ivalue_utils::IType

pub enum IType {
+
Show 17 variants Boolean, + S8, + S16, + S32, + S64, + U8, + U16, + U32, + U64, + F32, + F64, + String, + ByteArray, + Array(Box<IType>), + I32, + I64, + Record(u64), +
}
Expand description

Represents the types supported by WIT.

+

Variants§

§

Boolean

Boolean.

+
§

S8

A 8-bits signed integer.

+
§

S16

A 16-bits signed integer.

+
§

S32

A 32-bits signed integer.

+
§

S64

A 64-bits signed integer.

+
§

U8

A 8-bits unsigned integer.

+
§

U16

A 16-bits unsigned integer.

+
§

U32

A 32-bits unsigned integer.

+
§

U64

A 64-bits unsigned integer.

+
§

F32

A 32-bits float.

+
§

F64

A 64-bits float.

+
§

String

A string.

+
§

ByteArray

Specialization of arrays for byte vector.

+
§

Array(Box<IType>)

An array of values of the same type.

+
§

I32

A 32-bits integer (as defined in WebAssembly core).

+
§

I64

A 64-bits integer (as defined in WebAssembly core).

+
§

Record(u64)

A record contains record index from interfaces AST.

+

Implementations§

§

impl IType

pub const VARIANT_COUNT: usize = 17usize

Trait Implementations§

§

impl Clone for IType

§

fn clone(&self) -> IType

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for IType

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl<'de> Deserialize<'de> for IType

§

fn deserialize<__D>( + __deserializer: __D +) -> Result<IType, <__D as Deserializer<'de>>::Error>where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
§

impl Hash for IType

§

fn hash<__H>(&self, state: &mut __H)where + __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
§

impl Parse<'_> for IType

§

fn parse(parser: Parser<'_>) -> Result<IType, Error>

Attempts to parse Self from parser, returning an error if it could +not be parsed. Read more
§

impl PartialEq for IType

§

fn eq(&self, other: &IType) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
§

impl Serialize for IType

§

fn serialize<__S>( + &self, + __serializer: __S +) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more
§

impl<W> ToBytes<W> for ITypewhere + W: Write,

Encode an IType into bytes.

+
§

fn to_bytes(&self, writer: &mut W) -> Result<(), Error>

Converts the given value into &[u8] in the given writer.
§

impl ToString for &IType

Encode an IType into a string.

+
§

fn to_string(&self) -> String

Converts the given value to a String. Read more
§

impl Eq for IType

§

impl StructuralEq for IType

§

impl StructuralPartialEq for IType

Auto Trait Implementations§

§

impl RefUnwindSafe for IType

§

impl Send for IType

§

impl Sync for IType

§

impl Unpin for IType

§

impl UnwindSafe for IType

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> DeserializeOwned for Twhere + T: for<'de> Deserialize<'de>,

\ No newline at end of file diff --git a/ivalue_utils/enum.IValue.html b/ivalue_utils/enum.IValue.html new file mode 100644 index 0000000000..398e4f3f5c --- /dev/null +++ b/ivalue_utils/enum.IValue.html @@ -0,0 +1,50 @@ +IValue in ivalue_utils - Rust

Enum ivalue_utils::IValue

pub enum IValue {
+
Show 17 variants Boolean(bool), + S8(i8), + S16(i16), + S32(i32), + S64(i64), + U8(u8), + U16(u16), + U32(u32), + U64(u64), + F32(f32), + F64(f64), + String(String), + ByteArray(Vec<u8>), + Array(Vec<IValue>), + I32(i32), + I64(i64), + Record(NEVec<IValue>), +
}
Expand description

A WIT value.

+

Variants§

§

Boolean(bool)

Boolean value.

+
§

S8(i8)

A 8-bits signed integer.

+
§

S16(i16)

A 16-bits signed integer.

+
§

S32(i32)

A 32-bits signed integer.

+
§

S64(i64)

A 64-bits signed integer.

+
§

U8(u8)

A 8-bits unsigned integer.

+
§

U16(u16)

A 16-bits unsigned integer.

+
§

U32(u32)

A 32-bits unsigned integer.

+
§

U64(u64)

A 64-bits unsigned integer.

+
§

F32(f32)

A 32-bits float.

+
§

F64(f64)

A 64-bits float.

+
§

String(String)

A string.

+
§

ByteArray(Vec<u8>)

Specialization of array type for byte vector.

+
§

Array(Vec<IValue>)

A byte array.

+
§

I32(i32)

A 32-bits integer (as defined in WebAssembly core).

+
§

I64(i64)

A 64-bits integer (as defined in WebAssembly core).

+
§

Record(NEVec<IValue>)

A record.

+

Implementations§

§

impl IValue

pub const VARIANT_COUNT: usize = 17usize

Trait Implementations§

§

impl Clone for IValue

§

fn clone(&self) -> IValue

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for IValue

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Default for IValue

§

fn default() -> IValue

Returns the “default value” for a type. Read more
§

impl From<String> for IValue

§

fn from(n: String) -> IValue

Converts to this type from the input type.
§

impl From<Vec<u8>> for IValue

§

fn from(n: Vec<u8>) -> IValue

Converts to this type from the input type.
§

impl From<f32> for IValue

§

fn from(n: f32) -> IValue

Converts to this type from the input type.
§

impl From<f64> for IValue

§

fn from(n: f64) -> IValue

Converts to this type from the input type.
§

impl From<i16> for IValue

§

fn from(n: i16) -> IValue

Converts to this type from the input type.
§

impl From<i32> for IValue

§

fn from(n: i32) -> IValue

Converts to this type from the input type.
§

impl From<i64> for IValue

§

fn from(n: i64) -> IValue

Converts to this type from the input type.
§

impl From<i8> for IValue

§

fn from(n: i8) -> IValue

Converts to this type from the input type.
§

impl From<u16> for IValue

§

fn from(n: u16) -> IValue

Converts to this type from the input type.
§

impl From<u32> for IValue

§

fn from(n: u32) -> IValue

Converts to this type from the input type.
§

impl From<u64> for IValue

§

fn from(n: u64) -> IValue

Converts to this type from the input type.
§

impl From<u8> for IValue

§

fn from(n: u8) -> IValue

Converts to this type from the input type.
§

impl PartialEq for IValue

§

fn eq(&self, other: &IValue) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
§

impl TryFrom<IValue> for Vec<u8>

§

type Error = WasmValueNativeCastError

The type returned in the event of a conversion error.
§

fn try_from(w: IValue) -> Result<Vec<u8>, <Vec<u8> as TryFrom<IValue>>::Error>

Performs the conversion.
§

impl StructuralPartialEq for IValue

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/ivalue_utils/fn.as_str.html b/ivalue_utils/fn.as_str.html new file mode 100644 index 0000000000..9d4b44ab3c --- /dev/null +++ b/ivalue_utils/fn.as_str.html @@ -0,0 +1 @@ +as_str in ivalue_utils - Rust

Function ivalue_utils::as_str

source ·
pub fn as_str(v: &IValue) -> Option<&str>
\ No newline at end of file diff --git a/ivalue_utils/fn.error.html b/ivalue_utils/fn.error.html new file mode 100644 index 0000000000..8355d7ad62 --- /dev/null +++ b/ivalue_utils/fn.error.html @@ -0,0 +1,2 @@ +error in ivalue_utils - Rust

Function ivalue_utils::error

source ·
pub fn error(err: Value) -> Option<IValue>
Expand description

Converts erroneous result of call_service into IValue::Record

+
\ No newline at end of file diff --git a/ivalue_utils/fn.into_record.html b/ivalue_utils/fn.into_record.html new file mode 100644 index 0000000000..4e690e7beb --- /dev/null +++ b/ivalue_utils/fn.into_record.html @@ -0,0 +1,2 @@ +into_record in ivalue_utils - Rust

Function ivalue_utils::into_record

source ·
pub fn into_record(v: Result<Value, Value>) -> Option<IValue>
Expand description

Converts result of call_service into IValue::Record

+
\ No newline at end of file diff --git a/ivalue_utils/fn.into_record_opt.html b/ivalue_utils/fn.into_record_opt.html new file mode 100644 index 0000000000..87741f31b4 --- /dev/null +++ b/ivalue_utils/fn.into_record_opt.html @@ -0,0 +1,2 @@ +into_record_opt in ivalue_utils - Rust
pub fn into_record_opt(v: Result<Option<Value>, Value>) -> Option<IValue>
Expand description

Converts result of call_service into IValue::Record

+
\ No newline at end of file diff --git a/ivalue_utils/fn.into_string.html b/ivalue_utils/fn.into_string.html new file mode 100644 index 0000000000..499983329b --- /dev/null +++ b/ivalue_utils/fn.into_string.html @@ -0,0 +1 @@ +into_string in ivalue_utils - Rust

Function ivalue_utils::into_string

source ·
pub fn into_string(v: IValue) -> Option<String>
\ No newline at end of file diff --git a/ivalue_utils/fn.ok.html b/ivalue_utils/fn.ok.html new file mode 100644 index 0000000000..8953511554 --- /dev/null +++ b/ivalue_utils/fn.ok.html @@ -0,0 +1,2 @@ +ok in ivalue_utils - Rust

Function ivalue_utils::ok

source ·
pub fn ok(value: Value) -> Option<IValue>
Expand description

Converts successful result of call_service into IValue::Record

+
\ No newline at end of file diff --git a/ivalue_utils/fn.unit.html b/ivalue_utils/fn.unit.html new file mode 100644 index 0000000000..929a5b3d30 --- /dev/null +++ b/ivalue_utils/fn.unit.html @@ -0,0 +1,2 @@ +unit in ivalue_utils - Rust

Function ivalue_utils::unit

source ·
pub fn unit() -> Option<IValue>
Expand description

Converts empty result of call_service into IValue::Record

+
\ No newline at end of file diff --git a/ivalue_utils/index.html b/ivalue_utils/index.html new file mode 100644 index 0000000000..2723c47469 --- /dev/null +++ b/ivalue_utils/index.html @@ -0,0 +1,2 @@ +ivalue_utils - Rust

Crate ivalue_utils

source ·

Enums

  • Represents the types supported by WIT.
  • A WIT value.

Functions

  • Converts erroneous result of call_service into IValue::Record
  • Converts result of call_service into IValue::Record
  • Converts result of call_service into IValue::Record
  • Converts successful result of call_service into IValue::Record
  • Converts empty result of call_service into IValue::Record
\ No newline at end of file diff --git a/ivalue_utils/sidebar-items.js b/ivalue_utils/sidebar-items.js new file mode 100644 index 0000000000..998637176e --- /dev/null +++ b/ivalue_utils/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["IType","IValue"],"fn":["as_str","error","into_record","into_record_opt","into_string","ok","unit"]}; \ No newline at end of file diff --git a/json_utils/all.html b/json_utils/all.html new file mode 100644 index 0000000000..5efa581e73 --- /dev/null +++ b/json_utils/all.html @@ -0,0 +1 @@ +List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/json_utils/base64_serde/fn.deserialize.html b/json_utils/base64_serde/fn.deserialize.html new file mode 100644 index 0000000000..51b9de640e --- /dev/null +++ b/json_utils/base64_serde/fn.deserialize.html @@ -0,0 +1,2 @@ +deserialize in json_utils::base64_serde - Rust
pub fn deserialize<'de, D>(deserializer: D) -> Result<Vec<u8>, D::Error>where
+    D: Deserializer<'de>,
\ No newline at end of file diff --git a/json_utils/base64_serde/fn.serialize.html b/json_utils/base64_serde/fn.serialize.html new file mode 100644 index 0000000000..86263d4377 --- /dev/null +++ b/json_utils/base64_serde/fn.serialize.html @@ -0,0 +1,2 @@ +serialize in json_utils::base64_serde - Rust
pub fn serialize<S>(value: &Vec<u8>, serializer: S) -> Result<S::Ok, S::Error>where
+    S: Serializer,
\ No newline at end of file diff --git a/json_utils/base64_serde/index.html b/json_utils/base64_serde/index.html new file mode 100644 index 0000000000..93fb716331 --- /dev/null +++ b/json_utils/base64_serde/index.html @@ -0,0 +1 @@ +json_utils::base64_serde - Rust

Functions

\ No newline at end of file diff --git a/json_utils/base64_serde/sidebar-items.js b/json_utils/base64_serde/sidebar-items.js new file mode 100644 index 0000000000..4ed511ecee --- /dev/null +++ b/json_utils/base64_serde/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"fn":["deserialize","serialize"]}; \ No newline at end of file diff --git a/json_utils/fn.err_as_value.html b/json_utils/fn.err_as_value.html new file mode 100644 index 0000000000..4b681b51fc --- /dev/null +++ b/json_utils/fn.err_as_value.html @@ -0,0 +1,2 @@ +err_as_value in json_utils - Rust

Function json_utils::err_as_value

source ·
pub fn err_as_value<E: Debug + Display>(err: E) -> Value
Expand description

Converts an error into IValue::String

+
\ No newline at end of file diff --git a/json_utils/fn.into_array.html b/json_utils/fn.into_array.html new file mode 100644 index 0000000000..0ea56b32ab --- /dev/null +++ b/json_utils/fn.into_array.html @@ -0,0 +1 @@ +into_array in json_utils - Rust

Function json_utils::into_array

source ·
pub fn into_array(v: Value) -> Option<Vec<Value>>
\ No newline at end of file diff --git a/json_utils/fn.into_string.html b/json_utils/fn.into_string.html new file mode 100644 index 0000000000..0e3d18681f --- /dev/null +++ b/json_utils/fn.into_string.html @@ -0,0 +1 @@ +into_string in json_utils - Rust

Function json_utils::into_string

source ·
pub fn into_string(v: Value) -> Option<String>
\ No newline at end of file diff --git a/json_utils/index.html b/json_utils/index.html new file mode 100644 index 0000000000..7b37484858 --- /dev/null +++ b/json_utils/index.html @@ -0,0 +1,2 @@ +json_utils - Rust

Crate json_utils

source ·

Modules

Functions

\ No newline at end of file diff --git a/json_utils/sidebar-items.js b/json_utils/sidebar-items.js new file mode 100644 index 0000000000..9b7c030d7a --- /dev/null +++ b/json_utils/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"fn":["err_as_value","into_array","into_string"],"mod":["base64_serde"]}; \ No newline at end of file diff --git a/kademlia/all.html b/kademlia/all.html new file mode 100644 index 0000000000..8f6108e3cd --- /dev/null +++ b/kademlia/all.html @@ -0,0 +1 @@ +List of all items in this crate

List of all items

Structs

Enums

Traits

\ No newline at end of file diff --git a/kademlia/api/enum.Command.html b/kademlia/api/enum.Command.html new file mode 100644 index 0000000000..0400160331 --- /dev/null +++ b/kademlia/api/enum.Command.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../kademlia/enum.Command.html...

+ + + \ No newline at end of file diff --git a/kademlia/api/struct.KademliaApi.html b/kademlia/api/struct.KademliaApi.html new file mode 100644 index 0000000000..f3993f8703 --- /dev/null +++ b/kademlia/api/struct.KademliaApi.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../kademlia/struct.KademliaApi.html...

+ + + \ No newline at end of file diff --git a/kademlia/api/trait.KademliaApiT.html b/kademlia/api/trait.KademliaApiT.html new file mode 100644 index 0000000000..d798515357 --- /dev/null +++ b/kademlia/api/trait.KademliaApiT.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../kademlia/trait.KademliaApiT.html...

+ + + \ No newline at end of file diff --git a/kademlia/behaviour/struct.Kademlia.html b/kademlia/behaviour/struct.Kademlia.html new file mode 100644 index 0000000000..82c3877c76 --- /dev/null +++ b/kademlia/behaviour/struct.Kademlia.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../kademlia/struct.Kademlia.html...

+ + + \ No newline at end of file diff --git a/kademlia/behaviour/struct.KademliaConfig.html b/kademlia/behaviour/struct.KademliaConfig.html new file mode 100644 index 0000000000..f80d1bc748 --- /dev/null +++ b/kademlia/behaviour/struct.KademliaConfig.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../kademlia/struct.KademliaConfig.html...

+ + + \ No newline at end of file diff --git a/kademlia/enum.Command.html b/kademlia/enum.Command.html new file mode 100644 index 0000000000..e55410d88d --- /dev/null +++ b/kademlia/enum.Command.html @@ -0,0 +1,44 @@ +Command in kademlia - Rust

Enum kademlia::Command

source ·
pub enum Command {
+    AddContact {
+        contact: Contact,
+    },
+    LocalLookup {
+        peer: PeerId,
+        out: Sender<Vec<Multiaddr>>,
+    },
+    Bootstrap {
+        out: Sender<Result<(), KademliaError>>,
+    },
+    DiscoverPeer {
+        peer: PeerId,
+        out: Sender<Result<Vec<Multiaddr>, KademliaError>>,
+    },
+    Neighborhood {
+        key: Multihash<64>,
+        count: usize,
+        out: Sender<Result<Vec<PeerId>, KademliaError>>,
+    },
+}

Variants§

§

AddContact

Fields

§contact: Contact
§

LocalLookup

Fields

§peer: PeerId
§out: Sender<Vec<Multiaddr>>
§

Bootstrap

Fields

§out: Sender<Result<(), KademliaError>>
§

DiscoverPeer

Fields

§peer: PeerId
§out: Sender<Result<Vec<Multiaddr>, KademliaError>>
§

Neighborhood

Fields

§key: Multihash<64>
§count: usize
§out: Sender<Result<Vec<PeerId>, KademliaError>>

Trait Implementations§

source§

impl Debug for Command

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/kademlia/enum.KademliaError.html b/kademlia/enum.KademliaError.html new file mode 100644 index 0000000000..cef94bbed0 --- /dev/null +++ b/kademlia/enum.KademliaError.html @@ -0,0 +1,32 @@ +KademliaError in kademlia - Rust
pub enum KademliaError {
+    NoPeersFound,
+    PeerTimedOut,
+    QueryTimedOut,
+    Cancelled,
+    NoKnownPeers,
+    PeerBanned,
+}

Variants§

§

NoPeersFound

§

PeerTimedOut

§

QueryTimedOut

§

Cancelled

§

NoKnownPeers

§

PeerBanned

Trait Implementations§

source§

impl Debug for KademliaError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for KademliaError

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for KademliaError

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/kademlia/error/enum.KademliaError.html b/kademlia/error/enum.KademliaError.html new file mode 100644 index 0000000000..f854c94d50 --- /dev/null +++ b/kademlia/error/enum.KademliaError.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../kademlia/enum.KademliaError.html...

+ + + \ No newline at end of file diff --git a/kademlia/index.html b/kademlia/index.html new file mode 100644 index 0000000000..c33fe56542 --- /dev/null +++ b/kademlia/index.html @@ -0,0 +1,2 @@ +kademlia - Rust

Crate kademlia

source ·

Structs

Enums

Traits

\ No newline at end of file diff --git a/kademlia/sidebar-items.js b/kademlia/sidebar-items.js new file mode 100644 index 0000000000..fab1b7cb58 --- /dev/null +++ b/kademlia/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["Command","KademliaError"],"struct":["Kademlia","KademliaApi","KademliaConfig"],"trait":["KademliaApiT"]}; \ No newline at end of file diff --git a/kademlia/struct.Kademlia.html b/kademlia/struct.Kademlia.html new file mode 100644 index 0000000000..8d5b619a44 --- /dev/null +++ b/kademlia/struct.Kademlia.html @@ -0,0 +1,72 @@ +Kademlia in kademlia - Rust

Struct kademlia::Kademlia

source ·
pub struct Kademlia { /* private fields */ }

Implementations§

source§

impl Kademlia

source

pub fn new( + config: KademliaConfig, + metrics: Option<Arc<Metrics>> +) -> (Self, KademliaApi)

source

pub fn add_kad_node(&mut self, peer: PeerId, addresses: Vec<Multiaddr>)

source§

impl Kademlia

source

pub fn add_contact(&mut self, contact: Contact)

source

pub fn bootstrap(&mut self, outlet: Sender<Result<(), KademliaError>>)

source

pub fn local_lookup(&mut self, peer_id: &PeerId, outlet: Sender<Vec<Multiaddr>>)

source

pub fn discover_peer( + &mut self, + peer: PeerId, + outlet: Sender<Result<Vec<Multiaddr>, KademliaError>> +)

source

pub fn neighborhood( + &mut self, + key: Multihash<64>, + count: usize, + outlet: Sender<Result<Vec<PeerId>, KademliaError>> +)

source

pub fn remote_neighborhood( + &mut self, + key: Multihash<64>, + outlet: Sender<Result<Vec<PeerId>, KademliaError>> +)

source

pub fn protocol_name(&self) -> &StreamProtocol

Trait Implementations§

source§

impl NetworkBehaviour for Kademlia

§

type ConnectionHandler = <Behaviour<MemoryStore> as NetworkBehaviour>::ConnectionHandler

Handler for all the protocols the network behaviour supports.
§

type ToSwarm = ()

Event generated by the NetworkBehaviour and that the swarm will report back.
source§

fn handle_pending_inbound_connection( + &mut self, + _connection_id: ConnectionId, + _local_addr: &Multiaddr, + _remote_addr: &Multiaddr +) -> Result<(), ConnectionDenied>

Callback that is invoked for every new inbound connection. Read more
source§

fn handle_established_inbound_connection( + &mut self, + connection_id: ConnectionId, + peer_id: PeerId, + local_addr: &Multiaddr, + remote_addr: &Multiaddr +) -> Result<THandler<Self>, ConnectionDenied>

Callback that is invoked for every established inbound connection. Read more
source§

fn handle_pending_outbound_connection( + &mut self, + _connection_id: ConnectionId, + maybe_peer: Option<PeerId>, + _addresses: &[Multiaddr], + _effective_role: Endpoint +) -> Result<Vec<Multiaddr>, ConnectionDenied>

Callback that is invoked for every outbound connection attempt. Read more
source§

fn handle_established_outbound_connection( + &mut self, + connection_id: ConnectionId, + peer_id: PeerId, + addr: &Multiaddr, + role_override: Endpoint +) -> Result<THandler<Self>, ConnectionDenied>

Callback that is invoked for every established outbound connection. Read more
source§

fn on_swarm_event(&mut self, event: FromSwarm<'_>)

Informs the behaviour about an event from the Swarm.
source§

fn on_connection_handler_event( + &mut self, + peer_id: PeerId, + connection_id: ConnectionId, + event: THandlerOutEvent<Self> +)

Informs the behaviour about an event generated by the [ConnectionHandler] +dedicated to the peer identified by peer_id. for the behaviour. Read more
source§

fn poll( + &mut self, + cx: &mut Context<'_> +) -> Poll<ToSwarm<(), THandlerInEvent<Self>>>

Polls for things that swarm should do. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/kademlia/struct.KademliaApi.html b/kademlia/struct.KademliaApi.html new file mode 100644 index 0000000000..3374909e91 --- /dev/null +++ b/kademlia/struct.KademliaApi.html @@ -0,0 +1,37 @@ +KademliaApi in kademlia - Rust

Struct kademlia::KademliaApi

source ·
pub struct KademliaApi {
+    pub outlet: UnboundedSender<Command>,
+}

Fields§

§outlet: UnboundedSender<Command>

Trait Implementations§

source§

impl Clone for KademliaApi

source§

fn clone(&self) -> KademliaApi

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for KademliaApi

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl KademliaApiT for KademliaApi

source§

fn bootstrap(&self) -> BoxFuture<'static, Result<(), KademliaError>>

source§

fn add_contact(&self, contact: Contact) -> bool

source§

fn local_lookup( + &self, + peer: PeerId +) -> BoxFuture<'static, Result<Vec<Multiaddr>, KademliaError>>

source§

fn discover_peer( + &self, + peer: PeerId +) -> BoxFuture<'static, Result<Vec<Multiaddr>, KademliaError>>

source§

fn neighborhood( + &self, + key: Multihash<64>, + count: usize +) -> BoxFuture<'static, Result<Vec<PeerId>, KademliaError>>

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/kademlia/struct.KademliaConfig.html b/kademlia/struct.KademliaConfig.html new file mode 100644 index 0000000000..ddb5021279 --- /dev/null +++ b/kademlia/struct.KademliaConfig.html @@ -0,0 +1,33 @@ +KademliaConfig in kademlia - Rust
pub struct KademliaConfig {
+    pub peer_id: PeerId,
+    pub max_packet_size: Option<usize>,
+    pub query_timeout: Duration,
+    pub replication_factor: Option<usize>,
+    pub peer_fail_threshold: usize,
+    pub ban_cooldown: Duration,
+    pub protocol_name: StreamProtocol,
+}

Fields§

§peer_id: PeerId§max_packet_size: Option<usize>§query_timeout: Duration§replication_factor: Option<usize>§peer_fail_threshold: usize§ban_cooldown: Duration§protocol_name: StreamProtocol

Trait Implementations§

source§

impl Clone for KademliaConfig

source§

fn clone(&self) -> KademliaConfig

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for KademliaConfig

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<KademliaConfig> for Config

source§

fn from(value: KademliaConfig) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/kademlia/trait.KademliaApiT.html b/kademlia/trait.KademliaApiT.html new file mode 100644 index 0000000000..fd84588ebe --- /dev/null +++ b/kademlia/trait.KademliaApiT.html @@ -0,0 +1,28 @@ +KademliaApiT in kademlia - Rust
pub trait KademliaApiT {
+    // Required methods
+    fn bootstrap(&self) -> BoxFuture<'static, Result<(), KademliaError>>;
+    fn add_contact(&self, contact: Contact) -> bool;
+    fn local_lookup(
+        &self,
+        peer: PeerId
+    ) -> BoxFuture<'static, Result<Vec<Multiaddr>, KademliaError>>;
+    fn discover_peer(
+        &self,
+        peer: PeerId
+    ) -> BoxFuture<'static, Result<Vec<Multiaddr>, KademliaError>>;
+    fn neighborhood(
+        &self,
+        key: Multihash<64>,
+        count: usize
+    ) -> BoxFuture<'static, Result<Vec<PeerId>, KademliaError>>;
+}

Required Methods§

source

fn bootstrap(&self) -> BoxFuture<'static, Result<(), KademliaError>>

source

fn add_contact(&self, contact: Contact) -> bool

source

fn local_lookup( + &self, + peer: PeerId +) -> BoxFuture<'static, Result<Vec<Multiaddr>, KademliaError>>

source

fn discover_peer( + &self, + peer: PeerId +) -> BoxFuture<'static, Result<Vec<Multiaddr>, KademliaError>>

source

fn neighborhood( + &self, + key: Multihash<64>, + count: usize +) -> BoxFuture<'static, Result<Vec<PeerId>, KademliaError>>

Implementors§

\ No newline at end of file diff --git a/local_vm/all.html b/local_vm/all.html new file mode 100644 index 0000000000..283ebfb96a --- /dev/null +++ b/local_vm/all.html @@ -0,0 +1 @@ +List of all items in this crate

List of all items

Structs

Enums

Functions

Type Aliases

\ No newline at end of file diff --git a/local_vm/enum.DataStoreError.html b/local_vm/enum.DataStoreError.html new file mode 100644 index 0000000000..97a2ed0b3e --- /dev/null +++ b/local_vm/enum.DataStoreError.html @@ -0,0 +1,44 @@ +DataStoreError in local_vm - Rust
pub enum DataStoreError {
+    CreateDataStore(Error),
+    VaultError(VaultError),
+    StoreData(Error, PathBuf),
+    CleanupData(Error),
+    CreateAnomalyDir(Error),
+    WriteAnomaly(Error, PathBuf),
+    SerializeAnomaly(Error),
+    ReadData(Error, PathBuf),
+}

Variants§

§

CreateDataStore(Error)

§

VaultError(VaultError)

§

StoreData(Error, PathBuf)

§

CleanupData(Error)

§

CreateAnomalyDir(Error)

§

WriteAnomaly(Error, PathBuf)

§

SerializeAnomaly(Error)

§

ReadData(Error, PathBuf)

Trait Implementations§

source§

impl Debug for DataStoreError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Display for DataStoreError

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Error for DataStoreError

source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl From<VaultError> for DataStoreError

source§

fn from(source: VaultError) -> DataStoreError

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/local_vm/enum.Instruction.html b/local_vm/enum.Instruction.html new file mode 100644 index 0000000000..036b9caf6a --- /dev/null +++ b/local_vm/enum.Instruction.html @@ -0,0 +1,48 @@ +Instruction in local_vm - Rust
pub enum Instruction {
+    Seq(Box<Instruction>, Box<Instruction>),
+    Call(String),
+    Null,
+}

Variants§

Implementations§

source§

impl Instruction

source

pub fn add(self, call: String) -> Self

source

pub fn into_air(self) -> String

Trait Implementations§

source§

impl Debug for Instruction

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq for Instruction

source§

fn eq(&self, other: &Instruction) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for Instruction

source§

impl StructuralEq for Instruction

source§

impl StructuralPartialEq for Instruction

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/local_vm/fn.client_functions.html b/local_vm/fn.client_functions.html new file mode 100644 index 0000000000..c4785f33d8 --- /dev/null +++ b/local_vm/fn.client_functions.html @@ -0,0 +1,4 @@ +client_functions in local_vm - Rust

Function local_vm::client_functions

source ·
pub fn client_functions(
+    data: &HashMap<String, Value>,
+    args: Args
+) -> ClientFunctionsResult
\ No newline at end of file diff --git a/local_vm/fn.host_call.html b/local_vm/fn.host_call.html new file mode 100644 index 0000000000..14ea28df39 --- /dev/null +++ b/local_vm/fn.host_call.html @@ -0,0 +1,4 @@ +host_call in local_vm - Rust

Function local_vm::host_call

source ·
pub fn host_call(
+    data: &HashMap<String, Value>,
+    args: Args
+) -> (CallServiceResult, Returned)
\ No newline at end of file diff --git a/local_vm/fn.make_particle.html b/local_vm/fn.make_particle.html new file mode 100644 index 0000000000..c70f033866 --- /dev/null +++ b/local_vm/fn.make_particle.html @@ -0,0 +1,11 @@ +make_particle in local_vm - Rust

Function local_vm::make_particle

source ·
pub async fn make_particle(
+    peer_id: PeerId,
+    service_in: &HashMap<String, Value>,
+    script: String,
+    relay: impl Into<Option<PeerId>>,
+    local_vm: &mut AVMRunner<WasmtimeWasmBackend>,
+    data_store: Arc<ParticleDataStore>,
+    generated: bool,
+    particle_ttl: Duration,
+    key_pair: &KeyPair
+) -> Particle
\ No newline at end of file diff --git a/local_vm/fn.make_vm.html b/local_vm/fn.make_vm.html new file mode 100644 index 0000000000..7eeeeeb43f --- /dev/null +++ b/local_vm/fn.make_vm.html @@ -0,0 +1 @@ +make_vm in local_vm - Rust

Function local_vm::make_vm

source ·
pub async fn make_vm(tmp_dir_path: &Path) -> AVMRunner<WasmtimeWasmBackend>
\ No newline at end of file diff --git a/local_vm/fn.make_wasm_backend.html b/local_vm/fn.make_wasm_backend.html new file mode 100644 index 0000000000..fd1cd926c3 --- /dev/null +++ b/local_vm/fn.make_wasm_backend.html @@ -0,0 +1 @@ +make_wasm_backend in local_vm - Rust
pub fn make_wasm_backend() -> WasmtimeWasmBackend
\ No newline at end of file diff --git a/local_vm/fn.read_args.html b/local_vm/fn.read_args.html new file mode 100644 index 0000000000..3da0932935 --- /dev/null +++ b/local_vm/fn.read_args.html @@ -0,0 +1,7 @@ +read_args in local_vm - Rust

Function local_vm::read_args

source ·
pub async fn read_args(
+    particle: Particle,
+    peer_id: PeerId,
+    local_vm: &mut AVMRunner<WasmtimeWasmBackend>,
+    data_store: Arc<ParticleDataStore>,
+    key_pair: &KeyPair
+) -> Option<Result<Vec<JValue>, Vec<JValue>>>
\ No newline at end of file diff --git a/local_vm/fn.wrap_script.html b/local_vm/fn.wrap_script.html new file mode 100644 index 0000000000..542ea47c84 --- /dev/null +++ b/local_vm/fn.wrap_script.html @@ -0,0 +1,7 @@ +wrap_script in local_vm - Rust

Function local_vm::wrap_script

source ·
pub fn wrap_script(
+    script: String,
+    data: &HashMap<String, Value>,
+    relay: impl Into<Option<PeerId>>,
+    generated: bool,
+    executor: Option<PeerId>
+) -> String
\ No newline at end of file diff --git a/local_vm/index.html b/local_vm/index.html new file mode 100644 index 0000000000..81c0624c81 --- /dev/null +++ b/local_vm/index.html @@ -0,0 +1,2 @@ +local_vm - Rust

Crate local_vm

source ·

Structs

Enums

Functions

Type Aliases

\ No newline at end of file diff --git a/local_vm/local_vm/enum.Instruction.html b/local_vm/local_vm/enum.Instruction.html new file mode 100644 index 0000000000..c9ee7e1e66 --- /dev/null +++ b/local_vm/local_vm/enum.Instruction.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../local_vm/enum.Instruction.html...

+ + + \ No newline at end of file diff --git a/local_vm/local_vm/fn.client_functions.html b/local_vm/local_vm/fn.client_functions.html new file mode 100644 index 0000000000..cd767ac7f0 --- /dev/null +++ b/local_vm/local_vm/fn.client_functions.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../local_vm/fn.client_functions.html...

+ + + \ No newline at end of file diff --git a/local_vm/local_vm/fn.host_call.html b/local_vm/local_vm/fn.host_call.html new file mode 100644 index 0000000000..8425e585c2 --- /dev/null +++ b/local_vm/local_vm/fn.host_call.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../local_vm/fn.host_call.html...

+ + + \ No newline at end of file diff --git a/local_vm/local_vm/fn.make_particle.html b/local_vm/local_vm/fn.make_particle.html new file mode 100644 index 0000000000..8fb447f4f3 --- /dev/null +++ b/local_vm/local_vm/fn.make_particle.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../local_vm/fn.make_particle.html...

+ + + \ No newline at end of file diff --git a/local_vm/local_vm/fn.make_vm.html b/local_vm/local_vm/fn.make_vm.html new file mode 100644 index 0000000000..879236d0c0 --- /dev/null +++ b/local_vm/local_vm/fn.make_vm.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../local_vm/fn.make_vm.html...

+ + + \ No newline at end of file diff --git a/local_vm/local_vm/fn.make_wasm_backend.html b/local_vm/local_vm/fn.make_wasm_backend.html new file mode 100644 index 0000000000..64e76e34b1 --- /dev/null +++ b/local_vm/local_vm/fn.make_wasm_backend.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../local_vm/fn.make_wasm_backend.html...

+ + + \ No newline at end of file diff --git a/local_vm/local_vm/fn.read_args.html b/local_vm/local_vm/fn.read_args.html new file mode 100644 index 0000000000..ea336fa2e6 --- /dev/null +++ b/local_vm/local_vm/fn.read_args.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../local_vm/fn.read_args.html...

+ + + \ No newline at end of file diff --git a/local_vm/local_vm/fn.wrap_script.html b/local_vm/local_vm/fn.wrap_script.html new file mode 100644 index 0000000000..b9e72e034a --- /dev/null +++ b/local_vm/local_vm/fn.wrap_script.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../local_vm/fn.wrap_script.html...

+ + + \ No newline at end of file diff --git a/local_vm/local_vm/struct.ClientFunctionsResult.html b/local_vm/local_vm/struct.ClientFunctionsResult.html new file mode 100644 index 0000000000..9b24597828 --- /dev/null +++ b/local_vm/local_vm/struct.ClientFunctionsResult.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../local_vm/struct.ClientFunctionsResult.html...

+ + + \ No newline at end of file diff --git a/local_vm/local_vm/type.Returned.html b/local_vm/local_vm/type.Returned.html new file mode 100644 index 0000000000..e8b01d2b24 --- /dev/null +++ b/local_vm/local_vm/type.Returned.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../local_vm/type.Returned.html...

+ + + \ No newline at end of file diff --git a/local_vm/sidebar-items.js b/local_vm/sidebar-items.js new file mode 100644 index 0000000000..dde9713e6d --- /dev/null +++ b/local_vm/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["DataStoreError","Instruction"],"fn":["client_functions","host_call","make_particle","make_vm","make_wasm_backend","read_args","wrap_script"],"struct":["AVMRunner","ClientFunctionsResult","ParticleDataStore"],"type":["Returned"]}; \ No newline at end of file diff --git a/local_vm/struct.AVMRunner.html b/local_vm/struct.AVMRunner.html new file mode 100644 index 0000000000..0c5592b521 --- /dev/null +++ b/local_vm/struct.AVMRunner.html @@ -0,0 +1,96 @@ +AVMRunner in local_vm - Rust

Struct local_vm::AVMRunner

pub struct AVMRunner<WB>where
+    WB: WasmBackend,{ /* private fields */ }

Implementations§

§

impl<WB> AVMRunner<WB>where + WB: WasmBackend,

pub async fn new( + air_wasm_path: PathBuf, + total_memory_limit: Option<u64>, + avm_runtime_limits: AVMRuntimeLimits, + logging_mask: i32, + wasm_backend: WB +) -> Result<AVMRunner<WB>, RunnerError>

Create AVM with the provided config.

+

pub async fn call( + &mut self, + air: impl Into<String>, + prev_data: impl Into<Vec<u8>>, + data: impl Into<Vec<u8>>, + init_peer_id: impl Into<String>, + timestamp: u64, + ttl: u32, + current_peer_id: impl Into<String>, + call_results: HashMap<u32, CallServiceResult>, + keypair: &KeyPair, + particle_id: String +) -> Result<RawAVMOutcome, RunnerError>

pub async fn call_tracing( + &mut self, + air: impl Into<String>, + prev_data: impl Into<Vec<u8>>, + data: impl Into<Vec<u8>>, + init_peer_id: impl Into<String>, + timestamp: u64, + ttl: u32, + current_peer_id: impl Into<String>, + call_results: HashMap<u32, CallServiceResult>, + tracing_params: String, + tracing_output_mode: u8, + key_format: u8, + secret_key_bytes: Vec<u8>, + particle_id: String +) -> Result<RawAVMOutcome, RunnerError>

pub async fn to_human_readable_data<'this>( + &'this mut self, + data: Vec<u8> +) -> Result<String, RunnerError>

pub fn memory_stats(&self) -> AVMMemoryStats

Trait Implementations§

source§

impl AquaRuntime for AVMRunner<WasmtimeWasmBackend>

source§

fn create_runtime( + config: <AVMRunner<WasmtimeWasmBackend> as AquaRuntime>::Config, + backend: WasmtimeWasmBackend, + waker: Waker +) -> Result<AVMRunner<WasmtimeWasmBackend>, <AVMRunner<WasmtimeWasmBackend> as AquaRuntime>::Error>

Creates AVM in background (on blocking threadpool)

+
§

type Config = VmConfig

§

type Error = RunnerError

source§

fn into_effects( + outcome: Result<RawAVMOutcome, <AVMRunner<WasmtimeWasmBackend> as AquaRuntime>::Error>, + particle_id: String +) -> ParticleEffects

source§

fn call<'life0, 'life1, 'life2, 'async_trait>( + &'life0 mut self, + air: impl Into<String> + Send + 'async_trait, + prev_data: impl Into<Vec<u8>> + Send + 'async_trait, + current_data: impl Into<Vec<u8>> + Send + 'async_trait, + particle_params: ParticleParameters<'life1>, + call_results: HashMap<u32, CallServiceResult>, + key_pair: &'life2 KeyPair +) -> Pin<Box<dyn Future<Output = Result<RawAVMOutcome, <AVMRunner<WasmtimeWasmBackend> as AquaRuntime>::Error>> + Send + 'async_trait>>where + 'life0: 'async_trait, + 'life1: 'async_trait, + 'life2: 'async_trait, + AVMRunner<WasmtimeWasmBackend>: 'async_trait,

source§

fn memory_stats(&self) -> AVMMemoryStats

Return current size of memory. Use only for diagnostics purposes.

Auto Trait Implementations§

§

impl<WB> !RefUnwindSafe for AVMRunner<WB>

§

impl<WB> Send for AVMRunner<WB>where + <WB as WasmBackend>::Instance: Send,

§

impl<WB> !Sync for AVMRunner<WB>

§

impl<WB> Unpin for AVMRunner<WB>where + WB: Unpin, + <WB as WasmBackend>::Store: Unpin,

§

impl<WB> !UnwindSafe for AVMRunner<WB>

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/local_vm/struct.ClientFunctionsResult.html b/local_vm/struct.ClientFunctionsResult.html new file mode 100644 index 0000000000..e73bede069 --- /dev/null +++ b/local_vm/struct.ClientFunctionsResult.html @@ -0,0 +1,37 @@ +ClientFunctionsResult in local_vm - Rust
pub struct ClientFunctionsResult {
+    pub outcome: FunctionOutcome,
+    pub returned: Returned,
+}

Fields§

§outcome: FunctionOutcome§returned: Returned

Trait Implementations§

source§

impl Debug for ClientFunctionsResult

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/local_vm/struct.ParticleDataStore.html b/local_vm/struct.ParticleDataStore.html new file mode 100644 index 0000000000..336f295c0d --- /dev/null +++ b/local_vm/struct.ParticleDataStore.html @@ -0,0 +1,83 @@ +ParticleDataStore in local_vm - Rust
pub struct ParticleDataStore {
+    pub particle_data_store: PathBuf,
+    pub vault: ParticleVault,
+    pub anomaly_data_store: PathBuf,
+}

Fields§

§particle_data_store: PathBuf§vault: ParticleVault§anomaly_data_store: PathBuf

Implementations§

source§

impl ParticleDataStore

source

pub fn new( + particle_data_store: PathBuf, + vault_dir: PathBuf, + anomaly_data_store: PathBuf +) -> ParticleDataStore

source

pub fn data_file( + &self, + particle_id: &str, + current_peer_id: &str, + signature: &[u8] +) -> PathBuf

source

pub fn anomaly_dir( + &self, + particle_id: &str, + current_peer_id: &str, + signature: &[u8] +) -> PathBuf

Returns $ANOMALY_DATA_STORE/$particle_id/$timestamp

+
source§

impl ParticleDataStore

source

pub async fn initialize(&self) -> Result<(), DataStoreError>

source

pub async fn store_data( + &self, + data: &[u8], + particle_id: &str, + current_peer_id: &str, + signature: &[u8] +) -> Result<(), DataStoreError>

source

pub async fn read_data( + &self, + particle_id: &str, + current_peer_id: &str, + signature: &[u8] +) -> Result<Vec<u8>, DataStoreError>

source

pub async fn batch_cleanup_data( + &self, + cleanup_keys: Vec<(String, PeerId, Vec<u8>, String)> +)

source

pub fn detect_anomaly( + &self, + execution_time: Duration, + memory_delta: usize, + outcome: &RawAVMOutcome +) -> bool

source

pub async fn save_anomaly_data( + &self, + air_script: &str, + current_data: &[u8], + call_results: &HashMap<u32, CallServiceResult>, + particle_parameters: &ParticleParameters<'_>, + particle_signature: &[u8], + outcome: &RawAVMOutcome, + execution_time: Duration, + memory_delta: usize +) -> Result<(), DataStoreError>

Trait Implementations§

source§

impl Clone for ParticleDataStore

source§

fn clone(&self) -> ParticleDataStore

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ParticleDataStore

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/local_vm/type.Returned.html b/local_vm/type.Returned.html new file mode 100644 index 0000000000..a7b4688ab8 --- /dev/null +++ b/local_vm/type.Returned.html @@ -0,0 +1,6 @@ +Returned in local_vm - Rust

Type Alias local_vm::Returned

source ·
pub type Returned = Option<Result<Vec<Value>, Vec<Value>>>;

Aliased Type§

enum Returned {
+    None,
+    Some(Result<Vec<Value>, Vec<Value>>),
+}

Variants§

§1.0.0

None

No value.

+
§1.0.0

Some(Result<Vec<Value>, Vec<Value>>)

Some value of type T.

+
\ No newline at end of file diff --git a/log_format/all.html b/log_format/all.html new file mode 100644 index 0000000000..af012fcc4c --- /dev/null +++ b/log_format/all.html @@ -0,0 +1 @@ +List of all items in this crate

List of all items

Structs

\ No newline at end of file diff --git a/log_format/index.html b/log_format/index.html new file mode 100644 index 0000000000..de458c1510 --- /dev/null +++ b/log_format/index.html @@ -0,0 +1,2 @@ +log_format - Rust

Crate log_format

source ·

Structs

\ No newline at end of file diff --git a/log_format/sidebar-items.js b/log_format/sidebar-items.js new file mode 100644 index 0000000000..c27f69c946 --- /dev/null +++ b/log_format/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":["Format"]}; \ No newline at end of file diff --git a/log_format/struct.Format.html b/log_format/struct.Format.html new file mode 100644 index 0000000000..9893d65565 --- /dev/null +++ b/log_format/struct.Format.html @@ -0,0 +1,40 @@ +Format in log_format - Rust

Struct log_format::Format

source ·
pub struct Format<T = SystemTime> { /* private fields */ }

Implementations§

source§

impl<T> Format<T>

source

pub fn with_timer<T2>(self, timer: T2) -> Format<T2>

Use the given timer for log message timestamps.

+

See time module for the provided timer implementations.

+

Note that using the "time" feature flag enables the +additional time formatters UtcTime and LocalTime, which use the +time crate to provide more sophisticated timestamp formatting +options.

+
source

pub fn without_time(self) -> Format<()>

Do not emit timestamps with log messages.

+
source

pub fn with_target(self, display_target: bool) -> Format<T>

Sets whether or not an event’s target is displayed.

+
source

pub fn with_display_span_list(self, display_span_list: bool) -> Format<T>

Sets whether or not an event’s spans is displayed.

+
source

pub fn with_level(self, display_level: bool) -> Format<T>

Sets whether or not an event’s level is displayed.

+

Trait Implementations§

source§

impl<T: Clone> Clone for Format<T>

source§

fn clone(&self) -> Format<T>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T: Debug> Debug for Format<T>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Format<SystemTime>

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<S, N, T> FormatEvent<S, N> for Format<T>where + S: Subscriber + for<'a> LookupSpan<'a>, + N: for<'a> FormatFields<'a> + 'static, + T: FormatTime,

source§

fn format_event( + &self, + ctx: &FmtContext<'_, S, N>, + writer: Writer<'_>, + event: &Event<'_> +) -> Result

Write a log message for Event in Context to the given [Writer].

Auto Trait Implementations§

§

impl<T> RefUnwindSafe for Format<T>where + T: RefUnwindSafe,

§

impl<T> Send for Format<T>where + T: Send,

§

impl<T> Sync for Format<T>where + T: Sync,

§

impl<T> Unpin for Format<T>where + T: Unpin,

§

impl<T> UnwindSafe for Format<T>where + T: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/log_utils/all.html b/log_utils/all.html new file mode 100644 index 0000000000..3f000ae83a --- /dev/null +++ b/log_utils/all.html @@ -0,0 +1 @@ +List of all items in this crate

List of all items

Structs

Functions

\ No newline at end of file diff --git a/log_utils/fn.enable_logs.html b/log_utils/fn.enable_logs.html new file mode 100644 index 0000000000..0e65ab9ed7 --- /dev/null +++ b/log_utils/fn.enable_logs.html @@ -0,0 +1 @@ +enable_logs in log_utils - Rust

Function log_utils::enable_logs

source ·
pub fn enable_logs()
\ No newline at end of file diff --git a/log_utils/fn.enable_logs_for.html b/log_utils/fn.enable_logs_for.html new file mode 100644 index 0000000000..927e019678 --- /dev/null +++ b/log_utils/fn.enable_logs_for.html @@ -0,0 +1 @@ +enable_logs_for in log_utils - Rust

Function log_utils::enable_logs_for

source ·
pub fn enable_logs_for(spec: LogSpec)
\ No newline at end of file diff --git a/log_utils/index.html b/log_utils/index.html new file mode 100644 index 0000000000..e863a6637e --- /dev/null +++ b/log_utils/index.html @@ -0,0 +1,2 @@ +log_utils - Rust

Crate log_utils

source ·

Structs

Functions

\ No newline at end of file diff --git a/log_utils/sidebar-items.js b/log_utils/sidebar-items.js new file mode 100644 index 0000000000..eb6c5dbae8 --- /dev/null +++ b/log_utils/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"fn":["enable_logs","enable_logs_for"],"struct":["LogSpec"]}; \ No newline at end of file diff --git a/log_utils/struct.LogSpec.html b/log_utils/struct.LogSpec.html new file mode 100644 index 0000000000..ea60e47cc3 --- /dev/null +++ b/log_utils/struct.LogSpec.html @@ -0,0 +1,16 @@ +LogSpec in log_utils - Rust

Struct log_utils::LogSpec

source ·
pub struct LogSpec { /* private fields */ }

Implementations§

source§

impl LogSpec

source

pub fn new(directives: Vec<Directive>) -> Self

source

pub fn with_level(self, level: Level) -> Self

source

pub fn with_defaults(self) -> Self

source

pub fn with_wasm_level(self, level: Level) -> Self

source

pub fn with_directives(self, directives: Vec<Directive>) -> Self

Trait Implementations§

source§

impl Default for LogSpec

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/now_millis/all.html b/now_millis/all.html new file mode 100644 index 0000000000..e702cb869d --- /dev/null +++ b/now_millis/all.html @@ -0,0 +1 @@ +List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/now_millis/fn.now.html b/now_millis/fn.now.html new file mode 100644 index 0000000000..9d2fd22cc2 --- /dev/null +++ b/now_millis/fn.now.html @@ -0,0 +1,2 @@ +now in now_millis - Rust

Function now_millis::now

source ·
pub fn now() -> Duration
Expand description

Returns UNIX timestamp as Duration

+
\ No newline at end of file diff --git a/now_millis/fn.now_ms.html b/now_millis/fn.now_ms.html new file mode 100644 index 0000000000..4b6da361a4 --- /dev/null +++ b/now_millis/fn.now_ms.html @@ -0,0 +1,2 @@ +now_ms in now_millis - Rust

Function now_millis::now_ms

source ·
pub fn now_ms() -> u128
Expand description

Returns UNIX timestamp in milliseconds

+
\ No newline at end of file diff --git a/now_millis/fn.now_sec.html b/now_millis/fn.now_sec.html new file mode 100644 index 0000000000..d6609938dc --- /dev/null +++ b/now_millis/fn.now_sec.html @@ -0,0 +1,2 @@ +now_sec in now_millis - Rust

Function now_millis::now_sec

source ·
pub fn now_sec() -> u64
Expand description

Returns UNIX timestamp in seconds

+
\ No newline at end of file diff --git a/now_millis/index.html b/now_millis/index.html new file mode 100644 index 0000000000..310ff17df7 --- /dev/null +++ b/now_millis/index.html @@ -0,0 +1,2 @@ +now_millis - Rust

Crate now_millis

source ·

Functions

  • Returns UNIX timestamp as Duration
  • Returns UNIX timestamp in milliseconds
  • Returns UNIX timestamp in seconds
\ No newline at end of file diff --git a/now_millis/sidebar-items.js b/now_millis/sidebar-items.js new file mode 100644 index 0000000000..f9657555c9 --- /dev/null +++ b/now_millis/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"fn":["now","now_ms","now_sec"]}; \ No newline at end of file diff --git a/nox/all.html b/nox/all.html new file mode 100644 index 0000000000..9947c139ab --- /dev/null +++ b/nox/all.html @@ -0,0 +1 @@ +List of all items in this crate

List of all items

Structs

Enums

Functions

\ No newline at end of file diff --git a/nox/behaviour/network/enum.FluenceNetworkBehaviourEvent.html b/nox/behaviour/network/enum.FluenceNetworkBehaviourEvent.html new file mode 100644 index 0000000000..75cd109433 --- /dev/null +++ b/nox/behaviour/network/enum.FluenceNetworkBehaviourEvent.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../nox/enum.FluenceNetworkBehaviourEvent.html...

+ + + \ No newline at end of file diff --git a/nox/behaviour/network/struct.FluenceNetworkBehaviour.html b/nox/behaviour/network/struct.FluenceNetworkBehaviour.html new file mode 100644 index 0000000000..048ccbe9bf --- /dev/null +++ b/nox/behaviour/network/struct.FluenceNetworkBehaviour.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../nox/struct.FluenceNetworkBehaviour.html...

+ + + \ No newline at end of file diff --git a/nox/connectivity/struct.Connectivity.html b/nox/connectivity/struct.Connectivity.html new file mode 100644 index 0000000000..88893a8dad --- /dev/null +++ b/nox/connectivity/struct.Connectivity.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../nox/struct.Connectivity.html...

+ + + \ No newline at end of file diff --git a/nox/enum.ConnectionPoolCommand.html b/nox/enum.ConnectionPoolCommand.html new file mode 100644 index 0000000000..2328fec1a4 --- /dev/null +++ b/nox/enum.ConnectionPoolCommand.html @@ -0,0 +1,70 @@ +ConnectionPoolCommand in nox - Rust
pub enum ConnectionPoolCommand {
+    Connect {
+        contact: Contact,
+        out: Sender<bool>,
+    },
+    Send {
+        to: Contact,
+        particle: ExtendedParticle,
+        out: Sender<SendStatus>,
+    },
+    Dial {
+        addr: Multiaddr,
+        out: Sender<Option<Contact>>,
+    },
+    Disconnect {
+        peer_id: PeerId,
+        out: Sender<bool>,
+    },
+    IsConnected {
+        peer_id: PeerId,
+        out: Sender<bool>,
+    },
+    GetContact {
+        peer_id: PeerId,
+        out: Sender<Option<Contact>>,
+    },
+    CountConnections {
+        out: Sender<usize>,
+    },
+    LifecycleEvents {
+        out: UnboundedSender<LifecycleEvent>,
+    },
+}

Variants§

§

Connect

Fields

§contact: Contact
§out: Sender<bool>
§

Send

Fields

§out: Sender<SendStatus>
§

Dial

Fields

§addr: Multiaddr
§out: Sender<Option<Contact>>
§

Disconnect

Fields

§peer_id: PeerId
§out: Sender<bool>
§

IsConnected

Fields

§peer_id: PeerId
§out: Sender<bool>
§

GetContact

Fields

§peer_id: PeerId
§out: Sender<Option<Contact>>
§

CountConnections

Fields

§out: Sender<usize>
§

LifecycleEvents

Fields

§out: UnboundedSender<LifecycleEvent>

Trait Implementations§

§

impl Debug for Command

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> FutureExt for T

§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext +wrapper. Read more
§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext +wrapper. Read more
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
source§

impl<T> IntoRequest<T> for T

source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/nox/enum.FluenceNetworkBehaviourEvent.html b/nox/enum.FluenceNetworkBehaviourEvent.html new file mode 100644 index 0000000000..98a79e8788 --- /dev/null +++ b/nox/enum.FluenceNetworkBehaviourEvent.html @@ -0,0 +1,59 @@ +FluenceNetworkBehaviourEvent in nox - Rust
pub enum FluenceNetworkBehaviourEventwhere
+    Behaviour: NetworkBehaviour,
+    Behaviour: NetworkBehaviour,
+    Behaviour: NetworkBehaviour,
+    ConnectionPoolBehaviour: NetworkBehaviour,
+    Kademlia: NetworkBehaviour,{
+    Identify(<Behaviour as NetworkBehaviour>::ToSwarm),
+    Ping(<Behaviour as NetworkBehaviour>::ToSwarm),
+    ConnectionLimits(<Behaviour as NetworkBehaviour>::ToSwarm),
+    ConnectionPool(<ConnectionPoolBehaviour as NetworkBehaviour>::ToSwarm),
+    Kademlia(<Kademlia as NetworkBehaviour>::ToSwarm),
+}
Expand description

NetworkBehaviour::ToSwarm produced by FluenceNetworkBehaviour.

+

Variants§

§

Identify(<Behaviour as NetworkBehaviour>::ToSwarm)

§

Ping(<Behaviour as NetworkBehaviour>::ToSwarm)

§

ConnectionLimits(<Behaviour as NetworkBehaviour>::ToSwarm)

§

ConnectionPool(<ConnectionPoolBehaviour as NetworkBehaviour>::ToSwarm)

§

Kademlia(<Kademlia as NetworkBehaviour>::ToSwarm)

Trait Implementations§

source§

impl Debug for FluenceNetworkBehaviourEventwhere + Behaviour: NetworkBehaviour, + Behaviour: NetworkBehaviour, + Behaviour: NetworkBehaviour, + ConnectionPoolBehaviour: NetworkBehaviour, + Kademlia: NetworkBehaviour, + <Behaviour as NetworkBehaviour>::ToSwarm: Debug, + <Behaviour as NetworkBehaviour>::ToSwarm: Debug, + <Behaviour as NetworkBehaviour>::ToSwarm: Debug, + <ConnectionPoolBehaviour as NetworkBehaviour>::ToSwarm: Debug, + <Kademlia as NetworkBehaviour>::ToSwarm: Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> FutureExt for T

§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext +wrapper. Read more
§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext +wrapper. Read more
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
source§

impl<T> IntoRequest<T> for T

source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/nox/enum.KademliaCommand.html b/nox/enum.KademliaCommand.html new file mode 100644 index 0000000000..699490a51f --- /dev/null +++ b/nox/enum.KademliaCommand.html @@ -0,0 +1,58 @@ +KademliaCommand in nox - Rust

Enum nox::KademliaCommand

source ·
pub enum KademliaCommand {
+    AddContact {
+        contact: Contact,
+    },
+    LocalLookup {
+        peer: PeerId,
+        out: Sender<Vec<Multiaddr>>,
+    },
+    Bootstrap {
+        out: Sender<Result<(), KademliaError>>,
+    },
+    DiscoverPeer {
+        peer: PeerId,
+        out: Sender<Result<Vec<Multiaddr>, KademliaError>>,
+    },
+    Neighborhood {
+        key: Multihash<64>,
+        count: usize,
+        out: Sender<Result<Vec<PeerId>, KademliaError>>,
+    },
+}

Variants§

§

AddContact

Fields

§contact: Contact
§

LocalLookup

Fields

§peer: PeerId
§out: Sender<Vec<Multiaddr>>
§

Bootstrap

Fields

§out: Sender<Result<(), KademliaError>>
§

DiscoverPeer

Fields

§peer: PeerId
§out: Sender<Result<Vec<Multiaddr>, KademliaError>>
§

Neighborhood

Fields

§key: Multihash<64>
§count: usize
§out: Sender<Result<Vec<PeerId>, KademliaError>>

Trait Implementations§

source§

impl Debug for Command

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> FutureExt for T

§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext +wrapper. Read more
§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext +wrapper. Read more
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
source§

impl<T> IntoRequest<T> for T

source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/nox/fn.env_filter.html b/nox/fn.env_filter.html new file mode 100644 index 0000000000..ce539ce108 --- /dev/null +++ b/nox/fn.env_filter.html @@ -0,0 +1,2 @@ +env_filter in nox - Rust

Function nox::env_filter

source ·
pub fn env_filter<S>() -> impl Layer<S>where
+    S: Subscriber + for<'span> LookupSpan<'span>,
\ No newline at end of file diff --git a/nox/fn.log_layer.html b/nox/fn.log_layer.html new file mode 100644 index 0000000000..d2ae46a3e2 --- /dev/null +++ b/nox/fn.log_layer.html @@ -0,0 +1,2 @@ +log_layer in nox - Rust

Function nox::log_layer

source ·
pub fn log_layer<S>() -> (impl Layer<S>, WorkerGuard)where
+    S: Subscriber + for<'span> LookupSpan<'span>,
\ No newline at end of file diff --git a/nox/fn.tracing_layer.html b/nox/fn.tracing_layer.html new file mode 100644 index 0000000000..ba25d04d62 --- /dev/null +++ b/nox/fn.tracing_layer.html @@ -0,0 +1,6 @@ +tracing_layer in nox - Rust

Function nox::tracing_layer

source ·
pub fn tracing_layer<S>(
+    tracing_config: &TracingConfig,
+    peer_id: PeerId,
+    version: &str
+) -> Result<Option<impl Layer<S>>>where
+    S: Subscriber + for<'span> LookupSpan<'span>,
\ No newline at end of file diff --git a/nox/http/struct.StartedHttp.html b/nox/http/struct.StartedHttp.html new file mode 100644 index 0000000000..98b023387f --- /dev/null +++ b/nox/http/struct.StartedHttp.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../nox/struct.StartedHttp.html...

+ + + \ No newline at end of file diff --git a/nox/index.html b/nox/index.html new file mode 100644 index 0000000000..5c23b90296 --- /dev/null +++ b/nox/index.html @@ -0,0 +1,4 @@ +nox - Rust

Crate nox

source ·

Structs

Enums

Functions

\ No newline at end of file diff --git a/nox/layers/fn.env_filter.html b/nox/layers/fn.env_filter.html new file mode 100644 index 0000000000..e4446adbbb --- /dev/null +++ b/nox/layers/fn.env_filter.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../nox/fn.env_filter.html...

+ + + \ No newline at end of file diff --git a/nox/layers/fn.log_layer.html b/nox/layers/fn.log_layer.html new file mode 100644 index 0000000000..31e306c59a --- /dev/null +++ b/nox/layers/fn.log_layer.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../nox/fn.log_layer.html...

+ + + \ No newline at end of file diff --git a/nox/layers/fn.tracing_layer.html b/nox/layers/fn.tracing_layer.html new file mode 100644 index 0000000000..9ec60e1e48 --- /dev/null +++ b/nox/layers/fn.tracing_layer.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../nox/fn.tracing_layer.html...

+ + + \ No newline at end of file diff --git a/nox/node/struct.Node.html b/nox/node/struct.Node.html new file mode 100644 index 0000000000..db0b636229 --- /dev/null +++ b/nox/node/struct.Node.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../nox/struct.Node.html...

+ + + \ No newline at end of file diff --git a/nox/sidebar-items.js b/nox/sidebar-items.js new file mode 100644 index 0000000000..3aa0ae30be --- /dev/null +++ b/nox/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["ConnectionPoolCommand","FluenceNetworkBehaviourEvent","KademliaCommand"],"fn":["env_filter","log_layer","tracing_layer"],"struct":["Connectivity","FluenceNetworkBehaviour","Node","StartedHttp","Versions"]}; \ No newline at end of file diff --git a/nox/struct.Connectivity.html b/nox/struct.Connectivity.html new file mode 100644 index 0000000000..fcbd724b2c --- /dev/null +++ b/nox/struct.Connectivity.html @@ -0,0 +1,64 @@ +Connectivity in nox - Rust

Struct nox::Connectivity

source ·
pub struct Connectivity {
+    pub peer_id: PeerId,
+    pub kademlia: KademliaApi,
+    pub connection_pool: ConnectionPoolApi,
+    pub bootstrap_nodes: HashSet<Multiaddr>,
+    pub bootstrap_frequency: usize,
+    pub metrics: Option<ConnectivityMetrics>,
+    pub health: Option<ConnectivityHealth>,
+}
Expand description

This structure is just a composition of Kademlia and ConnectionPool. +It exists solely for code conciseness (i.e. avoid tuples); +there’s no architectural motivation behind

+

Fields§

§peer_id: PeerId§kademlia: KademliaApi§connection_pool: ConnectionPoolApi§bootstrap_nodes: HashSet<Multiaddr>§bootstrap_frequency: usize

Bootstrap will be executed after [1, N, 2N, 3N, …] bootstrap nodes connected +This setting specify that N.

+
§metrics: Option<ConnectivityMetrics>§health: Option<ConnectivityHealth>

Implementations§

source§

impl Connectivity

source

pub fn start(self) -> Tasks

source

pub async fn resolve_contact( + &self, + target: PeerId, + particle_id: &str +) -> Option<Contact>

source

pub async fn send(&self, contact: Contact, particle: ExtendedParticle) -> bool

source

pub async fn discover_peer( + &self, + target: PeerId +) -> Result<Option<Contact>, KademliaError>

Discover a peer via Kademlia

+
source

pub async fn kademlia_bootstrap(self)

Run kademlia bootstrap after first bootstrap is connected, and then every frequency

+
source

pub async fn reconnect_bootstraps(self)

Dial bootstraps, and then re-dial on each disconnection

+

Trait Implementations§

source§

impl AsRef<ConnectionPoolApi> for Connectivity

source§

fn as_ref(&self) -> &ConnectionPoolApi

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl AsRef<KademliaApi> for Connectivity

source§

fn as_ref(&self) -> &KademliaApi

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Clone for Connectivity

source§

fn clone(&self) -> Connectivity

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> FromRef<T> for Twhere + T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> FromRef<T> for Twhere + T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> FutureExt for T

§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext +wrapper. Read more
§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext +wrapper. Read more
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
source§

impl<T> IntoRequest<T> for T

source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/nox/struct.FluenceNetworkBehaviour.html b/nox/struct.FluenceNetworkBehaviour.html new file mode 100644 index 0000000000..06a7e576ff --- /dev/null +++ b/nox/struct.FluenceNetworkBehaviour.html @@ -0,0 +1,84 @@ +FluenceNetworkBehaviour in nox - Rust
pub struct FluenceNetworkBehaviour { /* private fields */ }
Expand description

Coordinates protocols, so they can cooperate

+

Implementations§

source§

impl FluenceNetworkBehaviour

Network address information is exchanged via Identify protocol. +That information is passed to relay, so nodes know each other’s addresses

+
source

pub fn inject_identify_event( + &mut self, + event: IdentifyEvent, + allow_local_addresses: bool +)

source§

impl FluenceNetworkBehaviour

source

pub fn new( + cfg: NetworkConfig, + health_registry: Option<&mut HealthCheckRegistry> +) -> (Self, Connectivity, Receiver<ExtendedParticle>)

Trait Implementations§

source§

impl NetworkBehaviour for FluenceNetworkBehaviourwhere + Behaviour: NetworkBehaviour, + Behaviour: NetworkBehaviour, + Behaviour: NetworkBehaviour, + ConnectionPoolBehaviour: NetworkBehaviour, + Kademlia: NetworkBehaviour,

§

type ConnectionHandler = ConnectionHandlerSelect<ConnectionHandlerSelect<ConnectionHandlerSelect<ConnectionHandlerSelect<<Behaviour as NetworkBehaviour>::ConnectionHandler, <Behaviour as NetworkBehaviour>::ConnectionHandler>, <Behaviour as NetworkBehaviour>::ConnectionHandler>, <ConnectionPoolBehaviour as NetworkBehaviour>::ConnectionHandler>, <Kademlia as NetworkBehaviour>::ConnectionHandler>

Handler for all the protocols the network behaviour supports.
§

type ToSwarm = FluenceNetworkBehaviourEvent

Event generated by the NetworkBehaviour and that the swarm will report back.
source§

fn handle_pending_inbound_connection( + &mut self, + connection_id: ConnectionId, + local_addr: &Multiaddr, + remote_addr: &Multiaddr +) -> Result<(), ConnectionDenied>

Callback that is invoked for every new inbound connection. Read more
source§

fn handle_established_inbound_connection( + &mut self, + connection_id: ConnectionId, + peer: PeerId, + local_addr: &Multiaddr, + remote_addr: &Multiaddr +) -> Result<THandler<Self>, ConnectionDenied>

Callback that is invoked for every established inbound connection. Read more
source§

fn handle_pending_outbound_connection( + &mut self, + connection_id: ConnectionId, + maybe_peer: Option<PeerId>, + addresses: &[Multiaddr], + effective_role: Endpoint +) -> Result<Vec<Multiaddr>, ConnectionDenied>

Callback that is invoked for every outbound connection attempt. Read more
source§

fn handle_established_outbound_connection( + &mut self, + connection_id: ConnectionId, + peer: PeerId, + addr: &Multiaddr, + role_override: Endpoint +) -> Result<THandler<Self>, ConnectionDenied>

Callback that is invoked for every established outbound connection. Read more
source§

fn on_connection_handler_event( + &mut self, + peer_id: PeerId, + connection_id: ConnectionId, + event: THandlerOutEvent<Self> +)

Informs the behaviour about an event generated by the [ConnectionHandler] +dedicated to the peer identified by peer_id. for the behaviour. Read more
source§

fn poll( + &mut self, + cx: &mut Context<'_> +) -> Poll<ToSwarm<Self::ToSwarm, THandlerInEvent<Self>>>

Polls for things that swarm should do. Read more
source§

fn on_swarm_event(&mut self, event: FromSwarm<'_>)

Informs the behaviour about an event from the Swarm.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> FutureExt for T

§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext +wrapper. Read more
§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext +wrapper. Read more
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
source§

impl<T> IntoRequest<T> for T

source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/nox/struct.Node.html b/nox/struct.Node.html new file mode 100644 index 0000000000..01729b21aa --- /dev/null +++ b/nox/struct.Node.html @@ -0,0 +1,102 @@ +Node in nox - Rust

Struct nox::Node

source ·
pub struct Node<RT: AquaRuntime> {
+    pub swarm: Swarm<FluenceNetworkBehaviour>,
+    pub connectivity: Connectivity,
+    pub aquamarine_api: AquamarineApi,
+    pub dispatcher: Dispatcher,
+    pub builtins_management_peer_id: PeerId,
+    pub scope: PeerScopes,
+    pub chain_listener: Option<ChainListener>,
+    /* private fields */
+}

Fields§

§swarm: Swarm<FluenceNetworkBehaviour>§connectivity: Connectivity§aquamarine_api: AquamarineApi§dispatcher: Dispatcher§builtins_management_peer_id: PeerId§scope: PeerScopes§chain_listener: Option<ChainListener>

Implementations§

source§

impl<RT: AquaRuntime> Node<RT>

source

pub async fn new( + config: ResolvedConfig, + core_distributor: Arc<dyn CoreDistributor>, + thread_pinner: Arc<dyn ThreadPinner>, + vm_config: RT::Config, + data_store_config: DataStoreConfig, + node_version: &'static str, + air_version: &'static str, + system_service_distros: SystemServiceDistros +) -> Result<Box<Self>>

source

pub fn swarm( + key_pair: Keypair, + network_config: NetworkConfig, + transport: Boxed<(PeerId, StreamMuxerBox)>, + external_addresses: Vec<Multiaddr>, + health_registry: Option<&mut HealthCheckRegistry>, + metrics_registry: Option<&mut Registry> +) -> Result<(Swarm<FluenceNetworkBehaviour>, Connectivity, Receiver<ExtendedParticle>)>

source

pub fn builtins( + config: BuiltinsConfig, + connectivity: Connectivity, + services_metrics: ServicesMetrics, + key_storage: Arc<KeyStorage>, + workers: Arc<Workers>, + scopes: PeerScopes, + health_registry: Option<&mut HealthCheckRegistry> +) -> Builtins<Connectivity>

source§

impl<RT: AquaRuntime> Node<RT>

source

pub fn with( + particle_stream: Receiver<ExtendedParticle>, + effects_stream: Receiver<Result<RemoteRoutingEffects, AquamarineApiError>>, + swarm: Swarm<FluenceNetworkBehaviour>, + connectivity: Connectivity, + aquamarine_api: AquamarineApi, + dispatcher: Dispatcher, + aquamarine_backend: AquamarineBackend<RT, Arc<Builtins<Connectivity>>>, + system_service_deployer: Deployer, + spell_event_bus_api: SpellEventBusApi, + spell_event_bus: SpellEventBus, + spell_events_receiver: UnboundedReceiver<TriggerEvent>, + sorcerer: Sorcerer, + metrics_registry: Option<Registry>, + health_registry: Option<HealthCheckRegistry>, + libp2p_metrics: Option<Arc<Metrics>>, + services_metrics_backend: ServicesMetricsBackend, + http_listen_addr: Option<SocketAddr>, + builtins_management_peer_id: PeerId, + scope: PeerScopes, + allow_local_addresses: bool, + versions: Versions, + chain_listener: Option<ChainListener>, + workers: Arc<Workers>, + config: ResolvedConfig +) -> Box<Self>

source

pub async fn start(self: Box<Self>, peer_id: PeerId) -> Result<StartedNode>

Starts node service

+
source

pub fn listen( + &mut self, + addrs: impl Into<Vec<Multiaddr>> +) -> Result<(), TransportError<Error>>

Starts node service listener.

+

Auto Trait Implementations§

§

impl<RT> !RefUnwindSafe for Node<RT>

§

impl<RT> Send for Node<RT>

§

impl<RT> !Sync for Node<RT>

§

impl<RT> Unpin for Node<RT>where + RT: Unpin, + <RT as AquaRuntime>::Config: Unpin,

§

impl<RT> !UnwindSafe for Node<RT>

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> FutureExt for T

§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext +wrapper. Read more
§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext +wrapper. Read more
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
source§

impl<T> IntoRequest<T> for T

source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/nox/struct.StartedHttp.html b/nox/struct.StartedHttp.html new file mode 100644 index 0000000000..2e825671cc --- /dev/null +++ b/nox/struct.StartedHttp.html @@ -0,0 +1,40 @@ +StartedHttp in nox - Rust

Struct nox::StartedHttp

source ·
pub struct StartedHttp {
+    pub listen_addr: SocketAddr,
+}

Fields§

§listen_addr: SocketAddr

Trait Implementations§

source§

impl Debug for StartedHttp

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> FutureExt for T

§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext +wrapper. Read more
§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext +wrapper. Read more
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
source§

impl<T> IntoRequest<T> for T

source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/nox/struct.Versions.html b/nox/struct.Versions.html new file mode 100644 index 0000000000..a590cbf02a --- /dev/null +++ b/nox/struct.Versions.html @@ -0,0 +1,51 @@ +Versions in nox - Rust

Struct nox::Versions

source ·
pub struct Versions {
+    pub node_version: String,
+    pub avm_version: String,
+    pub spell_version: String,
+    pub system_service: Versions,
+}

Fields§

§node_version: String§avm_version: String§spell_version: String§system_service: Versions

Implementations§

source§

impl Versions

source

pub fn new( + node_version: String, + avm_version: String, + spell_version: String, + system_service: Versions +) -> Self

Trait Implementations§

source§

impl Clone for Versions

source§

fn clone(&self) -> Versions

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Versions

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> FromRef<T> for Twhere + T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> FromRef<T> for Twhere + T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> FutureExt for T

§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext +wrapper. Read more
§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext +wrapper. Read more
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
source§

impl<T> IntoRequest<T> for T

source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

impl<T> MaybeSend for Twhere + T: Send,

\ No newline at end of file diff --git a/particle_args/all.html b/particle_args/all.html new file mode 100644 index 0000000000..ea7c7a041b --- /dev/null +++ b/particle_args/all.html @@ -0,0 +1 @@ +List of all items in this crate

List of all items

Structs

Enums

Functions

\ No newline at end of file diff --git a/particle_args/args/struct.Args.html b/particle_args/args/struct.Args.html new file mode 100644 index 0000000000..baef874a7c --- /dev/null +++ b/particle_args/args/struct.Args.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../particle_args/struct.Args.html...

+ + + \ No newline at end of file diff --git a/particle_args/args_error/enum.ArgsError.html b/particle_args/args_error/enum.ArgsError.html new file mode 100644 index 0000000000..baa4648b42 --- /dev/null +++ b/particle_args/args_error/enum.ArgsError.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../particle_args/enum.ArgsError.html...

+ + + \ No newline at end of file diff --git a/particle_args/args_error/struct.JError.html b/particle_args/args_error/struct.JError.html new file mode 100644 index 0000000000..bef69c873f --- /dev/null +++ b/particle_args/args_error/struct.JError.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../particle_args/struct.JError.html...

+ + + \ No newline at end of file diff --git a/particle_args/base58/fn.from_base58.html b/particle_args/base58/fn.from_base58.html new file mode 100644 index 0000000000..3339811d32 --- /dev/null +++ b/particle_args/base58/fn.from_base58.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../particle_args/fn.from_base58.html...

+ + + \ No newline at end of file diff --git a/particle_args/enum.AVMError.html b/particle_args/enum.AVMError.html new file mode 100644 index 0000000000..5d445e7a9d --- /dev/null +++ b/particle_args/enum.AVMError.html @@ -0,0 +1,59 @@ +AVMError in particle_args - Rust
pub enum AVMError<E> {
+    InterpreterFailed(ErrorAVMOutcome),
+    RunnerError(RunnerError),
+    DataStoreError(E),
+    AnomalyDataSeError(Error),
+}

Variants§

§

InterpreterFailed(ErrorAVMOutcome)

This error contains interpreter outcome in case when execution failed on the interpreter +side. A host should match on this error type explicitly to save provided data.

+
§

RunnerError(RunnerError)

This errors are encountered from an AVM runner.

+
§

DataStoreError(E)

This errors are encountered from a data store object.

+
§

AnomalyDataSeError(Error)

This errors are encountered from serialization of data tracked during an anomaly.

+

Trait Implementations§

§

impl<E> Debug for AVMError<E>where + E: Debug,

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl<E> Display for AVMError<E>where + E: Display,

§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl<E> Error for AVMError<E>where + E: Error, + AVMError<E>: Debug + Display,

§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
§

impl<E> From<E> for AVMError<E>

§

fn from(source: E) -> AVMError<E>

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<E> !RefUnwindSafe for AVMError<E>

§

impl<E> Send for AVMError<E>where + E: Send,

§

impl<E> Sync for AVMError<E>where + E: Sync,

§

impl<E> Unpin for AVMError<E>where + E: Unpin,

§

impl<E> !UnwindSafe for AVMError<E>

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<!> for T

source§

fn from(t: !) -> T

Converts to this type from the input type.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> FromFd for Twhere + T: From<OwnedFd>,

§

fn from_fd(owned_fd: OwnedFd) -> T

👎Deprecated since 1.0.0: FromFd::from_fd is replaced by From<OwnedFd>::from
Constructs a new instance of Self from the given file descriptor. Read more
§

fn from_into_fd<Owned>(into_owned: Owned) -> Selfwhere + Owned: Into<OwnedFd>, + Self: Sized + From<OwnedFd>,

Constructs a new instance of Self from the given file descriptor +converted from into_owned. Read more
§

impl<T> FromFilelike for Twhere + T: From<OwnedFd>,

§

fn from_filelike(owned: OwnedFd) -> T

Constructs a new instance of Self from the given filelike object. Read more
§

fn from_into_filelike<Owned>(owned: Owned) -> Twhere + Owned: IntoFilelike,

Constructs a new instance of Self from the given filelike object +converted from into_owned. Read more
§

impl<T> FromGrip for Twhere + T: From<OwnedFd>,

§

fn from_grip(owned_grip: OwnedFd) -> T

Consume an OwnedGrip and convert into a Self.
§

impl<T> FromSocketlike for Twhere + T: From<OwnedFd>,

§

fn from_socketlike(owned: OwnedFd) -> T

Constructs a new instance of Self from the given socketlike object.
§

fn from_into_socketlike<Owned>(owned: Owned) -> Twhere + Owned: IntoSocketlike,

Constructs a new instance of Self from the given socketlike object +converted from into_owned.
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/particle_args/enum.ArgsError.html b/particle_args/enum.ArgsError.html new file mode 100644 index 0000000000..f05a4cd5ed --- /dev/null +++ b/particle_args/enum.ArgsError.html @@ -0,0 +1,50 @@ +ArgsError in particle_args - Rust
pub enum ArgsError {
+    MissingField(&'static str),
+    SerdeJson {
+        field: &'static str,
+        err: Error,
+    },
+    InvalidFormat {
+        field: &'static str,
+        err: Cow<'static, str>,
+    },
+    NonUnaryOption {
+        field: &'static str,
+        length: usize,
+    },
+    DeserializeError {
+        field: &'static str,
+        value: Value,
+        expected_type: String,
+    },
+}

Variants§

§

MissingField(&'static str)

§

SerdeJson

Fields

§field: &'static str
§err: Error
§

InvalidFormat

Fields

§field: &'static str
§err: Cow<'static, str>
§

NonUnaryOption

Fields

§field: &'static str
§length: usize
§

DeserializeError

Fields

§field: &'static str
§value: Value
§expected_type: String

Trait Implementations§

source§

impl Debug for ArgsError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for ArgsError

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for ArgsError

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl From<ArgsError> for Value

source§

fn from(err: ArgsError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/particle_args/fn.from_base58.html b/particle_args/fn.from_base58.html new file mode 100644 index 0000000000..4d1dcfd5da --- /dev/null +++ b/particle_args/fn.from_base58.html @@ -0,0 +1,4 @@ +from_base58 in particle_args - Rust

Function particle_args::from_base58

source ·
pub fn from_base58(
+    name: &'static str,
+    args: &mut impl Iterator<Item = Value>
+) -> Result<Vec<u8>, ArgsError>
\ No newline at end of file diff --git a/particle_args/index.html b/particle_args/index.html new file mode 100644 index 0000000000..81ad6c7d38 --- /dev/null +++ b/particle_args/index.html @@ -0,0 +1,3 @@ +particle_args - Rust

Crate particle_args

source ·

Structs

  • Arguments passed by VM to host on call_service
  • An error that can be created from any other error +Simplifies life by converting errors to be returnable from host closures

Enums

Functions

\ No newline at end of file diff --git a/particle_args/sidebar-items.js b/particle_args/sidebar-items.js new file mode 100644 index 0000000000..0469b26773 --- /dev/null +++ b/particle_args/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["AVMError","ArgsError"],"fn":["from_base58"],"struct":["Args","JError"]}; \ No newline at end of file diff --git a/particle_args/struct.Args.html b/particle_args/struct.Args.html new file mode 100644 index 0000000000..f1d65acb88 --- /dev/null +++ b/particle_args/struct.Args.html @@ -0,0 +1,55 @@ +Args in particle_args - Rust

Struct particle_args::Args

source ·
pub struct Args {
+    pub service_id: String,
+    pub function_name: String,
+    pub function_args: Vec<Value>,
+    pub tetraplets: Vec<Vec<SecurityTetraplet>>,
+}
Expand description

Arguments passed by VM to host on call_service

+

Fields§

§service_id: String§function_name: String§function_args: Vec<Value>§tetraplets: Vec<Vec<SecurityTetraplet>>

Implementations§

source§

impl Args

source

pub fn next<T: for<'de> Deserialize<'de>>( + field: &'static str, + args: &mut impl Iterator<Item = JValue> +) -> Result<T, ArgsError>

Retrieves next json value from iterator, parse it to T +field is to generate a more accurate error message

+
source

pub fn next_opt<T: for<'de> Deserialize<'de>>( + field: &'static str, + args: &mut impl Iterator<Item = JValue> +) -> Result<Option<T>, ArgsError>

Retrieves a json value from iterator if it’s not empty, and parses it to Aqua’s option representation +Aqua’s option is expected to be an array of 1 or 0 elements. +For the sakes of backward compatibility, scalar value and absence of value are tolerated as well. +field is to generate a more accurate error message

+

In short, function returns:

+
    +
  • if next arg is T or [T] => Some(T)
  • +
  • if next arg is None or [] => None
  • +
  • if next arg is array of several elements => error
  • +
+

Trait Implementations§

source§

impl Clone for Args

source§

fn clone(&self) -> Args

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Args

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl TryFrom<CallRequestParams> for Args

§

type Error = ArgsError

The type returned in the event of a conversion error.
source§

fn try_from(value: CallRequestParams) -> Result<Self, Self::Error>

Performs the conversion.

Auto Trait Implementations§

§

impl RefUnwindSafe for Args

§

impl Send for Args

§

impl Sync for Args

§

impl Unpin for Args

§

impl UnwindSafe for Args

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/particle_args/struct.JError.html b/particle_args/struct.JError.html new file mode 100644 index 0000000000..5fac245665 --- /dev/null +++ b/particle_args/struct.JError.html @@ -0,0 +1,34 @@ +JError in particle_args - Rust

Struct particle_args::JError

source ·
pub struct JError(pub Value);
Expand description

An error that can be created from any other error +Simplifies life by converting errors to be returnable from host closures

+

Tuple Fields§

§0: Value

Implementations§

source§

impl JError

source

pub fn new(msg: impl AsRef<str>) -> Self

source

pub fn from_eyre(err: Report) -> Self

Trait Implementations§

source§

impl Clone for JError

source§

fn clone(&self) -> JError

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for JError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for JError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<E: Error> From<E> for JError

source§

fn from(err: E) -> Self

Converts to this type from the input type.
source§

impl From<JError> for Value

source§

fn from(err: JError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<!> for T

source§

fn from(t: !) -> T

Converts to this type from the input type.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/particle_builtins/all.html b/particle_builtins/all.html new file mode 100644 index 0000000000..db60a2ab3f --- /dev/null +++ b/particle_builtins/all.html @@ -0,0 +1 @@ +List of all items in this crate

List of all items

Structs

Functions

\ No newline at end of file diff --git a/particle_builtins/builtins/struct.Builtins.html b/particle_builtins/builtins/struct.Builtins.html new file mode 100644 index 0000000000..0589360c0e --- /dev/null +++ b/particle_builtins/builtins/struct.Builtins.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../particle_builtins/struct.Builtins.html...

+ + + \ No newline at end of file diff --git a/particle_builtins/builtins/struct.BuiltinsConfig.html b/particle_builtins/builtins/struct.BuiltinsConfig.html new file mode 100644 index 0000000000..02e8a49bf4 --- /dev/null +++ b/particle_builtins/builtins/struct.BuiltinsConfig.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../particle_builtins/struct.BuiltinsConfig.html...

+ + + \ No newline at end of file diff --git a/particle_builtins/builtins/struct.CustomService.html b/particle_builtins/builtins/struct.CustomService.html new file mode 100644 index 0000000000..151497640c --- /dev/null +++ b/particle_builtins/builtins/struct.CustomService.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../particle_builtins/struct.CustomService.html...

+ + + \ No newline at end of file diff --git a/particle_builtins/fn.ok.html b/particle_builtins/fn.ok.html new file mode 100644 index 0000000000..4cd742f6a8 --- /dev/null +++ b/particle_builtins/fn.ok.html @@ -0,0 +1 @@ +ok in particle_builtins - Rust

Function particle_builtins::ok

source ·
pub fn ok(v: Value) -> FunctionOutcome
\ No newline at end of file diff --git a/particle_builtins/fn.wrap.html b/particle_builtins/fn.wrap.html new file mode 100644 index 0000000000..53b81209c0 --- /dev/null +++ b/particle_builtins/fn.wrap.html @@ -0,0 +1 @@ +wrap in particle_builtins - Rust

Function particle_builtins::wrap

source ·
pub fn wrap(r: Result<Value, JError>) -> FunctionOutcome
\ No newline at end of file diff --git a/particle_builtins/fn.wrap_unit.html b/particle_builtins/fn.wrap_unit.html new file mode 100644 index 0000000000..fd84429351 --- /dev/null +++ b/particle_builtins/fn.wrap_unit.html @@ -0,0 +1 @@ +wrap_unit in particle_builtins - Rust
pub fn wrap_unit(r: Result<(), JError>) -> FunctionOutcome
\ No newline at end of file diff --git a/particle_builtins/identify/struct.NodeInfo.html b/particle_builtins/identify/struct.NodeInfo.html new file mode 100644 index 0000000000..f442482fc0 --- /dev/null +++ b/particle_builtins/identify/struct.NodeInfo.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../particle_builtins/struct.NodeInfo.html...

+ + + \ No newline at end of file diff --git a/particle_builtins/index.html b/particle_builtins/index.html new file mode 100644 index 0000000000..b669834f12 --- /dev/null +++ b/particle_builtins/index.html @@ -0,0 +1,2 @@ +particle_builtins - Rust

Structs

Functions

\ No newline at end of file diff --git a/particle_builtins/outcome/fn.ok.html b/particle_builtins/outcome/fn.ok.html new file mode 100644 index 0000000000..78f2585a58 --- /dev/null +++ b/particle_builtins/outcome/fn.ok.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../particle_builtins/fn.ok.html...

+ + + \ No newline at end of file diff --git a/particle_builtins/outcome/fn.wrap.html b/particle_builtins/outcome/fn.wrap.html new file mode 100644 index 0000000000..53754101f1 --- /dev/null +++ b/particle_builtins/outcome/fn.wrap.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../particle_builtins/fn.wrap.html...

+ + + \ No newline at end of file diff --git a/particle_builtins/outcome/fn.wrap_unit.html b/particle_builtins/outcome/fn.wrap_unit.html new file mode 100644 index 0000000000..10486b1851 --- /dev/null +++ b/particle_builtins/outcome/fn.wrap_unit.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../particle_builtins/fn.wrap_unit.html...

+ + + \ No newline at end of file diff --git a/particle_builtins/sidebar-items.js b/particle_builtins/sidebar-items.js new file mode 100644 index 0000000000..52e86839ff --- /dev/null +++ b/particle_builtins/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"fn":["ok","wrap","wrap_unit"],"struct":["Builtins","BuiltinsConfig","CustomService","NodeInfo","ParticleAppServicesConfig"]}; \ No newline at end of file diff --git a/particle_builtins/struct.Builtins.html b/particle_builtins/struct.Builtins.html new file mode 100644 index 0000000000..4339adfe78 --- /dev/null +++ b/particle_builtins/struct.Builtins.html @@ -0,0 +1,85 @@ +Builtins in particle_builtins - Rust
pub struct Builtins<C> {
+    pub connectivity: C,
+    pub modules: ModuleRepository,
+    pub services: ParticleAppServices,
+    pub custom_services: RwLock<HashMap<String, CustomService>>,
+    /* private fields */
+}

Fields§

§connectivity: C§modules: ModuleRepository§services: ParticleAppServices§custom_services: RwLock<HashMap<String, CustomService>>

Implementations§

source§

impl<C> Builtins<C>where + C: Clone + Send + Sync + 'static + AsRef<KademliaApi> + AsRef<ConnectionPoolApi>,

source

pub fn new( + config: BuiltinsConfig, + connectivity: C, + services_metrics: ServicesMetrics, + key_storage: Arc<KeyStorage>, + workers: Arc<Workers>, + scope: PeerScopes, + health_registry: Option<&mut HealthCheckRegistry> +) -> Self

source

pub async fn call( + &self, + args: Args, + particle: ParticleParams +) -> FunctionOutcome

source

pub async fn custom_service_call( + &self, + args: Args, + particle: ParticleParams +) -> FunctionOutcome

source

pub async fn builtins_call( + &self, + args: Args, + particle: ParticleParams +) -> FunctionOutcome

Trait Implementations§

source§

impl<C> Debug for Builtins<C>where + C: Debug,

source§

fn fmt(&self, __f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<C> ParticleFunction for Builtins<C>where + C: Clone + Send + Sync + 'static + AsRef<KademliaApi> + AsRef<ConnectionPoolApi>,

source§

fn call<'life0, 'async_trait>( + &'life0 self, + args: Args, + particle: ParticleParams +) -> Pin<Box<dyn Future<Output = FunctionOutcome> + Send + 'async_trait>>where + Self: 'async_trait, + 'life0: 'async_trait,

source§

fn extend<'life0, 'async_trait>( + &'life0 self, + service: String, + functions: HashMap<String, ServiceFunction>, + fallback: Option<ServiceFunction> +) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where + Self: 'async_trait, + 'life0: 'async_trait,

source§

fn remove<'life0, 'life1, 'async_trait>( + &'life0 self, + service: &'life1 str +) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where + Self: 'async_trait, + 'life0: 'async_trait, + 'life1: 'async_trait,

Auto Trait Implementations§

§

impl<C> !RefUnwindSafe for Builtins<C>

§

impl<C> Send for Builtins<C>where + C: Send,

§

impl<C> Sync for Builtins<C>where + C: Sync,

§

impl<C> Unpin for Builtins<C>where + C: Unpin,

§

impl<C> !UnwindSafe for Builtins<C>

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/particle_builtins/struct.BuiltinsConfig.html b/particle_builtins/struct.BuiltinsConfig.html new file mode 100644 index 0000000000..417771ffd7 --- /dev/null +++ b/particle_builtins/struct.BuiltinsConfig.html @@ -0,0 +1,52 @@ +BuiltinsConfig in particle_builtins - Rust
pub struct BuiltinsConfig {
+    pub particle_app_services: ParticleAppServicesConfig,
+    pub modules_dir: PathBuf,
+    pub blueprint_dir: PathBuf,
+    pub is_dev_mode: bool,
+    pub mounted_binaries_mapping: HashMap<String, PathBuf>,
+    pub allowed_effectors: HashMap<Hash, HashMap<String, PathBuf>>,
+}

Fields§

§particle_app_services: ParticleAppServicesConfig§modules_dir: PathBuf

Dir to store .wasm modules and their configs

+
§blueprint_dir: PathBuf

Path of the blueprint directory containing blueprints and wasm modules

+
§is_dev_mode: bool

Is in the developer mode

+
§mounted_binaries_mapping: HashMap<String, PathBuf>

Mapping of binary names to their paths for mounted binaries used in developer mode

+
§allowed_effectors: HashMap<Hash, HashMap<String, PathBuf>>

List of allowed effector modules by CID

+

Implementations§

source§

impl BuiltinsConfig

source

pub fn new( + particle_app_services: ParticleAppServicesConfig, + persistent_dir: PathBuf, + allowed_effectors: HashMap<Hash, HashMap<String, PathBuf>>, + mounted_binaries_mapping: HashMap<String, PathBuf>, + is_dev_mode: bool +) -> Result<Self, Error>

Trait Implementations§

source§

impl Debug for BuiltinsConfig

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/particle_builtins/struct.CustomService.html b/particle_builtins/struct.CustomService.html new file mode 100644 index 0000000000..fd1b78fdaa --- /dev/null +++ b/particle_builtins/struct.CustomService.html @@ -0,0 +1,42 @@ +CustomService in particle_builtins - Rust
pub struct CustomService {
+    pub functions: HashMap<String, ServiceFunction>,
+    pub fallback: Option<ServiceFunction>,
+}

Fields§

§functions: HashMap<String, ServiceFunction>

(function_name -> service function)

+
§fallback: Option<ServiceFunction>

if set, all function_name mismatches with custom_service.functions will be routed to fallback

+

Implementations§

source§

impl CustomService

source

pub fn new( + funcs: Vec<(&str, ServiceFunction)>, + fallback: Option<ServiceFunction> +) -> Self

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/particle_builtins/struct.NodeInfo.html b/particle_builtins/struct.NodeInfo.html new file mode 100644 index 0000000000..fd7b240d62 --- /dev/null +++ b/particle_builtins/struct.NodeInfo.html @@ -0,0 +1,42 @@ +NodeInfo in particle_builtins - Rust
pub struct NodeInfo {
+    pub external_addresses: Vec<Multiaddr>,
+    pub node_version: &'static str,
+    pub air_version: &'static str,
+    pub spell_version: String,
+    pub allowed_binaries: Vec<PathBuf>,
+}

Fields§

§external_addresses: Vec<Multiaddr>§node_version: &'static str§air_version: &'static str§spell_version: String§allowed_binaries: Vec<PathBuf>

Trait Implementations§

source§

impl Clone for NodeInfo

source§

fn clone(&self) -> NodeInfo

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for NodeInfo

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Serialize for NodeInfo

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/particle_builtins/struct.ParticleAppServicesConfig.html b/particle_builtins/struct.ParticleAppServicesConfig.html new file mode 100644 index 0000000000..c227e953d9 --- /dev/null +++ b/particle_builtins/struct.ParticleAppServicesConfig.html @@ -0,0 +1,68 @@ +ParticleAppServicesConfig in particle_builtins - Rust
pub struct ParticleAppServicesConfig {
+    pub local_peer_id: PeerId,
+    pub envs: HashMap<String, String>,
+    pub persistent_work_dir: PathBuf,
+    pub ephemeral_work_dir: PathBuf,
+    pub services_dir: PathBuf,
+    pub particles_vault_dir: PathBuf,
+    pub management_peer_id: PeerId,
+    pub builtins_management_peer_id: PeerId,
+    pub default_service_memory_limit: Option<ByteSize>,
+    pub wasm_backend_config: WasmBackendConfig,
+}

Fields§

§local_peer_id: PeerId

Peer id of the current node

+
§envs: HashMap<String, String>

Opaque environment variables to be passed on each service creation +TODO: isolate envs of different modules (i.e., module A shouldn’t access envs of module B)

+
§persistent_work_dir: PathBuf

Persistent working dir for services

+
§ephemeral_work_dir: PathBuf

Ephemeral working dir for services

+
§services_dir: PathBuf

Dir to persist info about running services

+
§particles_vault_dir: PathBuf

Dir to store directories shared between services +in the span of a single particle execution

+
§management_peer_id: PeerId

key that could manage services

+
§builtins_management_peer_id: PeerId

key to manage builtins services initialization

+
§default_service_memory_limit: Option<ByteSize>

Default heap size in bytes available for the module unless otherwise specified.

+
§wasm_backend_config: WasmBackendConfig

config for the wasmtime backend

+

Implementations§

§

impl ParticleAppServicesConfig

pub fn new( + local_peer_id: PeerId, + persistent_dir: PathBuf, + ephemeral_dir: PathBuf, + particles_vault_dir: PathBuf, + envs: HashMap<String, String>, + management_peer_id: PeerId, + builtins_management_peer_id: PeerId, + default_service_memory_limit: Option<ByteSize>, + wasm_backend_config: WasmBackendConfig +) -> Result<ParticleAppServicesConfig, Error>

Trait Implementations§

§

impl Clone for ParticleAppServicesConfig

§

fn clone(&self) -> ParticleAppServicesConfig

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for ParticleAppServicesConfig

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/particle_execution/all.html b/particle_execution/all.html new file mode 100644 index 0000000000..11fa789cb3 --- /dev/null +++ b/particle_execution/all.html @@ -0,0 +1 @@ +List of all items in this crate

List of all items

Structs

Enums

Traits

Type Aliases

Constants

\ No newline at end of file diff --git a/particle_execution/constant.VIRTUAL_PARTICLE_VAULT_PREFIX.html b/particle_execution/constant.VIRTUAL_PARTICLE_VAULT_PREFIX.html new file mode 100644 index 0000000000..851259f05d --- /dev/null +++ b/particle_execution/constant.VIRTUAL_PARTICLE_VAULT_PREFIX.html @@ -0,0 +1 @@ +VIRTUAL_PARTICLE_VAULT_PREFIX in particle_execution - Rust
pub const VIRTUAL_PARTICLE_VAULT_PREFIX: &str = "/tmp/vault";
\ No newline at end of file diff --git a/particle_execution/enum.FunctionOutcome.html b/particle_execution/enum.FunctionOutcome.html new file mode 100644 index 0000000000..95f162b150 --- /dev/null +++ b/particle_execution/enum.FunctionOutcome.html @@ -0,0 +1,45 @@ +FunctionOutcome in particle_execution - Rust
pub enum FunctionOutcome {
+    NotDefined {
+        args: Args,
+        params: ParticleParams,
+    },
+    Empty,
+    Ok(Value),
+    Err(JError),
+}

Variants§

§

NotDefined

Fields

§args: Args
§

Empty

§

Ok(Value)

§

Err(JError)

Implementations§

source§

impl FunctionOutcome

source

pub fn is_defined(&self) -> bool

Returns false if variant is [NotDefined]

+
source

pub fn not_err(&self) -> bool

Returns false if variant is Err

+
source

pub fn or_else(self, f: impl FnOnce(Args, ParticleParams) -> Self) -> Self

Trait Implementations§

source§

impl Clone for FunctionOutcome

source§

fn clone(&self) -> FunctionOutcome

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for FunctionOutcome

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<E: Error> From<E> for FunctionOutcome

source§

fn from(err: E) -> Self

Converts to this type from the input type.
source§

impl<E: Into<JError>> FromResidual<Result<Infallible, E>> for FunctionOutcome

source§

fn from_residual(residual: Result<Infallible, E>) -> Self

🔬This is a nightly-only experimental API. (try_trait_v2)
Constructs the type from a compatible Residual type. Read more
source§

impl FromResidual for FunctionOutcome

source§

fn from_residual(residual: JError) -> Self

🔬This is a nightly-only experimental API. (try_trait_v2)
Constructs the type from a compatible Residual type. Read more
source§

impl Try for FunctionOutcome

§

type Output = Option<Value>

🔬This is a nightly-only experimental API. (try_trait_v2)
The type of the value produced by ? when not short-circuiting.
§

type Residual = JError

🔬This is a nightly-only experimental API. (try_trait_v2)
The type of the value passed to FromResidual::from_residual +as part of ? when short-circuiting. Read more
source§

fn from_output(output: Self::Output) -> Self

🔬This is a nightly-only experimental API. (try_trait_v2)
Constructs the type from its Output type. Read more
source§

fn branch(self) -> ControlFlow<Self::Residual, Self::Output>

🔬This is a nightly-only experimental API. (try_trait_v2)
Used in ? to decide whether the operator should produce a value +(because this returned ControlFlow::Continue) +or propagate a value back to the caller +(because this returned ControlFlow::Break). Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<!> for T

source§

fn from(t: !) -> T

Converts to this type from the input type.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/particle_execution/enum.ServiceFunction.html b/particle_execution/enum.ServiceFunction.html new file mode 100644 index 0000000000..5f66e85131 --- /dev/null +++ b/particle_execution/enum.ServiceFunction.html @@ -0,0 +1,37 @@ +ServiceFunction in particle_execution - Rust
pub enum ServiceFunction {
+    Mut(Mutex<ServiceFunctionMut>),
+    Immut(ServiceFunctionImmut),
+}

Variants§

Implementations§

source§

impl ServiceFunction

source

pub async fn call( + &self, + args: Args, + particle: ParticleParams +) -> FunctionOutcome

Trait Implementations§

source§

impl From<Box<dyn Fn(Args, ParticleParams) -> Pin<Box<dyn Future<Output = FunctionOutcome> + Send>> + Sync + Send>> for ServiceFunction

source§

fn from(f: ServiceFunctionImmut) -> Self

Converts to this type from the input type.
source§

impl From<Box<dyn FnMut(Args, ParticleParams) -> Pin<Box<dyn Future<Output = FunctionOutcome> + Send>> + Sync + Send>> for ServiceFunction

source§

fn from(f: ServiceFunctionMut) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/particle_execution/enum.VaultError.html b/particle_execution/enum.VaultError.html new file mode 100644 index 0000000000..f06a44ec45 --- /dev/null +++ b/particle_execution/enum.VaultError.html @@ -0,0 +1,39 @@ +VaultError in particle_execution - Rust
pub enum VaultError {
+    InitializeVault(Error),
+    CreateVault(Error),
+    CleanupVault(Error),
+    WrongVault(Option<StripPrefixError>, PathBuf, PathBuf),
+    NotFound(Error, PathBuf),
+    ReadVault(Error, PathBuf),
+    WriteVault(Error, String),
+}

Variants§

§

InitializeVault(Error)

§

CreateVault(Error)

§

CleanupVault(Error)

§

WrongVault(Option<StripPrefixError>, PathBuf, PathBuf)

§

NotFound(Error, PathBuf)

§

ReadVault(Error, PathBuf)

§

WriteVault(Error, String)

Trait Implementations§

source§

impl Debug for VaultError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for VaultError

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for VaultError

source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/particle_execution/function_outcome/enum.FunctionOutcome.html b/particle_execution/function_outcome/enum.FunctionOutcome.html new file mode 100644 index 0000000000..26d4dec6b7 --- /dev/null +++ b/particle_execution/function_outcome/enum.FunctionOutcome.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../particle_execution/enum.FunctionOutcome.html...

+ + + \ No newline at end of file diff --git a/particle_execution/index.html b/particle_execution/index.html new file mode 100644 index 0000000000..c4a52f1428 --- /dev/null +++ b/particle_execution/index.html @@ -0,0 +1,3 @@ +particle_execution - Rust

Structs

Enums

Constants

Traits

Type Aliases

\ No newline at end of file diff --git a/particle_execution/particle_function/enum.ServiceFunction.html b/particle_execution/particle_function/enum.ServiceFunction.html new file mode 100644 index 0000000000..655959ca11 --- /dev/null +++ b/particle_execution/particle_function/enum.ServiceFunction.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../particle_execution/enum.ServiceFunction.html...

+ + + \ No newline at end of file diff --git a/particle_execution/particle_function/trait.ParticleFunction.html b/particle_execution/particle_function/trait.ParticleFunction.html new file mode 100644 index 0000000000..251a58d2bc --- /dev/null +++ b/particle_execution/particle_function/trait.ParticleFunction.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../particle_execution/trait.ParticleFunction.html...

+ + + \ No newline at end of file diff --git a/particle_execution/particle_function/trait.ParticleFunctionMut.html b/particle_execution/particle_function/trait.ParticleFunctionMut.html new file mode 100644 index 0000000000..d9a1933769 --- /dev/null +++ b/particle_execution/particle_function/trait.ParticleFunctionMut.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../particle_execution/trait.ParticleFunctionMut.html...

+ + + \ No newline at end of file diff --git a/particle_execution/particle_function/trait.ParticleFunctionStatic.html b/particle_execution/particle_function/trait.ParticleFunctionStatic.html new file mode 100644 index 0000000000..6ac4a01380 --- /dev/null +++ b/particle_execution/particle_function/trait.ParticleFunctionStatic.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../particle_execution/trait.ParticleFunctionStatic.html...

+ + + \ No newline at end of file diff --git a/particle_execution/particle_function/type.Output.html b/particle_execution/particle_function/type.Output.html new file mode 100644 index 0000000000..e99de0a15c --- /dev/null +++ b/particle_execution/particle_function/type.Output.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../particle_execution/type.ParticleFunctionOutput.html...

+ + + \ No newline at end of file diff --git a/particle_execution/particle_function/type.ServiceFunctionImmut.html b/particle_execution/particle_function/type.ServiceFunctionImmut.html new file mode 100644 index 0000000000..eb507e87e1 --- /dev/null +++ b/particle_execution/particle_function/type.ServiceFunctionImmut.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../particle_execution/type.ServiceFunctionImmut.html...

+ + + \ No newline at end of file diff --git a/particle_execution/particle_function/type.ServiceFunctionMut.html b/particle_execution/particle_function/type.ServiceFunctionMut.html new file mode 100644 index 0000000000..08dc19694f --- /dev/null +++ b/particle_execution/particle_function/type.ServiceFunctionMut.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../particle_execution/type.ServiceFunctionMut.html...

+ + + \ No newline at end of file diff --git a/particle_execution/particle_params/struct.ParticleParams.html b/particle_execution/particle_params/struct.ParticleParams.html new file mode 100644 index 0000000000..4180457338 --- /dev/null +++ b/particle_execution/particle_params/struct.ParticleParams.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../particle_execution/struct.ParticleParams.html...

+ + + \ No newline at end of file diff --git a/particle_execution/particle_vault/constant.VIRTUAL_PARTICLE_VAULT_PREFIX.html b/particle_execution/particle_vault/constant.VIRTUAL_PARTICLE_VAULT_PREFIX.html new file mode 100644 index 0000000000..5476c20578 --- /dev/null +++ b/particle_execution/particle_vault/constant.VIRTUAL_PARTICLE_VAULT_PREFIX.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../particle_execution/constant.VIRTUAL_PARTICLE_VAULT_PREFIX.html...

+ + + \ No newline at end of file diff --git a/particle_execution/particle_vault/enum.VaultError.html b/particle_execution/particle_vault/enum.VaultError.html new file mode 100644 index 0000000000..11244d1925 --- /dev/null +++ b/particle_execution/particle_vault/enum.VaultError.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../particle_execution/enum.VaultError.html...

+ + + \ No newline at end of file diff --git a/particle_execution/particle_vault/struct.ParticleVault.html b/particle_execution/particle_vault/struct.ParticleVault.html new file mode 100644 index 0000000000..49187900d4 --- /dev/null +++ b/particle_execution/particle_vault/struct.ParticleVault.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../particle_execution/struct.ParticleVault.html...

+ + + \ No newline at end of file diff --git a/particle_execution/sidebar-items.js b/particle_execution/sidebar-items.js new file mode 100644 index 0000000000..bbe8117ddf --- /dev/null +++ b/particle_execution/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"constant":["VIRTUAL_PARTICLE_VAULT_PREFIX"],"enum":["FunctionOutcome","ServiceFunction","VaultError"],"struct":["ParticleParams","ParticleVault"],"trait":["ParticleFunction","ParticleFunctionMut","ParticleFunctionStatic"],"type":["ParticleFunctionOutput","ServiceFunctionImmut","ServiceFunctionMut"]}; \ No newline at end of file diff --git a/particle_execution/struct.ParticleParams.html b/particle_execution/struct.ParticleParams.html new file mode 100644 index 0000000000..a9676d8d17 --- /dev/null +++ b/particle_execution/struct.ParticleParams.html @@ -0,0 +1,48 @@ +ParticleParams in particle_execution - Rust
pub struct ParticleParams {
+    pub id: String,
+    pub init_peer_id: PeerId,
+    pub peer_scope: PeerScope,
+    pub timestamp: u64,
+    pub ttl: u32,
+    pub script: String,
+    pub signature: Vec<u8>,
+    pub token: String,
+}
Expand description

Lightweight, static version of the [Particle] structure +It exists to avoid cloning [Particle::data] when possible

+

Fields§

§id: String§init_peer_id: PeerId§peer_scope: PeerScope§timestamp: u64

Unix timestamp in milliseconds

+
§ttl: u32

TTL in milliseconds

+
§script: String§signature: Vec<u8>§token: String

Implementations§

source§

impl ParticleParams

source

pub fn clone_from( + particle: &Particle, + peer_scope: PeerScope, + token: String +) -> Self

source

pub fn is_spell_particle(particle_id: &str) -> bool

source

pub fn get_spell_id(particle_id: &str) -> Option<String>

source

pub fn to_particle_parameters(self) -> ParticleParameters

Trait Implementations§

source§

impl Clone for ParticleParams

source§

fn clone(&self) -> ParticleParams

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ParticleParams

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/particle_execution/struct.ParticleVault.html b/particle_execution/struct.ParticleVault.html new file mode 100644 index 0000000000..a4cd6a0341 --- /dev/null +++ b/particle_execution/struct.ParticleVault.html @@ -0,0 +1,83 @@ +ParticleVault in particle_execution - Rust
pub struct ParticleVault { /* private fields */ }

Implementations§

source§

impl ParticleVault

source

pub fn new(vault_dir: PathBuf) -> Self

source

pub fn real_worker_particle_vault(&self, peer_id: PeerId) -> PathBuf

source

pub fn real_particle_vault( + &self, + peer_id: PeerId, + particle_id: &str, + particle_token: &str +) -> PathBuf

Returns Particle File Vault path on Nox’s filesystem

+
source

pub fn virtual_particle_vault( + &self, + particle_id: &str, + particle_token: &str +) -> PathBuf

Returns Particle File Vault path on Marine’s filesystem (ie how it would look like inside service)

+
source

pub async fn initialize(&self) -> Result<(), VaultError>

source

pub fn initialize_worker(&self, worker_id: PeerId) -> Result<(), VaultError>

source

pub fn create( + &self, + current_peer_id: PeerId, + particle_id: &str, + particle_token: &str +) -> Result<(), VaultError>

source

pub fn put( + &self, + current_peer_id: PeerId, + particle: &ParticleParams, + filename: String, + payload: &str +) -> Result<PathBuf, VaultError>

source

pub fn cat( + &self, + current_peer_id: PeerId, + particle: &ParticleParams, + virtual_path: &Path +) -> Result<String, VaultError>

source

pub fn cat_slice( + &self, + current_peer_id: PeerId, + particle: &ParticleParams, + virtual_path: &Path +) -> Result<Vec<u8>, VaultError>

source

pub async fn cleanup( + &self, + peer_id: PeerId, + particle_id: &str, + particle_token: &str +) -> Result<(), VaultError>

source

pub fn to_real_path( + &self, + current_peer_id: PeerId, + particle: &ParticleParams, + virtual_path: &Path +) -> Result<PathBuf, VaultError>

Converts virtual path with VIRTUAL_PARTICLE_VAULT_PREFIX to real path in vault_dir. +Support full paths to the file in the vault starting this the prefix as well as relative paths +inside the vault. +For example, some/file.txt is valid and will be resolved to REAL_PARTICLE_VAULT_PREFIX/some/file.txt.

+
source

pub fn inject_vault( + &self, + current_peer_id: PeerId, + module: &mut ModuleDescriptor +) -> Result<()>

Map vault_dir/$current-peer-id to /tmp/vault inside the service. +Particle File Vaults will be available as /tmp/vault/$particle_id

+

Trait Implementations§

source§

impl Clone for ParticleVault

source§

fn clone(&self) -> ParticleVault

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ParticleVault

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/particle_execution/trait.ParticleFunction.html b/particle_execution/trait.ParticleFunction.html new file mode 100644 index 0000000000..1560a97ba9 --- /dev/null +++ b/particle_execution/trait.ParticleFunction.html @@ -0,0 +1,44 @@ +ParticleFunction in particle_execution - Rust
pub trait ParticleFunction: 'static + Send + Sync {
+    // Required methods
+    fn call<'life0, 'async_trait>(
+        &'life0 self,
+        args: Args,
+        particle: ParticleParams
+    ) -> Pin<Box<dyn Future<Output = FunctionOutcome> + Send + 'async_trait>>
+       where Self: 'async_trait,
+             'life0: 'async_trait;
+    fn extend<'life0, 'async_trait>(
+        &'life0 self,
+        service: String,
+        functions: HashMap<String, ServiceFunction>,
+        fallback: Option<ServiceFunction>
+    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
+       where Self: 'async_trait,
+             'life0: 'async_trait;
+    fn remove<'life0, 'life1, 'async_trait>(
+        &'life0 self,
+        service: &'life1 str
+    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
+       where Self: 'async_trait,
+             'life0: 'async_trait,
+             'life1: 'async_trait;
+}

Required Methods§

source

fn call<'life0, 'async_trait>( + &'life0 self, + args: Args, + particle: ParticleParams +) -> Pin<Box<dyn Future<Output = FunctionOutcome> + Send + 'async_trait>>where + Self: 'async_trait, + 'life0: 'async_trait,

source

fn extend<'life0, 'async_trait>( + &'life0 self, + service: String, + functions: HashMap<String, ServiceFunction>, + fallback: Option<ServiceFunction> +) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where + Self: 'async_trait, + 'life0: 'async_trait,

source

fn remove<'life0, 'life1, 'async_trait>( + &'life0 self, + service: &'life1 str +) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where + Self: 'async_trait, + 'life0: 'async_trait, + 'life1: 'async_trait,

Implementors§

\ No newline at end of file diff --git a/particle_execution/trait.ParticleFunctionMut.html b/particle_execution/trait.ParticleFunctionMut.html new file mode 100644 index 0000000000..47bbaa1c7c --- /dev/null +++ b/particle_execution/trait.ParticleFunctionMut.html @@ -0,0 +1,4 @@ +ParticleFunctionMut in particle_execution - Rust
pub trait ParticleFunctionMut: 'static + Send + Sync {
+    // Required method
+    fn call_mut(&mut self, args: Args, particle: ParticleParams) -> Output<'_>;
+}

Required Methods§

source

fn call_mut(&mut self, args: Args, particle: ParticleParams) -> Output<'_>

Implementors§

\ No newline at end of file diff --git a/particle_execution/trait.ParticleFunctionStatic.html b/particle_execution/trait.ParticleFunctionStatic.html new file mode 100644 index 0000000000..d69f00883d --- /dev/null +++ b/particle_execution/trait.ParticleFunctionStatic.html @@ -0,0 +1,63 @@ +ParticleFunctionStatic in particle_execution - Rust
pub trait ParticleFunctionStatic: Clone + 'static + Send + Sync {
+    // Required methods
+    fn call<'life0, 'async_trait>(
+        &'life0 self,
+        args: Args,
+        particle: ParticleParams
+    ) -> Pin<Box<dyn Future<Output = FunctionOutcome> + Send + 'async_trait>>
+       where Self: 'async_trait,
+             'life0: 'async_trait;
+    fn extend<'life0, 'async_trait>(
+        &'life0 self,
+        service: String,
+        functions: HashMap<String, ServiceFunction>,
+        fallback: Option<ServiceFunction>
+    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
+       where Self: 'async_trait,
+             'life0: 'async_trait;
+    fn remove<'life0, 'life1, 'async_trait>(
+        &'life0 self,
+        service: &'life1 str
+    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
+       where Self: 'async_trait,
+             'life0: 'async_trait,
+             'life1: 'async_trait;
+}

Required Methods§

source

fn call<'life0, 'async_trait>( + &'life0 self, + args: Args, + particle: ParticleParams +) -> Pin<Box<dyn Future<Output = FunctionOutcome> + Send + 'async_trait>>where + Self: 'async_trait, + 'life0: 'async_trait,

source

fn extend<'life0, 'async_trait>( + &'life0 self, + service: String, + functions: HashMap<String, ServiceFunction>, + fallback: Option<ServiceFunction> +) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where + Self: 'async_trait, + 'life0: 'async_trait,

source

fn remove<'life0, 'life1, 'async_trait>( + &'life0 self, + service: &'life1 str +) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where + Self: 'async_trait, + 'life0: 'async_trait, + 'life1: 'async_trait,

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<F: ParticleFunction> ParticleFunctionStatic for Arc<F>

source§

fn call<'life0, 'async_trait>( + self: &'life0 Arc<F>, + args: Args, + particle: ParticleParams +) -> Pin<Box<dyn Future<Output = FunctionOutcome> + Send + 'async_trait>>where + Self: 'async_trait, + 'life0: 'async_trait,

source§

fn extend<'life0, 'async_trait>( + self: &'life0 Arc<F>, + service: String, + functions: HashMap<String, ServiceFunction>, + fallback: Option<ServiceFunction> +) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where + Self: 'async_trait, + 'life0: 'async_trait,

source§

fn remove<'life0, 'life1, 'async_trait>( + self: &'life0 Arc<F>, + service: &'life1 str +) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where + Self: 'async_trait, + 'life0: 'async_trait, + 'life1: 'async_trait,

Implementors§

\ No newline at end of file diff --git a/particle_execution/type.ParticleFunctionOutput.html b/particle_execution/type.ParticleFunctionOutput.html new file mode 100644 index 0000000000..c48ba4a645 --- /dev/null +++ b/particle_execution/type.ParticleFunctionOutput.html @@ -0,0 +1 @@ +ParticleFunctionOutput in particle_execution - Rust
pub type ParticleFunctionOutput<'a> = BoxFuture<'a, FunctionOutcome>;

Aliased Type§

struct ParticleFunctionOutput<'a> { /* private fields */ }
\ No newline at end of file diff --git a/particle_execution/type.ServiceFunctionImmut.html b/particle_execution/type.ServiceFunctionImmut.html new file mode 100644 index 0000000000..dbd232532a --- /dev/null +++ b/particle_execution/type.ServiceFunctionImmut.html @@ -0,0 +1 @@ +ServiceFunctionImmut in particle_execution - Rust
pub type ServiceFunctionImmut = Box<dyn Fn(Args, ParticleParams) -> Output<'static> + Send + Sync + 'static>;

Aliased Type§

struct ServiceFunctionImmut(/* private fields */);
\ No newline at end of file diff --git a/particle_execution/type.ServiceFunctionMut.html b/particle_execution/type.ServiceFunctionMut.html new file mode 100644 index 0000000000..7437002d39 --- /dev/null +++ b/particle_execution/type.ServiceFunctionMut.html @@ -0,0 +1 @@ +ServiceFunctionMut in particle_execution - Rust
pub type ServiceFunctionMut = Box<dyn FnMut(Args, ParticleParams) -> Output<'static> + Send + Sync + 'static>;

Aliased Type§

struct ServiceFunctionMut(/* private fields */);
\ No newline at end of file diff --git a/particle_modules/all.html b/particle_modules/all.html new file mode 100644 index 0000000000..2b5a839d2d --- /dev/null +++ b/particle_modules/all.html @@ -0,0 +1 @@ +List of all items in this crate

List of all items

Structs

Enums

Functions

\ No newline at end of file diff --git a/particle_modules/enum.ModuleError.html b/particle_modules/enum.ModuleError.html new file mode 100644 index 0000000000..f7c0612973 --- /dev/null +++ b/particle_modules/enum.ModuleError.html @@ -0,0 +1,125 @@ +ModuleError in particle_modules - Rust
pub enum ModuleError {
+
Show 29 variants AddModule { + path: PathBuf, + err: Error, + }, + SerializeConfig { + err: Error, + config: TomlMarineNamedModuleConfig, + }, + SerializeConfigJson(Error), + SerializeBlueprint { + err: Error, + blueprint: Blueprint, + }, + SerializeBlueprintJson(String), + WriteConfig { + path: PathBuf, + err: Error, + }, + NoSuchBlueprint { + path: PathBuf, + err: Error, + }, + BlueprintNotFound { + id: String, + }, + EmptyDependenciesList { + id: String, + }, + FacadeShouldBeHash { + id: String, + }, + IncorrectBlueprint { + err: Error, + }, + NoModuleConfig { + path: PathBuf, + err: Error, + }, + IncorrectModuleConfig { + err: Error, + }, + WriteBlueprint { + path: PathBuf, + err: Error, + }, + ModuleConvertError { + err: MarineError, + }, + ModuleNotFound { + path: PathBuf, + err: Error, + }, + ReadModuleInterfaceError { + path: PathBuf, + err: ITParserError, + }, + InvalidModuleName(String), + InvalidModuleReference { + reference: String, + }, + ModuleInvalidBase64 { + err: DecodeError, + }, + InvalidModulePath { + module_path: String, + err: Report, + }, + InvalidModuleConfigPath { + config_path: String, + err: Report, + }, + IncorrectVaultModuleConfig { + config_path: String, + err: Error, + }, + MaxHeapSizeOverflow { + max_heap_size_wanted: u64, + max_heap_size_allowed: u64, + }, + ForbiddenEffector { + module_name: String, + forbidden_cid: String, + }, + InvalidEffectorMountedBinary { + module_name: String, + module_cid: String, + binary_name: String, + }, + Vault(VaultError), + ModuleInfo(ModuleInfoError), + WrongModuleHash(ErrReport), +
}

Variants§

§

AddModule

Fields

§path: PathBuf
§err: Error
§

SerializeConfig

Fields

§err: Error
§

SerializeConfigJson(Error)

§

SerializeBlueprint

Fields

§err: Error
§blueprint: Blueprint
§

SerializeBlueprintJson(String)

§

WriteConfig

Fields

§path: PathBuf
§err: Error
§

NoSuchBlueprint

Fields

§path: PathBuf
§err: Error
§

BlueprintNotFound

Fields

§

EmptyDependenciesList

Fields

§

FacadeShouldBeHash

Fields

§

IncorrectBlueprint

Fields

§err: Error
§

NoModuleConfig

Fields

§path: PathBuf
§err: Error
§

IncorrectModuleConfig

Fields

§err: Error
§

WriteBlueprint

Fields

§path: PathBuf
§err: Error
§

ModuleConvertError

Fields

§err: MarineError
§

ModuleNotFound

Fields

§path: PathBuf
§err: Error
§

ReadModuleInterfaceError

Fields

§path: PathBuf
§err: ITParserError
§

InvalidModuleName(String)

§

InvalidModuleReference

Fields

§reference: String
§

ModuleInvalidBase64

Fields

§err: DecodeError
§

InvalidModulePath

Fields

§module_path: String
§

InvalidModuleConfigPath

Fields

§config_path: String
§

IncorrectVaultModuleConfig

Fields

§config_path: String
§err: Error
§

MaxHeapSizeOverflow

Fields

§max_heap_size_wanted: u64
§max_heap_size_allowed: u64
§

ForbiddenEffector

Fields

§module_name: String
§forbidden_cid: String
§

InvalidEffectorMountedBinary

Fields

§module_name: String
§module_cid: String
§binary_name: String
§

Vault(VaultError)

§

ModuleInfo(ModuleInfoError)

§

WrongModuleHash(ErrReport)

Trait Implementations§

source§

impl Debug for ModuleError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for ModuleError

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for ModuleError

source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl From<DecodeError> for ModuleError

source§

fn from(source: DecodeError) -> Self

Converts to this type from the input type.
source§

impl From<ModuleError> for Value

source§

fn from(err: ModuleError) -> Self

Converts to this type from the input type.
source§

impl From<ModuleInfoError> for ModuleError

source§

fn from(source: ModuleInfoError) -> Self

Converts to this type from the input type.
source§

impl From<Report> for ModuleError

source§

fn from(source: ErrReport) -> Self

Converts to this type from the input type.
source§

impl From<VaultError> for ModuleError

source§

fn from(source: VaultError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/particle_modules/error/enum.ModuleError.html b/particle_modules/error/enum.ModuleError.html new file mode 100644 index 0000000000..ab4e6c6888 --- /dev/null +++ b/particle_modules/error/enum.ModuleError.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../particle_modules/enum.ModuleError.html...

+ + + \ No newline at end of file diff --git a/particle_modules/files/fn.load_blueprint.html b/particle_modules/files/fn.load_blueprint.html new file mode 100644 index 0000000000..9941912515 --- /dev/null +++ b/particle_modules/files/fn.load_blueprint.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../particle_modules/fn.load_blueprint.html...

+ + + \ No newline at end of file diff --git a/particle_modules/files/fn.load_module_by_path.html b/particle_modules/files/fn.load_module_by_path.html new file mode 100644 index 0000000000..3b7628becb --- /dev/null +++ b/particle_modules/files/fn.load_module_by_path.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../particle_modules/fn.load_module_by_path.html...

+ + + \ No newline at end of file diff --git a/particle_modules/files/fn.load_module_descriptor.html b/particle_modules/files/fn.load_module_descriptor.html new file mode 100644 index 0000000000..9722f14611 --- /dev/null +++ b/particle_modules/files/fn.load_module_descriptor.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../particle_modules/fn.load_module_descriptor.html...

+ + + \ No newline at end of file diff --git a/particle_modules/fn.list_files.html b/particle_modules/fn.list_files.html new file mode 100644 index 0000000000..68e207ac37 --- /dev/null +++ b/particle_modules/fn.list_files.html @@ -0,0 +1,2 @@ +list_files in particle_modules - Rust
pub fn list_files(dir: &Path) -> Option<impl Iterator<Item = PathBuf>>
Expand description

List files in directory

+
\ No newline at end of file diff --git a/particle_modules/fn.load_blueprint.html b/particle_modules/fn.load_blueprint.html new file mode 100644 index 0000000000..fb60f8c879 --- /dev/null +++ b/particle_modules/fn.load_blueprint.html @@ -0,0 +1,5 @@ +load_blueprint in particle_modules - Rust
pub fn load_blueprint(
+    bp_dir: &Path,
+    blueprint_id: &str
+) -> Result<Blueprint, ModuleError>
Expand description

Load blueprint from disk

+
\ No newline at end of file diff --git a/particle_modules/fn.load_module_by_path.html b/particle_modules/fn.load_module_by_path.html new file mode 100644 index 0000000000..a0b4a555c3 --- /dev/null +++ b/particle_modules/fn.load_module_by_path.html @@ -0,0 +1 @@ +load_module_by_path in particle_modules - Rust
pub fn load_module_by_path(path: &Path) -> Result<Vec<u8>, ModuleError>
\ No newline at end of file diff --git a/particle_modules/fn.load_module_descriptor.html b/particle_modules/fn.load_module_descriptor.html new file mode 100644 index 0000000000..525067f31b --- /dev/null +++ b/particle_modules/fn.load_module_descriptor.html @@ -0,0 +1,5 @@ +load_module_descriptor in particle_modules - Rust
pub fn load_module_descriptor(
+    modules_dir: &Path,
+    module_hash: &Hash
+) -> Result<ModuleDescriptor, ModuleError>
Expand description

Load ModuleDescriptor from disk for a given module name

+
\ No newline at end of file diff --git a/particle_modules/index.html b/particle_modules/index.html new file mode 100644 index 0000000000..b69b7c8514 --- /dev/null +++ b/particle_modules/index.html @@ -0,0 +1,2 @@ +particle_modules - Rust

Crate particle_modules

source ·

Structs

Enums

Functions

\ No newline at end of file diff --git a/particle_modules/modules/struct.EffectorsMode.html b/particle_modules/modules/struct.EffectorsMode.html new file mode 100644 index 0000000000..13ca58eb5c --- /dev/null +++ b/particle_modules/modules/struct.EffectorsMode.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../particle_modules/struct.EffectorsMode.html...

+ + + \ No newline at end of file diff --git a/particle_modules/modules/struct.ModuleRepository.html b/particle_modules/modules/struct.ModuleRepository.html new file mode 100644 index 0000000000..ed5d25a343 --- /dev/null +++ b/particle_modules/modules/struct.ModuleRepository.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../particle_modules/struct.ModuleRepository.html...

+ + + \ No newline at end of file diff --git a/particle_modules/sidebar-items.js b/particle_modules/sidebar-items.js new file mode 100644 index 0000000000..bf186b9eaf --- /dev/null +++ b/particle_modules/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["ModuleError"],"fn":["list_files","load_blueprint","load_module_by_path","load_module_descriptor"],"struct":["AddBlueprint","EffectorsMode","ModuleConfig","ModuleRepository","NamedModuleConfig","WASIConfig"]}; \ No newline at end of file diff --git a/particle_modules/struct.AddBlueprint.html b/particle_modules/struct.AddBlueprint.html new file mode 100644 index 0000000000..702bc11333 --- /dev/null +++ b/particle_modules/struct.AddBlueprint.html @@ -0,0 +1,37 @@ +AddBlueprint in particle_modules - Rust
pub struct AddBlueprint {
+    pub name: String,
+    pub dependencies: Vec<Hash>,
+}

Fields§

§name: String§dependencies: Vec<Hash>

Implementations§

source§

impl AddBlueprint

source

pub fn new(name: String, dependencies: Vec<Hash>) -> AddBlueprint

source

pub fn get_ipld(&self) -> Ipld

source

pub fn encode(&self) -> Result<Vec<u8>, Report>

encode IPLD object with DAG JSON codec

+
source

pub fn to_string(&self) -> Result<String, Report>

source

pub fn decode(data: &[u8]) -> Result<AddBlueprint, Report>

Trait Implementations§

source§

impl Clone for AddBlueprint

source§

fn clone(&self) -> AddBlueprint

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for AddBlueprint

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/particle_modules/struct.EffectorsMode.html b/particle_modules/struct.EffectorsMode.html new file mode 100644 index 0000000000..6f9b477275 --- /dev/null +++ b/particle_modules/struct.EffectorsMode.html @@ -0,0 +1,38 @@ +EffectorsMode in particle_modules - Rust
pub struct EffectorsMode { /* private fields */ }

Implementations§

source§

impl EffectorsMode

source

pub fn restricted_effectors( + defined_effectors: HashMap<Hash, HashMap<String, PathBuf>> +) -> EffectorsMode

source

pub fn all_effectors( + defined_effectors: HashMap<Hash, HashMap<String, PathBuf>>, + default_binaries: HashMap<String, PathBuf> +) -> EffectorsMode

Trait Implementations§

source§

impl Clone for EffectorsMode

source§

fn clone(&self) -> EffectorsMode

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for EffectorsMode

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for EffectorsMode

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/particle_modules/struct.ModuleConfig.html b/particle_modules/struct.ModuleConfig.html new file mode 100644 index 0000000000..d6e9fdfd27 --- /dev/null +++ b/particle_modules/struct.ModuleConfig.html @@ -0,0 +1,46 @@ +ModuleConfig in particle_modules - Rust
pub struct ModuleConfig {
+    pub logger_enabled: Option<bool>,
+    pub logging_mask: Option<i32>,
+    pub wasi: Option<TomlWASIConfig>,
+    pub mounted_binaries: Option<Map<String, Value>>,
+}

Fields§

§logger_enabled: Option<bool>§logging_mask: Option<i32>§wasi: Option<TomlWASIConfig>§mounted_binaries: Option<Map<String, Value>>

Trait Implementations§

§

impl Clone for TomlMarineModuleConfig

§

fn clone(&self) -> TomlMarineModuleConfig

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for TomlMarineModuleConfig

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Default for TomlMarineModuleConfig

§

fn default() -> TomlMarineModuleConfig

Returns the “default value” for a type. Read more
§

impl<'de> Deserialize<'de> for TomlMarineModuleConfig

§

fn deserialize<__D>( + __deserializer: __D +) -> Result<TomlMarineModuleConfig, <__D as Deserializer<'de>>::Error>where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
§

impl Serialize for TomlMarineModuleConfig

§

fn serialize<__S>( + &self, + __serializer: __S +) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
source§

impl<T> DeserializeOwned for Twhere + T: for<'de> Deserialize<'de>,

\ No newline at end of file diff --git a/particle_modules/struct.ModuleRepository.html b/particle_modules/struct.ModuleRepository.html new file mode 100644 index 0000000000..ecb04b48f8 --- /dev/null +++ b/particle_modules/struct.ModuleRepository.html @@ -0,0 +1,76 @@ +ModuleRepository in particle_modules - Rust
pub struct ModuleRepository {
+    pub modules_dir: PathBuf,
+    /* private fields */
+}

Fields§

§modules_dir: PathBuf

Implementations§

source§

impl ModuleRepository

source

pub fn new( + modules_dir: &Path, + blueprints_dir: &Path, + effectors: EffectorsMode +) -> Self

source

pub fn add_module( + &self, + name: String, + module: Vec<u8> +) -> Result<Hash, ModuleError>

source

pub fn add_system_module( + &self, + module: Vec<u8>, + config: TomlMarineNamedModuleConfig +) -> Result<Hash, ModuleError>

source

pub fn load_module_config_from_vault( + vault: &ParticleVault, + current_peer_id: PeerId, + config_path: String, + particle: ParticleParams +) -> Result<TomlMarineNamedModuleConfig, ModuleError>

source

pub fn add_module_base64( + &self, + module: String, + config: TomlMarineNamedModuleConfig +) -> Result<String, ModuleError>

Adds a module to the filesystem, overwriting existing module.

+
source

pub fn add_module_from_vault( + &self, + vault: &ParticleVault, + current_peer_id: PeerId, + name: String, + module_path: String, + particle: ParticleParams +) -> Result<String, ModuleError>

source

pub fn add_blueprint( + &self, + blueprint: AddBlueprint +) -> Result<String, ModuleError>

Saves new blueprint to disk

+
source

pub fn list_modules(&self) -> Result<JValue, JError>

source

pub fn get_facade_interface(&self, id: &str) -> Result<JValue, ModuleError>

source

pub fn get_interface_by_hash(&self, hash: &Hash) -> Result<JValue, ModuleError>

source

pub fn get_interface(&self, hex_hash: &str) -> Result<JValue, JError>

source

pub fn get_blueprint_from_cache( + &self, + id: &str +) -> Result<Blueprint, ModuleError>

source

pub fn get_blueprints(&self) -> Vec<Blueprint>

Get available blueprints

+
source

pub fn resolve_blueprint( + &self, + blueprint_id: &str +) -> Result<Vec<ModuleDescriptor>, ModuleError>

Trait Implementations§

source§

impl Clone for ModuleRepository

source§

fn clone(&self) -> ModuleRepository

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ModuleRepository

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/particle_modules/struct.NamedModuleConfig.html b/particle_modules/struct.NamedModuleConfig.html new file mode 100644 index 0000000000..a04444d78c --- /dev/null +++ b/particle_modules/struct.NamedModuleConfig.html @@ -0,0 +1,46 @@ +NamedModuleConfig in particle_modules - Rust
pub struct NamedModuleConfig {
+    pub name: String,
+    pub load_from: Option<PathBuf>,
+    pub file_name: Option<String>,
+    pub config: TomlMarineModuleConfig,
+}

Fields§

§name: String§load_from: Option<PathBuf>§file_name: Option<String>§config: TomlMarineModuleConfig

Trait Implementations§

§

impl Clone for TomlMarineNamedModuleConfig

§

fn clone(&self) -> TomlMarineNamedModuleConfig

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for TomlMarineNamedModuleConfig

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Default for TomlMarineNamedModuleConfig

§

fn default() -> TomlMarineNamedModuleConfig

Returns the “default value” for a type. Read more
§

impl<'de> Deserialize<'de> for TomlMarineNamedModuleConfig

§

fn deserialize<__D>( + __deserializer: __D +) -> Result<TomlMarineNamedModuleConfig, <__D as Deserializer<'de>>::Error>where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
§

impl Serialize for TomlMarineNamedModuleConfig

§

fn serialize<__S>( + &self, + __serializer: __S +) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
source§

impl<T> DeserializeOwned for Twhere + T: for<'de> Deserialize<'de>,

\ No newline at end of file diff --git a/particle_modules/struct.WASIConfig.html b/particle_modules/struct.WASIConfig.html new file mode 100644 index 0000000000..faf4e96b76 --- /dev/null +++ b/particle_modules/struct.WASIConfig.html @@ -0,0 +1,44 @@ +WASIConfig in particle_modules - Rust
pub struct WASIConfig {
+    pub envs: Option<Map<String, Value>>,
+    pub mapped_dirs: Option<Map<String, Value>>,
+}

Fields§

§envs: Option<Map<String, Value>>§mapped_dirs: Option<Map<String, Value>>

Trait Implementations§

§

impl Clone for TomlWASIConfig

§

fn clone(&self) -> TomlWASIConfig

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for TomlWASIConfig

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Default for TomlWASIConfig

§

fn default() -> TomlWASIConfig

Returns the “default value” for a type. Read more
§

impl<'de> Deserialize<'de> for TomlWASIConfig

§

fn deserialize<__D>( + __deserializer: __D +) -> Result<TomlWASIConfig, <__D as Deserializer<'de>>::Error>where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
§

impl Serialize for TomlWASIConfig

§

fn serialize<__S>( + &self, + __serializer: __S +) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
source§

impl<T> DeserializeOwned for Twhere + T: for<'de> Deserialize<'de>,

\ No newline at end of file diff --git a/particle_protocol/all.html b/particle_protocol/all.html new file mode 100644 index 0000000000..25430791e1 --- /dev/null +++ b/particle_protocol/all.html @@ -0,0 +1 @@ +List of all items in this crate

List of all items

Structs

Enums

Constants

\ No newline at end of file diff --git a/particle_protocol/constant.PROTOCOL_NAME.html b/particle_protocol/constant.PROTOCOL_NAME.html new file mode 100644 index 0000000000..434792f152 --- /dev/null +++ b/particle_protocol/constant.PROTOCOL_NAME.html @@ -0,0 +1 @@ +PROTOCOL_NAME in particle_protocol - Rust
pub const PROTOCOL_NAME: &str = "/fluence/particle/2.0.0";
\ No newline at end of file diff --git a/particle_protocol/contact/struct.Contact.html b/particle_protocol/contact/struct.Contact.html new file mode 100644 index 0000000000..6182b1e8f5 --- /dev/null +++ b/particle_protocol/contact/struct.Contact.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../particle_protocol/struct.Contact.html...

+ + + \ No newline at end of file diff --git a/particle_protocol/enum.CompletionChannel.html b/particle_protocol/enum.CompletionChannel.html new file mode 100644 index 0000000000..1dee47e9f1 --- /dev/null +++ b/particle_protocol/enum.CompletionChannel.html @@ -0,0 +1,27 @@ +CompletionChannel in particle_protocol - Rust
pub enum CompletionChannel {
+    Ignore,
+    Oneshot(Sender<SendStatus>),
+}

Variants§

§

Ignore

§

Oneshot(Sender<SendStatus>)

Implementations§

Trait Implementations§

source§

impl Debug for CompletionChannel

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for CompletionChannel

source§

fn default() -> CompletionChannel

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/particle_protocol/enum.HandlerMessage.html b/particle_protocol/enum.HandlerMessage.html new file mode 100644 index 0000000000..a180bbd7bf --- /dev/null +++ b/particle_protocol/enum.HandlerMessage.html @@ -0,0 +1,49 @@ +HandlerMessage in particle_protocol - Rust
pub enum HandlerMessage {
+    OutParticle(Particle, CompletionChannel),
+    InParticle(Particle),
+    Upgrade,
+}

Variants§

§

OutParticle(Particle, CompletionChannel)

Particle being sent to remote peer. Contains a channel to signal write completion. +Send-only, can’t be received.

+
§

InParticle(Particle)

Particle being received from a remote peer. +Receive-only, can’t be sent.

+
§

Upgrade

Dummy plug. Generated by the OneshotHandler when Inbound or Outbound Upgrade happened.

+

Implementations§

Trait Implementations§

source§

impl Debug for HandlerMessage

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<()> for HandlerMessage

source§

fn from(_: ()) -> HandlerMessage

Converts to this type from the input type.
source§

impl From<ProtocolMessage> for HandlerMessage

source§

fn from(msg: ProtocolMessage) -> HandlerMessage

Converts to this type from the input type.
source§

impl<Socket> OutboundUpgrade<Socket> for HandlerMessagewhere + Socket: AsyncRead + AsyncWrite + Send + Unpin + 'static,

§

type Output = ()

Output after the upgrade has been successfully negotiated and the handshake performed.
§

type Error = Error

Possible error during the handshake.
§

type Future = Pin<Box<dyn Future<Output = Result<<HandlerMessage as OutboundUpgrade<Socket>>::Output, <HandlerMessage as OutboundUpgrade<Socket>>::Error>> + Send>>

Future that performs the handshake with the remote.
source§

fn upgrade_outbound(self, socket: Socket, _: Self::Info) -> Self::Future

After we have determined that the remote supports one of the protocols we support, this +method is called to start the handshake. Read more
source§

impl UpgradeInfo for HandlerMessage

§

type Info = &'static str

Opaque type representing a negotiable protocol.
§

type InfoIter = Once<<HandlerMessage as UpgradeInfo>::Info>

Iterator returned by protocol_info.
source§

fn protocol_info(&self) -> Self::InfoIter

Returns the list of protocols that are supported. Used during the negotiation process.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T, TInfo> OutboundUpgradeSend for Twhere + T: OutboundUpgrade<Stream, Info = TInfo> + UpgradeInfoSend<Info = TInfo>, + TInfo: AsRef<str> + Clone + Send + 'static, + <T as OutboundUpgrade<Stream>>::Output: Send + 'static, + <T as OutboundUpgrade<Stream>>::Error: Send + 'static, + <T as OutboundUpgrade<Stream>>::Future: Send + 'static,

§

type Output = <T as OutboundUpgrade<Stream>>::Output

§

type Error = <T as OutboundUpgrade<Stream>>::Error

Equivalent to OutboundUpgrade::Error.
§

type Future = <T as OutboundUpgrade<Stream>>::Future

§

fn upgrade_outbound( + self, + socket: Stream, + info: TInfo +) -> <T as OutboundUpgradeSend>::Future

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> UpgradeInfoSend for Twhere + T: UpgradeInfo + Send + 'static, + <T as UpgradeInfo>::Info: Send + 'static, + <<T as UpgradeInfo>::InfoIter as IntoIterator>::IntoIter: Send + 'static,

§

type Info = <T as UpgradeInfo>::Info

Equivalent to UpgradeInfo::Info.
§

type InfoIter = <<T as UpgradeInfo>::InfoIter as IntoIterator>::IntoIter

Equivalent to UpgradeInfo::InfoIter.
§

fn protocol_info(&self) -> <T as UpgradeInfoSend>::InfoIter

§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/particle_protocol/enum.ParticleError.html b/particle_protocol/enum.ParticleError.html new file mode 100644 index 0000000000..1c2129020c --- /dev/null +++ b/particle_protocol/enum.ParticleError.html @@ -0,0 +1,44 @@ +ParticleError in particle_protocol - Rust
pub enum ParticleError {
+    InvalidKeypair {
+        particle_id: String,
+        init_peer_id: String,
+        given_peer_id: String,
+    },
+    SigningFailed {
+        err: SigningError,
+        particle_id: String,
+    },
+    SignatureVerificationFailed {
+        err: VerificationError,
+        particle_id: String,
+        peer_id: String,
+    },
+    DecodingError {
+        err: DecodingError,
+        particle_id: String,
+    },
+}

Variants§

§

InvalidKeypair

Fields

§particle_id: String
§init_peer_id: String
§given_peer_id: String
§

SigningFailed

Fields

§err: SigningError
§particle_id: String
§

SignatureVerificationFailed

Fields

§err: VerificationError
§particle_id: String
§peer_id: String
§

DecodingError

Fields

§err: DecodingError
§particle_id: String

Trait Implementations§

source§

impl Debug for ParticleError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for ParticleError

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for ParticleError

source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/particle_protocol/enum.ProtocolMessage.html b/particle_protocol/enum.ProtocolMessage.html new file mode 100644 index 0000000000..486a60527b --- /dev/null +++ b/particle_protocol/enum.ProtocolMessage.html @@ -0,0 +1,34 @@ +ProtocolMessage in particle_protocol - Rust
pub enum ProtocolMessage {
+    Particle(Particle),
+    Upgrade,
+}

Variants§

§

Particle(Particle)

§

Upgrade

Trait Implementations§

source§

impl Clone for ProtocolMessage

source§

fn clone(&self) -> ProtocolMessage

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ProtocolMessage

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for ProtocolMessage

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Display for ProtocolMessage

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<ProtocolMessage> for HandlerMessage

source§

fn from(msg: ProtocolMessage) -> HandlerMessage

Converts to this type from the input type.
source§

impl PartialEq for ProtocolMessage

source§

fn eq(&self, other: &ProtocolMessage) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Serialize for ProtocolMessage

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl StructuralPartialEq for ProtocolMessage

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
source§

impl<T> DeserializeOwned for Twhere + T: for<'de> Deserialize<'de>,

\ No newline at end of file diff --git a/particle_protocol/enum.SendStatus.html b/particle_protocol/enum.SendStatus.html new file mode 100644 index 0000000000..56e705c3eb --- /dev/null +++ b/particle_protocol/enum.SendStatus.html @@ -0,0 +1,33 @@ +SendStatus in particle_protocol - Rust
pub enum SendStatus {
+    Ok,
+    TimedOut {
+        after: Duration,
+        error: Error,
+    },
+    ProtocolError(String),
+    NotConnected,
+    ConnectionPoolDied,
+}

Variants§

§

Ok

§

TimedOut

Fields

§after: Duration
§error: Error
§

ProtocolError(String)

§

NotConnected

§

ConnectionPoolDied

Trait Implementations§

source§

impl Debug for SendStatus

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for SendStatus

source§

fn default() -> SendStatus

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/particle_protocol/error/enum.ParticleError.html b/particle_protocol/error/enum.ParticleError.html new file mode 100644 index 0000000000..289383c27a --- /dev/null +++ b/particle_protocol/error/enum.ParticleError.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../particle_protocol/enum.ParticleError.html...

+ + + \ No newline at end of file diff --git a/particle_protocol/index.html b/particle_protocol/index.html new file mode 100644 index 0000000000..23c58fcef4 --- /dev/null +++ b/particle_protocol/index.html @@ -0,0 +1,2 @@ +particle_protocol - Rust

Structs

Enums

Constants

\ No newline at end of file diff --git a/particle_protocol/libp2p_protocol/message/enum.CompletionChannel.html b/particle_protocol/libp2p_protocol/message/enum.CompletionChannel.html new file mode 100644 index 0000000000..761ab4ff06 --- /dev/null +++ b/particle_protocol/libp2p_protocol/message/enum.CompletionChannel.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../particle_protocol/enum.CompletionChannel.html...

+ + + \ No newline at end of file diff --git a/particle_protocol/libp2p_protocol/message/enum.HandlerMessage.html b/particle_protocol/libp2p_protocol/message/enum.HandlerMessage.html new file mode 100644 index 0000000000..94e1c8df9c --- /dev/null +++ b/particle_protocol/libp2p_protocol/message/enum.HandlerMessage.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../particle_protocol/enum.HandlerMessage.html...

+ + + \ No newline at end of file diff --git a/particle_protocol/libp2p_protocol/message/enum.ProtocolMessage.html b/particle_protocol/libp2p_protocol/message/enum.ProtocolMessage.html new file mode 100644 index 0000000000..ad2dc265cc --- /dev/null +++ b/particle_protocol/libp2p_protocol/message/enum.ProtocolMessage.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../particle_protocol/enum.ProtocolMessage.html...

+ + + \ No newline at end of file diff --git a/particle_protocol/libp2p_protocol/message/enum.SendStatus.html b/particle_protocol/libp2p_protocol/message/enum.SendStatus.html new file mode 100644 index 0000000000..d28628f253 --- /dev/null +++ b/particle_protocol/libp2p_protocol/message/enum.SendStatus.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../particle_protocol/enum.SendStatus.html...

+ + + \ No newline at end of file diff --git a/particle_protocol/libp2p_protocol/upgrade/struct.ProtocolConfig.html b/particle_protocol/libp2p_protocol/upgrade/struct.ProtocolConfig.html new file mode 100644 index 0000000000..e51cc00ec0 --- /dev/null +++ b/particle_protocol/libp2p_protocol/upgrade/struct.ProtocolConfig.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../particle_protocol/struct.ProtocolConfig.html...

+ + + \ No newline at end of file diff --git a/particle_protocol/particle/struct.ExtendedParticle.html b/particle_protocol/particle/struct.ExtendedParticle.html new file mode 100644 index 0000000000..539a3e2030 --- /dev/null +++ b/particle_protocol/particle/struct.ExtendedParticle.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../particle_protocol/struct.ExtendedParticle.html...

+ + + \ No newline at end of file diff --git a/particle_protocol/particle/struct.Particle.html b/particle_protocol/particle/struct.Particle.html new file mode 100644 index 0000000000..118a1cd32e --- /dev/null +++ b/particle_protocol/particle/struct.Particle.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../particle_protocol/struct.Particle.html...

+ + + \ No newline at end of file diff --git a/particle_protocol/sidebar-items.js b/particle_protocol/sidebar-items.js new file mode 100644 index 0000000000..956e60bf6e --- /dev/null +++ b/particle_protocol/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"constant":["PROTOCOL_NAME"],"enum":["CompletionChannel","HandlerMessage","ParticleError","ProtocolMessage","SendStatus"],"struct":["Contact","ExtendedParticle","Particle","ProtocolConfig"]}; \ No newline at end of file diff --git a/particle_protocol/struct.Contact.html b/particle_protocol/struct.Contact.html new file mode 100644 index 0000000000..92f061243d --- /dev/null +++ b/particle_protocol/struct.Contact.html @@ -0,0 +1,38 @@ +Contact in particle_protocol - Rust
pub struct Contact {
+    pub peer_id: PeerId,
+    pub addresses: Vec<Multiaddr>,
+}

Fields§

§peer_id: PeerId§addresses: Vec<Multiaddr>

Implementations§

source§

impl Contact

source

pub fn new(peer_id: PeerId, addresses: Vec<Multiaddr>) -> Self

Trait Implementations§

source§

impl Clone for Contact

source§

fn clone(&self) -> Contact

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Contact

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for Contact

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Display for Contact

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq for Contact

source§

fn eq(&self, other: &Contact) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Serialize for Contact

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Eq for Contact

source§

impl StructuralEq for Contact

source§

impl StructuralPartialEq for Contact

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
source§

impl<T> DeserializeOwned for Twhere + T: for<'de> Deserialize<'de>,

\ No newline at end of file diff --git a/particle_protocol/struct.ExtendedParticle.html b/particle_protocol/struct.ExtendedParticle.html new file mode 100644 index 0000000000..5f515ff9c3 --- /dev/null +++ b/particle_protocol/struct.ExtendedParticle.html @@ -0,0 +1,28 @@ +ExtendedParticle in particle_protocol - Rust
pub struct ExtendedParticle {
+    pub particle: Particle,
+    pub span: Arc<Span>,
+}

Fields§

§particle: Particle§span: Arc<Span>

Implementations§

source§

impl ExtendedParticle

source

pub fn new(particle: Particle, span: Span) -> Self

source

pub fn linked(particle: Particle, span: Arc<Span>) -> Self

Trait Implementations§

source§

impl AsRef<Particle> for ExtendedParticle

source§

fn as_ref(&self) -> &Particle

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl AsRef<str> for ExtendedParticle

source§

fn as_ref(&self) -> &str

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Clone for ExtendedParticle

source§

fn clone(&self) -> ExtendedParticle

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ExtendedParticle

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/particle_protocol/struct.Particle.html b/particle_protocol/struct.Particle.html new file mode 100644 index 0000000000..e3acbd5155 --- /dev/null +++ b/particle_protocol/struct.Particle.html @@ -0,0 +1,41 @@ +Particle in particle_protocol - Rust
pub struct Particle {
+    pub id: String,
+    pub init_peer_id: PeerId,
+    pub timestamp: u64,
+    pub ttl: u32,
+    pub script: String,
+    pub signature: Vec<u8>,
+    pub data: Vec<u8>,
+}

Fields§

§id: String§init_peer_id: PeerId§timestamp: u64§ttl: u32§script: String§signature: Vec<u8>§data: Vec<u8>

base64-encoded

+

Implementations§

source§

impl Particle

source

pub fn is_expired(&self) -> bool

source

pub fn deadline(&self) -> Option<u64>

Deadline in milliseconds

+
source

pub fn time_to_live(&self) -> Duration

source

pub fn sign(&mut self, keypair: &KeyPair) -> Result<(), ParticleError>

source

pub fn verify(&self) -> Result<(), ParticleError>

Trait Implementations§

source§

impl AsRef<Particle> for ExtendedParticle

source§

fn as_ref(&self) -> &Particle

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Clone for Particle

source§

fn clone(&self) -> Particle

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Particle

source§

fn fmt(&self, __f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Particle

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for Particle

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Display for Particle

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq for Particle

source§

fn eq(&self, other: &Particle) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Serialize for Particle

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl StructuralPartialEq for Particle

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
source§

impl<T> DeserializeOwned for Twhere + T: for<'de> Deserialize<'de>,

\ No newline at end of file diff --git a/particle_protocol/struct.ProtocolConfig.html b/particle_protocol/struct.ProtocolConfig.html new file mode 100644 index 0000000000..64ed3d438a --- /dev/null +++ b/particle_protocol/struct.ProtocolConfig.html @@ -0,0 +1,52 @@ +ProtocolConfig in particle_protocol - Rust
pub struct ProtocolConfig {
+    pub upgrade_timeout: Duration,
+    pub outbound_substream_timeout: Duration,
+}

Fields§

§upgrade_timeout: Duration

Timeout for applying the given upgrade on a substream

+
§outbound_substream_timeout: Duration

Timeout for outbound substream upgrades.

+

Implementations§

source§

impl ProtocolConfig

source

pub fn new( + upgrade_timeout: Duration, + outbound_substream_timeout: Duration +) -> Self

Trait Implementations§

source§

impl Clone for ProtocolConfig

source§

fn clone(&self) -> ProtocolConfig

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ProtocolConfig

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for ProtocolConfig

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for ProtocolConfig

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl<OutProto: OutboundUpgradeSend, OutEvent> From<ProtocolConfig> for OneShotHandler<ProtocolConfig, OutProto, OutEvent>

source§

fn from( + item: ProtocolConfig +) -> OneShotHandler<ProtocolConfig, OutProto, OutEvent>

Converts to this type from the input type.
source§

impl<Socket> InboundUpgrade<Socket> for ProtocolConfigwhere + Socket: AsyncRead + Send + Unpin + 'static,

§

type Output = HandlerMessage

Output after the upgrade has been successfully negotiated and the handshake performed.
§

type Error = Error

Possible error during the handshake.
§

type Future = Pin<Box<dyn Future<Output = Result<<ProtocolConfig as InboundUpgrade<Socket>>::Output, <ProtocolConfig as InboundUpgrade<Socket>>::Error>> + Send>>

Future that performs the handshake with the remote.
source§

fn upgrade_inbound(self, socket: Socket, _: Self::Info) -> Self::Future

After we have determined that the remote supports one of the protocols we support, this +method is called to start the handshake. Read more
source§

impl Serialize for ProtocolConfig

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl UpgradeInfo for ProtocolConfig

§

type Info = &'static str

Opaque type representing a negotiable protocol.
§

type InfoIter = Once<<ProtocolConfig as UpgradeInfo>::Info>

Iterator returned by protocol_info.
source§

fn protocol_info(&self) -> Self::InfoIter

Returns the list of protocols that are supported. Used during the negotiation process.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T, TInfo> InboundUpgradeSend for Twhere + T: InboundUpgrade<Stream, Info = TInfo> + UpgradeInfoSend<Info = TInfo>, + TInfo: AsRef<str> + Clone + Send + 'static, + <T as InboundUpgrade<Stream>>::Output: Send + 'static, + <T as InboundUpgrade<Stream>>::Error: Send + 'static, + <T as InboundUpgrade<Stream>>::Future: Send + 'static,

§

type Output = <T as InboundUpgrade<Stream>>::Output

Equivalent to InboundUpgrade::Output.
§

type Error = <T as InboundUpgrade<Stream>>::Error

Equivalent to InboundUpgrade::Error.
§

type Future = <T as InboundUpgrade<Stream>>::Future

Equivalent to InboundUpgrade::Future.
§

fn upgrade_inbound( + self, + socket: Stream, + info: TInfo +) -> <T as InboundUpgradeSend>::Future

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> UpgradeInfoSend for Twhere + T: UpgradeInfo + Send + 'static, + <T as UpgradeInfo>::Info: Send + 'static, + <<T as UpgradeInfo>::InfoIter as IntoIterator>::IntoIter: Send + 'static,

§

type Info = <T as UpgradeInfo>::Info

Equivalent to UpgradeInfo::Info.
§

type InfoIter = <<T as UpgradeInfo>::InfoIter as IntoIterator>::IntoIter

Equivalent to UpgradeInfo::InfoIter.
§

fn protocol_info(&self) -> <T as UpgradeInfoSend>::InfoIter

§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
source§

impl<T> DeserializeOwned for Twhere + T: for<'de> Deserialize<'de>,

\ No newline at end of file diff --git a/particle_services/all.html b/particle_services/all.html new file mode 100644 index 0000000000..6ecf2f294f --- /dev/null +++ b/particle_services/all.html @@ -0,0 +1 @@ +List of all items in this crate

List of all items

Structs

Enums

\ No newline at end of file diff --git a/particle_services/app_services/enum.ServiceType.html b/particle_services/app_services/enum.ServiceType.html new file mode 100644 index 0000000000..c0350291a3 --- /dev/null +++ b/particle_services/app_services/enum.ServiceType.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../particle_services/enum.ServiceType.html...

+ + + \ No newline at end of file diff --git a/particle_services/app_services/struct.ParticleAppServices.html b/particle_services/app_services/struct.ParticleAppServices.html new file mode 100644 index 0000000000..9e8c449eec --- /dev/null +++ b/particle_services/app_services/struct.ParticleAppServices.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../particle_services/struct.ParticleAppServices.html...

+ + + \ No newline at end of file diff --git a/particle_services/app_services/struct.ServiceInfo.html b/particle_services/app_services/struct.ServiceInfo.html new file mode 100644 index 0000000000..96d7d23733 --- /dev/null +++ b/particle_services/app_services/struct.ServiceInfo.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../particle_services/struct.ServiceInfo.html...

+ + + \ No newline at end of file diff --git a/particle_services/config/struct.ParticleAppServicesConfig.html b/particle_services/config/struct.ParticleAppServicesConfig.html new file mode 100644 index 0000000000..2d7e169e5c --- /dev/null +++ b/particle_services/config/struct.ParticleAppServicesConfig.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../particle_services/struct.ParticleAppServicesConfig.html...

+ + + \ No newline at end of file diff --git a/particle_services/config/struct.WasmBackendConfig.html b/particle_services/config/struct.WasmBackendConfig.html new file mode 100644 index 0000000000..ed0ed01cd4 --- /dev/null +++ b/particle_services/config/struct.WasmBackendConfig.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../particle_services/struct.WasmBackendConfig.html...

+ + + \ No newline at end of file diff --git a/particle_services/enum.IType.html b/particle_services/enum.IType.html new file mode 100644 index 0000000000..47b2468d9f --- /dev/null +++ b/particle_services/enum.IType.html @@ -0,0 +1,99 @@ +IType in particle_services - Rust
pub enum IType {
+
Show 17 variants Boolean, + S8, + S16, + S32, + S64, + U8, + U16, + U32, + U64, + F32, + F64, + String, + ByteArray, + Array(Box<IType>), + I32, + I64, + Record(u64), +
}
Expand description

Represents the types supported by WIT.

+

Variants§

§

Boolean

Boolean.

+
§

S8

A 8-bits signed integer.

+
§

S16

A 16-bits signed integer.

+
§

S32

A 32-bits signed integer.

+
§

S64

A 64-bits signed integer.

+
§

U8

A 8-bits unsigned integer.

+
§

U16

A 16-bits unsigned integer.

+
§

U32

A 32-bits unsigned integer.

+
§

U64

A 64-bits unsigned integer.

+
§

F32

A 32-bits float.

+
§

F64

A 64-bits float.

+
§

String

A string.

+
§

ByteArray

Specialization of arrays for byte vector.

+
§

Array(Box<IType>)

An array of values of the same type.

+
§

I32

A 32-bits integer (as defined in WebAssembly core).

+
§

I64

A 64-bits integer (as defined in WebAssembly core).

+
§

Record(u64)

A record contains record index from interfaces AST.

+

Implementations§

§

impl IType

pub const VARIANT_COUNT: usize = 17usize

Trait Implementations§

§

impl Clone for IType

§

fn clone(&self) -> IType

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for IType

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl<'de> Deserialize<'de> for IType

§

fn deserialize<__D>( + __deserializer: __D +) -> Result<IType, <__D as Deserializer<'de>>::Error>where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
§

impl Hash for IType

§

fn hash<__H>(&self, state: &mut __H)where + __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
§

impl Parse<'_> for IType

§

fn parse(parser: Parser<'_>) -> Result<IType, Error>

Attempts to parse Self from parser, returning an error if it could +not be parsed. Read more
§

impl PartialEq for IType

§

fn eq(&self, other: &IType) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
§

impl Serialize for IType

§

fn serialize<__S>( + &self, + __serializer: __S +) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more
§

impl<W> ToBytes<W> for ITypewhere + W: Write,

Encode an IType into bytes.

+
§

fn to_bytes(&self, writer: &mut W) -> Result<(), Error>

Converts the given value into &[u8] in the given writer.
§

impl ToString for &IType

Encode an IType into a string.

+
§

fn to_string(&self) -> String

Converts the given value to a String. Read more
§

impl Eq for IType

§

impl StructuralEq for IType

§

impl StructuralPartialEq for IType

Auto Trait Implementations§

§

impl RefUnwindSafe for IType

§

impl Send for IType

§

impl Sync for IType

§

impl Unpin for IType

§

impl UnwindSafe for IType

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> CallHasher for Twhere + T: Hash + ?Sized,

§

default fn get_hash<H, B>(value: &H, build_hasher: &B) -> u64where + H: Hash + ?Sized, + B: BuildHasher,

source§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
source§

impl<T> DeserializeOwned for Twhere + T: for<'de> Deserialize<'de>,

\ No newline at end of file diff --git a/particle_services/enum.IValue.html b/particle_services/enum.IValue.html new file mode 100644 index 0000000000..19f3424206 --- /dev/null +++ b/particle_services/enum.IValue.html @@ -0,0 +1,73 @@ +IValue in particle_services - Rust
pub enum IValue {
+
Show 17 variants Boolean(bool), + S8(i8), + S16(i16), + S32(i32), + S64(i64), + U8(u8), + U16(u16), + U32(u32), + U64(u64), + F32(f32), + F64(f64), + String(String), + ByteArray(Vec<u8>), + Array(Vec<IValue>), + I32(i32), + I64(i64), + Record(NEVec<IValue>), +
}
Expand description

A WIT value.

+

Variants§

§

Boolean(bool)

Boolean value.

+
§

S8(i8)

A 8-bits signed integer.

+
§

S16(i16)

A 16-bits signed integer.

+
§

S32(i32)

A 32-bits signed integer.

+
§

S64(i64)

A 64-bits signed integer.

+
§

U8(u8)

A 8-bits unsigned integer.

+
§

U16(u16)

A 16-bits unsigned integer.

+
§

U32(u32)

A 32-bits unsigned integer.

+
§

U64(u64)

A 64-bits unsigned integer.

+
§

F32(f32)

A 32-bits float.

+
§

F64(f64)

A 64-bits float.

+
§

String(String)

A string.

+
§

ByteArray(Vec<u8>)

Specialization of array type for byte vector.

+
§

Array(Vec<IValue>)

A byte array.

+
§

I32(i32)

A 32-bits integer (as defined in WebAssembly core).

+
§

I64(i64)

A 64-bits integer (as defined in WebAssembly core).

+
§

Record(NEVec<IValue>)

A record.

+

Implementations§

§

impl IValue

pub const VARIANT_COUNT: usize = 17usize

Trait Implementations§

§

impl Clone for IValue

§

fn clone(&self) -> IValue

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for IValue

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Default for IValue

§

fn default() -> IValue

Returns the “default value” for a type. Read more
§

impl From<String> for IValue

§

fn from(n: String) -> IValue

Converts to this type from the input type.
§

impl From<Vec<u8>> for IValue

§

fn from(n: Vec<u8>) -> IValue

Converts to this type from the input type.
§

impl From<f32> for IValue

§

fn from(n: f32) -> IValue

Converts to this type from the input type.
§

impl From<f64> for IValue

§

fn from(n: f64) -> IValue

Converts to this type from the input type.
§

impl From<i16> for IValue

§

fn from(n: i16) -> IValue

Converts to this type from the input type.
§

impl From<i32> for IValue

§

fn from(n: i32) -> IValue

Converts to this type from the input type.
§

impl From<i64> for IValue

§

fn from(n: i64) -> IValue

Converts to this type from the input type.
§

impl From<i8> for IValue

§

fn from(n: i8) -> IValue

Converts to this type from the input type.
§

impl From<u16> for IValue

§

fn from(n: u16) -> IValue

Converts to this type from the input type.
§

impl From<u32> for IValue

§

fn from(n: u32) -> IValue

Converts to this type from the input type.
§

impl From<u64> for IValue

§

fn from(n: u64) -> IValue

Converts to this type from the input type.
§

impl From<u8> for IValue

§

fn from(n: u8) -> IValue

Converts to this type from the input type.
§

impl PartialEq for IValue

§

fn eq(&self, other: &IValue) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
§

impl TryFrom<IValue> for String

§

type Error = WasmValueNativeCastError

The type returned in the event of a conversion error.
§

fn try_from(w: IValue) -> Result<String, <String as TryFrom<IValue>>::Error>

Performs the conversion.
§

impl TryFrom<IValue> for Vec<u8>

§

type Error = WasmValueNativeCastError

The type returned in the event of a conversion error.
§

fn try_from(w: IValue) -> Result<Vec<u8>, <Vec<u8> as TryFrom<IValue>>::Error>

Performs the conversion.
§

impl StructuralPartialEq for IValue

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/particle_services/enum.PeerScope.html b/particle_services/enum.PeerScope.html new file mode 100644 index 0000000000..7e5f87c0b6 --- /dev/null +++ b/particle_services/enum.PeerScope.html @@ -0,0 +1,69 @@ +PeerScope in particle_services - Rust
pub enum PeerScope {
+    WorkerId(WorkerId),
+    Host,
+}

Variants§

§

WorkerId(WorkerId)

§

Host

Trait Implementations§

source§

impl Clone for PeerScope

source§

fn clone(&self) -> PeerScope

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for PeerScope

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for PeerScope

source§

fn deserialize<__D>( + __deserializer: __D +) -> Result<PeerScope, <__D as Deserializer<'de>>::Error>where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Hash for PeerScope

source§

fn hash<__H>(&self, state: &mut __H)where + __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Ord for PeerScope

source§

fn cmp(&self, other: &PeerScope) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Selfwhere + Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Selfwhere + Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Selfwhere + Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for PeerScope

source§

fn eq(&self, other: &PeerScope) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for PeerScope

source§

fn partial_cmp(&self, other: &PeerScope) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

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 more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= +operator. Read more
source§

impl Serialize for PeerScope

source§

fn serialize<__S>( + &self, + __serializer: __S +) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Copy for PeerScope

source§

impl Eq for PeerScope

source§

impl StructuralEq for PeerScope

source§

impl StructuralPartialEq for PeerScope

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> CallHasher for Twhere + T: Hash + ?Sized,

§

default fn get_hash<H, B>(value: &H, build_hasher: &B) -> u64where + H: Hash + ?Sized, + B: BuildHasher,

§

impl<Q, K> Comparable<K> for Qwhere + Q: Ord + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
source§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
source§

impl<T> DeserializeOwned for Twhere + T: for<'de> Deserialize<'de>,

\ No newline at end of file diff --git a/particle_services/enum.ServiceError.html b/particle_services/enum.ServiceError.html new file mode 100644 index 0000000000..c80e62fefb --- /dev/null +++ b/particle_services/enum.ServiceError.html @@ -0,0 +1,93 @@ +ServiceError in particle_services - Rust
pub enum ServiceError {
+
Show 23 variants NoSuchService(String, PeerScope), + NoSuchServiceWithFunction { + service: String, + function: String, + }, + CallServiceFailedWrongWorker { + service_id: String, + peer_scope: PeerScope, + }, + NoSuchAlias(String, PeerScope), + Forbidden { + user: PeerId, + function: &'static str, + reason: &'static str, + }, + ForbiddenAliasRoot(PeerId), + ForbiddenAliasWorker(PeerId), + AliasAsServiceId(String), + ForbiddenAlias(String), + Engine(AppServiceError), + ModuleError(ModuleError), + ReadPersistedService { + path: PathBuf, + err: Error, + }, + DeserializePersistedService { + path: PathBuf, + err: Error, + }, + CreateServicesDir { + path: PathBuf, + err: Error, + }, + CorruptedFaaSInterface(Error), + ArgParseError(ArgsError), + VaultLink { + err: Error, + particle_id: String, + service_id: String, + }, + VaultError(VaultError), + SerializePersistedService { + err: Error, + config: Box<dyn Debug + Send + Sync>, + }, + WritePersistedService { + path: PathBuf, + err: Error, + }, + InternalError(String), + WorkerNotFound { + worker_id: WorkerId, + }, + FailedToCreateDirectory { + path: PathBuf, + err: Error, + }, +
}

Variants§

§

NoSuchService(String, PeerScope)

§

NoSuchServiceWithFunction

Fields

§service: String
§function: String
§

CallServiceFailedWrongWorker

Fields

§service_id: String
§peer_scope: PeerScope
§

NoSuchAlias(String, PeerScope)

§

Forbidden

Fields

§user: PeerId
§function: &'static str
§reason: &'static str
§

ForbiddenAliasRoot(PeerId)

§

ForbiddenAliasWorker(PeerId)

§

AliasAsServiceId(String)

§

ForbiddenAlias(String)

§

Engine(AppServiceError)

§

ModuleError(ModuleError)

§

ReadPersistedService

Fields

§path: PathBuf
§err: Error
§

DeserializePersistedService

Fields

§path: PathBuf
§err: Error
§

CreateServicesDir

Fields

§path: PathBuf
§err: Error
§

CorruptedFaaSInterface(Error)

§

ArgParseError(ArgsError)

Fields

§err: Error
§particle_id: String
§service_id: String
§

VaultError(VaultError)

§

SerializePersistedService

Fields

§err: Error
§config: Box<dyn Debug + Send + Sync>
§

WritePersistedService

Fields

§path: PathBuf
§err: Error
§

InternalError(String)

§

WorkerNotFound

Fields

§worker_id: WorkerId
§

FailedToCreateDirectory

Fields

§path: PathBuf
§err: Error

Trait Implementations§

source§

impl Debug for ServiceError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for ServiceError

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for ServiceError

source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl From<AppServiceError> for ServiceError

source§

fn from(err: AppServiceError) -> Self

Converts to this type from the input type.
source§

impl From<ArgsError> for ServiceError

source§

fn from(err: ArgsError) -> Self

Converts to this type from the input type.
source§

impl From<ModuleError> for ServiceError

source§

fn from(err: ModuleError) -> Self

Converts to this type from the input type.
source§

impl From<ServiceError> for Value

source§

fn from(err: ServiceError) -> Self

Converts to this type from the input type.
source§

impl From<VaultError> for ServiceError

source§

fn from(source: VaultError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/particle_services/enum.ServiceType.html b/particle_services/enum.ServiceType.html new file mode 100644 index 0000000000..4b86dcdf28 --- /dev/null +++ b/particle_services/enum.ServiceType.html @@ -0,0 +1,51 @@ +ServiceType in particle_services - Rust
pub enum ServiceType {
+    Service,
+    Spell,
+}

Variants§

§

Service

§

Spell

Implementations§

Trait Implementations§

source§

impl Clone for ServiceType

source§

fn clone(&self) -> ServiceType

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ServiceType

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for ServiceType

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl PartialEq for ServiceType

source§

fn eq(&self, other: &ServiceType) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Serialize for ServiceType

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Eq for ServiceType

source§

impl StructuralEq for ServiceType

source§

impl StructuralPartialEq for ServiceType

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
source§

impl<T> DeserializeOwned for Twhere + T: for<'de> Deserialize<'de>,

\ No newline at end of file diff --git a/particle_services/error/enum.ServiceError.html b/particle_services/error/enum.ServiceError.html new file mode 100644 index 0000000000..0c2e81e78e --- /dev/null +++ b/particle_services/error/enum.ServiceError.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../particle_services/enum.ServiceError.html...

+ + + \ No newline at end of file diff --git a/particle_services/index.html b/particle_services/index.html new file mode 100644 index 0000000000..00a52a33f3 --- /dev/null +++ b/particle_services/index.html @@ -0,0 +1,2 @@ +particle_services - Rust

Structs

Enums

\ No newline at end of file diff --git a/particle_services/sidebar-items.js b/particle_services/sidebar-items.js new file mode 100644 index 0000000000..ad671fe7dc --- /dev/null +++ b/particle_services/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["IType","IValue","PeerScope","ServiceError","ServiceType"],"struct":["ParticleAppServices","ParticleAppServicesConfig","ServiceInfo","WasmBackendConfig"]}; \ No newline at end of file diff --git a/particle_services/struct.ParticleAppServices.html b/particle_services/struct.ParticleAppServices.html new file mode 100644 index 0000000000..385dfe50c6 --- /dev/null +++ b/particle_services/struct.ParticleAppServices.html @@ -0,0 +1,126 @@ +ParticleAppServices in particle_services - Rust
pub struct ParticleAppServices {
+    pub vault: ParticleVault,
+    pub metrics: Option<ServicesMetrics>,
+    /* private fields */
+}

Fields§

§vault: ParticleVault§metrics: Option<ServicesMetrics>

Implementations§

source§

impl ParticleAppServices

source

pub fn new( + config: ParticleAppServicesConfig, + modules: ModuleRepository, + metrics: Option<ServicesMetrics>, + health_registry: Option<&mut HealthCheckRegistry>, + workers: Arc<Workers>, + scope: PeerScopes +) -> Result<Self, ServiceError>

source

pub async fn create_service( + &self, + peer_scope: PeerScope, + service_type: ServiceType, + blueprint_id: String, + owner_id: PeerId +) -> Result<String, ServiceError>

source

pub async fn service_exists( + &self, + peer_scope: &PeerScope, + service_id: &str +) -> bool

source

pub async fn get_service_info( + &self, + peer_scope: PeerScope, + service_id_or_alias: String, + particle_id: &str +) -> Result<ServiceInfo, ServiceError>

source

pub async fn remove_services( + &self, + peer_scope: PeerScope +) -> Result<(), ServiceError>

source

pub async fn remove_service( + &self, + peer_scope: PeerScope, + particle_id: &str, + service_id_or_alias: &str, + init_peer_id: PeerId, + allow_remove_spell: bool +) -> Result<(), ServiceError>

source

pub async fn call_service( + &self, + function_args: Args, + particle: ParticleParams, + create_vault: bool +) -> FunctionOutcome

source

pub async fn call_function( + &self, + peer_scope: PeerScope, + service_id: &str, + function_name: &str, + function_args: Vec<JValue>, + particle_id: Option<String>, + init_peer_id: PeerId, + particle_ttl: Duration +) -> FunctionOutcome

source

pub async fn get_service( + &self, + peer_scope: PeerScope, + id_or_alias: String, + particle_id: &str +) -> Result<(Arc<Service>, String), ServiceError>

source

pub async fn add_alias( + &self, + peer_scope: PeerScope, + alias: String, + service_id: String, + init_peer_id: PeerId +) -> Result<(), ServiceError>

source

pub async fn resolve_alias( + &self, + peer_scope: PeerScope, + alias: String, + particle_id: &str +) -> Result<String, ServiceError>

source

pub async fn to_service_id( + &self, + peer_scope: PeerScope, + service_id_or_alias: String, + particle_id: &str +) -> Result<String, ServiceError>

source

pub async fn get_service_owner( + &self, + peer_scope: PeerScope, + id_or_alias: String, + particle_id: &str +) -> Result<PeerId, ServiceError>

source

pub async fn check_service_worker_id( + &self, + peer_scope: PeerScope, + id_or_alias: String, + particle_id: &str +) -> Result<(), ServiceError>

source

pub async fn get_interface( + &self, + peer_scope: PeerScope, + service_id: String, + particle_id: &str +) -> Result<JValue, ServiceError>

source

pub async fn list_services_all(&self) -> Vec<ServiceInfo>

source

pub async fn list_services(&self, peer_scope: PeerScope) -> Vec<ServiceInfo>

source

pub async fn get_service_mem_stats( + &self, + peer_scope: PeerScope, + service_id: String, + particle_id: &str +) -> Result<Vec<JValue>, JError>

source

pub async fn create_persisted_services(&mut self) -> Result<()>

Trait Implementations§

source§

impl Clone for ParticleAppServices

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ParticleAppServices

source§

fn fmt(&self, __f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/particle_services/struct.ParticleAppServicesConfig.html b/particle_services/struct.ParticleAppServicesConfig.html new file mode 100644 index 0000000000..101ac15153 --- /dev/null +++ b/particle_services/struct.ParticleAppServicesConfig.html @@ -0,0 +1,68 @@ +ParticleAppServicesConfig in particle_services - Rust
pub struct ParticleAppServicesConfig {
+    pub local_peer_id: PeerId,
+    pub envs: HashMap<String, String>,
+    pub persistent_work_dir: PathBuf,
+    pub ephemeral_work_dir: PathBuf,
+    pub services_dir: PathBuf,
+    pub particles_vault_dir: PathBuf,
+    pub management_peer_id: PeerId,
+    pub builtins_management_peer_id: PeerId,
+    pub default_service_memory_limit: Option<ByteSize>,
+    pub wasm_backend_config: WasmBackendConfig,
+}

Fields§

§local_peer_id: PeerId

Peer id of the current node

+
§envs: HashMap<String, String>

Opaque environment variables to be passed on each service creation +TODO: isolate envs of different modules (i.e., module A shouldn’t access envs of module B)

+
§persistent_work_dir: PathBuf

Persistent working dir for services

+
§ephemeral_work_dir: PathBuf

Ephemeral working dir for services

+
§services_dir: PathBuf

Dir to persist info about running services

+
§particles_vault_dir: PathBuf

Dir to store directories shared between services +in the span of a single particle execution

+
§management_peer_id: PeerId

key that could manage services

+
§builtins_management_peer_id: PeerId

key to manage builtins services initialization

+
§default_service_memory_limit: Option<ByteSize>

Default heap size in bytes available for the module unless otherwise specified.

+
§wasm_backend_config: WasmBackendConfig

config for the wasmtime backend

+

Implementations§

source§

impl ParticleAppServicesConfig

source

pub fn new( + local_peer_id: PeerId, + persistent_dir: PathBuf, + ephemeral_dir: PathBuf, + particles_vault_dir: PathBuf, + envs: HashMap<String, String>, + management_peer_id: PeerId, + builtins_management_peer_id: PeerId, + default_service_memory_limit: Option<ByteSize>, + wasm_backend_config: WasmBackendConfig +) -> Result<Self, Error>

Trait Implementations§

source§

impl Clone for ParticleAppServicesConfig

source§

fn clone(&self) -> ParticleAppServicesConfig

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ParticleAppServicesConfig

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/particle_services/struct.ServiceInfo.html b/particle_services/struct.ServiceInfo.html new file mode 100644 index 0000000000..6d236c3df6 --- /dev/null +++ b/particle_services/struct.ServiceInfo.html @@ -0,0 +1,41 @@ +ServiceInfo in particle_services - Rust
pub struct ServiceInfo {
+    pub id: String,
+    pub blueprint_id: String,
+    pub service_type: ServiceType,
+    pub owner_id: PeerId,
+    pub aliases: Vec<String>,
+    pub peer_scope: PeerScope,
+}

Fields§

§id: String§blueprint_id: String§service_type: ServiceType§owner_id: PeerId§aliases: Vec<String>§peer_scope: PeerScope

Trait Implementations§

source§

impl Debug for ServiceInfo

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/particle_services/struct.WasmBackendConfig.html b/particle_services/struct.WasmBackendConfig.html new file mode 100644 index 0000000000..db50a15dd7 --- /dev/null +++ b/particle_services/struct.WasmBackendConfig.html @@ -0,0 +1,46 @@ +WasmBackendConfig in particle_services - Rust
pub struct WasmBackendConfig {
+    pub debug_info: bool,
+    pub wasm_backtrace: bool,
+    pub async_wasm_stack: usize,
+    pub max_wasm_stack: usize,
+    pub epoch_interruption_duration: Option<Duration>,
+}

Fields§

§debug_info: bool

Configures whether DWARF debug information will be emitted during compilation.

+
§wasm_backtrace: bool

Configures whether the errors from the VM should collect the wasm backtrace and parse debug info.

+
§async_wasm_stack: usize

Configures the size of the stacks used for asynchronous execution.

+
§max_wasm_stack: usize

Configures the maximum amount of stack space available for executing WebAssembly code.

+
§epoch_interruption_duration: Option<Duration>

Enables the epoch interruption mechanism.

+

Trait Implementations§

source§

impl Clone for WasmBackendConfig

source§

fn clone(&self) -> WasmBackendConfig

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for WasmBackendConfig

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for WasmBackendConfig

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl From<WasmBackendConfig> for WasmtimeConfig

source§

fn from(value: WasmBackendConfig) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/peer_metrics/all.html b/peer_metrics/all.html new file mode 100644 index 0000000000..f0562b770a --- /dev/null +++ b/peer_metrics/all.html @@ -0,0 +1 @@ +List of all items in this crate

List of all items

Structs

Enums

Functions

\ No newline at end of file diff --git a/peer_metrics/chain_listener/struct.ChainListenerMetrics.html b/peer_metrics/chain_listener/struct.ChainListenerMetrics.html new file mode 100644 index 0000000000..8002b0e9dd --- /dev/null +++ b/peer_metrics/chain_listener/struct.ChainListenerMetrics.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../peer_metrics/struct.ChainListenerMetrics.html...

+ + + \ No newline at end of file diff --git a/peer_metrics/connection_pool/struct.ConnectionPoolMetrics.html b/peer_metrics/connection_pool/struct.ConnectionPoolMetrics.html new file mode 100644 index 0000000000..d30f8a7394 --- /dev/null +++ b/peer_metrics/connection_pool/struct.ConnectionPoolMetrics.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../peer_metrics/struct.ConnectionPoolMetrics.html...

+ + + \ No newline at end of file diff --git a/peer_metrics/connectivity/enum.Resolution.html b/peer_metrics/connectivity/enum.Resolution.html new file mode 100644 index 0000000000..fb13239b06 --- /dev/null +++ b/peer_metrics/connectivity/enum.Resolution.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../peer_metrics/enum.Resolution.html...

+ + + \ No newline at end of file diff --git a/peer_metrics/connectivity/struct.ConnectivityMetrics.html b/peer_metrics/connectivity/struct.ConnectivityMetrics.html new file mode 100644 index 0000000000..8c7332afb5 --- /dev/null +++ b/peer_metrics/connectivity/struct.ConnectivityMetrics.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../peer_metrics/struct.ConnectivityMetrics.html...

+ + + \ No newline at end of file diff --git a/peer_metrics/dispatcher/struct.DispatcherMetrics.html b/peer_metrics/dispatcher/struct.DispatcherMetrics.html new file mode 100644 index 0000000000..4a6ed07ae2 --- /dev/null +++ b/peer_metrics/dispatcher/struct.DispatcherMetrics.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../peer_metrics/struct.DispatcherMetrics.html...

+ + + \ No newline at end of file diff --git a/peer_metrics/enum.FunctionKind.html b/peer_metrics/enum.FunctionKind.html new file mode 100644 index 0000000000..8bf1de55da --- /dev/null +++ b/peer_metrics/enum.FunctionKind.html @@ -0,0 +1,50 @@ +FunctionKind in peer_metrics - Rust
pub enum FunctionKind {
+    Service,
+    ParticleFunction,
+    NotHappened,
+}

Variants§

§

Service

§

ParticleFunction

§

NotHappened

Trait Implementations§

source§

impl Clone for FunctionKind

source§

fn clone(&self) -> FunctionKind

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for FunctionKind

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl EncodeLabelValue for FunctionKind

source§

fn encode(&self, encoder: &mut LabelValueEncoder<'_>) -> Result<(), Error>

Encode oneself into the given encoder.
source§

impl Hash for FunctionKind

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for FunctionKind

source§

fn eq(&self, other: &FunctionKind) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Copy for FunctionKind

source§

impl Eq for FunctionKind

source§

impl StructuralEq for FunctionKind

source§

impl StructuralPartialEq for FunctionKind

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> CallHasher for Twhere + T: Hash + ?Sized,

§

default fn get_hash<H, B>(value: &H, build_hasher: &B) -> u64where + H: Hash + ?Sized, + B: BuildHasher,

§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/peer_metrics/enum.ParticleType.html b/peer_metrics/enum.ParticleType.html new file mode 100644 index 0000000000..e3a9dd4810 --- /dev/null +++ b/peer_metrics/enum.ParticleType.html @@ -0,0 +1,49 @@ +ParticleType in peer_metrics - Rust
pub enum ParticleType {
+    Spell,
+    Common,
+}

Variants§

§

Spell

§

Common

Trait Implementations§

source§

impl Clone for ParticleType

source§

fn clone(&self) -> ParticleType

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ParticleType

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl EncodeLabelValue for ParticleType

source§

fn encode(&self, encoder: &mut LabelValueEncoder<'_>) -> Result<(), Error>

Encode oneself into the given encoder.
source§

impl Hash for ParticleType

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for ParticleType

source§

fn eq(&self, other: &ParticleType) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for ParticleType

source§

impl StructuralEq for ParticleType

source§

impl StructuralPartialEq for ParticleType

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> CallHasher for Twhere + T: Hash + ?Sized,

§

default fn get_hash<H, B>(value: &H, build_hasher: &B) -> u64where + H: Hash + ?Sized, + B: BuildHasher,

§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/peer_metrics/enum.Resolution.html b/peer_metrics/enum.Resolution.html new file mode 100644 index 0000000000..09e7a37f6f --- /dev/null +++ b/peer_metrics/enum.Resolution.html @@ -0,0 +1,52 @@ +Resolution in peer_metrics - Rust
pub enum Resolution {
+    Local,
+    Kademlia,
+    KademliaNotFound,
+    KademliaError,
+    ConnectionFailed,
+}

Variants§

§

Local

§

Kademlia

§

KademliaNotFound

§

KademliaError

§

ConnectionFailed

Trait Implementations§

source§

impl Clone for Resolution

source§

fn clone(&self) -> Resolution

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Resolution

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl EncodeLabelValue for Resolution

source§

fn encode(&self, encoder: &mut LabelValueEncoder<'_>) -> Result<(), Error>

Encode oneself into the given encoder.
source§

impl Hash for Resolution

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for Resolution

source§

fn eq(&self, other: &Resolution) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for Resolution

source§

impl StructuralEq for Resolution

source§

impl StructuralPartialEq for Resolution

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> CallHasher for Twhere + T: Hash + ?Sized,

§

default fn get_hash<H, B>(value: &H, build_hasher: &B) -> u64where + H: Hash + ?Sized, + B: BuildHasher,

§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/peer_metrics/enum.ServiceCallStats.html b/peer_metrics/enum.ServiceCallStats.html new file mode 100644 index 0000000000..242378139d --- /dev/null +++ b/peer_metrics/enum.ServiceCallStats.html @@ -0,0 +1,41 @@ +ServiceCallStats in peer_metrics - Rust
pub enum ServiceCallStats {
+    Success {
+        memory_delta_bytes: f64,
+        call_time_sec: f64,
+        lock_wait_time_sec: f64,
+        timestamp: u64,
+    },
+    Fail {
+        timestamp: u64,
+    },
+}
Expand description

Service function call stats to store in memory

+

Variants§

§

Success

Fields

§memory_delta_bytes: f64
§call_time_sec: f64
§lock_wait_time_sec: f64
§timestamp: u64
§

Fail

Fields

§timestamp: u64

Trait Implementations§

source§

impl Debug for ServiceCallStats

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/peer_metrics/enum.ServiceType.html b/peer_metrics/enum.ServiceType.html new file mode 100644 index 0000000000..3f7bf155df --- /dev/null +++ b/peer_metrics/enum.ServiceType.html @@ -0,0 +1,50 @@ +ServiceType in peer_metrics - Rust
pub enum ServiceType {
+    Builtin,
+    Spell(Option<String>),
+    Service(Option<String>),
+}

Variants§

§

Builtin

§

Spell(Option<String>)

§

Service(Option<String>)

Trait Implementations§

source§

impl Clone for ServiceType

source§

fn clone(&self) -> ServiceType

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ServiceType

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl EncodeLabelValue for ServiceType

source§

fn encode(&self, encoder: &mut LabelValueEncoder<'_>) -> Result<(), Error>

Encode oneself into the given encoder.
source§

impl Hash for ServiceType

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for ServiceType

source§

fn eq(&self, other: &ServiceType) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for ServiceType

source§

impl StructuralEq for ServiceType

source§

impl StructuralPartialEq for ServiceType

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> CallHasher for Twhere + T: Hash + ?Sized,

§

default fn get_hash<H, B>(value: &H, build_hasher: &B) -> u64where + H: Hash + ?Sized, + B: BuildHasher,

§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/peer_metrics/enum.WorkerType.html b/peer_metrics/enum.WorkerType.html new file mode 100644 index 0000000000..edadca824c --- /dev/null +++ b/peer_metrics/enum.WorkerType.html @@ -0,0 +1,49 @@ +WorkerType in peer_metrics - Rust
pub enum WorkerType {
+    Worker,
+    Host,
+}

Variants§

§

Worker

§

Host

Trait Implementations§

source§

impl Clone for WorkerType

source§

fn clone(&self) -> WorkerType

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for WorkerType

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl EncodeLabelValue for WorkerType

source§

fn encode(&self, encoder: &mut LabelValueEncoder<'_>) -> Result<(), Error>

Encode oneself into the given encoder.
source§

impl Hash for WorkerType

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for WorkerType

source§

fn eq(&self, other: &WorkerType) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Copy for WorkerType

source§

impl Eq for WorkerType

source§

impl StructuralEq for WorkerType

source§

impl StructuralPartialEq for WorkerType

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> CallHasher for Twhere + T: Hash + ?Sized,

§

default fn get_hash<H, B>(value: &H, build_hasher: &B) -> u64where + H: Hash + ?Sized, + B: BuildHasher,

§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/peer_metrics/fn.add_info_metrics.html b/peer_metrics/fn.add_info_metrics.html new file mode 100644 index 0000000000..bb31c8a9ed --- /dev/null +++ b/peer_metrics/fn.add_info_metrics.html @@ -0,0 +1,6 @@ +add_info_metrics in peer_metrics - Rust
pub fn add_info_metrics(
+    registry: &mut Registry,
+    node_version: String,
+    air_version: String,
+    spell_version: String
+)
\ No newline at end of file diff --git a/peer_metrics/index.html b/peer_metrics/index.html new file mode 100644 index 0000000000..200bb9fe86 --- /dev/null +++ b/peer_metrics/index.html @@ -0,0 +1,4 @@ +peer_metrics - Rust

Crate peer_metrics

source ·

Structs

Enums

Functions

\ No newline at end of file diff --git a/peer_metrics/info/fn.add_info_metrics.html b/peer_metrics/info/fn.add_info_metrics.html new file mode 100644 index 0000000000..3c35b301db --- /dev/null +++ b/peer_metrics/info/fn.add_info_metrics.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../peer_metrics/fn.add_info_metrics.html...

+ + + \ No newline at end of file diff --git a/peer_metrics/particle_executor/enum.FunctionKind.html b/peer_metrics/particle_executor/enum.FunctionKind.html new file mode 100644 index 0000000000..a7a4ea319b --- /dev/null +++ b/peer_metrics/particle_executor/enum.FunctionKind.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../peer_metrics/enum.FunctionKind.html...

+ + + \ No newline at end of file diff --git a/peer_metrics/particle_executor/enum.WorkerType.html b/peer_metrics/particle_executor/enum.WorkerType.html new file mode 100644 index 0000000000..394a224be7 --- /dev/null +++ b/peer_metrics/particle_executor/enum.WorkerType.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../peer_metrics/enum.WorkerType.html...

+ + + \ No newline at end of file diff --git a/peer_metrics/particle_executor/struct.ParticleExecutorMetrics.html b/peer_metrics/particle_executor/struct.ParticleExecutorMetrics.html new file mode 100644 index 0000000000..ff2fd15ee0 --- /dev/null +++ b/peer_metrics/particle_executor/struct.ParticleExecutorMetrics.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../peer_metrics/struct.ParticleExecutorMetrics.html...

+ + + \ No newline at end of file diff --git a/peer_metrics/particle_executor/struct.WorkerLabel.html b/peer_metrics/particle_executor/struct.WorkerLabel.html new file mode 100644 index 0000000000..8ceb4edf32 --- /dev/null +++ b/peer_metrics/particle_executor/struct.WorkerLabel.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../peer_metrics/struct.WorkerLabel.html...

+ + + \ No newline at end of file diff --git a/peer_metrics/services_metrics/backend/struct.ServicesMetricsBackend.html b/peer_metrics/services_metrics/backend/struct.ServicesMetricsBackend.html new file mode 100644 index 0000000000..c39b952492 --- /dev/null +++ b/peer_metrics/services_metrics/backend/struct.ServicesMetricsBackend.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../peer_metrics/struct.ServicesMetricsBackend.html...

+ + + \ No newline at end of file diff --git a/peer_metrics/services_metrics/builtin/struct.ServicesMetricsBuiltin.html b/peer_metrics/services_metrics/builtin/struct.ServicesMetricsBuiltin.html new file mode 100644 index 0000000000..ebb2d86842 --- /dev/null +++ b/peer_metrics/services_metrics/builtin/struct.ServicesMetricsBuiltin.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../peer_metrics/struct.ServicesMetricsBuiltin.html...

+ + + \ No newline at end of file diff --git a/peer_metrics/services_metrics/external/enum.ServiceType.html b/peer_metrics/services_metrics/external/enum.ServiceType.html new file mode 100644 index 0000000000..fc766ea33b --- /dev/null +++ b/peer_metrics/services_metrics/external/enum.ServiceType.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../peer_metrics/enum.ServiceType.html...

+ + + \ No newline at end of file diff --git a/peer_metrics/services_metrics/external/struct.ServicesMetricsExternal.html b/peer_metrics/services_metrics/external/struct.ServicesMetricsExternal.html new file mode 100644 index 0000000000..1af4ae10f6 --- /dev/null +++ b/peer_metrics/services_metrics/external/struct.ServicesMetricsExternal.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../peer_metrics/struct.ServicesMetricsExternal.html...

+ + + \ No newline at end of file diff --git a/peer_metrics/services_metrics/message/enum.ServiceCallStats.html b/peer_metrics/services_metrics/message/enum.ServiceCallStats.html new file mode 100644 index 0000000000..aac441df0e --- /dev/null +++ b/peer_metrics/services_metrics/message/enum.ServiceCallStats.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../peer_metrics/enum.ServiceCallStats.html...

+ + + \ No newline at end of file diff --git a/peer_metrics/services_metrics/message/struct.ServiceMemoryStat.html b/peer_metrics/services_metrics/message/struct.ServiceMemoryStat.html new file mode 100644 index 0000000000..72be5b5d0c --- /dev/null +++ b/peer_metrics/services_metrics/message/struct.ServiceMemoryStat.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../peer_metrics/struct.ServiceMemoryStat.html...

+ + + \ No newline at end of file diff --git a/peer_metrics/services_metrics/struct.ServicesMetrics.html b/peer_metrics/services_metrics/struct.ServicesMetrics.html new file mode 100644 index 0000000000..d31aed97d3 --- /dev/null +++ b/peer_metrics/services_metrics/struct.ServicesMetrics.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../peer_metrics/struct.ServicesMetrics.html...

+ + + \ No newline at end of file diff --git a/peer_metrics/sidebar-items.js b/peer_metrics/sidebar-items.js new file mode 100644 index 0000000000..d4c7ebc1e1 --- /dev/null +++ b/peer_metrics/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["FunctionKind","ParticleType","Resolution","ServiceCallStats","ServiceType","WorkerType"],"fn":["add_info_metrics"],"struct":["ChainListenerMetrics","ConnectionPoolMetrics","ConnectivityMetrics","DispatcherMetrics","ParticleExecutorMetrics","ParticleLabel","ServiceMemoryStat","ServicesMetrics","ServicesMetricsBackend","ServicesMetricsBuiltin","ServicesMetricsExternal","SpellMetrics","VmPoolMetrics","WorkerLabel"]}; \ No newline at end of file diff --git a/peer_metrics/spell_metrics/struct.SpellMetrics.html b/peer_metrics/spell_metrics/struct.SpellMetrics.html new file mode 100644 index 0000000000..48ce3e9b15 --- /dev/null +++ b/peer_metrics/spell_metrics/struct.SpellMetrics.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../peer_metrics/struct.SpellMetrics.html...

+ + + \ No newline at end of file diff --git a/peer_metrics/struct.ChainListenerMetrics.html b/peer_metrics/struct.ChainListenerMetrics.html new file mode 100644 index 0000000000..15152e79ec --- /dev/null +++ b/peer_metrics/struct.ChainListenerMetrics.html @@ -0,0 +1,31 @@ +ChainListenerMetrics in peer_metrics - Rust
pub struct ChainListenerMetrics { /* private fields */ }

Implementations§

source§

impl ChainListenerMetrics

source

pub fn new(registry: &mut Registry) -> Self

source

pub fn observe_ccp_request(&self)

source

pub fn observe_ccp_reply(&self, duration: f64)

source

pub fn observe_proof_failed(&self)

source

pub fn observe_proof_submitted(&self)

source

pub fn observe_proof_tx_success(&self)

source

pub fn observe_proof_tx_failed(&self, tx_hash: String)

source

pub fn observe_new_block(&self, block_number: u64)

source

pub fn observe_processed_block(&self, block_number: u64)

Trait Implementations§

source§

impl Clone for ChainListenerMetrics

source§

fn clone(&self) -> ChainListenerMetrics

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/peer_metrics/struct.ConnectionPoolMetrics.html b/peer_metrics/struct.ConnectionPoolMetrics.html new file mode 100644 index 0000000000..cabfa8ee86 --- /dev/null +++ b/peer_metrics/struct.ConnectionPoolMetrics.html @@ -0,0 +1,41 @@ +ConnectionPoolMetrics in peer_metrics - Rust
pub struct ConnectionPoolMetrics {
+    pub received_particles: Family<ParticleLabel, Counter>,
+    pub particle_sizes: Family<ParticleLabel, Histogram>,
+    pub connected_peers: Gauge,
+    pub particle_queue_size: Gauge,
+}

Fields§

§received_particles: Family<ParticleLabel, Counter>§particle_sizes: Family<ParticleLabel, Histogram>§connected_peers: Gauge§particle_queue_size: Gauge

Implementations§

source§

impl ConnectionPoolMetrics

source

pub fn new(registry: &mut Registry) -> Self

source

pub fn incoming_particle( + &self, + particle_id: &str, + queue_len: i64, + particle_len: f64 +)

Trait Implementations§

source§

impl Clone for ConnectionPoolMetrics

source§

fn clone(&self) -> ConnectionPoolMetrics

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/peer_metrics/struct.ConnectivityMetrics.html b/peer_metrics/struct.ConnectivityMetrics.html new file mode 100644 index 0000000000..0b40501e43 --- /dev/null +++ b/peer_metrics/struct.ConnectivityMetrics.html @@ -0,0 +1,37 @@ +ConnectivityMetrics in peer_metrics - Rust
pub struct ConnectivityMetrics {
+    pub particle_send_success: Family<ParticleLabel, Counter>,
+    pub particle_send_failure: Family<ParticleLabel, Counter>,
+    pub bootstrap_disconnected: Counter,
+    pub bootstrap_connected: Counter,
+    /* private fields */
+}

Fields§

§particle_send_success: Family<ParticleLabel, Counter>§particle_send_failure: Family<ParticleLabel, Counter>§bootstrap_disconnected: Counter§bootstrap_connected: Counter

Implementations§

source§

impl ConnectivityMetrics

source

pub fn new(registry: &mut Registry) -> Self

source

pub fn count_resolution(&self, resolution: Resolution)

source

pub fn send_particle_ok(&self, particle: &str)

source

pub fn send_particle_failed(&self, particle: &str)

Trait Implementations§

source§

impl Clone for ConnectivityMetrics

source§

fn clone(&self) -> ConnectivityMetrics

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/peer_metrics/struct.DispatcherMetrics.html b/peer_metrics/struct.DispatcherMetrics.html new file mode 100644 index 0000000000..947d358ddf --- /dev/null +++ b/peer_metrics/struct.DispatcherMetrics.html @@ -0,0 +1,33 @@ +DispatcherMetrics in peer_metrics - Rust
pub struct DispatcherMetrics {
+    pub expired_particles: Family<ParticleLabel, Counter>,
+}

Fields§

§expired_particles: Family<ParticleLabel, Counter>

Implementations§

source§

impl DispatcherMetrics

source

pub fn new(registry: &mut Registry, _parallelism: Option<usize>) -> Self

source

pub fn particle_expired(&self, particle_id: &str)

Trait Implementations§

source§

impl Clone for DispatcherMetrics

source§

fn clone(&self) -> DispatcherMetrics

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/peer_metrics/struct.ParticleExecutorMetrics.html b/peer_metrics/struct.ParticleExecutorMetrics.html new file mode 100644 index 0000000000..2113c380ae --- /dev/null +++ b/peer_metrics/struct.ParticleExecutorMetrics.html @@ -0,0 +1,43 @@ +ParticleExecutorMetrics in peer_metrics - Rust
pub struct ParticleExecutorMetrics {
+    pub interpretation_time_sec: Family<WorkerLabel, Histogram>,
+    pub interpretation_successes: Family<WorkerLabel, Counter>,
+    pub interpretation_failures: Family<WorkerLabel, Counter>,
+    pub total_actors_mailbox: Family<WorkerLabel, Gauge>,
+    pub alive_actors: Family<WorkerLabel, Gauge>,
+    /* private fields */
+}

Fields§

§interpretation_time_sec: Family<WorkerLabel, Histogram>§interpretation_successes: Family<WorkerLabel, Counter>§interpretation_failures: Family<WorkerLabel, Counter>§total_actors_mailbox: Family<WorkerLabel, Gauge>§alive_actors: Family<WorkerLabel, Gauge>

Implementations§

source§

impl ParticleExecutorMetrics

source

pub fn new(registry: &mut Registry) -> Self

source

pub fn service_call( + &self, + success: bool, + kind: FunctionKind, + run_time: Option<Duration> +)

Trait Implementations§

source§

impl Clone for ParticleExecutorMetrics

source§

fn clone(&self) -> ParticleExecutorMetrics

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/peer_metrics/struct.ParticleLabel.html b/peer_metrics/struct.ParticleLabel.html new file mode 100644 index 0000000000..19a801aee5 --- /dev/null +++ b/peer_metrics/struct.ParticleLabel.html @@ -0,0 +1,46 @@ +ParticleLabel in peer_metrics - Rust
pub struct ParticleLabel { /* private fields */ }

Trait Implementations§

source§

impl Clone for ParticleLabel

source§

fn clone(&self) -> ParticleLabel

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ParticleLabel

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl EncodeLabelSet for ParticleLabel

source§

fn encode(&self, encoder: LabelSetEncoder<'_>) -> Result<(), Error>

Encode oneself into the given encoder.
source§

impl Hash for ParticleLabel

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for ParticleLabel

source§

fn eq(&self, other: &ParticleLabel) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for ParticleLabel

source§

impl StructuralEq for ParticleLabel

source§

impl StructuralPartialEq for ParticleLabel

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> CallHasher for Twhere + T: Hash + ?Sized,

§

default fn get_hash<H, B>(value: &H, build_hasher: &B) -> u64where + H: Hash + ?Sized, + B: BuildHasher,

§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/peer_metrics/struct.ServiceMemoryStat.html b/peer_metrics/struct.ServiceMemoryStat.html new file mode 100644 index 0000000000..d13473745b --- /dev/null +++ b/peer_metrics/struct.ServiceMemoryStat.html @@ -0,0 +1,35 @@ +ServiceMemoryStat in peer_metrics - Rust
pub struct ServiceMemoryStat {
+    pub used_mem: u64,
+    pub modules_stats: HashMap<String, u64>,
+}

Fields§

§used_mem: u64

Memory used by the service

+
§modules_stats: HashMap<String, u64>

Memory used by the modules that belongs to the service

+

Implementations§

source§

impl ServiceMemoryStat

source

pub fn new(stats: &MemoryStats<'_>) -> ServiceMemoryStat

Trait Implementations§

source§

impl Debug for ServiceMemoryStat

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for ServiceMemoryStat

source§

fn default() -> ServiceMemoryStat

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/peer_metrics/struct.ServicesMetrics.html b/peer_metrics/struct.ServicesMetrics.html new file mode 100644 index 0000000000..884bd7def4 --- /dev/null +++ b/peer_metrics/struct.ServicesMetrics.html @@ -0,0 +1,65 @@ +ServicesMetrics in peer_metrics - Rust
pub struct ServicesMetrics {
+    pub external: Option<ServicesMetricsExternal>,
+    pub builtin: ServicesMetricsBuiltin,
+    /* private fields */
+}

Fields§

§external: Option<ServicesMetricsExternal>§builtin: ServicesMetricsBuiltin

Implementations§

source§

impl ServicesMetrics

source

pub fn new( + external: Option<ServicesMetricsExternal>, + metrics_backend_outlet: UnboundedSender<ServiceMetricsMsg>, + max_builtin_storage_size: usize +) -> Self

source

pub fn with_external_backend( + timer_resolution: Duration, + max_builtin_storage_size: usize, + registry: &mut Registry +) -> (ServicesMetricsBackend, Self)

source

pub fn with_simple_backend( + max_builtin_storage_size: usize +) -> (ServicesMetricsBackend, Self)

source

pub fn observe_builtins(&self, is_ok: bool, call_time: f64)

source

pub fn observe_service_state( + &self, + service_id: String, + function_name: String, + service_type: ServiceType, + memory: ServiceMemoryStat, + stats: ServiceCallStats +)

source

pub fn observe_service_state_failed( + &self, + service_id: String, + function_name: Option<String>, + service_type: ServiceType, + stats: ServiceCallStats +)

source

pub fn observe_created( + &self, + service_id: String, + service_type: ServiceType, + stats: ServiceMemoryStat, + creation_time: f64 +)

Collect all metrics that are relevant on service creation.

+
source

pub fn observe_created_failed(&self)

source

pub fn observe_removed(&self, service_type: ServiceType, removal_time: f64)

Trait Implementations§

source§

impl Clone for ServicesMetrics

source§

fn clone(&self) -> ServicesMetrics

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ServicesMetrics

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/peer_metrics/struct.ServicesMetricsBackend.html b/peer_metrics/struct.ServicesMetricsBackend.html new file mode 100644 index 0000000000..df2cab40e1 --- /dev/null +++ b/peer_metrics/struct.ServicesMetricsBackend.html @@ -0,0 +1,43 @@ +ServicesMetricsBackend in peer_metrics - Rust
pub struct ServicesMetricsBackend { /* private fields */ }
Expand description

The backend creates a separate threads that processes +requests from critical sections of code (where we can’t afford to wait on locks) +to store some metrics.

+

Implementations§

source§

impl ServicesMetricsBackend

source

pub fn with_external_metrics( + timer_resolution: Duration, + memory_metrics: ServicesMemoryMetrics, + builtin_metrics: ServicesMetricsBuiltin, + inlet: UnboundedReceiver<ServiceMetricsMsg> +) -> Self

Create fully a functional backend for both external and builtin metrics.

+
source

pub fn new( + builtin_metrics: ServicesMetricsBuiltin, + inlet: UnboundedReceiver<ServiceMetricsMsg> +) -> Self

Create a backend with only builtin metrics gathering enabled.

+
source

pub fn start(self) -> JoinHandle<()>

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/peer_metrics/struct.ServicesMetricsBuiltin.html b/peer_metrics/struct.ServicesMetricsBuiltin.html new file mode 100644 index 0000000000..a2745a9fe4 --- /dev/null +++ b/peer_metrics/struct.ServicesMetricsBuiltin.html @@ -0,0 +1,36 @@ +ServicesMetricsBuiltin in peer_metrics - Rust
pub struct ServicesMetricsBuiltin { /* private fields */ }

Implementations§

source§

impl ServicesMetricsBuiltin

source

pub fn new(max_metrics_storage_size: usize) -> Self

source

pub fn update( + &self, + service_id: String, + function_name: String, + stats: ServiceCallStats +)

source

pub fn read(&self, service_id: &String) -> Option<ServiceStat>

source

pub fn get_used_memory(stats: &MemoryStats<'_>) -> u64

Trait Implementations§

source§

impl Clone for ServicesMetricsBuiltin

source§

fn clone(&self) -> ServicesMetricsBuiltin

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/peer_metrics/struct.ServicesMetricsExternal.html b/peer_metrics/struct.ServicesMetricsExternal.html new file mode 100644 index 0000000000..8118e1f007 --- /dev/null +++ b/peer_metrics/struct.ServicesMetricsExternal.html @@ -0,0 +1,59 @@ +ServicesMetricsExternal in peer_metrics - Rust
pub struct ServicesMetricsExternal {
+    pub services_count: Family<ServiceTypeLabel, Gauge>,
+    pub creation_time_msec: Family<ServiceTypeLabel, Histogram>,
+    pub removal_time_msec: Family<ServiceTypeLabel, Histogram>,
+    pub creation_count: Family<ServiceTypeLabel, Counter>,
+    pub removal_count: Family<ServiceTypeLabel, Counter>,
+    pub creation_failure_count: Counter,
+    pub modules_in_services_count: Histogram,
+    pub call_time_sec: Family<ServiceTypeLabel, Histogram>,
+    pub lock_wait_time_sec: Family<ServiceTypeLabel, Histogram>,
+    pub call_success_count: Family<ServiceTypeLabel, Counter>,
+    pub call_failed_count: Family<ServiceTypeLabel, Counter>,
+    pub memory_metrics: ServicesMemoryMetrics,
+}

Fields§

§services_count: Family<ServiceTypeLabel, Gauge>

Number of currently running services

+
§creation_time_msec: Family<ServiceTypeLabel, Histogram>

How long it took to create a service

+
§removal_time_msec: Family<ServiceTypeLabel, Histogram>

How long it took to remove a service

+
§creation_count: Family<ServiceTypeLabel, Counter>

Number of (srv create) calls

+
§removal_count: Family<ServiceTypeLabel, Counter>

Number of (srv remove) calls

+
§creation_failure_count: Counter

Number of (srv create) failures

+
§modules_in_services_count: Histogram

How many modules a service includes.

+
§call_time_sec: Family<ServiceTypeLabel, Histogram>

Service call time

+
§lock_wait_time_sec: Family<ServiceTypeLabel, Histogram>§call_success_count: Family<ServiceTypeLabel, Counter>§call_failed_count: Family<ServiceTypeLabel, Counter>§memory_metrics: ServicesMemoryMetrics

Memory metrics

+

Implementations§

source§

impl ServicesMetricsExternal

source

pub fn new(registry: &mut Registry) -> Self

source

pub fn observe_removed(&self, service_type: ServiceType, removal_time: f64)

Collect all metrics that are relevant on service removal.

+
source

pub fn observe_created( + &self, + service_type: ServiceType, + modules_num: f64, + creation_time: f64 +)

Trait Implementations§

source§

impl Clone for ServicesMetricsExternal

source§

fn clone(&self) -> ServicesMetricsExternal

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/peer_metrics/struct.SpellMetrics.html b/peer_metrics/struct.SpellMetrics.html new file mode 100644 index 0000000000..2cc622312d --- /dev/null +++ b/peer_metrics/struct.SpellMetrics.html @@ -0,0 +1,31 @@ +SpellMetrics in peer_metrics - Rust
pub struct SpellMetrics { /* private fields */ }

Implementations§

source§

impl SpellMetrics

source

pub fn new(registry: &mut Registry) -> Self

source

pub fn observe_started_spell(&self, period: u32)

source

pub fn observe_finished_spell(&self)

source

pub fn observe_spell_cast(&self)

Trait Implementations§

source§

impl Clone for SpellMetrics

source§

fn clone(&self) -> SpellMetrics

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/peer_metrics/struct.VmPoolMetrics.html b/peer_metrics/struct.VmPoolMetrics.html new file mode 100644 index 0000000000..8ac7b4ac72 --- /dev/null +++ b/peer_metrics/struct.VmPoolMetrics.html @@ -0,0 +1,47 @@ +VmPoolMetrics in peer_metrics - Rust
pub struct VmPoolMetrics {
Show 14 fields + pub free_vms: Gauge, + pub get_vm: Counter, + pub put_vm: Counter, + pub no_free_vm: Counter, + pub vm_mem_max_value: u64, + pub vm_mem_max: Gauge, + pub vm_mem_min_value: u64, + pub vm_mem_min: Gauge, + pub vm_mems: Vec<u64>, + pub vm_mem_total: Gauge, + pub vm_mem_cma: u64, + pub vm_mem_measures: u64, + pub vm_mem_avg: Gauge, + pub vm_mem_histo: Histogram, + /* private fields */ +
}

Fields§

§free_vms: Gauge§get_vm: Counter§put_vm: Counter§no_free_vm: Counter§vm_mem_max_value: u64§vm_mem_max: Gauge§vm_mem_min_value: u64§vm_mem_min: Gauge§vm_mems: Vec<u64>§vm_mem_total: Gauge§vm_mem_cma: u64§vm_mem_measures: u64§vm_mem_avg: Gauge§vm_mem_histo: Histogram

Implementations§

source§

impl VmPoolMetrics

source

pub fn new(registry: &mut Registry) -> Self

source

pub fn set_pool_size(&mut self, size: usize)

source

pub fn measure_memory(&mut self, idx: usize, memory_size: u64)

Trait Implementations§

source§

impl Clone for VmPoolMetrics

source§

fn clone(&self) -> VmPoolMetrics

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/peer_metrics/struct.WorkerLabel.html b/peer_metrics/struct.WorkerLabel.html new file mode 100644 index 0000000000..f7e0989933 --- /dev/null +++ b/peer_metrics/struct.WorkerLabel.html @@ -0,0 +1,46 @@ +WorkerLabel in peer_metrics - Rust
pub struct WorkerLabel { /* private fields */ }

Implementations§

source§

impl WorkerLabel

source

pub fn new(worker_type: WorkerType, peer_id: String) -> Self

Trait Implementations§

source§

impl Clone for WorkerLabel

source§

fn clone(&self) -> WorkerLabel

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for WorkerLabel

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl EncodeLabelSet for WorkerLabel

source§

fn encode(&self, encoder: LabelSetEncoder<'_>) -> Result<(), Error>

Encode oneself into the given encoder.
source§

impl Hash for WorkerLabel

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for WorkerLabel

source§

fn eq(&self, other: &WorkerLabel) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for WorkerLabel

source§

impl StructuralEq for WorkerLabel

source§

impl StructuralPartialEq for WorkerLabel

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> CallHasher for Twhere + T: Hash + ?Sized,

§

default fn get_hash<H, B>(value: &H, build_hasher: &B) -> u64where + H: Hash + ?Sized, + B: BuildHasher,

§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/peer_metrics/vm_pool/struct.VmPoolMetrics.html b/peer_metrics/vm_pool/struct.VmPoolMetrics.html new file mode 100644 index 0000000000..8571f2bf43 --- /dev/null +++ b/peer_metrics/vm_pool/struct.VmPoolMetrics.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../peer_metrics/struct.VmPoolMetrics.html...

+ + + \ No newline at end of file diff --git a/search-index.js b/search-index.js new file mode 100644 index 0000000000..38b9f93f21 --- /dev/null +++ b/search-index.js @@ -0,0 +1,51 @@ +var searchIndex = JSON.parse('{\ +"air_interpreter_fs":{"doc":"","t":"FF","n":["air_interpreter_path","write_default_air_interpreter"],"q":[[0,"air_interpreter_fs"],[2,"std::path"],[3,"std::path"]],"d":["",""],"i":[0,0],"f":[[1,2],[1,[[4,[3]]]]],"c":[],"p":[[3,"Path",2],[3,"PathBuf",2],[15,"tuple"],[6,"Result",3]],"b":[]},\ +"aquamarine":{"doc":"","t":"GIDEDNNNQNNDEQNDNDDNDNDNNNNDDDDNNLLMMMLMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLKMMLLLLLLLLLLLLLLLLLLLLKLMLLLLLLLLLLLLLLLMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMLMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMLLLLLLLLLLLLLLLLLMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLKLMMMKLLLLLLLLLMMLLLLLLLLLLLLLLMMMMMMMMLLMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMLLLLLLLLLLLLLLMMMMMMMMMMM","n":["AVMRunner","AquaRuntime","AquamarineApi","AquamarineApiError","AquamarineBackend","AquamarineDied","AquamarineQueueFull","CleanupData","Config","CreateAnomalyDir","CreateDataStore","DataStoreConfig","DataStoreError","Error","ExecutionTimedOut","InterpretationStats","OneshotCancelled","ParticleDataStore","ParticleEffects","ParticleExpired","Plumber","ReadData","RemoteRoutingEffects","SerializeAnomaly","SignatureVerificationFailed","StoreData","VaultError","VmConfig","VmPoolConfig","WasmBackendConfig","WasmtimeWasmBackend","WorkerIsNotActive","WriteAnomaly","add_service","add_service","air_interpreter","air_size_limit","anomaly_data_store","anomaly_dir","async_wasm_stack","batch_cleanup_data","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","call","call_requests","call_result_size_limit","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","create_runtime","create_worker_pool","current_peer_id","data_file","debug","debug","debug","debug","debug","debug","debug","debug","debug","debug","debug","debug","debug","debug","debug_info","default","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","detect_anomaly","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","empty","epoch_interruption_duration","execute","execution_timeout","failed","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","hard_limit_enabled","increment_epoch","ingest","init","init","init","init","init","init","init","init","init","init","init","init","init","init","initialize","interpretation_time","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into_any","into_any","into_any","into_any","into_any","into_any","into_any","into_any","into_any","into_any","into_any","into_any","into_any","into_any","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_effects","into_particle_id","max_heap_size","max_wasm_stack","memory_delta","memory_stats","new","new","new","new","new","new","new","new","new_async","new_data","new_data_len","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","next_peers","next_peers","particle","particle_data_store","particle_size_limit","particles_anomaly_dir","particles_dir","particles_vault_dir","poll","poll","pool_size","read_data","references","references","references","references","references","references","references","references","references","references","references","references","references","references","remove_service","remove_service","remove_worker_pool","save_anomaly_data","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","source","start","store_data","success","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_string","to_string","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_name","type_name","type_name","type_name","type_name","type_name","type_name","type_name","type_name","type_name","type_name","type_name","type_name","type_name","vault","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","wasm_backtrace","err","particle_id","particle_id","particle_id","particle_id","particle_id","particle_id","particle_id","timeout","worker_id"],"q":[[0,"aquamarine"],[437,"aquamarine::AquamarineApiError"],[447,"alloc::string"],[448,"particle_execution::particle_function"],[449,"std::collections::hash::map"],[450,"core::option"],[451,"particle_execution::particle_function"],[452,"std::path"],[453,"libp2p_identity::peer_id"],[454,"alloc::vec"],[455,"avm_interface::particle_parameters"],[456,"avm_interface::call_service_result"],[457,"fluence_keypair::key_pair"],[458,"alloc::boxed"],[459,"core::pin"],[460,"core::convert"],[461,"core::marker"],[462,"core::task::wake"],[463,"core::result"],[464,"types::peer_scope"],[465,"core::fmt"],[466,"core::fmt"],[467,"avm_interface::raw_outcome"],[468,"particle_protocol::particle"],[469,"core::fmt"],[470,"system_interface::fs::fd_flags"],[471,"std::io::error"],[472,"types::peer_scope"],[473,"alloc::sync"],[474,"alloc::rc"],[475,"avm_server::runner"],[476,"tokio::sync::mpsc::bounded"],[477,"peer_metrics::particle_executor"],[478,"peer_metrics::vm_pool"],[479,"health"],[480,"workers::workers"],[481,"workers::key_storage"],[482,"workers::scope"],[483,"workers::workers"],[484,"marine_wasmtime_backend"],[485,"marine_wasm_backend_traits::errors"],[486,"system_interface::fs::fd_flags"],[487,"core::task::wake"],[488,"libipld_core::raw"],[489,"anyhow"],[490,"std::io"],[491,"cid::cid"],[492,"core::iter::traits::collect"],[493,"core::error"],[494,"tokio::runtime::task::join"],[495,"core::any"]],"d":["","","","","","","","","","","","","","","","Performance stats about particle’s interpretation","","","Effects produced by particle execution. Currently the only …","","","","","","","","","","","","","","","","","Path to AIR interpreter .wasm file (aquamarine.wasm)","Maximum AIR script size in bytes.","","Returns $ANOMALY_DATA_STORE/$particle_id/$timestamp","Configures the size of the stacks used for asynchronous …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Instruction to execute host calls","Maximum call result size in bytes.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Configures whether DWARF debug information will be emitted …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Enables the epoch interruption mechanism.","Send particle to the interpreters pool","Timeout of a particle execution","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","","","","","","","","","","","","","","A knob to enable/disable hard limits behavior in AquaVM.","","Receives and ingests incoming particle: creates a new …","","","","","","","","","","","","","","","","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Maximum heap size in bytes available for the interpreter.","Configures the maximum amount of stack space available for …","","Return current size of memory. Use only for diagnostics …","","","","","","","","","","New particle data","","","","","","","","","","","","","","","","Instruction to send particle to these peers","","","","Maximum particle size in bytes.","Dir to store particles data of AquaVM performance anomalies","Dir for the interpreter to persist particle data to merge …","Dir to store directories shared between services in the …","","","Number of VMs to create","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Configures whether the errors from the VM should collect …","","","","","","","","","",""],"i":[0,0,0,0,0,44,44,45,7,45,45,0,0,7,44,0,44,0,0,44,0,45,0,45,44,45,45,0,0,0,0,44,45,1,9,26,26,11,11,29,11,63,1,25,9,26,27,28,44,29,11,45,30,31,32,63,1,25,9,26,27,28,44,29,11,45,30,31,32,7,30,26,25,9,26,27,28,29,11,30,31,32,25,9,26,27,28,29,11,30,31,32,7,1,26,11,63,1,25,9,26,27,28,44,29,11,45,30,31,32,29,29,63,1,25,9,26,27,28,44,29,11,45,30,31,32,63,1,25,9,26,27,28,44,29,11,45,30,31,32,11,63,1,25,9,26,27,28,44,29,11,45,30,31,32,30,29,9,27,31,26,27,28,44,44,29,11,45,45,30,31,32,63,1,25,9,26,27,28,44,29,11,45,45,30,31,32,63,1,25,9,26,27,28,44,29,11,45,30,31,32,26,25,1,63,1,25,9,26,27,28,44,29,11,45,30,31,32,11,31,63,1,25,9,26,27,28,44,29,11,45,30,31,32,63,1,25,9,26,27,28,44,29,11,45,30,31,32,25,9,26,27,28,44,29,11,45,30,31,32,63,1,25,9,26,27,28,44,29,11,45,30,31,32,7,44,26,29,31,7,63,1,25,9,26,27,28,11,25,30,31,63,1,25,9,26,27,28,44,29,11,45,30,31,32,30,32,32,11,26,28,28,28,63,1,27,11,63,1,25,9,26,27,28,44,29,11,45,30,31,32,1,9,1,11,63,1,25,9,26,27,28,44,29,11,45,30,31,32,45,63,11,31,25,9,26,27,28,29,11,30,31,32,44,45,63,1,25,9,26,27,28,44,29,11,45,30,31,32,63,1,25,9,26,27,28,44,29,11,45,30,31,32,63,1,25,9,26,27,28,44,29,11,45,30,31,32,63,1,25,9,26,27,28,44,29,11,45,30,31,32,11,63,1,25,9,26,27,28,44,29,11,45,30,31,32,29,80,81,82,83,84,85,80,86,84,86],"f":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[[1,[-1,-2]],2,[4,[2,3]],[5,[3]]],6,7,8],[[9,2,[4,[2,3]]],[[0,[10]]]],0,0,0,[[11,12,12,[14,[13]]],15],0,[[11,[17,[[6,[2,16,[17,[13]],2]]]]],6],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[[-1,-2,-3,-4,18,19,20],[[22,[[21,[10]]]]],[],[[23,[2]],24],[[23,[[17,[13]]]],24],[[23,[[17,[13]]]],24]],0,0,[25,25],[9,9],[26,26],[27,27],[28,28],[29,29],[11,11],[30,30],[31,31],[32,32],[[-1,-2],6,[],[]],[[-1,-2],6,[],[]],[[-1,-2],6,[],[]],[[-1,-2],6,[],[]],[[-1,-2],6,[],[]],[[-1,-2],6,[],[]],[[-1,-2],6,[],[]],[[-1,-2],6,[],[]],[[-1,-2],6,[],[]],[[-1,-2],6,[],[]],[[25,33],[[34,[-1]]],[]],[[[1,[-1,-2]],35,36],6,7,8],0,[[11,12,12,[14,[13]]],15],[37,[[34,[6,38]]]],[37,[[34,[6,38]]]],[37,[[34,[6,38]]]],[37,[[34,[6,38]]]],[37,[[34,[6,38]]]],[37,[[34,[6,38]]]],[37,[[34,[6,38]]]],[37,[[34,[6,38]]]],[37,[[34,[6,38]]]],[37,[[34,[6,38]]]],[37,[[34,[6,38]]]],[37,[[34,[6,38]]]],[37,[[34,[6,38]]]],[37,[[34,[6,38]]]],0,[[],29],[36,-1,[]],[36,-1,[]],[36,-1,[]],[36,-1,[]],[36,-1,[]],[36,-1,[]],[36,-1,[]],[36,-1,[]],[36,-1,[]],[36,-1,[]],[36,-1,[]],[36,-1,[]],[36,-1,[]],[36,-1,[]],[36,-1,[]],[36,-1,[]],[36,-1,[]],[36,-1,[]],[36,-1,[]],[36,-1,[]],[36,-1,[]],[36,-1,[]],[36,-1,[]],[36,-1,[]],[36,-1,[]],[36,-1,[]],[36,-1,[]],[36,-1,[]],[[11,39,36,40],41],[36,6],[36,6],[36,6],[36,6],[36,6],[36,6],[36,6],[36,6],[36,6],[36,6],[36,6],[36,6],[36,6],[36,6],[[],30],0,[[9,42,[5,[3]]],[[0,[10]]]],0,[[],31],[[26,37],43],[[27,37],43],[[28,37],43],[[44,37],43],[[44,37],43],[[29,37],[[34,[6,38]]]],[[11,37],43],[[45,37],43],[[45,37],43],[[30,37],43],[[31,37],43],[[32,37],43],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[46,45],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,[[34,[47,48]]],[]],[-1,[[34,[47,48]]],[]],[-1,[[34,[47,48]]],[]],[-1,[[34,[47,48]]],[]],[-1,[[34,[47,48]]],[]],[-1,[[34,[47,48]]],[]],[-1,[[34,[47,48]]],[]],[-1,[[34,[47,48]]],[]],[-1,[[34,[47,48]]],[]],[-1,[[34,[47,48]]],[]],[-1,[[34,[47,48]]],[]],[-1,[[34,[47,48]]],[]],[-1,[[34,[47,48]]],[]],[-1,[[34,[47,48]]],[]],0,[25,6],[[[1,[-1,-2]],42,[5,[3]],49],6,7,8],[[],36],[[],36],[[],36],[[],36],[[],36],[[],36],[[],36],[[],36],[[],36],[[],36],[[],36],[[],36],[[],36],[[],36],[11,[[34,[6,45]]]],0,[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[[[21,[-1]]],[[21,[50]]],[]],[[[21,[-1]]],[[21,[50]]],[]],[[[21,[-1]]],[[21,[50]]],[]],[[[21,[-1]]],[[21,[50]]],[]],[[[21,[-1]]],[[21,[50]]],[]],[[[21,[-1]]],[[21,[50]]],[]],[[[21,[-1]]],[[21,[50]]],[]],[[[21,[-1]]],[[21,[50]]],[]],[[[21,[-1]]],[[21,[50]]],[]],[[[21,[-1]]],[[21,[50]]],[]],[[[21,[-1]]],[[21,[50]]],[]],[[[21,[-1]]],[[21,[50]]],[]],[[[21,[-1]]],[[21,[50]]],[]],[[[21,[-1]]],[[21,[50]]],[]],[[[51,[-1]]],[[51,[50]]],[]],[[[51,[-1]]],[[51,[50]]],[]],[[[51,[-1]]],[[51,[50]]],[]],[[[51,[-1]]],[[51,[50]]],[]],[[[51,[-1]]],[[51,[50]]],[]],[[[51,[-1]]],[[51,[50]]],[]],[[[51,[-1]]],[[51,[50]]],[]],[[[51,[-1]]],[[51,[50]]],[]],[[[51,[-1]]],[[51,[50]]],[]],[[[51,[-1]]],[[51,[50]]],[]],[[[51,[-1]]],[[51,[50]]],[]],[[[51,[-1]]],[[51,[50]]],[]],[[[52,[-1]]],[[52,[50]]],[]],[[[52,[-1]]],[[52,[50]]],[]],[[[52,[-1]]],[[52,[50]]],[]],[[[52,[-1]]],[[52,[50]]],[]],[[[52,[-1]]],[[52,[50]]],[]],[[[52,[-1]]],[[52,[50]]],[]],[[[52,[-1]]],[[52,[50]]],[]],[[[52,[-1]]],[[52,[50]]],[]],[[[52,[-1]]],[[52,[50]]],[]],[[[52,[-1]]],[[52,[50]]],[]],[[[52,[-1]]],[[52,[50]]],[]],[[[52,[-1]]],[[52,[50]]],[]],[[[52,[-1]]],[[52,[50]]],[]],[[[52,[-1]]],[[52,[50]]],[]],[[[34,[40]],2],30],[44,[[5,[2]]]],0,0,0,[-1,53,[]],[[27,29,28,-1,[54,[[34,[32,44]]]],[5,[55]],[5,[56]],[5,[57]],[51,[58]],[51,[59]],60,[62,[61]]],[[64,[[6,[[63,[-2,-1]],9]]]]],8,7],[[[0,[-1]],[51,[11]],-2,[5,[55]],[51,[58]],[51,[59]],60,25],[[1,[-1,-2]]],7,8],[65,[[34,[25,66]]]],[[[54,[0]],39],9],[[16,15,[5,[67]],[5,[67]],[5,[67]],[5,[67]],41],26],[[36,39],27],[15,28],[[15,15,15],11],[[],[[34,[25,66]]]],0,0,[[-1,47],[[34,[[68,[-2]],48]]],[],69],[[-1,47],[[34,[[68,[-2]],48]]],[],69],[[-1,47],[[34,[[68,[-2]],48]]],[],69],[[-1,47],[[34,[[68,[-2]],48]]],[],69],[[-1,47],[[34,[[68,[-2]],48]]],[],69],[[-1,47],[[34,[[68,[-2]],48]]],[],69],[[-1,47],[[34,[[68,[-2]],48]]],[],69],[[-1,47],[[34,[[68,[-2]],48]]],[],69],[[-1,47],[[34,[[68,[-2]],48]]],[],69],[[-1,47],[[34,[[68,[-2]],48]]],[],69],[[-1,47],[[34,[[68,[-2]],48]]],[],69],[[-1,47],[[34,[[68,[-2]],48]]],[],69],[[-1,47],[[34,[[68,[-2]],48]]],[],69],[[-1,47],[[34,[[68,[-2]],48]]],[],69],0,0,0,0,0,0,0,0,[[[63,[-1,-2]],70],[[71,[6]]],7,8],[[[1,[-1,-2]],70],[[71,[[34,[32,44]]]]],7,8],0,[[11,12,12,[14,[13]]],[[34,[[17,[13]],45]]]],[[72,-1,-2],[[34,[6,73]]],74,[[76,[75]]]],[[72,-1,-2],[[34,[6,73]]],74,[[76,[75]]]],[[72,-1,-2],[[34,[6,73]]],74,[[76,[75]]]],[[72,-1,-2],[[34,[6,73]]],74,[[76,[75]]]],[[72,-1,-2],[[34,[6,73]]],74,[[76,[75]]]],[[72,-1,-2],[[34,[6,73]]],74,[[76,[75]]]],[[72,-1,-2],[[34,[6,73]]],74,[[76,[75]]]],[[72,-1,-2],[[34,[6,73]]],74,[[76,[75]]]],[[72,-1,-2],[[34,[6,73]]],74,[[76,[75]]]],[[72,-1,-2],[[34,[6,73]]],74,[[76,[75]]]],[[72,-1,-2],[[34,[6,73]]],74,[[76,[75]]]],[[72,-1,-2],[[34,[6,73]]],74,[[76,[75]]]],[[72,-1,-2],[[34,[6,73]]],74,[[76,[75]]]],[[72,-1,-2],[[34,[6,73]]],74,[[76,[75]]]],[[[1,[-1,-2]],2],6,7,8],[[9,2],[[0,[10]]]],[[[1,[-1,-2]],35],6,7,8],[[11,12,[14,[13]],19,18,[14,[13]],40,39,36],[[34,[6,45]]]],[[-1,[68,[-2]]],[[34,[6,48]]],[],69],[[-1,[68,[-2]]],[[34,[6,48]]],[],69],[[-1,[68,[-2]]],[[34,[6,48]]],[],69],[[-1,[68,[-2]]],[[34,[6,48]]],[],69],[[-1,[68,[-2]]],[[34,[6,48]]],[],69],[[-1,[68,[-2]]],[[34,[6,48]]],[],69],[[-1,[68,[-2]]],[[34,[6,48]]],[],69],[[-1,[68,[-2]]],[[34,[6,48]]],[],69],[[-1,[68,[-2]]],[[34,[6,48]]],[],69],[[-1,[68,[-2]]],[[34,[6,48]]],[],69],[[-1,[68,[-2]]],[[34,[6,48]]],[],69],[[-1,[68,[-2]]],[[34,[6,48]]],[],69],[[-1,[68,[-2]]],[[34,[6,48]]],[],69],[[-1,[68,[-2]]],[[34,[6,48]]],[],69],[45,[[5,[77]]]],[[[63,[-1,-2]]],[[78,[6]]],7,8],[[11,[14,[13]],12,12,[14,[13]]],[[34,[6,45]]]],0,[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,2,[]],[-1,2,[]],[-1,[[34,[-2]]],[],[]],[-1,[[34,[-2]]],[],[]],[-1,[[34,[-2]]],[],[]],[-1,[[34,[-2]]],[],[]],[-1,[[34,[-2]]],[],[]],[-1,[[34,[-2]]],[],[]],[-1,[[34,[-2]]],[],[]],[-1,[[34,[-2]]],[],[]],[-1,[[34,[-2]]],[],[]],[-1,[[34,[-2]]],[],[]],[-1,[[34,[-2]]],[],[]],[-1,[[34,[-2]]],[],[]],[-1,[[34,[-2]]],[],[]],[-1,[[34,[-2]]],[],[]],[-1,[[34,[-2]]],[],[]],[-1,[[34,[-2]]],[],[]],[-1,[[34,[-2]]],[],[]],[-1,[[34,[-2]]],[],[]],[-1,[[34,[-2]]],[],[]],[-1,[[34,[-2]]],[],[]],[-1,[[34,[-2]]],[],[]],[-1,[[34,[-2]]],[],[]],[-1,[[34,[-2]]],[],[]],[-1,[[34,[-2]]],[],[]],[-1,[[34,[-2]]],[],[]],[-1,[[34,[-2]]],[],[]],[-1,[[34,[-2]]],[],[]],[-1,[[34,[-2]]],[],[]],[-1,79,[]],[-1,79,[]],[-1,79,[]],[-1,79,[]],[-1,79,[]],[-1,79,[]],[-1,79,[]],[-1,79,[]],[-1,79,[]],[-1,79,[]],[-1,79,[]],[-1,79,[]],[-1,79,[]],[-1,79,[]],[-1,12,[]],[-1,12,[]],[-1,12,[]],[-1,12,[]],[-1,12,[]],[-1,12,[]],[-1,12,[]],[-1,12,[]],[-1,12,[]],[-1,12,[]],[-1,12,[]],[-1,12,[]],[-1,12,[]],[-1,12,[]],0,[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],0,0,0,0,0,0,0,0,0,0,0],"c":[],"p":[[3,"Plumber",0],[3,"String",447],[4,"ServiceFunction",448],[3,"HashMap",449],[4,"Option",450],[15,"tuple"],[8,"AquaRuntime",0],[8,"ParticleFunctionStatic",448],[3,"AquamarineApi",0],[8,"Future",451],[3,"ParticleDataStore",0],[15,"str"],[15,"u8"],[15,"slice"],[3,"PathBuf",452],[3,"PeerId",453],[3,"Vec",454],[3,"ParticleParameters",455],[6,"CallResults",456],[4,"KeyPair",457],[3,"Box",458],[3,"Pin",459],[8,"Into",460],[8,"Send",461],[3,"WasmtimeWasmBackend",0],[3,"VmConfig",0],[3,"VmPoolConfig",0],[3,"DataStoreConfig",0],[3,"WasmBackendConfig",0],[3,"ParticleEffects",0],[3,"InterpretationStats",0],[3,"RemoteRoutingEffects",0],[3,"Waker",462],[4,"Result",463],[3,"WorkerId",464],[15,"usize"],[3,"Formatter",465],[3,"Error",465],[3,"Duration",466],[3,"RawAVMOutcome",467],[15,"bool"],[3,"ExtendedParticle",468],[6,"Result",465],[4,"AquamarineApiError",0],[4,"DataStoreError",0],[4,"VaultError",469],[3,"FdFlags",470],[3,"Error",471],[4,"PeerScope",464],[8,"Any",472],[3,"Arc",473],[3,"Rc",474],[3,"AVMMemoryStats",475],[3,"Sender",476],[3,"ParticleExecutorMetrics",477],[3,"VmPoolMetrics",478],[3,"HealthCheckRegistry",479],[3,"Workers",480],[3,"KeyStorage",481],[3,"PeerScopes",482],[4,"Event",480],[3,"Receiver",476],[3,"AquamarineBackend",0],[6,"Result",483],[3,"WasmtimeConfig",484],[4,"WasmBackendError",485],[15,"u64"],[3,"SetFdFlags",470],[8,"AsFilelike",486],[3,"Context",462],[4,"Poll",487],[3,"RawCodec",488],[3,"Error",489],[8,"Read",490],[3,"Cid",491],[8,"Extend",492],[8,"Error",493],[3,"JoinHandle",494],[3,"TypeId",472],[13,"SignatureVerificationFailed",437],[13,"ParticleExpired",437],[13,"OneshotCancelled",437],[13,"AquamarineDied",437],[13,"ExecutionTimedOut",437],[13,"AquamarineQueueFull",437],[13,"WorkerIsNotActive",437]],"b":[[163,"impl-Debug-for-AquamarineApiError"],[164,"impl-Display-for-AquamarineApiError"],[167,"impl-Display-for-DataStoreError"],[168,"impl-Debug-for-DataStoreError"]]},\ +"async_unlock":{"doc":"This crate describes functions to work with async_std’s …","t":"FF","n":["unlock","unlock_f"],"q":[[0,"async_unlock"],[2,"tokio::sync::mutex"],[3,"core::ops::function"]],"d":["Performs computation on a value inside Mutex, unlocking …","Performs async computation on a value inside Mutex This …"],"i":[0,0],"f":[[[[1,[-1]],-2],-3,[],2,[]],[[[1,[-1]],-2],-3,[],2,[]]],"c":[],"p":[[3,"Mutex",2],[8,"FnOnce",3]],"b":[]},\ +"chain_connector":{"doc":"","t":"NNDEAIDENAANNNNNNDNNNARNNNDNNNNNDNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMLLLLLLLLLLLLLLLLLLLLLLLLMLLLLLLLLLMLLLLLLLLLLLLLLMKLLLLLLLLLLLLLLLLLLLLLLLLLLLKLKLKLKLLKLLLLLLLLKLLLKLKLMLLMLLLLLLLMLLLLLLLLLLLLLLLLLLLLLLLLLLLLFFMMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMLLLKLMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMEDNESSDNMMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNDDNDDLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMLLLLLLLLLLLLLLLLMNDDNDDLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMLLLLLLLLLLLLLLMMMESMMMMMMMMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNDDLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNDDLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNDDLLLLLLLLLLLLLLLLLNDDLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNDDLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNDDNDDNDDLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNDDENNNSNEMMMLLLLLLLNDDLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNDDNDDLLLLLLLLLLLLMMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMLLLLLLLLLLLLLLLLMMMLLLLLLLLLLLLLLLNDDLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMDDESMMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNDDNDDLLLLLLLLLMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMMMLLLLLLLLLNDDLLLLLLLLLLLMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMLLLLLLLLLLLL","n":["Active","AddressParseError","CCInitParams","CCStatus","Capacity","ChainConnector","CommitmentId","ConnectorError","ConvertCid","Core","Deal","DecodeConstHex","DecodeData","DecodeHex","EmptyData","Failed","FieldNotFound","HttpChainConnector","Inactive","InvalidU256","IpcInternalNetworkError","Offer","PEER_NOT_EXISTS","ParseChainDataFailed","ParseChainDataFailedAlloy","ParseError","PendingUnit","Removed","ResponseParseError","RpcCallError","RpcChainData","RpcError","SubnetResolveResult","WaitDelegation","WaitStart","as_","as_","as_","as_","as_","as_","as_","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone","clone_into","clone_into","clone_into","cmp","compare","current_epoch","current_timestamp","debug","debug","debug","debug","debug","debug","debug","deref","deref","deref","deref","deref","deref","deref","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deserialize","deserialize","detokenize","difficulty","drop","drop","drop","drop","drop","drop","drop","encode_topic","encode_topic_preimage","epoch_duration","eq","eq","eq","eq","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","error","exit_deal","exit_deal","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","get_app_cid","get_cc_init_params","get_cc_init_params","get_commitment_status","get_commitment_status","get_compute_units","get_compute_units","get_current_commitment_id","get_current_commitment_id","get_deal_compute_units","get_deal_statuses","get_deal_statuses","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_global_nonce","get_global_nonce","get_hash","get_hash","get_tx_receipts","get_tx_receipts","get_tx_statuses","get_tx_statuses","global_nonce","hash","hash","id","init","init","init","init","init","init","init","init_timestamp","into","into","into","into","into","into","into","into_any","into_any","into_any","into_any","into_any","into_any","into_any","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","is_commitment_not_active","is_too_many_proofs","max_proofs_per_epoch","min_proofs_per_epoch","new","new","new","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","partial_cmp","references","references","references","references","references","references","references","register_worker","send_tx","serialize","serialize","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","source","start_epoch","stv_abi_encode_packed_to","stv_eip712_data_word","stv_to_tokens","submit_proofs","submit_proofs","success","to_owned","to_owned","to_owned","to_string","to_string","topic_preimage_length","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_check","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_name","type_name","type_name","type_name","type_name","type_name","type_name","valid_token","vzip","vzip","vzip","vzip","vzip","vzip","vzip","workers","CapacityCalls","CapacityCommitmentIsNotActive","CapacityCommitmentIsNotActive","CapacityErrors","SELECTORS","SELECTORS","TooManyProofs","TooManyProofs","_0","_0","abi_decode_raw","abi_decode_raw","abi_decode_returns","abi_decode_returns","abi_decode_returns","abi_decode_returns","abi_encode_raw","abi_encode_raw","abi_encoded_size","abi_encoded_size","as_","as_","as_","as_","as_","as_","as_","as_","as_","as_","as_","as_","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","commitmentId","debug","debug","debug","debug","debug","debug","debug","debug","debug","debug","debug","debug","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","from","from","from","from","from","from","from","from","from","from","from","from","getGlobalNonce","getGlobalNonceCall","getGlobalNonceReturn","getStatus","getStatusCall","getStatusReturn","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","init","init","init","init","init","init","init","init","init","init","init","init","into","into","into","into","into","into","into","into","into","into","into","into","into_any","into_any","into_any","into_any","into_any","into_any","into_any","into_any","into_any","into_any","into_any","into_any","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","localUnitNonce","localUnitNonces","new","new","new","new","new","new","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","references","references","references","references","references","references","references","references","references","references","references","references","resultHash","resultHashes","selector","selector","selector_at","selector_at","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","status","submitProof","submitProofCall","submitProofReturn","submitProofs","submitProofsCall","submitProofsReturn","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","tokenize","tokenize","tokenize","tokenize","tokenize","tokenize","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_name","type_name","type_name","type_name","type_name","type_name","type_name","type_name","type_name","type_name","type_name","type_name","unitId","unitIds","valid_selector","valid_selector","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","code","data","message","CoreCalls","SELECTORS","_0","_0","_0","_0","_0","_0","_0","_0","abi_decode_raw","abi_decode_returns","abi_decode_returns","abi_decode_returns","abi_decode_returns","abi_decode_returns","abi_decode_returns","abi_decode_returns","abi_decode_returns","abi_encode_raw","abi_encoded_size","as_","as_","as_","as_","as_","as_","as_","as_","as_","as_","as_","as_","as_","as_","as_","as_","as_","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","capacity","capacityCall","capacityReturn","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","currentEpoch","currentEpochCall","currentEpochReturn","debug","debug","debug","debug","debug","debug","debug","debug","debug","debug","debug","debug","debug","debug","debug","debug","debug","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","difficulty","difficultyCall","difficultyReturn","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","epochDuration","epochDurationCall","epochDurationReturn","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","initTimestamp","initTimestampCall","initTimestampReturn","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into_any","into_any","into_any","into_any","into_any","into_any","into_any","into_any","into_any","into_any","into_any","into_any","into_any","into_any","into_any","into_any","into_any","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","market","marketCall","marketReturn","maxProofsPerEpoch","maxProofsPerEpochCall","maxProofsPerEpochReturn","minProofsPerEpoch","minProofsPerEpochCall","minProofsPerEpochReturn","new","new","new","new","new","new","new","new","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","references","references","references","references","references","references","references","references","references","references","references","references","references","references","references","references","references","selector","selector_at","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","tokenize","tokenize","tokenize","tokenize","tokenize","tokenize","tokenize","tokenize","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_name","type_name","type_name","type_name","type_name","type_name","type_name","type_name","type_name","type_name","type_name","type_name","type_name","type_name","type_name","type_name","type_name","valid_selector","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","ACTIVE","CIDV1","ComputeUnit","DealCalls","ENDED","INSUFFICIENT_FUNDS","NOT_ENOUGH_WORKERS","SELECTORS","SMALL_BALANCE","Status","_0","_0","_0","abi_decode_raw","abi_decode_returns","abi_decode_returns","abi_decode_returns","abi_decode_returns","abi_encode_raw","abi_encoded_size","appCID","appCIDCall","appCIDReturn","as_","as_","as_","as_","as_","as_","as_","as_","as_","as_","as_","as_","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","computeUnitId","debug","debug","debug","debug","debug","debug","debug","debug","debug","debug","debug","debug","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deserialize","detokenize","detokenize","detokenize","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","eip712_components","eip712_components","eip712_encode_data","eip712_encode_data","eip712_encode_type","eip712_encode_type","eip712_root_type","eip712_root_type","encode_topic","encode_topic","encode_topic","encode_topic_preimage","encode_topic_preimage","encode_topic_preimage","eq","equivalent","equivalent","equivalent","equivalent","equivalent","fmt","from","from","from","from","from","from","from","from","from","from","from","from","from_hex","from_hex","getComputeUnits","getComputeUnitsCall","getComputeUnitsReturn","getStatus","getStatusCall","getStatusReturn","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","hash","id","init","init","init","init","init","init","init","init","init","init","init","init","into","into","into","into","into","into","into","into","into","into","into","into","into_any","into_any","into_any","into_any","into_any","into_any","into_any","into_any","into_any","into_any","into_any","into_any","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","joinedEpoch","new","new","new","new","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","peerId","prefixes","provider","references","references","references","references","references","references","references","references","references","references","references","references","selector","selector_at","serialize","setWorker","setWorkerCall","setWorkerReturn","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","stv_abi_encode_packed_to","stv_abi_encode_packed_to","stv_abi_encode_packed_to","stv_abi_encoded_size","stv_abi_encoded_size","stv_eip712_data_word","stv_eip712_data_word","stv_eip712_data_word","stv_to_tokens","stv_to_tokens","stv_to_tokens","to_ipld","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","tokenize","tokenize","tokenize","tokenize","topic_preimage_length","topic_preimage_length","topic_preimage_length","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_check","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_name","type_name","type_name","type_name","type_name","type_name","type_name","type_name","type_name","type_name","type_name","type_name","valid_selector","valid_token","valid_token","valid_token","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","workerId","workerId","ComputePeer","ComputeUnit","OfferCalls","SELECTORS","_0","_0","abi_decode_raw","abi_decode_returns","abi_decode_returns","abi_decode_returns","abi_encode_raw","abi_encoded_size","as_","as_","as_","as_","as_","as_","as_","as_","as_","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","commitmentId","deal","debug","debug","debug","debug","debug","debug","debug","debug","debug","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","detokenize","detokenize","drop","drop","drop","drop","drop","drop","drop","drop","drop","eip712_components","eip712_components","eip712_encode_data","eip712_encode_data","eip712_encode_type","eip712_encode_type","eip712_root_type","eip712_root_type","encode_topic","encode_topic","encode_topic_preimage","encode_topic_preimage","fmt","from","from","from","from","from","from","from","from","from","getComputePeer","getComputePeerCall","getComputePeerReturn","getComputeUnits","getComputeUnitsCall","getComputeUnitsReturn","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","id","init","init","init","init","init","init","init","init","init","into","into","into","into","into","into","into","into","into","into_any","into_any","into_any","into_any","into_any","into_any","into_any","into_any","into_any","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","new","new","new","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","offerId","owner","peerId","peerId","references","references","references","references","references","references","references","references","references","returnComputeUnitFromDeal","returnComputeUnitFromDealCall","returnComputeUnitFromDealReturn","selector","selector_at","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","startEpoch","stv_abi_encode_packed_to","stv_abi_encode_packed_to","stv_abi_encoded_size","stv_abi_encoded_size","stv_eip712_data_word","stv_eip712_data_word","stv_to_tokens","stv_to_tokens","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","tokenize","tokenize","tokenize","topic_preimage_length","topic_preimage_length","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_name","type_name","type_name","type_name","type_name","type_name","type_name","type_name","type_name","unitCount","unitId","valid_selector","valid_token","valid_token","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip"],"q":[[0,"chain_connector"],[296,"chain_connector::Capacity"],[648,"chain_connector::ConnectorError"],[651,"chain_connector::Core"],[1137,"chain_connector::Deal"],[1534,"chain_connector::Offer"],[1823,"bnum::cast"],[1824,"core::cmp"],[1825,"core::fmt"],[1826,"core::fmt"],[1827,"serde::de"],[1828,"alloy_sol_types::abi::token"],[1829,"alloc::vec"],[1830,"ccp_shared::types::cuid"],[1831,"core::future::future"],[1832,"alloc::boxed"],[1833,"core::pin"],[1834,"core::fmt"],[1835,"hex::error"],[1836,"cid::error"],[1837,"jsonrpsee_core::client::error"],[1838,"clarity::error"],[1839,"alloc::string"],[1840,"chain_data::error"],[1841,"jsonrpsee_types::error"],[1842,"const_hex::error"],[1843,"serde_json::error"],[1844,"alloc::string"],[1845,"types::deal_id"],[1846,"system_interface::fs::fd_flags"],[1847,"std::io::error"],[1848,"core::hash"],[1849,"core::marker"],[1850,"core::hash"],[1851,"alloc::sync"],[1852,"alloc::rc"],[1853,"server_config::node_config"],[1854,"libp2p_identity::peer_id"],[1855,"particle_builtins::builtins"],[1856,"std::collections::hash::map"],[1857,"eyre"],[1858,"core::option"],[1859,"ruint::aliases"],[1860,"system_interface::fs::fd_flags"],[1861,"libipld_core::raw"],[1862,"anyhow"],[1863,"std::io"],[1864,"cid::cid"],[1865,"core::iter::traits::collect"],[1866,"types::peer_scope"],[1867,"serde::ser"],[1868,"core::error"],[1869,"alloy_sol_types"],[1870,"ccp_shared::types::local_nonce"],[1871,"ccp_shared::types::result_hash"],[1872,"alloy_sol_types::errors"]],"d":["","","","","Module containing a contract’s types and functions.","","","","","Module containing a contract’s types and functions.","Module containing a contract’s types and functions.","","","","","","","","","","","Module containing a contract’s types and functions.","“Peer doesn’t exists” in Market.sol","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","","Returns the argument unchanged.","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","","Returns the argument unchanged.","Returns the argument unchanged.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Container for all the Capacity function calls.","@dev Capacity commitment is not active Custom error with …","","Container for all the Capacity custom errors.","All the selectors of this enum.","All the selectors of this enum.","@dev Throws if peer sent too many proofs for the …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","Function with signature getGlobalNonce() and selector …","Container type for the return parameters of the …","","@dev Returns the commitment status @param commitmentId …","@dev Returns the commitment status @param commitmentId …","","","","","","","","","","","","","","","","","","","","","","","","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","@dev Submits a proof for the commitment @param unitId …","@dev Submits a proof for the commitment @param unitId …","","@dev Submits proofs for the commitment @param unitIds …","@dev Submits proofs for the commitment @param unitIds …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Code","Optional data","Message","Container for all the Core function calls.","All the selectors of this enum.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Function with signature capacity() and selector 0x5cfc1a51.","Container type for the return parameters of the capacity() …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","@dev Returns current epoch @return current epoch number …","@dev Returns current epoch @return current epoch number …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","@dev Returns the difficulty for CCP Function with …","@dev Returns the difficulty for CCP Container type for the …","","","","","","","","","","","","","","","","","","","@dev Returns epoch duration @return epochDuration in …","@dev Returns epoch duration @return epochDuration in …","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","@dev Returns epoch init timestamp @return initTimestamp in …","@dev Returns epoch init timestamp @return initTimestamp in …","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Function with signature market() and selector 0x80f55605.","Container type for the return parameters of the market() …","","@dev Returns the max randomX proofs per epoch Function …","@dev Returns the max randomX proofs per epoch Container …","","@dev Returns the min required randomX proofs per epoch for …","@dev Returns the min required randomX proofs per epoch for …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Container for all the Deal function calls.","","","","All the selectors of this enum.","","","","","","","","","","","","","","@dev Returns the app CID Function with signature appCID() …","@dev Returns the app CID Container type for the return …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","","","@dev Returns the compute units info by provider Function …","@dev Returns the compute units info by provider Container …","","@dev Returns the status of the deal Function with …","@dev Returns the status of the deal Container type for the …","","","","","","","","","","","","","","","","","","","","","","","","","","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","@dev Set worker ID for a compute unit. Compute unit can …","@dev Set worker ID for a compute unit. Compute unit can …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Container for all the Offer function calls.","All the selectors of this enum.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","@dev Returns the compute peer info Function with signature …","@dev Returns the compute peer info Container type for the …","","@dev Returns the compute units info of a peer Function …","@dev Returns the compute units info of a peer Container …","","","","","","","","","","","","","","","","","","","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","@dev Return the compute unit from a deal Function with …","@dev Return the compute unit from a deal Container type …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""],"i":[2,22,0,0,0,0,0,0,22,0,0,22,22,22,22,2,22,0,2,22,22,0,0,22,22,22,0,2,22,22,22,22,0,2,2,21,123,22,2,3,6,4,21,123,22,2,3,6,4,21,123,22,2,3,6,4,2,3,4,2,3,4,6,6,123,123,21,123,22,2,3,6,4,21,123,22,2,3,6,4,21,123,22,2,3,6,4,3,4,2,123,21,123,22,2,3,6,4,2,2,123,2,3,6,4,3,3,3,3,3,6,6,6,6,6,4,124,21,22,22,2,3,3,6,4,21,123,22,22,22,22,22,22,22,22,22,22,22,2,3,6,6,4,21,124,21,124,21,124,21,124,21,21,124,21,21,123,22,2,3,6,4,124,21,3,6,124,21,124,21,123,3,6,6,21,123,22,2,3,6,4,123,21,123,22,2,3,6,4,21,123,22,2,3,6,4,21,123,22,2,3,6,4,21,123,22,2,3,6,4,0,0,123,123,21,3,6,21,123,22,2,3,6,4,6,21,123,22,2,3,6,4,21,21,3,4,21,123,22,2,3,6,4,22,6,2,2,2,124,21,4,2,3,4,22,3,2,21,123,22,2,2,3,6,4,21,123,22,2,3,6,4,2,21,123,22,2,3,6,4,21,123,22,2,3,6,4,2,21,123,22,2,3,6,4,4,0,0,75,0,74,75,0,75,79,81,74,75,78,80,82,84,74,75,74,75,74,75,76,77,78,79,80,81,82,83,84,85,74,75,76,77,78,79,80,81,82,83,84,85,74,75,76,77,78,79,80,81,82,83,84,85,76,77,78,79,80,81,82,83,84,85,76,77,78,79,80,81,82,83,84,85,80,74,75,76,77,78,79,80,81,82,83,84,85,74,75,76,77,78,79,80,81,82,83,84,85,74,75,76,77,78,79,80,81,82,83,84,85,74,75,76,77,78,79,80,81,82,83,84,85,74,75,76,77,78,79,80,81,82,83,84,85,74,0,0,74,0,0,74,75,76,77,78,79,80,81,82,83,84,85,74,75,76,77,78,79,80,81,82,83,84,85,74,75,76,77,78,79,80,81,82,83,84,85,74,75,76,77,78,79,80,81,82,83,84,85,74,75,76,77,78,79,80,81,82,83,84,85,74,75,76,77,78,79,80,81,82,83,84,85,82,84,76,77,78,80,82,84,74,75,76,77,78,79,80,81,82,83,84,85,74,75,76,77,78,79,80,81,82,83,84,85,82,84,74,75,74,75,74,75,76,77,78,79,80,81,82,83,84,85,77,74,0,0,74,0,0,76,77,78,79,80,81,82,83,84,85,76,77,78,80,82,84,74,75,76,77,78,79,80,81,82,83,84,85,74,75,76,77,78,79,80,81,82,83,84,85,74,75,76,77,78,79,80,81,82,83,84,85,74,75,76,77,78,79,80,81,82,83,84,85,82,84,74,75,74,75,76,77,78,79,80,81,82,83,84,85,125,125,125,0,86,88,90,92,94,96,98,100,102,86,87,89,91,93,95,97,99,101,86,86,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,86,0,0,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,86,0,0,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,86,0,0,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,86,0,0,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,86,0,0,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,86,0,0,86,0,0,86,0,0,87,89,91,93,95,97,99,101,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,86,86,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,87,89,91,93,95,97,99,101,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,86,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,113,0,0,0,113,113,113,103,113,0,106,108,112,103,105,107,109,111,103,103,103,0,0,103,104,38,105,106,107,108,109,110,111,112,113,103,104,38,105,106,107,108,109,110,111,112,113,103,104,38,105,106,107,108,109,110,111,112,113,104,38,105,106,107,108,109,110,111,112,113,104,38,105,106,107,108,109,110,111,112,113,109,103,104,38,105,106,107,108,109,110,111,112,113,103,104,38,105,106,107,108,109,110,111,112,113,103,104,38,105,106,107,108,109,110,111,112,113,113,104,38,113,103,104,38,105,106,107,108,109,110,111,112,113,104,38,104,38,104,38,104,38,104,38,113,104,38,113,113,113,113,113,113,113,113,103,104,38,105,106,107,108,109,110,111,112,113,104,113,103,0,0,103,0,0,103,104,38,105,106,107,108,109,110,111,112,113,104,38,103,104,38,105,106,107,108,109,110,111,112,113,103,104,38,105,106,107,108,109,110,111,112,113,103,104,38,105,106,107,108,109,110,111,112,113,103,104,38,105,106,107,108,109,110,111,112,113,103,104,38,105,106,107,108,109,110,111,112,113,38,105,107,109,111,103,104,38,105,106,107,108,109,110,111,112,113,38,104,38,103,104,38,105,106,107,108,109,110,111,112,113,103,103,113,103,0,0,103,104,38,105,106,107,108,109,110,111,112,113,104,38,113,104,38,104,38,113,104,38,113,104,104,38,105,106,107,108,109,110,111,112,113,105,107,109,111,104,38,113,103,104,38,105,106,107,108,109,110,111,112,113,113,103,104,38,105,106,107,108,109,110,111,112,113,113,103,104,38,105,106,107,108,109,110,111,112,113,103,104,38,105,106,107,108,109,110,111,112,113,103,104,38,113,103,104,38,105,106,107,108,109,110,111,112,113,38,109,0,0,0,115,118,120,115,117,119,121,115,115,115,116,34,117,118,119,120,121,122,115,116,34,117,118,119,120,121,122,115,116,34,117,118,119,120,121,122,116,34,117,118,119,120,121,122,116,34,117,118,119,120,121,122,116,34,115,116,34,117,118,119,120,121,122,115,116,34,117,118,119,120,121,122,115,116,34,117,118,119,120,121,122,116,34,115,116,34,117,118,119,120,121,122,116,34,116,34,116,34,116,34,116,34,116,34,34,115,116,34,117,118,119,120,121,122,115,0,0,115,0,0,115,116,34,117,118,119,120,121,122,34,115,116,34,117,118,119,120,121,122,115,116,34,117,118,119,120,121,122,115,116,34,117,118,119,120,121,122,115,116,34,117,118,119,120,121,122,115,116,34,117,118,119,120,121,122,117,119,121,115,116,34,117,118,119,120,121,122,116,116,117,119,115,116,34,117,118,119,120,121,122,115,0,0,115,115,115,116,34,117,118,119,120,121,122,34,116,34,116,34,116,34,116,34,116,34,117,118,119,120,121,122,117,119,121,116,34,115,116,34,117,118,119,120,121,122,115,116,34,117,118,119,120,121,122,115,116,34,117,118,119,120,121,122,115,116,34,117,118,119,120,121,122,116,121,115,116,34,115,116,34,117,118,119,120,121,122],"f":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[2,2],[3,3],[4,4],[[-1,-2],5,[],[]],[[-1,-2],5,[],[]],[[-1,-2],5,[],[]],[[6,6],7],[[-1,-2],7,[],[]],0,0,[8,[[10,[5,9]]]],[8,[[10,[5,9]]]],[8,[[10,[5,9]]]],[8,[[10,[5,9]]]],[8,[[10,[5,9]]]],[8,[[10,[5,9]]]],[8,[[10,[5,9]]]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[-1,[[10,[3]]],12],[-1,[[10,[4]]],12],[[]],0,[11,5],[11,5],[11,5],[11,5],[11,5],[11,5],[11,5],[[],13],[[[15,[14]]],5],0,[[2,2],16],[[3,3],16],[[6,6],16],[[4,4],16],[[-1,-2],16,[],[]],[[-1,-2],16,[],[]],[[-1,-2],16,[],[]],[[-1,-2],16,[],[]],[[-1,-2],16,[],[]],[[-1,-2],16,[],[]],[[-1,-2],16,[],[]],[[-1,-2],16,[],[]],[[-1,-2],16,[],[]],[[-1,-2],16,[],[]],0,[[-1,17],[[20,[[19,[18]]]]],[]],[[21,17],[[20,[[19,[18]]]]]],[[22,8],23],[[22,8],23],[[2,8],23],[[3,8],23],[[3,8],23],[[6,8],23],[[4,8],23],[-1,-1,[]],[-1,-1,[]],[24,22],[-1,-1,[]],[25,22],[26,22],[27,22],[28,22],[29,22],[30,22],[31,22],[32,22],[33,22],[-1,-1,[]],[-1,-1,[]],[34,6],[-1,-1,[]],[-1,-1,[]],[[21,-1],[[10,[[15,[35]],22]]],36],[-1,[[20,[[19,[18]]]]],[]],[21,[[20,[[19,[18]]]]]],[[-1,3],[[20,[[19,[18]]]]],[]],[[21,3],[[20,[[19,[18]]]]]],[-1,[[20,[[19,[18]]]]],[]],[21,[[20,[[19,[18]]]]]],[-1,[[20,[[19,[18]]]]],[]],[21,[[20,[[19,[18]]]]]],[[21,37],[[10,[[15,[38]],22]]]],[[-1,[15,[37]]],[[20,[[19,[18]]]]],[]],[[21,[15,[37]]],[[20,[[19,[18]]]]]],[-1,[[10,[39,40]]],[]],[-1,[[10,[39,40]]],[]],[-1,[[10,[39,40]]],[]],[-1,[[10,[39,40]]],[]],[-1,[[10,[39,40]]],[]],[-1,[[10,[39,40]]],[]],[-1,[[10,[39,40]]],[]],[-1,[[20,[[19,[18]]]]],[]],[21,[[20,[[19,[18]]]]]],[[-1,-2],41,[42,43],44],[[-1,-2],41,[42,43],44],[[-1,[15,[35]]],[[20,[[19,[18]]]]],[]],[[21,[15,[35]]],[[20,[[19,[18]]]]]],[[-1,[15,[35]]],[[20,[[19,[18]]]]],[]],[[21,[15,[35]]],[[20,[[19,[18]]]]]],0,[[3,-1],5,45],[[6,-1],5,45],0,[[],11],[[],11],[[],11],[[],11],[[],11],[[],11],[[],11],0,[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[[[19,[-1]]],[[19,[46]]],[]],[[[19,[-1]]],[[19,[46]]],[]],[[[19,[-1]]],[[19,[46]]],[]],[[[19,[-1]]],[[19,[46]]],[]],[[[19,[-1]]],[[19,[46]]],[]],[[[19,[-1]]],[[19,[46]]],[]],[[[19,[-1]]],[[19,[46]]],[]],[[[47,[-1]]],[[47,[46]]],[]],[[[47,[-1]]],[[47,[46]]],[]],[[[47,[-1]]],[[47,[46]]],[]],[[[47,[-1]]],[[47,[46]]],[]],[[[47,[-1]]],[[47,[46]]],[]],[[[47,[-1]]],[[47,[46]]],[]],[[[47,[-1]]],[[47,[46]]],[]],[[[48,[-1]]],[[48,[46]]],[]],[[[48,[-1]]],[[48,[46]]],[]],[[[48,[-1]]],[[48,[46]]],[]],[[[48,[-1]]],[[48,[46]]],[]],[[[48,[-1]]],[[48,[46]]],[]],[[[48,[-1]]],[[48,[46]]],[]],[[[48,[-1]]],[[48,[46]]],[]],[49,16],[49,16],0,0,[[50,51],[[54,[[5,[[47,[21]],[53,[35,52]]]]]]]],[[[55,[14]]],[[56,[3]]]],[[17,57],6],[[-1,39],[[10,[[58,[-2]],40]]],[],59],[[-1,39],[[10,[[58,[-2]],40]]],[],59],[[-1,39],[[10,[[58,[-2]],40]]],[],59],[[-1,39],[[10,[[58,[-2]],40]]],[],59],[[-1,39],[[10,[[58,[-2]],40]]],[],59],[[-1,39],[[10,[[58,[-2]],40]]],[],59],[[-1,39],[[10,[[58,[-2]],40]]],[],59],[[6,6],[[56,[7]]]],[[60,-1,-2],[[10,[5,61]]],62,[[64,[63]]]],[[60,-1,-2],[[10,[5,61]]],62,[[64,[63]]]],[[60,-1,-2],[[10,[5,61]]],62,[[64,[63]]]],[[60,-1,-2],[[10,[5,61]]],62,[[64,[63]]]],[[60,-1,-2],[[10,[5,61]]],62,[[64,[63]]]],[[60,-1,-2],[[10,[5,61]]],62,[[64,[63]]]],[[60,-1,-2],[[10,[5,61]]],62,[[64,[63]]]],[[21,37,65,17],[[10,[35,22]]]],[[21,[15,[14]],49],[[10,[35,22]]]],[[3,-1],10,66],[[4,-1],10,66],[[-1,[58,[-2]]],[[10,[5,40]]],[],59],[[-1,[58,[-2]]],[[10,[5,40]]],[],59],[[-1,[58,[-2]]],[[10,[5,40]]],[],59],[[-1,[58,[-2]]],[[10,[5,40]]],[],59],[[-1,[58,[-2]]],[[10,[5,40]]],[],59],[[-1,[58,[-2]]],[[10,[5,40]]],[],59],[[-1,[58,[-2]]],[[10,[5,40]]],[],59],[22,[[56,[67]]]],0,[[2,[15,[14]]],5],[2,68],[2],[[-1,[15,[17]],[15,[69]],[15,[70]]],[[20,[[19,[18]]]]],[]],[[21,[15,[17]],[15,[69]],[15,[70]]],[[20,[[19,[18]]]]]],0,[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,35,[]],[-1,35,[]],[[],11],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[14,[[71,[2]]]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[[],[[71,[5]]]],[-1,72,[]],[-1,72,[]],[-1,72,[]],[-1,72,[]],[-1,72,[]],[-1,72,[]],[-1,72,[]],[-1,49,[]],[-1,49,[]],[-1,49,[]],[-1,49,[]],[-1,49,[]],[-1,49,[]],[-1,49,[]],[[],16],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],0,0,0,0,0,0,0,0,0,0,0,[[[55,[14]],[73,[14]],16],[[71,[74]]]],[[[55,[14]],[73,[14]],16],[[71,[75]]]],[[[73,[14]],16],71],[[[73,[14]],16],71],[[[73,[14]],16],71],[[[73,[14]],16],71],[[74,[15,[14]]],5],[[75,[15,[14]]],5],[74,11],[75,11],[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[76,76],[77,77],[78,78],[79,79],[80,80],[81,81],[82,82],[83,83],[84,84],[85,85],[[-1,-2],5,[],[]],[[-1,-2],5,[],[]],[[-1,-2],5,[],[]],[[-1,-2],5,[],[]],[[-1,-2],5,[],[]],[[-1,-2],5,[],[]],[[-1,-2],5,[],[]],[[-1,-2],5,[],[]],[[-1,-2],5,[],[]],[[-1,-2],5,[],[]],0,[8,[[10,[5,9]]]],[8,[[10,[5,9]]]],[8,[[10,[5,9]]]],[8,[[10,[5,9]]]],[8,[[10,[5,9]]]],[8,[[10,[5,9]]]],[8,[[10,[5,9]]]],[8,[[10,[5,9]]]],[8,[[10,[5,9]]]],[8,[[10,[5,9]]]],[8,[[10,[5,9]]]],[8,[[10,[5,9]]]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,5],[11,5],[11,5],[11,5],[11,5],[11,5],[11,5],[11,5],[11,5],[11,5],[11,5],[11,5],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],0,0,0,0,0,0,[-1,[[10,[39,40]]],[]],[-1,[[10,[39,40]]],[]],[-1,[[10,[39,40]]],[]],[-1,[[10,[39,40]]],[]],[-1,[[10,[39,40]]],[]],[-1,[[10,[39,40]]],[]],[-1,[[10,[39,40]]],[]],[-1,[[10,[39,40]]],[]],[-1,[[10,[39,40]]],[]],[-1,[[10,[39,40]]],[]],[-1,[[10,[39,40]]],[]],[-1,[[10,[39,40]]],[]],[[],11],[[],11],[[],11],[[],11],[[],11],[[],11],[[],11],[[],11],[[],11],[[],11],[[],11],[[],11],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[[[19,[-1]]],[[19,[46]]],[]],[[[19,[-1]]],[[19,[46]]],[]],[[[19,[-1]]],[[19,[46]]],[]],[[[19,[-1]]],[[19,[46]]],[]],[[[19,[-1]]],[[19,[46]]],[]],[[[19,[-1]]],[[19,[46]]],[]],[[[19,[-1]]],[[19,[46]]],[]],[[[19,[-1]]],[[19,[46]]],[]],[[[19,[-1]]],[[19,[46]]],[]],[[[19,[-1]]],[[19,[46]]],[]],[[[19,[-1]]],[[19,[46]]],[]],[[[19,[-1]]],[[19,[46]]],[]],[[[47,[-1]]],[[47,[46]]],[]],[[[47,[-1]]],[[47,[46]]],[]],[[[47,[-1]]],[[47,[46]]],[]],[[[47,[-1]]],[[47,[46]]],[]],[[[47,[-1]]],[[47,[46]]],[]],[[[47,[-1]]],[[47,[46]]],[]],[[[47,[-1]]],[[47,[46]]],[]],[[[47,[-1]]],[[47,[46]]],[]],[[[47,[-1]]],[[47,[46]]],[]],[[[47,[-1]]],[[47,[46]]],[]],[[[47,[-1]]],[[47,[46]]],[]],[[[47,[-1]]],[[47,[46]]],[]],[[[48,[-1]]],[[48,[46]]],[]],[[[48,[-1]]],[[48,[46]]],[]],[[[48,[-1]]],[[48,[46]]],[]],[[[48,[-1]]],[[48,[46]]],[]],[[[48,[-1]]],[[48,[46]]],[]],[[[48,[-1]]],[[48,[46]]],[]],[[[48,[-1]]],[[48,[46]]],[]],[[[48,[-1]]],[[48,[46]]],[]],[[[48,[-1]]],[[48,[46]]],[]],[[[48,[-1]]],[[48,[46]]],[]],[[[48,[-1]]],[[48,[46]]],[]],[[[48,[-1]]],[[48,[46]]],[]],0,0,[[],76],[[],77],[[],78],[[],80],[[],82],[[],84],[[-1,39],[[10,[[58,[-2]],40]]],[],59],[[-1,39],[[10,[[58,[-2]],40]]],[],59],[[-1,39],[[10,[[58,[-2]],40]]],[],59],[[-1,39],[[10,[[58,[-2]],40]]],[],59],[[-1,39],[[10,[[58,[-2]],40]]],[],59],[[-1,39],[[10,[[58,[-2]],40]]],[],59],[[-1,39],[[10,[[58,[-2]],40]]],[],59],[[-1,39],[[10,[[58,[-2]],40]]],[],59],[[-1,39],[[10,[[58,[-2]],40]]],[],59],[[-1,39],[[10,[[58,[-2]],40]]],[],59],[[-1,39],[[10,[[58,[-2]],40]]],[],59],[[-1,39],[[10,[[58,[-2]],40]]],[],59],[[60,-1,-2],[[10,[5,61]]],62,[[64,[63]]]],[[60,-1,-2],[[10,[5,61]]],62,[[64,[63]]]],[[60,-1,-2],[[10,[5,61]]],62,[[64,[63]]]],[[60,-1,-2],[[10,[5,61]]],62,[[64,[63]]]],[[60,-1,-2],[[10,[5,61]]],62,[[64,[63]]]],[[60,-1,-2],[[10,[5,61]]],62,[[64,[63]]]],[[60,-1,-2],[[10,[5,61]]],62,[[64,[63]]]],[[60,-1,-2],[[10,[5,61]]],62,[[64,[63]]]],[[60,-1,-2],[[10,[5,61]]],62,[[64,[63]]]],[[60,-1,-2],[[10,[5,61]]],62,[[64,[63]]]],[[60,-1,-2],[[10,[5,61]]],62,[[64,[63]]]],[[60,-1,-2],[[10,[5,61]]],62,[[64,[63]]]],0,0,[74,[[55,[14]]]],[75,[[55,[14]]]],[11,[[56,[[55,[14]]]]]],[11,[[56,[[55,[14]]]]]],[[-1,[58,[-2]]],[[10,[5,40]]],[],59],[[-1,[58,[-2]]],[[10,[5,40]]],[],59],[[-1,[58,[-2]]],[[10,[5,40]]],[],59],[[-1,[58,[-2]]],[[10,[5,40]]],[],59],[[-1,[58,[-2]]],[[10,[5,40]]],[],59],[[-1,[58,[-2]]],[[10,[5,40]]],[],59],[[-1,[58,[-2]]],[[10,[5,40]]],[],59],[[-1,[58,[-2]]],[[10,[5,40]]],[],59],[[-1,[58,[-2]]],[[10,[5,40]]],[],59],[[-1,[58,[-2]]],[[10,[5,40]]],[],59],[[-1,[58,[-2]]],[[10,[5,40]]],[],59],[[-1,[58,[-2]]],[[10,[5,40]]],[],59],0,0,0,0,0,0,0,[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[76],[77],[78],[80],[82],[84],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,72,[]],[-1,72,[]],[-1,72,[]],[-1,72,[]],[-1,72,[]],[-1,72,[]],[-1,72,[]],[-1,72,[]],[-1,72,[]],[-1,72,[]],[-1,72,[]],[-1,72,[]],[-1,49,[]],[-1,49,[]],[-1,49,[]],[-1,49,[]],[-1,49,[]],[-1,49,[]],[-1,49,[]],[-1,49,[]],[-1,49,[]],[-1,49,[]],[-1,49,[]],[-1,49,[]],0,0,[[[55,[14]]],16],[[[55,[14]]],16],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],0,0,0,0,0,0,0,0,0,0,0,0,0,[[[55,[14]],[73,[14]],16],[[71,[86]]]],[[[73,[14]],16],71],[[[73,[14]],16],71],[[[73,[14]],16],71],[[[73,[14]],16],71],[[[73,[14]],16],71],[[[73,[14]],16],71],[[[73,[14]],16],71],[[[73,[14]],16],71],[[86,[15,[14]]],5],[86,11],[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],0,0,0,[87,87],[88,88],[89,89],[90,90],[91,91],[92,92],[93,93],[94,94],[95,95],[96,96],[97,97],[98,98],[99,99],[100,100],[101,101],[102,102],[[-1,-2],5,[],[]],[[-1,-2],5,[],[]],[[-1,-2],5,[],[]],[[-1,-2],5,[],[]],[[-1,-2],5,[],[]],[[-1,-2],5,[],[]],[[-1,-2],5,[],[]],[[-1,-2],5,[],[]],[[-1,-2],5,[],[]],[[-1,-2],5,[],[]],[[-1,-2],5,[],[]],[[-1,-2],5,[],[]],[[-1,-2],5,[],[]],[[-1,-2],5,[],[]],[[-1,-2],5,[],[]],[[-1,-2],5,[],[]],0,0,0,[8,[[10,[5,9]]]],[8,[[10,[5,9]]]],[8,[[10,[5,9]]]],[8,[[10,[5,9]]]],[8,[[10,[5,9]]]],[8,[[10,[5,9]]]],[8,[[10,[5,9]]]],[8,[[10,[5,9]]]],[8,[[10,[5,9]]]],[8,[[10,[5,9]]]],[8,[[10,[5,9]]]],[8,[[10,[5,9]]]],[8,[[10,[5,9]]]],[8,[[10,[5,9]]]],[8,[[10,[5,9]]]],[8,[[10,[5,9]]]],[8,[[10,[5,9]]]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],0,0,0,[11,5],[11,5],[11,5],[11,5],[11,5],[11,5],[11,5],[11,5],[11,5],[11,5],[11,5],[11,5],[11,5],[11,5],[11,5],[11,5],[11,5],0,0,0,[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,[[10,[39,40]]],[]],[-1,[[10,[39,40]]],[]],[-1,[[10,[39,40]]],[]],[-1,[[10,[39,40]]],[]],[-1,[[10,[39,40]]],[]],[-1,[[10,[39,40]]],[]],[-1,[[10,[39,40]]],[]],[-1,[[10,[39,40]]],[]],[-1,[[10,[39,40]]],[]],[-1,[[10,[39,40]]],[]],[-1,[[10,[39,40]]],[]],[-1,[[10,[39,40]]],[]],[-1,[[10,[39,40]]],[]],[-1,[[10,[39,40]]],[]],[-1,[[10,[39,40]]],[]],[-1,[[10,[39,40]]],[]],[-1,[[10,[39,40]]],[]],[[],11],[[],11],[[],11],[[],11],[[],11],[[],11],[[],11],[[],11],[[],11],[[],11],[[],11],[[],11],[[],11],[[],11],[[],11],[[],11],[[],11],0,0,0,[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[[[19,[-1]]],[[19,[46]]],[]],[[[19,[-1]]],[[19,[46]]],[]],[[[19,[-1]]],[[19,[46]]],[]],[[[19,[-1]]],[[19,[46]]],[]],[[[19,[-1]]],[[19,[46]]],[]],[[[19,[-1]]],[[19,[46]]],[]],[[[19,[-1]]],[[19,[46]]],[]],[[[19,[-1]]],[[19,[46]]],[]],[[[19,[-1]]],[[19,[46]]],[]],[[[19,[-1]]],[[19,[46]]],[]],[[[19,[-1]]],[[19,[46]]],[]],[[[19,[-1]]],[[19,[46]]],[]],[[[19,[-1]]],[[19,[46]]],[]],[[[19,[-1]]],[[19,[46]]],[]],[[[19,[-1]]],[[19,[46]]],[]],[[[19,[-1]]],[[19,[46]]],[]],[[[19,[-1]]],[[19,[46]]],[]],[[[47,[-1]]],[[47,[46]]],[]],[[[47,[-1]]],[[47,[46]]],[]],[[[47,[-1]]],[[47,[46]]],[]],[[[47,[-1]]],[[47,[46]]],[]],[[[47,[-1]]],[[47,[46]]],[]],[[[47,[-1]]],[[47,[46]]],[]],[[[47,[-1]]],[[47,[46]]],[]],[[[47,[-1]]],[[47,[46]]],[]],[[[47,[-1]]],[[47,[46]]],[]],[[[47,[-1]]],[[47,[46]]],[]],[[[47,[-1]]],[[47,[46]]],[]],[[[47,[-1]]],[[47,[46]]],[]],[[[47,[-1]]],[[47,[46]]],[]],[[[47,[-1]]],[[47,[46]]],[]],[[[47,[-1]]],[[47,[46]]],[]],[[[47,[-1]]],[[47,[46]]],[]],[[[47,[-1]]],[[47,[46]]],[]],[[[48,[-1]]],[[48,[46]]],[]],[[[48,[-1]]],[[48,[46]]],[]],[[[48,[-1]]],[[48,[46]]],[]],[[[48,[-1]]],[[48,[46]]],[]],[[[48,[-1]]],[[48,[46]]],[]],[[[48,[-1]]],[[48,[46]]],[]],[[[48,[-1]]],[[48,[46]]],[]],[[[48,[-1]]],[[48,[46]]],[]],[[[48,[-1]]],[[48,[46]]],[]],[[[48,[-1]]],[[48,[46]]],[]],[[[48,[-1]]],[[48,[46]]],[]],[[[48,[-1]]],[[48,[46]]],[]],[[[48,[-1]]],[[48,[46]]],[]],[[[48,[-1]]],[[48,[46]]],[]],[[[48,[-1]]],[[48,[46]]],[]],[[[48,[-1]]],[[48,[46]]],[]],[[[48,[-1]]],[[48,[46]]],[]],0,0,0,0,0,0,0,0,0,[[],87],[[],89],[[],91],[[],93],[[],95],[[],97],[[],99],[[],101],[[-1,39],[[10,[[58,[-2]],40]]],[],59],[[-1,39],[[10,[[58,[-2]],40]]],[],59],[[-1,39],[[10,[[58,[-2]],40]]],[],59],[[-1,39],[[10,[[58,[-2]],40]]],[],59],[[-1,39],[[10,[[58,[-2]],40]]],[],59],[[-1,39],[[10,[[58,[-2]],40]]],[],59],[[-1,39],[[10,[[58,[-2]],40]]],[],59],[[-1,39],[[10,[[58,[-2]],40]]],[],59],[[-1,39],[[10,[[58,[-2]],40]]],[],59],[[-1,39],[[10,[[58,[-2]],40]]],[],59],[[-1,39],[[10,[[58,[-2]],40]]],[],59],[[-1,39],[[10,[[58,[-2]],40]]],[],59],[[-1,39],[[10,[[58,[-2]],40]]],[],59],[[-1,39],[[10,[[58,[-2]],40]]],[],59],[[-1,39],[[10,[[58,[-2]],40]]],[],59],[[-1,39],[[10,[[58,[-2]],40]]],[],59],[[-1,39],[[10,[[58,[-2]],40]]],[],59],[[60,-1,-2],[[10,[5,61]]],62,[[64,[63]]]],[[60,-1,-2],[[10,[5,61]]],62,[[64,[63]]]],[[60,-1,-2],[[10,[5,61]]],62,[[64,[63]]]],[[60,-1,-2],[[10,[5,61]]],62,[[64,[63]]]],[[60,-1,-2],[[10,[5,61]]],62,[[64,[63]]]],[[60,-1,-2],[[10,[5,61]]],62,[[64,[63]]]],[[60,-1,-2],[[10,[5,61]]],62,[[64,[63]]]],[[60,-1,-2],[[10,[5,61]]],62,[[64,[63]]]],[[60,-1,-2],[[10,[5,61]]],62,[[64,[63]]]],[[60,-1,-2],[[10,[5,61]]],62,[[64,[63]]]],[[60,-1,-2],[[10,[5,61]]],62,[[64,[63]]]],[[60,-1,-2],[[10,[5,61]]],62,[[64,[63]]]],[[60,-1,-2],[[10,[5,61]]],62,[[64,[63]]]],[[60,-1,-2],[[10,[5,61]]],62,[[64,[63]]]],[[60,-1,-2],[[10,[5,61]]],62,[[64,[63]]]],[[60,-1,-2],[[10,[5,61]]],62,[[64,[63]]]],[[60,-1,-2],[[10,[5,61]]],62,[[64,[63]]]],[86,[[55,[14]]]],[11,[[56,[[55,[14]]]]]],[[-1,[58,[-2]]],[[10,[5,40]]],[],59],[[-1,[58,[-2]]],[[10,[5,40]]],[],59],[[-1,[58,[-2]]],[[10,[5,40]]],[],59],[[-1,[58,[-2]]],[[10,[5,40]]],[],59],[[-1,[58,[-2]]],[[10,[5,40]]],[],59],[[-1,[58,[-2]]],[[10,[5,40]]],[],59],[[-1,[58,[-2]]],[[10,[5,40]]],[],59],[[-1,[58,[-2]]],[[10,[5,40]]],[],59],[[-1,[58,[-2]]],[[10,[5,40]]],[],59],[[-1,[58,[-2]]],[[10,[5,40]]],[],59],[[-1,[58,[-2]]],[[10,[5,40]]],[],59],[[-1,[58,[-2]]],[[10,[5,40]]],[],59],[[-1,[58,[-2]]],[[10,[5,40]]],[],59],[[-1,[58,[-2]]],[[10,[5,40]]],[],59],[[-1,[58,[-2]]],[[10,[5,40]]],[],59],[[-1,[58,[-2]]],[[10,[5,40]]],[],59],[[-1,[58,[-2]]],[[10,[5,40]]],[],59],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[87],[89],[91],[93],[95],[97],[99],[101],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,72,[]],[-1,72,[]],[-1,72,[]],[-1,72,[]],[-1,72,[]],[-1,72,[]],[-1,72,[]],[-1,72,[]],[-1,72,[]],[-1,72,[]],[-1,72,[]],[-1,72,[]],[-1,72,[]],[-1,72,[]],[-1,72,[]],[-1,72,[]],[-1,72,[]],[-1,49,[]],[-1,49,[]],[-1,49,[]],[-1,49,[]],[-1,49,[]],[-1,49,[]],[-1,49,[]],[-1,49,[]],[-1,49,[]],[-1,49,[]],[-1,49,[]],[-1,49,[]],[-1,49,[]],[-1,49,[]],[-1,49,[]],[-1,49,[]],[-1,49,[]],[[[55,[14]]],16],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],0,0,0,0,0,0,0,0,0,0,0,0,0,[[[55,[14]],[73,[14]],16],[[71,[103]]]],[[[73,[14]],16],71],[[[73,[14]],16],71],[[[73,[14]],16],71],[[[73,[14]],16],71],[[103,[15,[14]]],5],[103,11],0,0,0,[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[104,104],[38,38],[105,105],[106,106],[107,107],[108,108],[109,109],[110,110],[111,111],[112,112],[113,113],[[-1,-2],5,[],[]],[[-1,-2],5,[],[]],[[-1,-2],5,[],[]],[[-1,-2],5,[],[]],[[-1,-2],5,[],[]],[[-1,-2],5,[],[]],[[-1,-2],5,[],[]],[[-1,-2],5,[],[]],[[-1,-2],5,[],[]],[[-1,-2],5,[],[]],[[-1,-2],5,[],[]],0,[8,[[10,[5,9]]]],[8,[[10,[5,9]]]],[8,[[10,[5,9]]]],[8,[[10,[5,9]]]],[8,[[10,[5,9]]]],[8,[[10,[5,9]]]],[8,[[10,[5,9]]]],[8,[[10,[5,9]]]],[8,[[10,[5,9]]]],[8,[[10,[5,9]]]],[8,[[10,[5,9]]]],[8,[[10,[5,9]]]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[-1,[[10,[113]]],12],[[]],[[]],[[]],[11,5],[11,5],[11,5],[11,5],[11,5],[11,5],[11,5],[11,5],[11,5],[11,5],[11,5],[11,5],[[],[[15,[[114,[49]]]]]],[[],[[15,[[114,[49]]]]]],[104,[[15,[14]]]],[38,[[15,[14]]]],[[],[[114,[49]]]],[[],[[114,[49]]]],[[],[[114,[49]]]],[[],[[114,[49]]]],[[],13],[[],13],[[],13],[[[15,[14]]],5],[[[15,[14]]],5],[[[15,[14]]],5],[[113,113],16],[[-1,-2],16,[],[]],[[-1,-2],16,[],[]],[[-1,-2],16,[],[]],[[-1,-2],16,[],[]],[[-1,-2],16,[],[]],[[113,8],23],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[49,[[10,[104,22]]]],[49,[[10,[113,22]]]],0,0,0,0,0,0,[-1,[[10,[39,40]]],[]],[-1,[[10,[39,40]]],[]],[-1,[[10,[39,40]]],[]],[-1,[[10,[39,40]]],[]],[-1,[[10,[39,40]]],[]],[-1,[[10,[39,40]]],[]],[-1,[[10,[39,40]]],[]],[-1,[[10,[39,40]]],[]],[-1,[[10,[39,40]]],[]],[-1,[[10,[39,40]]],[]],[-1,[[10,[39,40]]],[]],[-1,[[10,[39,40]]],[]],0,0,[[],11],[[],11],[[],11],[[],11],[[],11],[[],11],[[],11],[[],11],[[],11],[[],11],[[],11],[[],11],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[[[19,[-1]]],[[19,[46]]],[]],[[[19,[-1]]],[[19,[46]]],[]],[[[19,[-1]]],[[19,[46]]],[]],[[[19,[-1]]],[[19,[46]]],[]],[[[19,[-1]]],[[19,[46]]],[]],[[[19,[-1]]],[[19,[46]]],[]],[[[19,[-1]]],[[19,[46]]],[]],[[[19,[-1]]],[[19,[46]]],[]],[[[19,[-1]]],[[19,[46]]],[]],[[[19,[-1]]],[[19,[46]]],[]],[[[19,[-1]]],[[19,[46]]],[]],[[[19,[-1]]],[[19,[46]]],[]],[[[47,[-1]]],[[47,[46]]],[]],[[[47,[-1]]],[[47,[46]]],[]],[[[47,[-1]]],[[47,[46]]],[]],[[[47,[-1]]],[[47,[46]]],[]],[[[47,[-1]]],[[47,[46]]],[]],[[[47,[-1]]],[[47,[46]]],[]],[[[47,[-1]]],[[47,[46]]],[]],[[[47,[-1]]],[[47,[46]]],[]],[[[47,[-1]]],[[47,[46]]],[]],[[[47,[-1]]],[[47,[46]]],[]],[[[47,[-1]]],[[47,[46]]],[]],[[[47,[-1]]],[[47,[46]]],[]],[[[48,[-1]]],[[48,[46]]],[]],[[[48,[-1]]],[[48,[46]]],[]],[[[48,[-1]]],[[48,[46]]],[]],[[[48,[-1]]],[[48,[46]]],[]],[[[48,[-1]]],[[48,[46]]],[]],[[[48,[-1]]],[[48,[46]]],[]],[[[48,[-1]]],[[48,[46]]],[]],[[[48,[-1]]],[[48,[46]]],[]],[[[48,[-1]]],[[48,[46]]],[]],[[[48,[-1]]],[[48,[46]]],[]],[[[48,[-1]]],[[48,[46]]],[]],[[[48,[-1]]],[[48,[46]]],[]],0,[[],105],[[],107],[[],109],[[],111],[[-1,39],[[10,[[58,[-2]],40]]],[],59],[[-1,39],[[10,[[58,[-2]],40]]],[],59],[[-1,39],[[10,[[58,[-2]],40]]],[],59],[[-1,39],[[10,[[58,[-2]],40]]],[],59],[[-1,39],[[10,[[58,[-2]],40]]],[],59],[[-1,39],[[10,[[58,[-2]],40]]],[],59],[[-1,39],[[10,[[58,[-2]],40]]],[],59],[[-1,39],[[10,[[58,[-2]],40]]],[],59],[[-1,39],[[10,[[58,[-2]],40]]],[],59],[[-1,39],[[10,[[58,[-2]],40]]],[],59],[[-1,39],[[10,[[58,[-2]],40]]],[],59],[[-1,39],[[10,[[58,[-2]],40]]],[],59],0,0,0,[[60,-1,-2],[[10,[5,61]]],62,[[64,[63]]]],[[60,-1,-2],[[10,[5,61]]],62,[[64,[63]]]],[[60,-1,-2],[[10,[5,61]]],62,[[64,[63]]]],[[60,-1,-2],[[10,[5,61]]],62,[[64,[63]]]],[[60,-1,-2],[[10,[5,61]]],62,[[64,[63]]]],[[60,-1,-2],[[10,[5,61]]],62,[[64,[63]]]],[[60,-1,-2],[[10,[5,61]]],62,[[64,[63]]]],[[60,-1,-2],[[10,[5,61]]],62,[[64,[63]]]],[[60,-1,-2],[[10,[5,61]]],62,[[64,[63]]]],[[60,-1,-2],[[10,[5,61]]],62,[[64,[63]]]],[[60,-1,-2],[[10,[5,61]]],62,[[64,[63]]]],[[60,-1,-2],[[10,[5,61]]],62,[[64,[63]]]],[103,[[55,[14]]]],[11,[[56,[[55,[14]]]]]],[[113,-1],10,66],0,0,0,[[-1,[58,[-2]]],[[10,[5,40]]],[],59],[[-1,[58,[-2]]],[[10,[5,40]]],[],59],[[-1,[58,[-2]]],[[10,[5,40]]],[],59],[[-1,[58,[-2]]],[[10,[5,40]]],[],59],[[-1,[58,[-2]]],[[10,[5,40]]],[],59],[[-1,[58,[-2]]],[[10,[5,40]]],[],59],[[-1,[58,[-2]]],[[10,[5,40]]],[],59],[[-1,[58,[-2]]],[[10,[5,40]]],[],59],[[-1,[58,[-2]]],[[10,[5,40]]],[],59],[[-1,[58,[-2]]],[[10,[5,40]]],[],59],[[-1,[58,[-2]]],[[10,[5,40]]],[],59],[[-1,[58,[-2]]],[[10,[5,40]]],[],59],[[104,[15,[14]]],5],[[38,[15,[14]]],5],[[113,[15,[14]]],5],[104,11],[38,11],[104,68],[38,68],[113,68],[104],[38],[113],[104,[[10,[35,22]]]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[105],[107],[109],[111],[[],11],[[],11],[[],11],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[14,[[71,[113]]]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[[],[[71,[5]]]],[-1,72,[]],[-1,72,[]],[-1,72,[]],[-1,72,[]],[-1,72,[]],[-1,72,[]],[-1,72,[]],[-1,72,[]],[-1,72,[]],[-1,72,[]],[-1,72,[]],[-1,72,[]],[-1,49,[]],[-1,49,[]],[-1,49,[]],[-1,49,[]],[-1,49,[]],[-1,49,[]],[-1,49,[]],[-1,49,[]],[-1,49,[]],[-1,49,[]],[-1,49,[]],[-1,49,[]],[[[55,[14]]],16],[[],16],[[],16],[[],16],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],0,0,0,0,0,0,0,0,[[[55,[14]],[73,[14]],16],[[71,[115]]]],[[[73,[14]],16],71],[[[73,[14]],16],71],[[[73,[14]],16],71],[[115,[15,[14]]],5],[115,11],[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[116,116],[34,34],[117,117],[118,118],[119,119],[120,120],[121,121],[122,122],[[-1,-2],5,[],[]],[[-1,-2],5,[],[]],[[-1,-2],5,[],[]],[[-1,-2],5,[],[]],[[-1,-2],5,[],[]],[[-1,-2],5,[],[]],[[-1,-2],5,[],[]],[[-1,-2],5,[],[]],0,0,[8,[[10,[5,9]]]],[8,[[10,[5,9]]]],[8,[[10,[5,9]]]],[8,[[10,[5,9]]]],[8,[[10,[5,9]]]],[8,[[10,[5,9]]]],[8,[[10,[5,9]]]],[8,[[10,[5,9]]]],[8,[[10,[5,9]]]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[11,-1,[]],[[]],[[]],[11,5],[11,5],[11,5],[11,5],[11,5],[11,5],[11,5],[11,5],[11,5],[[],[[15,[[114,[49]]]]]],[[],[[15,[[114,[49]]]]]],[116,[[15,[14]]]],[34,[[15,[14]]]],[[],[[114,[49]]]],[[],[[114,[49]]]],[[],[[114,[49]]]],[[],[[114,[49]]]],[[],13],[[],13],[[[15,[14]]],5],[[[15,[14]]],5],[[34,8],23],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],0,0,0,0,0,0,[-1,[[10,[39,40]]],[]],[-1,[[10,[39,40]]],[]],[-1,[[10,[39,40]]],[]],[-1,[[10,[39,40]]],[]],[-1,[[10,[39,40]]],[]],[-1,[[10,[39,40]]],[]],[-1,[[10,[39,40]]],[]],[-1,[[10,[39,40]]],[]],[-1,[[10,[39,40]]],[]],0,[[],11],[[],11],[[],11],[[],11],[[],11],[[],11],[[],11],[[],11],[[],11],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[[[19,[-1]]],[[19,[46]]],[]],[[[19,[-1]]],[[19,[46]]],[]],[[[19,[-1]]],[[19,[46]]],[]],[[[19,[-1]]],[[19,[46]]],[]],[[[19,[-1]]],[[19,[46]]],[]],[[[19,[-1]]],[[19,[46]]],[]],[[[19,[-1]]],[[19,[46]]],[]],[[[19,[-1]]],[[19,[46]]],[]],[[[19,[-1]]],[[19,[46]]],[]],[[[47,[-1]]],[[47,[46]]],[]],[[[47,[-1]]],[[47,[46]]],[]],[[[47,[-1]]],[[47,[46]]],[]],[[[47,[-1]]],[[47,[46]]],[]],[[[47,[-1]]],[[47,[46]]],[]],[[[47,[-1]]],[[47,[46]]],[]],[[[47,[-1]]],[[47,[46]]],[]],[[[47,[-1]]],[[47,[46]]],[]],[[[47,[-1]]],[[47,[46]]],[]],[[[48,[-1]]],[[48,[46]]],[]],[[[48,[-1]]],[[48,[46]]],[]],[[[48,[-1]]],[[48,[46]]],[]],[[[48,[-1]]],[[48,[46]]],[]],[[[48,[-1]]],[[48,[46]]],[]],[[[48,[-1]]],[[48,[46]]],[]],[[[48,[-1]]],[[48,[46]]],[]],[[[48,[-1]]],[[48,[46]]],[]],[[[48,[-1]]],[[48,[46]]],[]],[[],117],[[],119],[[],121],[[-1,39],[[10,[[58,[-2]],40]]],[],59],[[-1,39],[[10,[[58,[-2]],40]]],[],59],[[-1,39],[[10,[[58,[-2]],40]]],[],59],[[-1,39],[[10,[[58,[-2]],40]]],[],59],[[-1,39],[[10,[[58,[-2]],40]]],[],59],[[-1,39],[[10,[[58,[-2]],40]]],[],59],[[-1,39],[[10,[[58,[-2]],40]]],[],59],[[-1,39],[[10,[[58,[-2]],40]]],[],59],[[-1,39],[[10,[[58,[-2]],40]]],[],59],0,0,0,0,[[60,-1,-2],[[10,[5,61]]],62,[[64,[63]]]],[[60,-1,-2],[[10,[5,61]]],62,[[64,[63]]]],[[60,-1,-2],[[10,[5,61]]],62,[[64,[63]]]],[[60,-1,-2],[[10,[5,61]]],62,[[64,[63]]]],[[60,-1,-2],[[10,[5,61]]],62,[[64,[63]]]],[[60,-1,-2],[[10,[5,61]]],62,[[64,[63]]]],[[60,-1,-2],[[10,[5,61]]],62,[[64,[63]]]],[[60,-1,-2],[[10,[5,61]]],62,[[64,[63]]]],[[60,-1,-2],[[10,[5,61]]],62,[[64,[63]]]],0,0,0,[115,[[55,[14]]]],[11,[[56,[[55,[14]]]]]],[[-1,[58,[-2]]],[[10,[5,40]]],[],59],[[-1,[58,[-2]]],[[10,[5,40]]],[],59],[[-1,[58,[-2]]],[[10,[5,40]]],[],59],[[-1,[58,[-2]]],[[10,[5,40]]],[],59],[[-1,[58,[-2]]],[[10,[5,40]]],[],59],[[-1,[58,[-2]]],[[10,[5,40]]],[],59],[[-1,[58,[-2]]],[[10,[5,40]]],[],59],[[-1,[58,[-2]]],[[10,[5,40]]],[],59],[[-1,[58,[-2]]],[[10,[5,40]]],[],59],0,[[116,[15,[14]]],5],[[34,[15,[14]]],5],[116,11],[34,11],[116,68],[34,68],[116],[34],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[117],[119],[121],[[],11],[[],11],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,72,[]],[-1,72,[]],[-1,72,[]],[-1,72,[]],[-1,72,[]],[-1,72,[]],[-1,72,[]],[-1,72,[]],[-1,72,[]],[-1,49,[]],[-1,49,[]],[-1,49,[]],[-1,49,[]],[-1,49,[]],[-1,49,[]],[-1,49,[]],[-1,49,[]],[-1,49,[]],0,0,[[[55,[14]]],16],[[],16],[[],16],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]]],"c":[],"p":[[8,"CastFrom",1823],[4,"CCStatus",0],[3,"CommitmentId",0],[3,"SubnetResolveResult",0],[15,"tuple"],[3,"PendingUnit",0],[4,"Ordering",1824],[3,"Formatter",1825],[3,"Error",1825],[4,"Result",1826],[15,"usize"],[8,"Deserializer",1827],[3,"WordToken",1828],[15,"u8"],[3,"Vec",1829],[15,"bool"],[3,"CUID",1830],[8,"Future",1831],[3,"Box",1832],[3,"Pin",1833],[3,"HttpChainConnector",0],[4,"ConnectorError",0],[6,"Result",1825],[4,"Error",1834],[4,"FromHexError",1835],[4,"Error",1836],[4,"Error",1837],[4,"Error",1838],[3,"FromUtf8Error",1839],[4,"ChainDataError",1840],[6,"ErrorObjectOwned",1841],[4,"FromHexError",1842],[3,"Error",1843],[3,"ComputeUnit",1534],[3,"String",1839],[8,"Iterator",1844],[3,"DealId",1845],[3,"ComputeUnit",1137],[3,"FdFlags",1846],[3,"Error",1847],[15,"u64"],[8,"Hash",1848],[8,"Sized",1849],[8,"BuildHasher",1848],[8,"Hasher",1848],[8,"Any",1850],[3,"Arc",1851],[3,"Rc",1852],[15,"str"],[3,"ChainConfig",1853],[3,"PeerId",1854],[3,"CustomService",1855],[3,"HashMap",1856],[6,"Result",1857],[15,"array"],[4,"Option",1858],[6,"U256",1859],[3,"SetFdFlags",1846],[8,"AsFilelike",1860],[3,"RawCodec",1861],[3,"Error",1862],[8,"Read",1863],[3,"Cid",1864],[8,"Extend",1865],[3,"WorkerId",1866],[8,"Serializer",1867],[8,"Error",1868],[6,"Word",1869],[3,"LocalNonce",1870],[3,"ResultHash",1871],[6,"Result",1834],[3,"TypeId",1850],[15,"slice"],[4,"CapacityCalls",296],[4,"CapacityErrors",296],[3,"TooManyProofs",296],[3,"CapacityCommitmentIsNotActive",296],[3,"getGlobalNonceCall",296],[3,"getGlobalNonceReturn",296],[3,"getStatusCall",296],[3,"getStatusReturn",296],[3,"submitProofCall",296],[3,"submitProofReturn",296],[3,"submitProofsCall",296],[3,"submitProofsReturn",296],[4,"CoreCalls",651],[3,"capacityCall",651],[3,"capacityReturn",651],[3,"marketCall",651],[3,"marketReturn",651],[3,"currentEpochCall",651],[3,"currentEpochReturn",651],[3,"epochDurationCall",651],[3,"epochDurationReturn",651],[3,"initTimestampCall",651],[3,"initTimestampReturn",651],[3,"difficultyCall",651],[3,"difficultyReturn",651],[3,"minProofsPerEpochCall",651],[3,"minProofsPerEpochReturn",651],[3,"maxProofsPerEpochCall",651],[3,"maxProofsPerEpochReturn",651],[4,"DealCalls",1137],[3,"CIDV1",1137],[3,"getStatusCall",1137],[3,"getStatusReturn",1137],[3,"appCIDCall",1137],[3,"appCIDReturn",1137],[3,"setWorkerCall",1137],[3,"setWorkerReturn",1137],[3,"getComputeUnitsCall",1137],[3,"getComputeUnitsReturn",1137],[4,"Status",1137],[4,"Cow",1872],[4,"OfferCalls",1534],[3,"ComputePeer",1534],[3,"getComputePeerCall",1534],[3,"getComputePeerReturn",1534],[3,"getComputeUnitsCall",1534],[3,"getComputeUnitsReturn",1534],[3,"returnComputeUnitFromDealCall",1534],[3,"returnComputeUnitFromDealReturn",1534],[3,"CCInitParams",0],[8,"ChainConnector",0],[13,"RpcCallError",648]],"b":[[118,"impl-Debug-for-ConnectorError"],[119,"impl-Display-for-ConnectorError"],[121,"impl-Display-for-CommitmentId"],[122,"impl-Debug-for-CommitmentId"],[127,"impl-From%3CError%3E-for-ConnectorError"],[129,"impl-From%3CFromHexError%3E-for-ConnectorError"],[130,"impl-From%3CError%3E-for-ConnectorError"],[131,"impl-From%3CClientError%3E-for-ConnectorError"],[132,"impl-From%3CError%3E-for-ConnectorError"],[133,"impl-From%3CFromUtf8Error%3E-for-ConnectorError"],[134,"impl-From%3CChainDataError%3E-for-ConnectorError"],[135,"impl-From%3CErrorObject%3C\'static%3E%3E-for-ConnectorError"],[136,"impl-From%3CFromHexError%3E-for-ConnectorError"],[137,"impl-From%3CError%3E-for-ConnectorError"]]},\ +"chain_data":{"doc":"","t":"DINEINNNNNNENNNNNNDENNNNNNMLLLLLLLLLLLLLLMLLLKLLLLLLLLLLLLLLLLLLLLLLLLLKFFMLKFFFFFFMLKLLMLLLLLLMLLLLLLLLLLLLLLLLLLLLMMMM","n":["BlockHeader","ChainData","ChainData","ChainDataError","ChainEvent","DecodeConstHex","DecodeHex","DecodeHex","Empty","EthError","EthError","EventField","Indexed","InvalidComputePeerId","InvalidComputePeerId","InvalidParsedToken","InvalidParsedToken","InvalidTokenSize","Log","LogParseError","MissingParsedToken","MissingParsedToken","MissingToken","MissingTopic","NoTokens","NotIndexed","block_number","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone_into","clone_into","data","deserialize","deserialize","eq","event_name","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","from","from","from_json","into","into","into","into","into","new","next","next_opt","number","param_type","parse","parse_chain_data","parse_log","parse_peer_id","peer_id_from_hex","peer_id_to_bytes","peer_id_to_hex","removed","serialize","signature","source","source","timestamp","to_owned","to_owned","to_string","to_string","topic","topic","topics","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","vzip","vzip","vzip","vzip","vzip","event_field","event_field","position","position"],"q":[[0,"chain_data"],[116,"chain_data::LogParseError"],[120,"core::result"],[121,"serde::de"],[122,"core::fmt"],[123,"core::fmt"],[124,"libp2p_identity::peer_id"],[125,"const_hex::error"],[126,"alloy_sol_types::errors"],[127,"hex::error"],[128,"serde_json::value"],[129,"eyre"],[130,"alloc::string"],[131,"core::iter::traits::iterator"],[132,"core::ops::function"],[133,"ethabi::param_type::param_type"],[134,"core::marker"],[135,"ethabi::token::token"],[136,"alloc::vec"],[137,"alloy_sol_types::types::event"],[138,"libp2p_identity::peer_id"],[139,"core::error"],[140,"core::option"],[141,"core::any"]],"d":["","","","","","","","","","","","Kind of the field in Chain Event","If field is indexed, it’s passed among topics","","","","","","","","","","","","","If field is not indexed, it’s passed in log.data","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","","Returns the argument unchanged.","","Returns the argument unchanged.","","Returns the argument unchanged.","","","","","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","","Parse data from chain. Accepts data with and without “0x…","","","","This code works only for PeerId generated from ed25519 …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""],"i":[0,0,12,0,0,12,11,12,11,11,12,0,1,11,12,11,12,11,0,0,11,12,12,12,12,1,2,4,1,11,2,12,4,1,11,2,12,1,2,1,2,2,4,2,1,36,4,1,11,11,2,12,12,4,1,11,11,11,2,12,12,12,12,12,12,4,4,1,11,2,12,37,0,0,4,1,36,0,0,0,0,0,0,2,2,36,11,12,4,1,2,11,12,36,36,2,4,1,11,2,12,4,1,11,2,12,4,1,11,2,12,4,1,11,2,12,38,39,38,39],"f":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[1,1],[2,2],[[-1,-2],3,[],[]],[[-1,-2],3,[],[]],0,[-1,[[5,[4]]],6],[-1,[[5,[2]]],6],[[1,1],7],[[],8],[[4,9],10],[[1,9],10],[[11,9],10],[[11,9],10],[[2,9],10],[[12,9],10],[[12,9],10],[-1,-1,[]],[-1,-1,[]],[13,11],[-1,-1,[]],[14,11],[-1,-1,[]],[15,12],[-1,-1,[]],[11,12],[16,12],[14,12],[17,12],[18,[[19,[4]]]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[[20,-1],-2,[],[]],[[-1,8,-2],[[5,[-3,11]]],21,22,[]],[[-1,8,-2],[[5,[-3,11]]],21,22,[]],0,[1,23],[-1,[[5,[-2,11]]],21,24],[[8,[25,[23]]],[[5,[[27,[26]],11]]]],[2,[[5,[-1,12]]],28],[[[25,[29]]],[[5,[30,14]]]],[8,[[19,[30]]]],[30,[[31,[29]]]],[30,20],0,[[2,-1],5,32],[[],[[27,[1]]]],[11,[[34,[33]]]],[12,[[34,[33]]]],0,[-1,-2,[],[]],[-1,-2,[],[]],[-1,20,[]],[-1,20,[]],[[],20],[[],20],0,[-1,[[5,[-2]]],[],[]],[-1,[[5,[-2]]],[],[]],[-1,[[5,[-2]]],[],[]],[-1,[[5,[-2]]],[],[]],[-1,[[5,[-2]]],[],[]],[-1,[[5,[-2]]],[],[]],[-1,[[5,[-2]]],[],[]],[-1,[[5,[-2]]],[],[]],[-1,[[5,[-2]]],[],[]],[-1,[[5,[-2]]],[],[]],[-1,35,[]],[-1,35,[]],[-1,35,[]],[-1,35,[]],[-1,35,[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],0,0,0,0],"c":[],"p":[[4,"EventField",0],[3,"Log",0],[15,"tuple"],[3,"BlockHeader",0],[4,"Result",120],[8,"Deserializer",121],[15,"bool"],[15,"str"],[3,"Formatter",122],[6,"Result",122],[4,"ChainDataError",0],[4,"LogParseError",0],[4,"Error",123],[4,"ParseError",124],[4,"FromHexError",125],[4,"Error",126],[4,"FromHexError",127],[4,"Value",128],[6,"Result",129],[3,"String",130],[8,"Iterator",131],[8,"Fn",132],[4,"ParamType",133],[8,"Sized",134],[15,"slice"],[4,"Token",135],[3,"Vec",136],[8,"SolEvent",137],[15,"u8"],[3,"PeerId",124],[15,"array"],[8,"Serializer",138],[8,"Error",139],[4,"Option",140],[3,"TypeId",141],[8,"ChainData",0],[8,"ChainEvent",0],[13,"MissingToken",116],[13,"MissingTopic",116]],"b":[[48,"impl-Display-for-ChainDataError"],[49,"impl-Debug-for-ChainDataError"],[51,"impl-Display-for-LogParseError"],[52,"impl-Debug-for-LogParseError"],[55,"impl-From%3CError%3E-for-ChainDataError"],[57,"impl-From%3CParseError%3E-for-ChainDataError"],[59,"impl-From%3CFromHexError%3E-for-LogParseError"],[61,"impl-From%3CChainDataError%3E-for-LogParseError"],[62,"impl-From%3CError%3E-for-LogParseError"],[63,"impl-From%3CParseError%3E-for-LogParseError"],[64,"impl-From%3CFromHexError%3E-for-LogParseError"]]},\ +"chain_listener":{"doc":"","t":"DDDDDDMLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMMLMMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMLLLLLLLLLLLLLLLMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMMLLLLLLLLLLLLLMMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMMMLLLLLLL","n":["CIDV1","ChainListener","CommitmentActivated","ComputeUnitMatched","UnitActivated","UnitDeactivated","appCID","as_","as_","as_","as_","as_","as_","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","commitmentId","commitmentId","commitmentId","create_ws_client","deal","dealCreationBlock","debug","debug","debug","debug","debug","debug","deref","deref","deref","deref","deref","deref","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","detokenize","drop","drop","drop","drop","drop","drop","eip712_components","eip712_encode_data","eip712_encode_type","eip712_root_type","encode_topic","encode_topic_preimage","encode_topics_raw","encode_topics_raw","encode_topics_raw","encode_topics_raw","endEpoch","fmt","fmt","fmt","from","from","from","from","from","from","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","hash","init","init","init","init","init","init","into","into","into","into","into","into","into_any","into_any","into_any","into_any","into_any","into_any","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","new","new","new","new","new","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","peerId","peerId","prefixes","references","references","references","references","references","references","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","start","startEpoch","startEpoch","stv_abi_encode_packed_to","stv_abi_encoded_size","stv_eip712_data_word","stv_to_tokens","to_owned","to_owned","to_owned","to_owned","to_owned","tokenize_body","tokenize_body","tokenize_body","tokenize_body","topic_preimage_length","topics","topics","topics","topics","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_name","type_name","type_name","type_name","type_name","type_name","unitId","unitId","unitId","unitIds","valid_token","vzip","vzip","vzip","vzip","vzip","vzip"],"q":[[0,"chain_listener"],[205,"bnum::cast"],[206,"jsonrpsee_core::client::async_client"],[207,"jsonrpsee_core::client::error"],[208,"core::result"],[209,"core::fmt"],[210,"core::fmt"],[211,"alloc::vec"],[212,"alloy_sol_types::abi::token"],[213,"alloy_sol_types::errors"],[214,"core::fmt"],[215,"std::io::error"],[216,"alloc::boxed"],[217,"core::any"],[218,"alloc::sync"],[219,"alloc::rc"],[220,"server_config::node_config"],[221,"server_config::node_config"],[222,"chain_connector::connector"],[223,"core_distributor::distributor"],[224,"ccp_rpc_client"],[225,"core::option"],[226,"std::path"],[227,"peer_metrics::chain_listener"],[228,"system_interface::fs::fd_flags"],[229,"libipld_core::raw"],[230,"anyhow"],[231,"std::io"],[232,"cid::cid"],[233,"core::iter::traits::collect"],[234,"tokio::runtime::task::join"],[235,"alloy_sol_types"],[236,"core::any"]],"d":["","","@dev Emitted when a commitment is activated. Commitment …","Event with signature …","@dev Emitted when a unit activated. Unit is activated when …","@dev Emitted when a unit deactivated. Unit is deactivated …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","","","","","","","","","","","","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""],"i":[0,0,0,0,0,0,4,37,2,3,4,5,6,37,2,3,4,5,6,37,2,3,4,5,6,2,3,4,5,6,2,3,4,5,6,2,5,6,37,4,4,37,2,3,4,5,6,37,2,3,4,5,6,37,2,3,4,5,6,3,37,2,3,4,5,6,3,3,3,3,3,3,2,4,5,6,2,2,5,6,37,2,3,4,5,6,37,2,3,4,5,6,3,37,2,3,4,5,6,37,2,3,4,5,6,37,2,3,4,5,6,37,2,3,4,5,6,37,2,3,4,5,6,37,2,4,5,6,37,2,3,4,5,6,2,4,3,37,2,3,4,5,6,37,2,3,4,5,6,37,2,5,3,3,3,3,2,3,4,5,6,2,4,5,6,3,2,4,5,6,37,2,3,4,5,6,37,2,3,4,5,6,37,2,3,4,5,6,37,2,3,4,5,6,4,5,6,2,3,37,2,3,4,5,6],"f":[0,0,0,0,0,0,0,[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[2,2],[3,3],[4,4],[5,5],[6,6],[[-1,-2],7,[],[]],[[-1,-2],7,[],[]],[[-1,-2],7,[],[]],[[-1,-2],7,[],[]],[[-1,-2],7,[],[]],0,0,0,[8,[[11,[9,10]]]],0,0,[12,[[11,[7,13]]]],[12,[[11,[7,13]]]],[12,[[11,[7,13]]]],[12,[[11,[7,13]]]],[12,[[11,[7,13]]]],[12,[[11,[7,13]]]],[14,-1,[]],[14,-1,[]],[14,-1,[]],[14,-1,[]],[14,-1,[]],[14,-1,[]],[14,-1,[]],[14,-1,[]],[14,-1,[]],[14,-1,[]],[14,-1,[]],[14,-1,[]],[[]],[14,7],[14,7],[14,7],[14,7],[14,7],[14,7],[[],[[16,[[15,[8]]]]]],[3,[[16,[17]]]],[[],[[15,[8]]]],[[],[[15,[8]]]],[[],18],[[[16,[17]]],7],[[2,[19,[18]]],[[20,[7]]]],[[4,[19,[18]]],[[20,[7]]]],[[5,[19,[18]]],[[20,[7]]]],[[6,[19,[18]]],[[20,[7]]]],0,[[2,12],21],[[5,12],21],[[6,12],21],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,[[11,[22,23]]],[]],[-1,[[11,[22,23]]],[]],[-1,[[11,[22,23]]],[]],[-1,[[11,[22,23]]],[]],[-1,[[11,[22,23]]],[]],[-1,[[11,[22,23]]],[]],0,[[],14],[[],14],[[],14],[[],14],[[],14],[[],14],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[[[24,[-1]]],[[24,[25]]],[]],[[[24,[-1]]],[[24,[25]]],[]],[[[24,[-1]]],[[24,[25]]],[]],[[[24,[-1]]],[[24,[25]]],[]],[[[24,[-1]]],[[24,[25]]],[]],[[[24,[-1]]],[[24,[25]]],[]],[[[26,[-1]]],[[26,[25]]],[]],[[[26,[-1]]],[[26,[25]]],[]],[[[26,[-1]]],[[26,[25]]],[]],[[[26,[-1]]],[[26,[25]]],[]],[[[26,[-1]]],[[26,[25]]],[]],[[[26,[-1]]],[[26,[25]]],[]],[[[27,[-1]]],[[27,[25]]],[]],[[[27,[-1]]],[[27,[25]]],[]],[[[27,[-1]]],[[27,[25]]],[]],[[[27,[-1]]],[[27,[25]]],[]],[[[27,[-1]]],[[27,[25]]],[]],[[[27,[-1]]],[[27,[25]]],[]],[[28,9,29,30,[26,[31]],[26,[32]],[34,[33]],35,[34,[36]]],37],[[],2],[[],4],[[],5],[[],6],[[-1,22],[[11,[[38,[-2]],23]]],[],39],[[-1,22],[[11,[[38,[-2]],23]]],[],39],[[-1,22],[[11,[[38,[-2]],23]]],[],39],[[-1,22],[[11,[[38,[-2]],23]]],[],39],[[-1,22],[[11,[[38,[-2]],23]]],[],39],[[-1,22],[[11,[[38,[-2]],23]]],[],39],0,0,0,[[40,-1,-2],[[11,[7,41]]],42,[[44,[43]]]],[[40,-1,-2],[[11,[7,41]]],42,[[44,[43]]]],[[40,-1,-2],[[11,[7,41]]],42,[[44,[43]]]],[[40,-1,-2],[[11,[7,41]]],42,[[44,[43]]]],[[40,-1,-2],[[11,[7,41]]],42,[[44,[43]]]],[[40,-1,-2],[[11,[7,41]]],42,[[44,[43]]]],[[-1,[38,[-2]]],[[11,[7,23]]],[],39],[[-1,[38,[-2]]],[[11,[7,23]]],[],39],[[-1,[38,[-2]]],[[11,[7,23]]],[],39],[[-1,[38,[-2]]],[[11,[7,23]]],[],39],[[-1,[38,[-2]]],[[11,[7,23]]],[],39],[[-1,[38,[-2]]],[[11,[7,23]]],[],39],[37,[[45,[7]]]],0,0,[[3,[16,[17]]],7],[3,14],[3,46],[3],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[2],[4],[5],[6],[[],14],[2],[4],[5],[6],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,47,[]],[-1,47,[]],[-1,47,[]],[-1,47,[]],[-1,47,[]],[-1,47,[]],[-1,8,[]],[-1,8,[]],[-1,8,[]],[-1,8,[]],[-1,8,[]],[-1,8,[]],0,0,0,0,[[],48],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]]],"c":[],"p":[[8,"CastFrom",205],[3,"CommitmentActivated",0],[3,"CIDV1",0],[3,"ComputeUnitMatched",0],[3,"UnitActivated",0],[3,"UnitDeactivated",0],[15,"tuple"],[15,"str"],[3,"Client",206],[4,"Error",207],[4,"Result",208],[3,"Formatter",209],[3,"Error",209],[15,"usize"],[4,"Cow",210],[3,"Vec",211],[15,"u8"],[3,"WordToken",212],[15,"slice"],[6,"Result",213],[6,"Result",209],[3,"FdFlags",214],[3,"Error",215],[3,"Box",216],[8,"Any",217],[3,"Arc",218],[3,"Rc",219],[3,"ChainConfig",220],[3,"ChainListenerConfig",220],[3,"PeerId",221],[8,"ChainConnector",222],[8,"CoreDistributor",223],[3,"CCPRpcHttpClient",224],[4,"Option",225],[3,"PathBuf",226],[3,"ChainListenerMetrics",227],[3,"ChainListener",0],[3,"SetFdFlags",214],[8,"AsFilelike",228],[3,"RawCodec",229],[3,"Error",230],[8,"Read",231],[3,"Cid",232],[8,"Extend",233],[3,"JoinHandle",234],[6,"Word",235],[3,"TypeId",217],[15,"bool"]],"b":[]},\ +"cid_utils":{"doc":"","t":"DLLLLLLLLLLLLLLLLLLLLLLLL","n":["Hash","as_bytes","borrow","borrow_mut","clone","clone_into","deserialize","eq","equivalent","equivalent","equivalent","fmt","fmt","from","from_string","hash","into","new","references","serialize","to_owned","to_string","try_from","try_into","type_id"],"q":[[0,"cid_utils"],[25,"alloc::vec"],[26,"core::result"],[27,"serde::de"],[28,"core::fmt"],[29,"core::fmt"],[30,"core::hash"],[31,"eyre"],[32,"libipld_core::raw"],[33,"anyhow"],[34,"std::io"],[35,"cid::cid"],[36,"core::iter::traits::collect"],[37,"serde::ser"],[38,"alloc::string"],[39,"core::any"]],"d":["","","","","","","","","","","","","","Returns the argument unchanged.","","","Calls U::from(self).","","","","","","","",""],"i":[0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],"f":[0,[1,[[3,[2]]]],[-1,-2,[],[]],[-1,-2,[],[]],[1,1],[[-1,-2],4,[],[]],[-1,[[5,[1]]],6],[[1,1],7],[[-1,-2],7,[],[]],[[-1,-2],7,[],[]],[[-1,-2],7,[],[]],[[1,8],9],[[1,8],9],[-1,-1,[]],[10,[[5,[1,11]]]],[[1,-1],4,12],[-1,-2,[],[]],[[[13,[2]]],[[14,[1]]]],[[15,-1,-2],[[5,[4,16]]],17,[[19,[18]]]],[[1,-1],5,20],[-1,-2,[],[]],[-1,21,[]],[-1,[[5,[-2]]],[],[]],[-1,[[5,[-2]]],[],[]],[-1,22,[]]],"c":[],"p":[[3,"Hash",0],[15,"u8"],[3,"Vec",25],[15,"tuple"],[4,"Result",26],[8,"Deserializer",27],[15,"bool"],[3,"Formatter",28],[6,"Result",28],[15,"str"],[4,"Error",29],[8,"Hasher",30],[15,"slice"],[6,"Result",31],[3,"RawCodec",32],[3,"Error",33],[8,"Read",34],[3,"Cid",35],[8,"Extend",36],[8,"Serializer",37],[3,"String",38],[3,"TypeId",39]],"b":[[11,"impl-Display-for-Hash"],[12,"impl-Debug-for-Hash"]]},\ +"config_utils":{"doc":"","t":"FFFFFFFF","n":["blueprint_dir","modules_dir","particles_anomaly_dir","particles_dir","particles_vault_dir","services_dir","to_peer_id","workdir"],"q":[[0,"config_utils"],[8,"std::path"],[9,"std::path"],[10,"libp2p_identity::peer_id"]],"d":["","","","","","","",""],"i":[0,0,0,0,0,0,0,0],"f":[[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[3,4],[1,2]],"c":[],"p":[[3,"Path",8],[3,"PathBuf",8],[3,"Keypair",9],[3,"PeerId",10]],"b":[]},\ +"connected_client":{"doc":"","t":"EEDNNNLLLLLLMLLLLLLMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMLLLLLMMLMLLLLLLLLLLLLLLMLMMLLLLLLLLLLLLLLLLLMMMMM","n":["ClientCommand","ClientEvent","ConnectedClient","NewConnection","Particle","Particle","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","client","clone","clone_into","connect_to","connect_to_with_timeout","connect_with_keypair","connect_with_timeout","data_store","debug","debug","debug","deref","deref","deref","deref","deref_mut","deref_mut","deref_mut","deref_mut","deserialize","drop","drop","drop","execute_particle","fmt","fmt","from","from","from","get_data_store","get_fd_flags","get_fd_flags","get_fd_flags","get_local_vm","init","init","init","into","into","into","into_any","into_any","into_any","into_any_arc","into_any_arc","into_any_arc","into_any_rc","into_any_rc","into_any_rc","listen_for_n","local_vm","maybe_receive","new","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","node","node_address","particle_ttl","particle_ttl","receive","receive_args","references","references","references","send","send_particle","send_particle_ext","serialize","set_fd_flags","set_fd_flags","set_fd_flags","set_particle_ttl","short_timeout","short_timeout","timeout","timeout","tmp_dir","to_owned","try_from","try_from","try_from","try_into","try_into","try_into","type_id","type_id","type_id","type_name","type_name","type_name","vzip","vzip","vzip","wait_particle_args","particle","multiaddr","particle","peer_id","sender"],"q":[[0,"connected_client"],[107,"connected_client::ClientCommand"],[108,"connected_client::ClientEvent"],[112,"multiaddr"],[113,"eyre"],[114,"core::time"],[115,"core::option"],[116,"fluence_keypair::key_pair"],[117,"core::fmt"],[118,"core::fmt"],[119,"serde::de"],[120,"serde_json::value"],[121,"std::collections::hash::map"],[122,"alloc::vec"],[123,"alloc::string"],[124,"core::convert"],[125,"core::fmt"],[126,"alloc::sync"],[127,"system_interface::fs::fd_flags"],[128,"std::io::error"],[129,"marine_wasmtime_backend"],[130,"avm_server::runner"],[131,"tokio::sync::mutex"],[132,"alloc::boxed"],[133,"core::any"],[134,"alloc::rc"],[135,"core::ops::function"],[136,"core::default"],[137,"particle_protocol::particle"],[138,"libp2p_identity::peer_id"],[139,"system_interface::fs::fd_flags"],[140,"libipld_core::raw"],[141,"anyhow"],[142,"std::io"],[143,"cid::cid"],[144,"core::iter::traits::collect"],[145,"serde::ser"],[146,"core::any"]],"d":["Describes commands sent from client to relay node; also …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","","","","","","","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Wait for a particle with specified particle_id, and read …","","","","",""],"i":[0,0,0,22,1,22,4,1,22,4,1,22,4,1,1,4,4,4,4,4,4,1,22,4,4,1,22,4,4,1,22,1,4,1,22,4,1,22,4,1,22,4,4,1,22,4,4,1,22,4,1,22,4,1,22,4,1,22,4,1,22,4,4,4,4,4,1,22,4,4,4,4,4,4,4,1,22,4,4,4,1,4,1,22,4,4,4,4,4,4,1,4,1,22,4,1,22,4,1,22,4,1,22,4,1,22,4,47,48,49,48,49],"f":[0,0,0,0,0,0,[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],0,[1,1],[[-1,-2],2,[],[]],[3,[[5,[4]]]],[[3,6,6,[7,[6]]],[[5,[4]]]],[[3,[7,[8]]],[[5,[4]]]],[[3,[7,[8]],6,6,[7,[6]],9],[[5,[4]]]],0,[10,[[12,[2,11]]]],[10,[[12,[2,11]]]],[10,[[12,[2,11]]]],[4],[13,-1,[]],[13,-1,[]],[13,-1,[]],[13,-1,[]],[4],[13,-1,[]],[13,-1,[]],[-1,[[12,[1]]],14],[13,2],[13,2],[13,2],[[4,-1,[17,[15,16]]],[[5,[[18,[16]]]]],[[20,[19]]]],[[1,10],21],[[22,10],21],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[4,[[24,[23]]]],[-1,[[12,[25,26]]],[]],[-1,[[12,[25,26]]],[]],[-1,[[12,[25,26]]],[]],[4,[[29,[[28,[27]]]]]],[[],13],[[],13],[[],13],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[[[30,[-1]]],[[30,[31]]],[]],[[[30,[-1]]],[[30,[31]]],[]],[[[30,[-1]]],[[30,[31]]],[]],[[[24,[-1]]],[[24,[31]]],[]],[[[24,[-1]]],[[24,[31]]],[]],[[[24,[-1]]],[[24,[31]]],[]],[[[32,[-1]]],[[32,[31]]],[]],[[[32,[-1]]],[[32,[31]]],[]],[[[32,[-1]]],[[32,[31]]],[]],[[4,13,-1],-2,33,34],0,[4,[[7,[35]]]],0,[[-1,25],[[12,[[37,[-2]],26]]],[],38],[[-1,25],[[12,[[37,[-2]],26]]],[],38],[[-1,25],[[12,[[37,[-2]],26]]],[],38],0,0,[4,6],0,[4,[[5,[35]]]],[4,[[5,[[18,[16]]]]]],[[39,-1,-2],[[12,[2,40]]],41,[[43,[42]]]],[[39,-1,-2],[[12,[2,40]]],41,[[43,[42]]]],[[39,-1,-2],[[12,[2,40]]],41,[[43,[42]]]],[[4,35],2],[[4,-1,[17,[15,16]]],19,[[20,[19]]]],[[4,-1,[17,[15,16]],9],19,[[20,[19]]]],[[1,-1],12,44],[[-1,[37,[-2]]],[[12,[2,26]]],[],38],[[-1,[37,[-2]]],[[12,[2,26]]],[],38],[[-1,[37,[-2]]],[[12,[2,26]]],[],38],[[4,6],2],[4,6],0,[4,6],0,0,[-1,-2,[],[]],[-1,[[12,[-2]]],[],[]],[-1,[[12,[-2]]],[],[]],[-1,[[12,[-2]]],[],[]],[-1,[[12,[-2]]],[],[]],[-1,[[12,[-2]]],[],[]],[-1,[[12,[-2]]],[],[]],[-1,45,[]],[-1,45,[]],[-1,45,[]],[-1,15,[]],[-1,15,[]],[-1,15,[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[[4,-1],[[5,[[18,[16]]]]],[[46,[15]]]],0,0,0,0,0],"c":[],"p":[[4,"ClientCommand",0],[15,"tuple"],[3,"Multiaddr",112],[3,"ConnectedClient",0],[6,"Result",113],[3,"Duration",114],[4,"Option",115],[4,"KeyPair",116],[15,"bool"],[3,"Formatter",117],[3,"Error",117],[4,"Result",118],[15,"usize"],[8,"Deserializer",119],[15,"str"],[4,"Value",120],[3,"HashMap",121],[3,"Vec",122],[3,"String",123],[8,"Into",124],[6,"Result",117],[4,"ClientEvent",0],[3,"ParticleDataStore",125],[3,"Arc",126],[3,"FdFlags",127],[3,"Error",128],[3,"WasmtimeWasmBackend",129],[3,"AVMRunner",130],[3,"Mutex",131],[3,"Box",132],[8,"Any",133],[3,"Rc",134],[8,"Fn",135],[8,"Default",136],[3,"Particle",137],[3,"PeerId",138],[3,"SetFdFlags",127],[8,"AsFilelike",139],[3,"RawCodec",140],[3,"Error",141],[8,"Read",142],[3,"Cid",143],[8,"Extend",144],[8,"Serializer",145],[3,"TypeId",133],[8,"AsRef",124],[13,"Particle",107],[13,"NewConnection",108],[13,"Particle",108]],"b":[]},\ +"connection_pool":{"doc":"","t":"ENNDDINNNNNNENNLLLLLLLLLLLLLLKLLKLLLLLLLLLLLLLLKLLKLLLLLLLLLLLLLLKLLLLLLLLLLLLLLLLLLKLLKLLLLLLLLMLKLLMLLLLLLLLLLLLLLLLLLLLLLLMMMMMMMMMMMMMMM","n":["Command","Connect","Connected","ConnectionPoolApi","ConnectionPoolBehaviour","ConnectionPoolT","CountConnections","Dial","Disconnect","Disconnected","GetContact","IsConnected","LifecycleEvent","LifecycleEvents","Send","add_discovered_addresses","add_subscriber","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone_into","clone_into","connect","connect","connect","count_connections","count_connections","count_connections","debug","debug","debug","debug","deref","deref","deref","deref","deref_mut","deref_mut","deref_mut","deref_mut","dial","dial","dial","disconnect","disconnect","disconnect","drop","drop","drop","drop","fmt","fmt","fmt","fmt","from","from","from","from","get_contact","get_contact","get_contact","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","handle_established_inbound_connection","handle_established_outbound_connection","handle_pending_inbound_connection","handle_pending_outbound_connection","init","init","init","init","into","into","into","into","is_connected","is_connected","is_connected","lifecycle_events","lifecycle_events","new","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","on_connection_handler_event","on_swarm_event","outlet","poll","send","send","send","send_timeout","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","to_owned","to_owned","to_string","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","vzip","vzip","vzip","vzip","addr","contact","out","out","out","out","out","out","out","out","particle","peer_id","peer_id","peer_id","to"],"q":[[0,"connection_pool"],[125,"connection_pool::Command"],[140,"libp2p_identity::peer_id"],[141,"multiaddr"],[142,"alloc::vec"],[143,"tokio::sync::mpsc::unbounded"],[144,"particle_protocol::contact"],[145,"futures_core::future"],[146,"tokio::sync::oneshot"],[147,"core::fmt"],[148,"core::fmt"],[149,"core::option"],[150,"core::fmt"],[151,"std::io::error"],[152,"libp2p_swarm::connection"],[153,"libp2p_swarm"],[154,"libp2p_swarm"],[155,"futures_core::stream"],[156,"particle_protocol::libp2p_protocol::upgrade"],[157,"peer_metrics::connection_pool"],[158,"particle_protocol::particle"],[159,"tokio::sync::mpsc::bounded"],[160,"system_interface::fs::fd_flags"],[161,"libp2p_swarm"],[162,"core::task::wake"],[163,"particle_protocol::libp2p_protocol::message"],[164,"libp2p_swarm::behaviour"],[165,"particle_protocol::libp2p_protocol::message"],[166,"core::any"]],"d":["","","","","","","","","","","","","","","","","Subscribes given channel for all LifecycleEvents","","","","","","","","","","","","","","Connect to the contact by all of its known addresses and …","","","Returns number of connected contacts","","","","","","","","","","","","","","","Dial address, and send contact back on success None means …","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","Returns contact for a given peer if it is known","","","","","","","","","","","","","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","Returns whether given peer is connected or not","","","","","","","","","","","","","","Sends a particle to a connected contact. Returns whether …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""],"i":[0,18,6,0,0,0,18,18,18,6,18,18,0,18,18,1,1,1,18,8,6,1,18,8,6,8,6,8,6,43,1,8,43,1,8,1,18,8,6,1,18,8,6,1,18,8,6,43,1,8,43,1,8,1,18,8,6,18,8,6,6,1,18,8,6,43,1,8,1,18,8,6,1,1,1,1,1,18,8,6,1,18,8,6,43,1,8,43,8,1,1,18,8,6,1,1,8,1,43,1,8,8,1,18,8,6,8,6,6,1,18,8,6,1,18,8,6,1,18,8,6,1,18,8,6,44,45,45,46,44,47,48,49,50,51,46,47,48,49,46],"f":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[1,2,[4,[3]]],5],[[1,[7,[6]]],5],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[8,8],[6,6],[[-1,-2],5,[],[]],[[-1,-2],5,[],[]],[[-1,9],[[11,[10]]],[]],[[1,9,[12,[10]]],5],[[8,9],[[11,[10]]]],[-1,[[11,[13]]],[]],[[1,[12,[13]]],5],[8,[[11,[13]]]],[14,[[16,[5,15]]]],[14,[[16,[5,15]]]],[14,[[16,[5,15]]]],[14,[[16,[5,15]]]],[13,-1,[]],[13,-1,[]],[13,-1,[]],[13,-1,[]],[13,-1,[]],[13,-1,[]],[13,-1,[]],[13,-1,[]],[[-1,3],[[11,[[17,[9]]]]],[]],[[1,3,[12,[[17,[9]]]]],5],[[8,3],[[11,[[17,[9]]]]]],[[-1,2],[[11,[10]]],[]],[[1,2,[12,[10]]],5],[[8,2],[[11,[10]]]],[13,5],[13,5],[13,5],[13,5],[[18,14],19],[[8,14],19],[[6,14],19],[[6,14],19],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[[-1,2],[[11,[[17,[9]]]]],[]],[[1,2,[12,[[17,[9]]]]],5],[[8,2],[[11,[[17,[9]]]]]],[-1,[[16,[20,21]]],[]],[-1,[[16,[20,21]]],[]],[-1,[[16,[20,21]]],[]],[-1,[[16,[20,21]]],[]],[[1,22,2,3,3],[[16,[[23,[1]],24]]]],[[1,22,2,3,25],[[16,[[23,[1]],24]]]],[[1,22,3,3],[[16,[5,24]]]],[[1,22,[17,[2]],[26,[3]],25],[[16,[[4,[3]],24]]]],[[],13],[[],13],[[],13],[[],13],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[[-1,2],[[11,[10]]],[]],[[1,2,[12,[10]]],5],[[8,2],[[11,[10]]]],[-1,[[27,[6]]],[]],[8,[[27,[6]]]],[[13,28,2,[17,[29]]],[[5,[1,[31,[30]],8]]]],[[-1,20],[[16,[[32,[-2]],21]]],[],33],[[-1,20],[[16,[[32,[-2]],21]]],[],33],[[-1,20],[[16,[[32,[-2]],21]]],[],33],[[-1,20],[[16,[[32,[-2]],21]]],[],33],[[1,2,22,[34,[1]]],5],[[1,35],5],0,[[1,36],[[39,[[38,[5,37]]]]]],[[-1,9,30],[[11,[40]]],[]],[[1,9,30,[12,[40]]],5],[[8,9,30],[[11,[40]]]],0,[[-1,[32,[-2]]],[[16,[5,21]]],[],33],[[-1,[32,[-2]]],[[16,[5,21]]],[],33],[[-1,[32,[-2]]],[[16,[5,21]]],[],33],[[-1,[32,[-2]]],[[16,[5,21]]],[],33],[-1,-2,[],[]],[-1,-2,[],[]],[-1,41,[]],[-1,[[16,[-2]]],[],[]],[-1,[[16,[-2]]],[],[]],[-1,[[16,[-2]]],[],[]],[-1,[[16,[-2]]],[],[]],[-1,[[16,[-2]]],[],[]],[-1,[[16,[-2]]],[],[]],[-1,[[16,[-2]]],[],[]],[-1,[[16,[-2]]],[],[]],[-1,42,[]],[-1,42,[]],[-1,42,[]],[-1,42,[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"c":[],"p":[[3,"ConnectionPoolBehaviour",0],[3,"PeerId",140],[3,"Multiaddr",141],[3,"Vec",142],[15,"tuple"],[4,"LifecycleEvent",0],[3,"UnboundedSender",143],[3,"ConnectionPoolApi",0],[3,"Contact",144],[15,"bool"],[6,"BoxFuture",145],[3,"Sender",146],[15,"usize"],[3,"Formatter",147],[3,"Error",147],[4,"Result",148],[4,"Option",149],[4,"Command",0],[6,"Result",147],[3,"FdFlags",150],[3,"Error",151],[3,"ConnectionId",152],[6,"THandler",153],[3,"ConnectionDenied",153],[4,"Endpoint",154],[15,"slice"],[6,"BoxStream",155],[3,"ProtocolConfig",156],[3,"ConnectionPoolMetrics",157],[3,"ExtendedParticle",158],[3,"Receiver",159],[3,"SetFdFlags",150],[8,"AsFilelike",160],[6,"THandlerOutEvent",153],[4,"FromSwarm",161],[3,"Context",162],[4,"HandlerMessage",163],[4,"ToSwarm",161],[4,"Poll",164],[4,"SendStatus",163],[3,"String",165],[3,"TypeId",166],[8,"ConnectionPoolT",0],[13,"Dial",125],[13,"Connect",125],[13,"Send",125],[13,"Disconnect",125],[13,"IsConnected",125],[13,"GetContact",125],[13,"CountConnections",125],[13,"LifecycleEvents",125]],"b":[[59,"impl-Debug-for-LifecycleEvent"],[60,"impl-Display-for-LifecycleEvent"]]},\ +"control_macro":{"doc":"","t":"OOOO","n":["get_return","measure","ok_get","unwrap_return"],"q":[[0,"control_macro"]],"d":["Retrieves value from Some, returns on None","","Takes option as an argument, unwraps if Some, exit …","Retrieves value from Some, returns on None"],"i":[0,0,0,0],"f":[0,0,0,0],"c":[],"p":[],"b":[]},\ +"core_distributor":{"doc":"","t":"EDIDDGDDDNNIKLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLALLLLLLLLLLLLLLLALLLLLLLLLLLLLLLLLLLLLKLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLKKKLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLALLLLLLLDLLLLLLLLLLLLLLLLLENNENDNNNNNENNENNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMMMMMMMMMMMMMMMDDNDNDELLLLLLLLLLLLLLLLLLMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMLMMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL","n":["AcquireStrategy","CUID","CoreDistributor","CoreRange","LogicalCoreId","Map","PersistenceTask","PersistentCoreDistributor","PhysicalCoreId","RoundRobin","Strict","ThreadPinner","acquire_worker_cores","acquire_worker_cores","as_ref","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","cmp","cmp","cmp","compare","compare","compare","default","default","deserialize","deserialize","deserialize","deserialize","dummy","encode_hex","encode_hex_upper","eq","eq","eq","eq","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","errors","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from_hex","from_path","from_str","from_str","get_system_cpu_assignment","get_system_cpu_assignment","hash","hash","hash","into","into","into","into","into","into","into","into_any","into_any","into_any","into_any","into_any","into_any","into_any","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","is_subset","new","new","new","partial_cmp","partial_cmp","partial_cmp","pin_current_thread_to","pin_current_thread_to_cpuset","release_worker_cores","release_worker_cores","run","serialize","serialize","serialize","serialize","to_owned","to_owned","to_owned","to_owned","to_string","to_string","to_string","to_string","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_name","type_name","type_name","type_name","type_name","type_name","type_name","types","vzip","vzip","vzip","vzip","vzip","vzip","vzip","DummyCoreDistibutor","acquire_worker_cores","borrow","borrow_mut","default","from","get_system_cpu_assignment","into","into_any","into_any_arc","into_any_rc","new","release_worker_cores","try_from","try_into","type_id","type_name","vzip","AcquireError","CollectCoresData","CreateCoreDistributor","CreateError","CreateTopology","CurrentAssignment","DecodeError","DeserializationError","IllegalSystemCoreCount","IoError","IoError","LoadingError","NotEnoughCores","NotFoundAvailableCores","PersistError","PersistError","SerializationError","WrongCoreRange","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","eq","eq","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","from","from","into","into","into","into","into","into_any","into_any","into_any","into_any","into_any","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","new","source","source","to_string","to_string","to_string","to_string","to_string","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_name","type_name","type_name","type_name","type_name","vzip","vzip","vzip","vzip","vzip","acquire_request","available","current_assignment","required","available","core_range","err","err","required","err","err","err","err","err","err","err","AcquireRequest","Assignment","CapacityCommitment","Cores","Deal","SystemAssignment","WorkType","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","cuid_cores","deserialize","eq","eq","eq","eq","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","hash","into","into","into","into","into","into_any","into_any","into_any","into_any","into_any","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","logical_core_ids","logical_core_ids","logical_core_ids","new","physical_core_id","physical_core_ids","pin_current_thread_with","serialize","to_owned","to_owned","to_owned","to_owned","to_string","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_name","type_name","type_name","type_name","type_name","vzip","vzip","vzip","vzip","vzip"],"q":[[0,"core_distributor"],[181,"core_distributor::dummy"],[199,"core_distributor::errors"],[304,"core_distributor::errors::AcquireError"],[308,"core_distributor::errors::CreateError"],[313,"core_distributor::errors::LoadingError"],[318,"core_distributor::errors::PersistError"],[320,"core_distributor::types"],[429,"core::result"],[430,"core::cmp"],[431,"serde::de"],[432,"core::iter::traits::collect"],[433,"core::fmt"],[434,"core::fmt"],[435,"std::path"],[436,"cpu_utils::cpu_topology"],[437,"alloc::sync"],[438,"core::hash"],[439,"alloc::boxed"],[440,"core::any"],[441,"alloc::rc"],[442,"nonempty"],[443,"core::option"],[444,"serde::ser"],[445,"alloc::string"],[446,"core::any"],[447,"std::io::error"],[448,"core::str::error"],[449,"toml::ser"],[450,"alloc::vec"],[451,"core::error"]],"d":["","","","","An opaque type that represents a CPU logical core.","","","PersistentCoreDistributor is a CPU core distributor …","An opaque type that represents a CPU physical core.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","Returns the argument unchanged.","","Returns the argument unchanged.","","Loads the state from file_name if exists. If not creates a …","Parse CoreRange from string like “1,2-30,31”","","","","","","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""],"i":[0,0,0,0,0,0,0,0,0,26,26,0,55,5,6,5,29,26,9,10,11,6,5,29,26,9,10,11,6,9,10,11,6,9,10,11,6,10,11,6,10,11,6,9,6,9,10,11,6,0,6,6,9,10,11,6,10,10,10,11,11,11,6,6,6,0,9,9,10,10,11,11,6,6,5,29,26,9,10,10,11,11,6,6,5,9,6,55,5,10,11,6,5,29,26,9,10,11,6,5,29,26,9,10,11,6,5,29,26,9,10,11,6,5,29,26,9,10,11,6,9,10,11,6,10,11,6,54,54,55,5,29,9,10,11,6,9,10,11,6,9,10,11,6,5,29,26,9,9,10,11,6,5,29,26,9,10,11,6,5,29,26,9,10,11,6,5,29,26,9,10,11,6,0,5,29,26,9,10,11,6,0,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,0,44,30,0,44,0,30,30,44,30,45,0,44,3,0,30,45,44,44,30,45,43,3,44,30,45,43,3,43,3,44,44,30,30,45,45,43,43,3,3,44,30,30,30,30,30,30,45,45,45,43,3,44,30,45,43,3,44,30,45,43,3,44,30,45,43,3,44,30,45,43,3,43,30,45,44,30,45,43,3,44,30,45,43,3,44,30,45,43,3,44,30,45,43,3,44,30,45,43,3,44,30,45,43,3,56,56,56,56,57,58,59,60,57,61,62,63,64,65,66,67,0,0,52,0,52,0,0,32,52,1,53,2,32,52,1,53,2,52,1,53,2,52,1,53,2,2,52,52,1,53,2,52,52,52,53,53,53,2,2,2,52,1,1,53,2,32,52,1,53,2,52,32,52,1,53,2,32,52,1,53,2,32,52,1,53,2,32,52,1,53,2,2,32,53,1,53,32,2,52,52,1,53,2,1,32,52,1,53,2,32,52,1,53,2,32,52,1,53,2,32,52,1,53,2,32,52,1,53,2],"f":[0,0,0,0,0,0,0,0,0,0,0,0,[[-1,1],[[4,[2,3]]],[]],[[5,1],[[4,[2,3]]]],[6,[[8,[7]]]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[9,9],[10,10],[11,11],[6,6],[[-1,-2],12,[],[]],[[-1,-2],12,[],[]],[[-1,-2],12,[],[]],[[-1,-2],12,[],[]],[[10,10],13],[[11,11],13],[[6,6],13],[[-1,-2],13,[],[]],[[-1,-2],13,[],[]],[[-1,-2],13,[],[]],[[],9],[[],6],[-1,[[4,[9]]],14],[-1,[[4,[10]]],14],[-1,[[4,[11]]],14],[-1,[[4,[6]]],14],0,[6,-1,[[16,[15]]]],[6,-1,[[16,[15]]]],[[9,9],17],[[10,10],17],[[11,11],17],[[6,6],17],[[-1,-2],17,[],[]],[[-1,-2],17,[],[]],[[-1,-2],17,[],[]],[[-1,-2],17,[],[]],[[-1,-2],17,[],[]],[[-1,-2],17,[],[]],[[-1,-2],17,[],[]],[[-1,-2],17,[],[]],[[-1,-2],17,[],[]],0,[[9,18],19],[[9,18],19],[[10,18],[[4,[12,20]]]],[[10,18],[[4,[12,20]]]],[[11,18],[[4,[12,20]]]],[[11,18],[[4,[12,20]]]],[[6,18],[[4,[12,20]]]],[[6,18],[[4,[12,20]]]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[21,10],[-1,-1,[]],[21,11],[-1,-1,[]],[-1,[[4,[6]]],[[23,[[22,[7]]]]]],[[24,25,9,26,27],[[4,[[12,[[28,[5]],29]],30]]]],[31,[[4,[9]]]],[31,[[4,[6]]]],[-1,32,[]],[5,32],[[10,-1],12,33],[[11,-1],12,33],[[6,-1],12,33],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[[[34,[-1]]],[[34,[35]]],[]],[[[34,[-1]]],[[34,[35]]],[]],[[[34,[-1]]],[[34,[35]]],[]],[[[34,[-1]]],[[34,[35]]],[]],[[[34,[-1]]],[[34,[35]]],[]],[[[34,[-1]]],[[34,[35]]],[]],[[[34,[-1]]],[[34,[35]]],[]],[[[28,[-1]]],[[28,[35]]],[]],[[[28,[-1]]],[[28,[35]]],[]],[[[28,[-1]]],[[28,[35]]],[]],[[[28,[-1]]],[[28,[35]]],[]],[[[28,[-1]]],[[28,[35]]],[]],[[[28,[-1]]],[[28,[35]]],[]],[[[28,[-1]]],[[28,[35]]],[]],[[[36,[-1]]],[[36,[35]]],[]],[[[36,[-1]]],[[36,[35]]],[]],[[[36,[-1]]],[[36,[35]]],[]],[[[36,[-1]]],[[36,[35]]],[]],[[[36,[-1]]],[[36,[35]]],[]],[[[36,[-1]]],[[36,[35]]],[]],[[[36,[-1]]],[[36,[35]]],[]],[[9,[37,[10]]],17],[21,10],[21,11],[[[8,[7]]],6],[[10,10],[[38,[13]]]],[[11,11],[[38,[13]]]],[[6,6],[[38,[13]]]],[[-1,11],17,[]],[[-1,[22,[11]]],17,[]],[[-1,[22,[6]]],12,[]],[[5,[22,[6]]],12],[29,12],[[9,-1],4,39],[[10,-1],4,39],[[11,-1],4,39],[[6,-1],4,39],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,40,[]],[-1,40,[]],[-1,40,[]],[-1,40,[]],[-1,[[4,[-2]]],[],[]],[-1,[[4,[-2]]],[],[]],[-1,[[4,[-2]]],[],[]],[-1,[[4,[-2]]],[],[]],[[[22,[25]]],[[4,[9]]]],[-1,[[4,[-2]]],[],[]],[-1,[[4,[-2]]],[],[]],[-1,[[4,[-2]]],[],[]],[-1,[[4,[-2]]],[],[]],[-1,[[4,[-2]]],[],[]],[-1,[[4,[-2]]],[],[]],[-1,[[4,[-2]]],[],[]],[-1,[[4,[-2]]],[],[]],[-1,[[4,[-2]]],[],[]],[-1,[[4,[-2]]],[],[]],[-1,41,[]],[-1,41,[]],[-1,41,[]],[-1,41,[]],[-1,41,[]],[-1,41,[]],[-1,41,[]],[-1,31,[]],[-1,31,[]],[-1,31,[]],[-1,31,[]],[-1,31,[]],[-1,31,[]],[-1,31,[]],0,[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],0,[[42,1],[[4,[2,3]]]],[-1,-2,[],[]],[-1,-2,[],[]],[[],42],[-1,-1,[]],[42,32],[-1,-2,[],[]],[[[34,[-1]]],[[34,[35]]],[]],[[[28,[-1]]],[[28,[35]]],[]],[[[36,[-1]]],[[36,[35]]],[]],[[],42],[[42,[22,[6]]],12],[-1,[[4,[-2]]],[],[]],[-1,[[4,[-2]]],[],[]],[-1,41,[]],[-1,31,[]],[-1,-2,[],[]],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[[43,43],17],[[3,3],17],[[44,18],19],[[44,18],19],[[30,18],19],[[30,18],19],[[45,18],19],[[45,18],19],[[43,18],19],[[43,18],19],[[3,18],19],[[3,18],19],[-1,-1,[]],[-1,-1,[]],[46,30],[47,30],[44,30],[48,30],[45,30],[49,45],[47,45],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[[[34,[-1]]],[[34,[35]]],[]],[[[34,[-1]]],[[34,[35]]],[]],[[[34,[-1]]],[[34,[35]]],[]],[[[34,[-1]]],[[34,[35]]],[]],[[[34,[-1]]],[[34,[35]]],[]],[[[28,[-1]]],[[28,[35]]],[]],[[[28,[-1]]],[[28,[35]]],[]],[[[28,[-1]]],[[28,[35]]],[]],[[[28,[-1]]],[[28,[35]]],[]],[[[28,[-1]]],[[28,[35]]],[]],[[[36,[-1]]],[[36,[35]]],[]],[[[36,[-1]]],[[36,[35]]],[]],[[[36,[-1]]],[[36,[35]]],[]],[[[36,[-1]]],[[36,[35]]],[]],[[[36,[-1]]],[[36,[35]]],[]],[[[50,[[12,[10,6]]]]],43],[30,[[38,[51]]]],[45,[[38,[51]]]],[-1,40,[]],[-1,40,[]],[-1,40,[]],[-1,40,[]],[-1,40,[]],[-1,[[4,[-2]]],[],[]],[-1,[[4,[-2]]],[],[]],[-1,[[4,[-2]]],[],[]],[-1,[[4,[-2]]],[],[]],[-1,[[4,[-2]]],[],[]],[-1,[[4,[-2]]],[],[]],[-1,[[4,[-2]]],[],[]],[-1,[[4,[-2]]],[],[]],[-1,[[4,[-2]]],[],[]],[-1,[[4,[-2]]],[],[]],[-1,41,[]],[-1,41,[]],[-1,41,[]],[-1,41,[]],[-1,41,[]],[-1,31,[]],[-1,31,[]],[-1,31,[]],[-1,31,[]],[-1,31,[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[52,52],[1,1],[53,53],[2,2],[[-1,-2],12,[],[]],[[-1,-2],12,[],[]],[[-1,-2],12,[],[]],[[-1,-2],12,[],[]],0,[-1,[[4,[52]]],14],[[52,52],17],[[1,1],17],[[53,53],17],[[2,2],17],[[-1,-2],17,[],[]],[[-1,-2],17,[],[]],[[-1,-2],17,[],[]],[[-1,-2],17,[],[]],[[-1,-2],17,[],[]],[[-1,-2],17,[],[]],[[-1,-2],17,[],[]],[[-1,-2],17,[],[]],[[-1,-2],17,[],[]],[[52,18],19],[[1,18],19],[[1,18],19],[[53,18],19],[[2,18],19],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[[52,-1],12,33],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[[[34,[-1]]],[[34,[35]]],[]],[[[34,[-1]]],[[34,[35]]],[]],[[[34,[-1]]],[[34,[35]]],[]],[[[34,[-1]]],[[34,[35]]],[]],[[[34,[-1]]],[[34,[35]]],[]],[[[28,[-1]]],[[28,[35]]],[]],[[[28,[-1]]],[[28,[35]]],[]],[[[28,[-1]]],[[28,[35]]],[]],[[[28,[-1]]],[[28,[35]]],[]],[[[28,[-1]]],[[28,[35]]],[]],[[[36,[-1]]],[[36,[35]]],[]],[[[36,[-1]]],[[36,[35]]],[]],[[[36,[-1]]],[[36,[35]]],[]],[[[36,[-1]]],[[36,[35]]],[]],[[[36,[-1]]],[[36,[35]]],[]],[2,[[50,[11]]]],0,0,[[[50,[6]],52],1],0,0,[[2,54],12],[[52,-1],4,39],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,40,[]],[-1,[[4,[-2]]],[],[]],[-1,[[4,[-2]]],[],[]],[-1,[[4,[-2]]],[],[]],[-1,[[4,[-2]]],[],[]],[-1,[[4,[-2]]],[],[]],[-1,[[4,[-2]]],[],[]],[-1,[[4,[-2]]],[],[]],[-1,[[4,[-2]]],[],[]],[-1,[[4,[-2]]],[],[]],[-1,[[4,[-2]]],[],[]],[-1,41,[]],[-1,41,[]],[-1,41,[]],[-1,41,[]],[-1,41,[]],[-1,31,[]],[-1,31,[]],[-1,31,[]],[-1,31,[]],[-1,31,[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]]],"c":[],"p":[[3,"AcquireRequest",320],[3,"Assignment",320],[4,"AcquireError",199],[4,"Result",429],[3,"PersistentCoreDistributor",0],[3,"CUID",0],[15,"u8"],[15,"array"],[3,"CoreRange",0],[3,"PhysicalCoreId",0],[3,"LogicalCoreId",0],[15,"tuple"],[4,"Ordering",430],[8,"Deserializer",431],[15,"char"],[8,"FromIterator",432],[15,"bool"],[3,"Formatter",433],[6,"Result",433],[3,"Error",433],[15,"u32"],[15,"slice"],[8,"AsRef",434],[3,"PathBuf",435],[15,"usize"],[4,"AcquireStrategy",0],[8,"CPUTopology",436],[3,"Arc",437],[3,"PersistenceTask",0],[4,"LoadingError",199],[15,"str"],[3,"SystemAssignment",320],[8,"Hasher",438],[3,"Box",439],[8,"Any",440],[3,"Rc",441],[3,"NonEmpty",442],[4,"Option",443],[8,"Serializer",444],[3,"String",445],[3,"TypeId",440],[3,"DummyCoreDistibutor",181],[3,"CurrentAssignment",199],[4,"CreateError",199],[4,"PersistError",199],[3,"Error",446],[3,"Error",447],[3,"Utf8Error",448],[3,"Error",449],[3,"Vec",450],[8,"Error",451],[4,"WorkType",320],[3,"Cores",320],[8,"ThreadPinner",0],[8,"CoreDistributor",0],[13,"NotFoundAvailableCores",304],[13,"NotEnoughCores",308],[13,"WrongCoreRange",308],[13,"CreateTopology",308],[13,"CollectCoresData",308],[13,"CreateCoreDistributor",313],[13,"IoError",313],[13,"DecodeError",313],[13,"DeserializationError",313],[13,"PersistError",313],[13,"IoError",318],[13,"SerializationError",318]],"b":[[66,"impl-Display-for-CoreRange"],[67,"impl-Debug-for-CoreRange"],[68,"impl-Display-for-PhysicalCoreId"],[69,"impl-Debug-for-PhysicalCoreId"],[70,"impl-Debug-for-LogicalCoreId"],[71,"impl-Display-for-LogicalCoreId"],[72,"impl-Debug-for-CUID"],[73,"impl-Display-for-CUID"],[229,"impl-Display-for-CreateError"],[230,"impl-Debug-for-CreateError"],[231,"impl-Display-for-LoadingError"],[232,"impl-Debug-for-LoadingError"],[233,"impl-Display-for-PersistError"],[234,"impl-Debug-for-PersistError"],[235,"impl-Debug-for-CurrentAssignment"],[236,"impl-Display-for-CurrentAssignment"],[237,"impl-Display-for-AcquireError"],[238,"impl-Debug-for-AcquireError"],[241,"impl-From%3CError%3E-for-LoadingError"],[242,"impl-From%3CError%3E-for-LoadingError"],[243,"impl-From%3CCreateError%3E-for-LoadingError"],[244,"impl-From%3CUtf8Error%3E-for-LoadingError"],[245,"impl-From%3CPersistError%3E-for-LoadingError"],[246,"impl-From%3CError%3E-for-PersistError"],[247,"impl-From%3CError%3E-for-PersistError"],[361,"impl-Display-for-AcquireRequest"],[362,"impl-Debug-for-AcquireRequest"]]},\ +"created_swarm":{"doc":"","t":"DDDDNNEDDNNDDFMMFMLLLLLLLLLMLLLLLLLLLLLLLLLLLLLMMMMMMLLLLLLLLLLLLLLLMMMFFLLLLLLLLLMMLLLLLLLLLLLLLLLLLLLMLLLLLLLLLMMMCCCLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMLLLLLLLLLLMMMMLLLLLLLLLMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMMFFFFFFMMMMMMMMLLLLLLLLLLLLLLLMMMMMLLLLLLLLLLMLMLLLLLLLLLMMCAMMMMMLLLLLLLLLMMLLLLLLLLLLLLLLLLLLLMLLLLLLLLLLLLLLLLLLLLLLLLLLLMMMNDDNDNDEDNLMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMLLLLLLMMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMLLLLLLMMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMLLLLLLLLLLLLMMMMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMM","n":["Args","BaseVmConfig","ChainConfig","CreatedSwarm","Empty","Err","FunctionOutcome","JError","NetworkKey","NotDefined","Ok","ParticleParams","SwarmConfig","add_print","allowed_binaries","allowed_effectors","aqua_vm_config","aquamarine_api","as_","as_","as_","as_","as_","as_","as_","as_","as_","bootstraps","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","branch","builtins_dir","builtins_keypair","cancellation_token","cc_events_dir","chain_config","chain_listener_config","clone","clone","clone","clone","clone","clone","clone","clone_from","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","config","connectivity","cpu_cores_count","create_swarm","create_swarm_with_runtime","debug","debug","debug","debug","debug","debug","debug","debug","debug","default_base_fee","default_priority_fee","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deserialize","diamond_contract_address","drop","drop","drop","drop","drop","drop","drop","drop","drop","enabled_system_services","exit_outlet","extend_system_services","fluence_app_service","fluence_keypair","fluence_spell_dtos","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from_eyre","from_output","from_ref","from_ref","from_ref","from_ref","from_ref","from_ref","from_ref","from_ref","from_ref","from_ref","from_ref","from_ref","from_ref","from_ref","from_residual","from_residual","function_args","function_name","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_spell_id","http_endpoint","http_listen_addr","http_port","id","init","init","init","init","init","init","init","init","init","init_peer_id","into","into","into","into","into","into","into","into","into","into_any","into_any","into_any","into_any","into_any","into_any","into_any","into_any","into_any","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_request","into_request","into_request","into_request","into_request","into_request","into_request","into_request","into_request","is_defined","is_spell_particle","keypair","listen_on","listen_on","make_swarms","make_swarms_with","make_swarms_with_cfg","make_swarms_with_keypair","make_swarms_with_mocked_vm","make_swarms_with_transport_and_mocked_vm","management_keypair","management_keypair","manager","metrics_enabled","multiaddr","network_id","network_key","network_key","new","new","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","next","next_opt","not_err","or_else","override_system_services_config","peer_id","peer_id","peer_scope","pool_size","random","references","references","references","references","references","references","references","references","references","script","serialize","service_id","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","signature","spell_base_dir","system_services","system_services_config","tetraplets","timestamp","tmp_dir","tmp_dir","tmp_dir","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_particle_parameters","to_string","token","transport","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","ttl","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_name","type_name","type_name","type_name","type_name","type_name","type_name","type_name","type_name","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","wallet_key","args","params","AquaIpfs","AquaIpfsConfig","ConnectorConfig","Decider","DeciderConfig","Registry","RegistryConfig","ServiceKey","SystemServicesConfig","TrustGraph","all_values","aqua_ipfs","as_","as_","as_","as_","as_","as_","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","connector","curl_binary_path","debug","debug","debug","debug","debug","debug","decider","decider_period_sec","default","default","default","default","default","deref","deref","deref","deref","deref","deref","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deserialize","deserialize","deserialize","deserialize","deserialize","deserialize","drop","drop","drop","drop","drop","drop","enable","eq","equivalent","equivalent","equivalent","equivalent","equivalent","expired_period_sec","external_api_multiaddr","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from_ref","from_ref","from_ref","from_ref","from_ref","from_ref","from_ref","from_ref","from_ref","from_ref","from_ref","from_ref","from_string","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_hash","hash","init","init","init","init","init","init","into","into","into","into","into","into","into_any","into_any","into_any","into_any","into_any","into_any","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_request","into_request","into_request","into_request","into_request","into_request","ipfs_binary_path","local_api_multiaddr","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","references","references","references","references","references","references","registry","registry_period_sec","renew_period_sec","replicate_period_sec","serialize","serialize","serialize","serialize","serialize","serialize","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_string","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_name","type_name","type_name","type_name","type_name","type_name","vzip","vzip","vzip","vzip","vzip","vzip","worker_ipfs_multiaddr","worker_period_sec"],"q":[[0,"created_swarm"],[360,"created_swarm::FunctionOutcome"],[362,"created_swarm::system_services_config"],[591,"core::iter::traits::iterator"],[592,"bnum::cast"],[593,"core::ops::control_flow"],[594,"particle_protocol::particle"],[595,"types::peer_scope"],[596,"alloc::string"],[597,"libp2p_identity::peer_id"],[598,"aquamarine"],[599,"nox::node"],[600,"alloc::boxed"],[601,"fluence_keypair::key_pair"],[602,"server_config::resolved_config"],[603,"tracing::span"],[604,"core_distributor::persistence"],[605,"core::ops::function"],[606,"aquamarine::aqua_runtime"],[607,"core::fmt"],[608,"core::fmt"],[609,"serde::de"],[610,"core::fmt"],[611,"eyre"],[612,"core::convert"],[613,"core::convert"],[614,"std::io::error"],[615,"core::option"],[616,"core::any"],[617,"alloc::sync"],[618,"alloc::rc"],[619,"tonic::request"],[620,"alloc::vec"],[621,"core::ops::function"],[622,"fluence_libp2p::transport"],[623,"core::convert"],[624,"system_interface::fs::fd_flags"],[625,"particle_args::args_error"],[626,"serde::de"],[627,"anyhow"],[628,"std::io"],[629,"cid::cid"],[630,"core::iter::traits::collect"],[631,"serde::ser"],[632,"marine_call_parameters"],[633,"avm_interface::call_request_parameters"],[634,"core::any"],[635,"core::marker"],[636,"core::hash"]],"d":["Arguments passed by VM to host on call_service","","","","","","","An error that can be created from any other error …","","","","Lightweight, static version of the [Particle] structure It …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","If none, comes from the chain","If none, comes from the chain","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","","","Returns the argument unchanged.","","Returns the argument unchanged.","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns false if variant is [NotDefined]","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Retrieves next json value from iterator, parse it to T …","Retrieves a json value from iterator if it’s not empty, …","Returns false if variant is Err","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Unix timestamp in milliseconds","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","TTL in milliseconds","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","","","","","","","","","","","","","","","","","","","","","","","","","","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""],"i":[0,0,0,0,5,5,0,0,0,5,5,0,0,0,11,11,0,31,7,8,5,3,9,31,10,11,12,11,7,8,5,3,9,31,10,11,12,7,8,5,3,9,31,10,11,12,5,11,11,31,11,11,11,7,8,5,9,10,11,12,9,7,8,5,9,10,11,12,31,31,11,0,0,7,8,5,3,9,31,10,11,12,12,12,7,8,5,3,9,31,10,11,12,7,8,5,3,9,31,10,11,12,12,12,7,8,5,3,9,31,10,11,12,11,31,11,0,0,0,7,8,8,5,9,31,10,11,12,7,8,8,8,5,5,5,3,9,31,10,10,11,12,8,5,7,7,8,8,5,5,9,9,10,10,11,11,12,12,5,5,7,7,7,8,5,3,9,31,10,11,12,9,12,31,11,9,7,8,5,3,9,31,10,11,12,9,7,8,5,3,9,31,10,11,12,7,8,5,3,9,31,10,11,12,7,8,5,3,9,31,10,11,12,7,8,5,3,9,31,10,11,12,7,8,5,3,9,31,10,11,12,5,9,11,3,11,0,0,0,0,0,0,31,11,3,11,31,12,31,11,8,11,7,8,5,3,9,31,10,11,12,7,7,5,5,11,3,31,9,11,10,7,8,5,3,9,31,10,11,12,9,12,7,7,8,5,3,9,31,10,11,12,9,11,0,0,7,9,3,31,11,7,8,5,9,10,11,12,9,8,9,11,7,7,8,5,3,9,31,10,11,12,7,8,5,3,9,31,10,11,12,9,7,8,5,3,9,31,10,11,12,7,8,5,3,9,31,10,11,12,7,8,5,3,9,31,10,11,12,12,80,80,69,0,0,69,0,69,0,0,0,69,69,70,69,70,71,72,73,74,69,70,71,72,73,74,69,70,71,72,73,74,69,70,71,72,73,74,69,70,71,72,73,74,70,72,69,70,71,72,73,74,70,73,70,71,72,73,74,69,70,71,72,73,74,69,70,71,72,73,74,69,70,71,72,73,74,69,70,71,72,73,74,70,69,69,69,69,69,69,74,71,69,69,70,71,72,73,74,69,70,71,72,73,74,69,69,70,70,71,71,72,72,73,73,74,74,69,69,70,71,72,73,74,69,69,69,70,71,72,73,74,69,70,71,72,73,74,69,70,71,72,73,74,69,70,71,72,73,74,69,70,71,72,73,74,69,70,71,72,73,74,71,71,69,70,71,72,73,74,69,70,71,72,73,74,70,74,74,74,69,70,71,72,73,74,69,70,71,72,73,74,69,70,71,72,73,74,69,69,70,71,72,73,74,69,70,71,72,73,74,69,70,71,72,73,74,69,70,71,72,73,74,69,70,71,72,73,74,73,73],"f":[0,0,0,0,0,0,0,0,0,0,0,0,0,[-1,1,2],0,0,[3],0,[-1,-3,[],[],[[4,[-2]]]],[-1,-3,[],[],[[4,[-2]]]],[-1,-3,[],[],[[4,[-2]]]],[-1,-3,[],[],[[4,[-2]]]],[-1,-3,[],[],[[4,[-2]]]],[-1,-3,[],[],[[4,[-2]]]],[-1,-3,[],[],[[4,[-2]]]],[-1,-3,[],[],[[4,[-2]]]],[-1,-3,[],[],[[4,[-2]]]],0,[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[5,6],0,0,0,0,0,0,[7,7],[8,8],[5,5],[9,9],[10,10],[11,11],[12,12],[[13,14,15],9],[[-1,-2],1,[],[]],[[-1,-2],1,[],[]],[[-1,-2],1,[],[]],[[-1,-2],1,[],[]],[[-1,-2],1,[],[]],[[-1,-2],1,[],[]],[[-1,-2],1,[],[]],0,0,0,[11,[[1,[16,[19,[[18,[17]]]],20,11,21,22,23]]]],[[11,-1],[[1,[16,[19,[[18,[-2]]]],20,11,21,22,23]]],24,25],[26,[[28,[1,27]]]],[26,[[28,[1,27]]]],[26,[[28,[1,27]]]],[26,[[28,[1,27]]]],[26,[[28,[1,27]]]],[26,[[28,[1,27]]]],[26,[[28,[1,27]]]],[26,[[28,[1,27]]]],[26,[[28,[1,27]]]],0,0,[29,-1,[]],[29,-1,[]],[29,-1,[]],[29,-1,[]],[29,-1,[]],[29,-1,[]],[29,-1,[]],[29,-1,[]],[29,-1,[]],[29,-1,[]],[29,-1,[]],[29,-1,[]],[29,-1,[]],[29,-1,[]],[29,-1,[]],[29,-1,[]],[29,-1,[]],[29,-1,[]],[-1,[[28,[12]]],30],0,[29,1],[29,1],[29,1],[29,1],[29,1],[29,1],[29,1],[29,1],[29,1],0,0,0,0,0,0,[[7,26],[[28,[1,27]]]],[[8,26],[[28,[1,27]]]],[[8,26],[[28,[1,27]]]],[[5,26],[[28,[1,27]]]],[[9,26],[[28,[1,27]]]],[[31,26],32],[[10,26],32],[[11,26],32],[[12,26],[[28,[1,27]]]],[-1,-1,[]],[-1,8,33],[34,-1,[]],[-1,-1,[]],[34,-1,[]],[-1,-1,[]],[-1,5,33],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[[[36,[35]]],10],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[37,8],[[],5],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[[[28,[38,-1]]],5,[[39,[8]]]],[8,5],0,0,[-1,[[28,[40,41]]],[]],[-1,[[28,[40,41]]],[]],[-1,[[28,[40,41]]],[]],[-1,[[28,[40,41]]],[]],[-1,[[28,[40,41]]],[]],[-1,[[28,[40,41]]],[]],[-1,[[28,[40,41]]],[]],[-1,[[28,[40,41]]],[]],[-1,[[28,[40,41]]],[]],[42,[[43,[15]]]],0,0,0,0,[[],29],[[],29],[[],29],[[],29],[[],29],[[],29],[[],29],[[],29],[[],29],0,[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[[[19,[-1]]],[[19,[44]]],[]],[[[19,[-1]]],[[19,[44]]],[]],[[[19,[-1]]],[[19,[44]]],[]],[[[19,[-1]]],[[19,[44]]],[]],[[[19,[-1]]],[[19,[44]]],[]],[[[19,[-1]]],[[19,[44]]],[]],[[[19,[-1]]],[[19,[44]]],[]],[[[19,[-1]]],[[19,[44]]],[]],[[[19,[-1]]],[[19,[44]]],[]],[[[45,[-1]]],[[45,[44]]],[]],[[[45,[-1]]],[[45,[44]]],[]],[[[45,[-1]]],[[45,[44]]],[]],[[[45,[-1]]],[[45,[44]]],[]],[[[45,[-1]]],[[45,[44]]],[]],[[[45,[-1]]],[[45,[44]]],[]],[[[45,[-1]]],[[45,[44]]],[]],[[[45,[-1]]],[[45,[44]]],[]],[[[45,[-1]]],[[45,[44]]],[]],[[[46,[-1]]],[[46,[44]]],[]],[[[46,[-1]]],[[46,[44]]],[]],[[[46,[-1]]],[[46,[44]]],[]],[[[46,[-1]]],[[46,[44]]],[]],[[[46,[-1]]],[[46,[44]]],[]],[[[46,[-1]]],[[46,[44]]],[]],[[[46,[-1]]],[[46,[44]]],[]],[[[46,[-1]]],[[46,[44]]],[]],[[[46,[-1]]],[[46,[44]]],[]],[-1,[[47,[-2]]],[],[]],[-1,[[47,[-2]]],[],[]],[-1,[[47,[-2]]],[],[]],[-1,[[47,[-2]]],[],[]],[-1,[[47,[-2]]],[],[]],[-1,[[47,[-2]]],[],[]],[-1,[[47,[-2]]],[],[]],[-1,[[47,[-2]]],[],[]],[-1,[[47,[-2]]],[],[]],[5,48],[42,48],0,0,0,[29,[[49,[31]]]],[[29,-1,-2,-3,48],[[49,[31]]],50,50,50],[[29,-1],[[49,[31]]],50],[[29,20],[[49,[31]]]],[[29,-1,[43,[51]],-2],[[49,[31]]],50,50],[[29,52],[[49,[31]]]],0,0,0,0,0,0,0,0,[-1,8,[[53,[42]]]],[[[49,[54]],54,10],11],[[-1,40],[[28,[[55,[-2]],41]]],[],56],[[-1,40],[[28,[[55,[-2]],41]]],[],56],[[-1,40],[[28,[[55,[-2]],41]]],[],56],[[-1,40],[[28,[[55,[-2]],41]]],[],56],[[-1,40],[[28,[[55,[-2]],41]]],[],56],[[-1,40],[[28,[[55,[-2]],41]]],[],56],[[-1,40],[[28,[[55,[-2]],41]]],[],56],[[-1,40],[[28,[[55,[-2]],41]]],[],56],[[-1,40],[[28,[[55,[-2]],41]]],[],56],[[42,-1],[[28,[-2,57]]],2,58],[[42,-1],[[28,[[43,[-2]],57]]],2,58],[5,48],[[5,-1],5,59],0,0,0,0,0,[[],10],[[60,-1,-2],[[28,[1,61]]],62,[[64,[63]]]],[[60,-1,-2],[[28,[1,61]]],62,[[64,[63]]]],[[60,-1,-2],[[28,[1,61]]],62,[[64,[63]]]],[[60,-1,-2],[[28,[1,61]]],62,[[64,[63]]]],[[60,-1,-2],[[28,[1,61]]],62,[[64,[63]]]],[[60,-1,-2],[[28,[1,61]]],62,[[64,[63]]]],[[60,-1,-2],[[28,[1,61]]],62,[[64,[63]]]],[[60,-1,-2],[[28,[1,61]]],62,[[64,[63]]]],[[60,-1,-2],[[28,[1,61]]],62,[[64,[63]]]],0,[[12,-1],28,65],0,[[-1,[55,[-2]]],[[28,[1,41]]],[],56],[[-1,[55,[-2]]],[[28,[1,41]]],[],56],[[-1,[55,[-2]]],[[28,[1,41]]],[],56],[[-1,[55,[-2]]],[[28,[1,41]]],[],56],[[-1,[55,[-2]]],[[28,[1,41]]],[],56],[[-1,[55,[-2]]],[[28,[1,41]]],[],56],[[-1,[55,[-2]]],[[28,[1,41]]],[],56],[[-1,[55,[-2]]],[[28,[1,41]]],[],56],[[-1,[55,[-2]]],[[28,[1,41]]],[],56],0,0,0,0,0,0,0,0,0,[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[9,66],[-1,15,[]],0,0,[-1,[[28,[-2]]],[],[]],[67,[[28,[7]]]],[-1,[[28,[-2]]],[],[]],[-1,[[28,[-2]]],[],[]],[-1,[[28,[-2]]],[],[]],[-1,[[28,[-2]]],[],[]],[-1,[[28,[-2]]],[],[]],[-1,[[28,[-2]]],[],[]],[-1,[[28,[-2]]],[],[]],[-1,[[28,[-2]]],[],[]],[-1,[[28,[-2]]],[],[]],[-1,[[28,[-2]]],[],[]],[-1,[[28,[-2]]],[],[]],[-1,[[28,[-2]]],[],[]],[-1,[[28,[-2]]],[],[]],[-1,[[28,[-2]]],[],[]],[-1,[[28,[-2]]],[],[]],[-1,[[28,[-2]]],[],[]],[-1,[[28,[-2]]],[],[]],0,[-1,68,[]],[-1,68,[]],[-1,68,[]],[-1,68,[]],[-1,68,[]],[-1,68,[]],[-1,68,[]],[-1,68,[]],[-1,68,[]],[-1,42,[]],[-1,42,[]],[-1,42,[]],[-1,42,[]],[-1,42,[]],[-1,42,[]],[-1,42,[]],[-1,42,[]],[-1,42,[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],0,0,0,0,0,0,0,0,0,0,0,0,0,[[],[[49,[69]]]],0,[-1,-3,[],[],[[4,[-2]]]],[-1,-3,[],[],[[4,[-2]]]],[-1,-3,[],[],[[4,[-2]]]],[-1,-3,[],[],[[4,[-2]]]],[-1,-3,[],[],[[4,[-2]]]],[-1,-3,[],[],[[4,[-2]]]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[69,69],[70,70],[71,71],[72,72],[73,73],[74,74],[[-1,-2],1,[],[]],[[-1,-2],1,[],[]],[[-1,-2],1,[],[]],[[-1,-2],1,[],[]],[[-1,-2],1,[],[]],[[-1,-2],1,[],[]],0,0,[26,[[28,[1,27]]]],[26,[[28,[1,27]]]],[26,[[28,[1,27]]]],[26,[[28,[1,27]]]],[26,[[28,[1,27]]]],[26,[[28,[1,27]]]],0,0,[[],70],[[],71],[[],72],[[],73],[[],74],[29,-1,[]],[29,-1,[]],[29,-1,[]],[29,-1,[]],[29,-1,[]],[29,-1,[]],[29,-1,[]],[29,-1,[]],[29,-1,[]],[29,-1,[]],[29,-1,[]],[29,-1,[]],[-1,[[28,[69]]],30],[-1,[[28,[70]]],30],[-1,[[28,[71]]],30],[-1,[[28,[72]]],30],[-1,[[28,[73]]],30],[-1,[[28,[74]]],30],[29,1],[29,1],[29,1],[29,1],[29,1],[29,1],0,[[69,69],48],[[-1,-2],48,[],[]],[[-1,-2],48,[],[]],[[-1,-2],48,[],[]],[[-1,-2],48,[],[]],[[-1,-2],48,[],[]],0,0,[[69,26],[[28,[1,27]]]],[[69,26],[[28,[1,27]]]],[[70,26],[[28,[1,27]]]],[[71,26],[[28,[1,27]]]],[[72,26],[[28,[1,27]]]],[[73,26],[[28,[1,27]]]],[[74,26],[[28,[1,27]]]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[42,[[43,[69]]]],[-1,[[28,[40,41]]],[]],[-1,[[28,[40,41]]],[]],[-1,[[28,[40,41]]],[]],[-1,[[28,[40,41]]],[]],[-1,[[28,[40,41]]],[]],[-1,[[28,[40,41]]],[]],[[-1,-2],75,[76,77],78],[[69,-1],1,79],[[],29],[[],29],[[],29],[[],29],[[],29],[[],29],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[[[19,[-1]]],[[19,[44]]],[]],[[[19,[-1]]],[[19,[44]]],[]],[[[19,[-1]]],[[19,[44]]],[]],[[[19,[-1]]],[[19,[44]]],[]],[[[19,[-1]]],[[19,[44]]],[]],[[[19,[-1]]],[[19,[44]]],[]],[[[45,[-1]]],[[45,[44]]],[]],[[[45,[-1]]],[[45,[44]]],[]],[[[45,[-1]]],[[45,[44]]],[]],[[[45,[-1]]],[[45,[44]]],[]],[[[45,[-1]]],[[45,[44]]],[]],[[[45,[-1]]],[[45,[44]]],[]],[[[46,[-1]]],[[46,[44]]],[]],[[[46,[-1]]],[[46,[44]]],[]],[[[46,[-1]]],[[46,[44]]],[]],[[[46,[-1]]],[[46,[44]]],[]],[[[46,[-1]]],[[46,[44]]],[]],[[[46,[-1]]],[[46,[44]]],[]],[-1,[[47,[-2]]],[],[]],[-1,[[47,[-2]]],[],[]],[-1,[[47,[-2]]],[],[]],[-1,[[47,[-2]]],[],[]],[-1,[[47,[-2]]],[],[]],[-1,[[47,[-2]]],[],[]],0,0,[[-1,40],[[28,[[55,[-2]],41]]],[],56],[[-1,40],[[28,[[55,[-2]],41]]],[],56],[[-1,40],[[28,[[55,[-2]],41]]],[],56],[[-1,40],[[28,[[55,[-2]],41]]],[],56],[[-1,40],[[28,[[55,[-2]],41]]],[],56],[[-1,40],[[28,[[55,[-2]],41]]],[],56],[[60,-1,-2],[[28,[1,61]]],62,[[64,[63]]]],[[60,-1,-2],[[28,[1,61]]],62,[[64,[63]]]],[[60,-1,-2],[[28,[1,61]]],62,[[64,[63]]]],[[60,-1,-2],[[28,[1,61]]],62,[[64,[63]]]],[[60,-1,-2],[[28,[1,61]]],62,[[64,[63]]]],[[60,-1,-2],[[28,[1,61]]],62,[[64,[63]]]],0,0,0,0,[[69,-1],28,65],[[70,-1],28,65],[[71,-1],28,65],[[72,-1],28,65],[[73,-1],28,65],[[74,-1],28,65],[[-1,[55,[-2]]],[[28,[1,41]]],[],56],[[-1,[55,[-2]]],[[28,[1,41]]],[],56],[[-1,[55,[-2]]],[[28,[1,41]]],[],56],[[-1,[55,[-2]]],[[28,[1,41]]],[],56],[[-1,[55,[-2]]],[[28,[1,41]]],[],56],[[-1,[55,[-2]]],[[28,[1,41]]],[],56],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,15,[]],[-1,[[28,[-2]]],[],[]],[-1,[[28,[-2]]],[],[]],[-1,[[28,[-2]]],[],[]],[-1,[[28,[-2]]],[],[]],[-1,[[28,[-2]]],[],[]],[-1,[[28,[-2]]],[],[]],[-1,[[28,[-2]]],[],[]],[-1,[[28,[-2]]],[],[]],[-1,[[28,[-2]]],[],[]],[-1,[[28,[-2]]],[],[]],[-1,[[28,[-2]]],[],[]],[-1,[[28,[-2]]],[],[]],[-1,68,[]],[-1,68,[]],[-1,68,[]],[-1,68,[]],[-1,68,[]],[-1,68,[]],[-1,42,[]],[-1,42,[]],[-1,42,[]],[-1,42,[]],[-1,42,[]],[-1,42,[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],0,0],"c":[],"p":[[15,"tuple"],[8,"Iterator",591],[3,"BaseVmConfig",0],[8,"CastFrom",592],[4,"FunctionOutcome",0],[4,"ControlFlow",593],[3,"Args",0],[3,"JError",0],[3,"ParticleParams",0],[3,"NetworkKey",0],[3,"SwarmConfig",0],[3,"ChainConfig",0],[3,"Particle",594],[4,"PeerScope",595],[3,"String",596],[3,"PeerId",597],[6,"AVMRunner",598],[3,"Node",599],[3,"Box",600],[4,"KeyPair",601],[3,"ResolvedConfig",602],[3,"Span",603],[3,"PersistenceTask",604],[8,"Fn",605],[8,"AquaRuntime",606],[3,"Formatter",607],[3,"Error",607],[4,"Result",608],[15,"usize"],[8,"Deserializer",609],[3,"CreatedSwarm",0],[6,"Result",607],[8,"Error",610],[15,"never"],[15,"u8"],[15,"array"],[3,"Report",611],[4,"Infallible",612],[8,"Into",612],[3,"FdFlags",613],[3,"Error",614],[15,"str"],[4,"Option",615],[8,"Any",616],[3,"Arc",617],[3,"Rc",618],[3,"Request",619],[15,"bool"],[3,"Vec",620],[8,"FnMut",605],[3,"Duration",621],[4,"Transport",622],[8,"AsRef",612],[3,"Multiaddr",623],[3,"SetFdFlags",613],[8,"AsFilelike",624],[4,"ArgsError",625],[8,"Deserialize",609],[8,"FnOnce",605],[3,"RawCodec",626],[3,"Error",627],[8,"Read",628],[3,"Cid",629],[8,"Extend",630],[8,"Serializer",631],[3,"ParticleParameters",632],[3,"CallRequestParams",633],[3,"TypeId",616],[4,"ServiceKey",362],[3,"SystemServicesConfig",362],[3,"AquaIpfsConfig",362],[3,"ConnectorConfig",362],[3,"DeciderConfig",362],[3,"RegistryConfig",362],[15,"u64"],[8,"Hash",634],[8,"Sized",635],[8,"BuildHasher",634],[8,"Hasher",634],[13,"NotDefined",360]],"b":[[120,"impl-Debug-for-JError"],[121,"impl-Display-for-JError"],[158,"impl-FromResidual%3CResult%3CInfallible,+E%3E%3E-for-FunctionOutcome"],[159,"impl-FromResidual-for-FunctionOutcome"],[452,"impl-Debug-for-ServiceKey"],[453,"impl-Display-for-ServiceKey"]]},\ +"fluence_libp2p":{"doc":"","t":"NNDDELLLLLLLFFLLLLLLLLLOLLLLLLLLLLLLLOLLLLLLAOLLAFLLLLLLLLLLLLLLLLLLLLFFFF","n":["Memory","Network","PeerId","RandomPeerId","Transport","as_ref","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","build_memory_transport","build_transport","clone","clone","clone_into","clone_into","cmp","deserialize","eq","equivalent","equivalent","event_polling","fmt","fmt","fmt","from","from","from","from","from","from_bytes","from_maddr","from_multihash","from_public_key","from_str","generate_swarm_event_type","hash","into","into","into","is_network","partial_cmp","peerid_serializer_opt","poll_loop","random","random","random_multiaddr","remote_multiaddr","serialize","to_base58","to_bytes","to_owned","to_owned","to_string","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","type_id","type_id","type_id","vzip","vzip","vzip","deserialize","serialize","create_memory_maddr","create_tcp_maddr"],"q":[[0,"fluence_libp2p"],[70,"fluence_libp2p::peerid_serializer_opt"],[72,"fluence_libp2p::random_multiaddr"],[74,"multihash::multihash"],[75,"libp2p_identity::keypair"],[76,"core::time"],[77,"libp2p_core::muxing::boxed"],[78,"libp2p_core::transport::boxed"],[79,"core::cmp"],[80,"core::result"],[81,"serde::de"],[82,"core::fmt"],[83,"core::fmt"],[84,"multiaddr"],[85,"core::hash"],[86,"core::option"],[87,"libp2p_core::connection"],[88,"serde::ser"],[89,"alloc::string"],[90,"alloc::vec"],[91,"core::any"]],"d":["","","Identifier of a peer of the network.","","","","","","","","","","","","","","","","","","","","","Intended to simplify simple polling functions that just …","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","","Parses a PeerId from bytes.","","Tries to turn a Multihash into a PeerId.","Builds a PeerId from a public key.","","Generates a type of events produced by Swarm by its name","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","Generates PeerId from random Ed25519 key","Generates a random peer ID from a cryptographically secure …","","Retrieves multiaddr of the remote peer","","Returns a base-58 encoded string of this PeerId.","Returns a raw bytes representation of this PeerId.","","","","","","","","","","","","","","","","","","","","",""],"i":[8,8,0,0,0,1,29,8,1,29,8,1,0,0,8,1,8,1,1,8,1,1,1,0,8,1,1,29,8,1,1,1,1,8,1,1,1,0,1,29,8,1,8,1,0,0,29,1,0,0,8,1,1,8,1,1,29,8,1,1,1,29,8,1,29,8,1,29,8,1,0,0,0,0],"f":[0,0,0,0,0,[1,2],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[[3,4],[[7,[[6,[1,5]]]]]],[[8,3,4],[[7,[[6,[1,5]]]]]],[8,8],[1,1],[[-1,-2],6,[],[]],[[-1,-2],6,[],[]],[[1,1],9],[-1,[[10,[8]]],11],[[1,1],12],[[-1,-2],12,[],[]],[[-1,-2],12,[],[]],0,[[8,13],14],[[1,13],[[10,[6,15]]]],[[1,13],[[10,[6,15]]]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[16,1],[16,1],[[[18,[17]]],[[10,[1,19]]]],[20,8],[2,[[10,[1,2]]]],[16,1],[21,[[10,[1]]]],0,[[1,-1],6,22],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[8,12],[[1,1],[[23,[9]]]],0,0,[[],1],[[],1],0,[24,20],[[8,-1],10,25],[1,26],[1,[[27,[17]]]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,26,[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[[[27,[17]]],[[10,[1]]]],[2,[[10,[1]]]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,28,[]],[-1,28,[]],[-1,28,[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,[[10,[[23,[1]]]]],11],[[[23,[1]],-1],10,25],[[],20],[[],20]],"c":[],"p":[[3,"PeerId",0],[3,"Multihash",74],[3,"Keypair",75],[3,"Duration",76],[3,"StreamMuxerBox",77],[15,"tuple"],[3,"Boxed",78],[4,"Transport",0],[4,"Ordering",79],[4,"Result",80],[8,"Deserializer",81],[15,"bool"],[3,"Formatter",82],[6,"Result",82],[3,"Error",82],[3,"PublicKey",75],[15,"u8"],[15,"slice"],[4,"ParseError",83],[3,"Multiaddr",84],[15,"str"],[8,"Hasher",85],[4,"Option",86],[4,"ConnectedPoint",87],[8,"Serializer",88],[3,"String",89],[3,"Vec",90],[3,"TypeId",91],[3,"RandomPeerId",0]],"b":[[25,"impl-Debug-for-PeerId"],[26,"impl-Display-for-PeerId"],[30,"impl-From%3CPublicKey%3E-for-PeerId"],[31,"impl-From%3C%26PublicKey%3E-for-PeerId"],[58,"impl-TryFrom%3CVec%3Cu8%3E%3E-for-PeerId"],[59,"impl-TryFrom%3CMultihash%3C64%3E%3E-for-PeerId"]]},\ +"fs_utils":{"doc":"","t":"NNENLLFFFFFFFLLLLFFFFFFLFLLLLMMMMMM","n":["CreateDir","DeserializeData","LoadDataError","ReadPersistedData","borrow","borrow_mut","canonicalize","copy_dir_all","create_dir","create_dir_write_only","create_dirs","file_name","file_stem","fmt","fmt","from","into","list_files","load_persisted_data","remove_dir","remove_dirs","remove_file","set_write_only","source","to_abs_path","to_string","try_from","try_into","type_id","err","err","err","path","path","path"],"q":[[0,"fs_utils"],[29,"fs_utils::LoadDataError"],[35,"std::path"],[36,"eyre"],[37,"std::path"],[38,"std::io::error"],[39,"core::result"],[40,"core::fmt"],[41,"alloc::string"],[42,"core::fmt"],[43,"core::option"],[44,"alloc::vec"],[45,"core::error"],[46,"core::any"]],"d":["","","","","","","","","","","","","","","","Returns the argument unchanged.","Calls U::from(self).","List files in directory","Load some data from disk in parallel","","","","","","","","","","","","","","","",""],"i":[11,11,0,11,11,11,0,0,0,0,0,0,0,11,11,11,11,0,0,0,0,0,0,11,0,11,11,11,11,19,20,21,19,20,21],"f":[0,0,0,0,[-1,-2,[],[]],[-1,-2,[],[]],[-1,[[2,[1]]],[[4,[3]]]],[[-1,-2],[[2,[5]]],[[4,[3]]],[[4,[3]]]],[-1,[[7,[5,6]]],[[4,[3]],8]],[-1,[[7,[5,6]]],[[4,[3]],8]],[[[9,[-1]]],[[7,[5,6]]],[[4,[3]],8]],[-1,[[2,[10]]],[[4,[3]]]],[-1,[[2,[10]]],[[4,[3]]]],[[11,12],13],[[11,12],13],[-1,-1,[]],[-1,-2,[],[]],[3,[[15,[[0,[14]]]]]],[3,[[7,[[16,[[5,[-1,1]]]],11]]],[]],[3,[[7,[5,6]]]],[[[9,[-1]]],[[7,[5,6]]],[[4,[3]],8]],[3,[[7,[5,6]]]],[3,[[7,[5,6]]]],[11,[[15,[17]]]],[1,1],[-1,10,[]],[-1,[[7,[-2]]],[],[]],[-1,[[7,[-2]]],[],[]],[-1,18,[]],0,0,0,0,0,0],"c":[],"p":[[3,"PathBuf",35],[6,"Result",36],[3,"Path",35],[8,"AsRef",37],[15,"tuple"],[3,"Error",38],[4,"Result",39],[8,"Debug",40],[15,"slice"],[3,"String",41],[4,"LoadDataError",0],[3,"Formatter",40],[6,"Result",40],[8,"Iterator",42],[4,"Option",43],[3,"Vec",44],[8,"Error",45],[3,"TypeId",46],[13,"CreateDir",29],[13,"ReadPersistedData",29],[13,"DeserializeData",29]],"b":[[13,"impl-Display-for-LoadDataError"],[14,"impl-Debug-for-LoadDataError"]]},\ +"health":{"doc":"Health check registry implementation.","t":"NIDENNLLLLLLLLLLLLLKLLLLLLL","n":["Fail","HealthCheck","HealthCheckRegistry","HealthStatus","Ok","Warning","borrow","borrow","borrow_mut","borrow_mut","default","eq","fmt","from","from","into","into","new","register","status","status","try_from","try_from","try_into","try_into","type_id","type_id"],"q":[[0,"health"],[27,"core::fmt"],[28,"core::fmt"],[29,"core::result"],[30,"core::any"]],"d":["","","","The result of the health check, which can be one of the …","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Calls U::from(self).","Calls U::from(self).","","","","","","","","","",""],"i":[2,0,0,0,2,2,1,2,1,2,1,2,2,1,2,1,2,1,1,8,1,1,2,1,2,1,2],"f":[0,0,0,0,0,0,[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[[],1],[[2,2],3],[[2,4],5],[-1,-1,[]],[-1,-1,[]],[-1,-2,[],[]],[-1,-2,[],[]],[[],1],[[1,6,-1],7,8],[-1,[[9,[7]]],[]],[1,2],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,11,[]],[-1,11,[]]],"c":[],"p":[[3,"HealthCheckRegistry",0],[4,"HealthStatus",0],[15,"bool"],[3,"Formatter",27],[6,"Result",27],[15,"str"],[15,"tuple"],[8,"HealthCheck",0],[6,"Result",28],[4,"Result",29],[3,"TypeId",30]],"b":[]},\ +"hex_utils":{"doc":"","t":"ENNNLLLLFFFFLLLLLALLLLLMMDLLLLLLLLL","n":["FromHexError","InvalidHexCharacter","InvalidStringLength","OddLength","borrow","borrow_mut","clone","clone_into","decode_hex","encode_hex_0x","encode_hex_0x_zero_pad","encode_hex_no_prefix","eq","fmt","fmt","from","into","serde_as","to_owned","to_string","try_from","try_into","type_id","c","index","Hex","borrow","borrow_mut","deserialize_as","from","into","serialize_as","try_from","try_into","type_id"],"q":[[0,"hex_utils"],[23,"hex_utils::FromHexError"],[25,"hex_utils::serde_as"],[35,"alloc::vec"],[36,"core::result"],[37,"alloc::string"],[38,"core::convert"],[39,"core::fmt"],[40,"core::fmt"],[41,"serde::de"],[42,"hex"],[43,"hex"]],"d":["The error type for decoding a hex string into Vec<u8> or …","An invalid character was found. Valid ones are: 0...9, …","If the hex string is decoded into a fixed sized container, …","A hex string’s length needs to be even, as two digits …","","","","","Decode hex to bytes tolerating absence and presence of 0x …","Encode bytes to hex with 0x prefix","Encode bytes to hex with 0x prefix and zero padding of a …","A simple renaming to force to consider the absence of ‘0x…","","","","Returns the argument unchanged.","Calls U::from(self).","","","","","","","","","","","","","Returns the argument unchanged.","Calls U::from(self).","","","",""],"i":[0,1,1,1,1,1,1,1,0,0,0,0,1,1,1,1,1,0,1,1,1,1,1,19,19,0,20,20,20,20,20,20,20,20,20],"f":[0,0,0,0,[-1,-2,[],[]],[-1,-2,[],[]],[1,1],[[-1,-2],2,[],[]],[3,[[6,[[5,[4]],1]]]],[-1,7,[[9,[[8,[4]]]]]],[[-1,10],7,[[9,[[8,[4]]]]]],[-1,7,[[9,[[8,[4]]]]]],[[1,1],11],[[1,12],[[6,[2,13]]]],[[1,12],[[6,[2,13]]]],[-1,-1,[]],[-1,-2,[],[]],0,[-1,-2,[],[]],[-1,7,[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,14,[]],0,0,0,[-1,-2,[],[]],[-1,-2,[],[]],[-1,[[6,[-2]]],15,16],[-1,-1,[]],[-1,-2,[],[]],[[-1,-2],6,17,18],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,14,[]]],"c":[],"p":[[4,"FromHexError",0],[15,"tuple"],[15,"str"],[15,"u8"],[3,"Vec",35],[4,"Result",36],[3,"String",37],[15,"slice"],[8,"AsRef",38],[15,"usize"],[15,"bool"],[3,"Formatter",39],[3,"Error",39],[3,"TypeId",40],[8,"Deserializer",41],[8,"FromHex",42],[8,"ToHex",42],[8,"Serializer",43],[13,"InvalidHexCharacter",23],[3,"Hex",25]],"b":[[13,"impl-Display-for-FromHexError"],[14,"impl-Debug-for-FromHexError"]]},\ +"ivalue_utils":{"doc":"","t":"NNNNNNNNNNNNNNEENNNNNNNNNNNNNNNNNNNNSSFLLLLLLLLLLLLLLLFLLLLLLLLLLLLLLLLLLLFFFFLLLLLLLLLLLLF","n":["Array","Array","Boolean","Boolean","ByteArray","ByteArray","F32","F32","F64","F64","I32","I32","I64","I64","IType","IValue","Record","Record","S16","S16","S32","S32","S64","S64","S8","S8","String","String","U16","U16","U32","U32","U64","U64","U8","U8","VARIANT_COUNT","VARIANT_COUNT","as_str","borrow","borrow","borrow_mut","borrow_mut","clone","clone","clone_into","clone_into","default","deserialize","eq","eq","equivalent","equivalent","equivalent","error","fmt","fmt","from","from","from","from","from","from","from","from","from","from","from","from","from","from","hash","into","into","into_record","into_record_opt","into_string","ok","parse","serialize","to_bytes","to_owned","to_owned","to_string","try_from","try_from","try_into","try_into","type_id","type_id","unit"],"q":[[0,"ivalue_utils"],[91,"core::option"],[92,"core::result"],[93,"serde::de"],[94,"serde_json::value"],[95,"core::fmt"],[96,"core::fmt"],[97,"alloc::string"],[98,"core::hash"],[99,"wast::parser"],[100,"wast"],[101,"serde::ser"],[102,"std::io::error"],[103,"std::io"],[104,"core::any"]],"d":["An array of values of the same type.","A byte array.","Boolean.","Boolean value.","Specialization of arrays for byte vector.","Specialization of array type for byte vector.","A 32-bits float.","A 32-bits float.","A 64-bits float.","A 64-bits float.","A 32-bits integer (as defined in WebAssembly core).","A 32-bits integer (as defined in WebAssembly core).","A 64-bits integer (as defined in WebAssembly core).","A 64-bits integer (as defined in WebAssembly core).","Represents the types supported by WIT.","A WIT value.","A record contains record index from interfaces AST.","A record.","A 16-bits signed integer.","A 16-bits signed integer.","A 32-bits signed integer.","A 32-bits signed integer.","A 64-bits signed integer.","A 64-bits signed integer.","A 8-bits signed integer.","A 8-bits signed integer.","A string.","A string.","A 16-bits unsigned integer.","A 16-bits unsigned integer.","A 32-bits unsigned integer.","A 32-bits unsigned integer.","A 64-bits unsigned integer.","A 64-bits unsigned integer.","A 8-bits unsigned integer.","A 8-bits unsigned integer.","","","","","","","","","","","","","","","","","","","Converts erroneous result of call_service into …","","","Returns the argument unchanged.","","","Returns the argument unchanged.","","","","","","","","","","","","Calls U::from(self).","Calls U::from(self).","Converts result of call_service into IValue::Record","Converts result of call_service into IValue::Record","","Converts successful result of call_service into …","","","","","","","","","","","","","Converts empty result of call_service into IValue::Record"],"i":[4,1,4,1,4,1,4,1,4,1,4,1,4,1,0,0,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,0,4,1,4,1,4,1,4,1,1,4,4,1,4,4,4,0,4,1,4,1,1,1,1,1,1,1,1,1,1,1,1,1,4,4,1,0,0,0,0,4,4,4,4,1,4,4,1,4,1,4,1,0],"f":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[1,[[3,[2]]]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[4,4],[1,1],[[-1,-2],5,[],[]],[[-1,-2],5,[],[]],[[],1],[-1,[[6,[4]]],7],[[4,4],8],[[1,1],8],[[-1,-2],8,[],[]],[[-1,-2],8,[],[]],[[-1,-2],8,[],[]],[9,[[3,[1]]]],[[4,10],[[6,[5,11]]]],[[1,10],[[6,[5,11]]]],[-1,-1,[]],[12,1],[13,1],[-1,-1,[]],[14,1],[15,1],[16,1],[17,1],[18,1],[19,1],[20,1],[21,1],[[[22,[12]]],1],[23,1],[[4,-1],5,24],[-1,-2,[],[]],[-1,-2,[],[]],[[[6,[9,9]]],[[3,[1]]]],[[[6,[[3,[9]],9]]],[[3,[1]]]],[1,[[3,[23]]]],[9,[[3,[1]]]],[25,[[6,[4,26]]]],[[4,-1],6,27],[[4,-1],[[6,[5,28]]],29],[-1,-2,[],[]],[-1,-2,[],[]],[4,23],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,30,[]],[-1,30,[]],[[],[[3,[1]]]]],"c":[],"p":[[4,"IValue",0],[15,"str"],[4,"Option",91],[4,"IType",0],[15,"tuple"],[4,"Result",92],[8,"Deserializer",93],[15,"bool"],[4,"Value",94],[3,"Formatter",95],[3,"Error",95],[15,"u8"],[15,"f32"],[15,"u32"],[15,"i16"],[15,"i64"],[15,"u16"],[15,"i8"],[15,"u64"],[15,"f64"],[15,"i32"],[3,"Vec",96],[3,"String",97],[8,"Hasher",98],[3,"Parser",99],[3,"Error",100],[8,"Serializer",101],[3,"Error",102],[8,"Write",103],[3,"TypeId",104]],"b":[[58,"impl-From%3Cu8%3E-for-IValue"],[59,"impl-From%3Cf32%3E-for-IValue"],[61,"impl-From%3Cu32%3E-for-IValue"],[62,"impl-From%3Ci16%3E-for-IValue"],[63,"impl-From%3Ci64%3E-for-IValue"],[64,"impl-From%3Cu16%3E-for-IValue"],[65,"impl-From%3Ci8%3E-for-IValue"],[66,"impl-From%3Cu64%3E-for-IValue"],[67,"impl-From%3Cf64%3E-for-IValue"],[68,"impl-From%3Ci32%3E-for-IValue"],[69,"impl-From%3CVec%3Cu8%3E%3E-for-IValue"],[70,"impl-From%3CString%3E-for-IValue"]]},\ +"json_utils":{"doc":"","t":"AFFFFF","n":["base64_serde","err_as_value","into_array","into_string","deserialize","serialize"],"q":[[0,"json_utils"],[4,"json_utils::base64_serde"],[6,"serde_json::value"],[7,"core::fmt"],[8,"core::fmt"],[9,"core::option"],[10,"alloc::string"],[11,"core::result"],[12,"serde::de"],[13,"serde::ser"]],"d":["","Converts an error into IValue::String","","","",""],"i":[0,0,0,0,0,0],"f":[0,[-1,1,[2,3]],[1,[[5,[[4,[1]]]]]],[1,[[5,[6]]]],[-1,[[8,[[4,[7]]]]],9],[[[4,[7]],-1],8,10]],"c":[],"p":[[4,"Value",6],[8,"Debug",7],[8,"Display",7],[3,"Vec",8],[4,"Option",9],[3,"String",10],[15,"u8"],[4,"Result",11],[8,"Deserializer",12],[8,"Serializer",13]],"b":[]},\ +"kademlia":{"doc":"","t":"NNNENDDIDENNNNNNNKLLLMKLLLLLLLLLLLLLLLLKLLLLLLLLLLLLLLLLLLLLLKLLMKLLLLLMMMLLMMLMLLLLLLLLLLLLLLLLLLLLLLLMMMMMMMMM","n":["AddContact","Bootstrap","Cancelled","Command","DiscoverPeer","Kademlia","KademliaApi","KademliaApiT","KademliaConfig","KademliaError","LocalLookup","Neighborhood","NoKnownPeers","NoPeersFound","PeerBanned","PeerTimedOut","QueryTimedOut","add_contact","add_contact","add_contact","add_kad_node","ban_cooldown","bootstrap","bootstrap","bootstrap","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone_into","clone_into","discover_peer","discover_peer","discover_peer","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","handle_established_inbound_connection","handle_established_outbound_connection","handle_pending_inbound_connection","handle_pending_outbound_connection","into","into","into","into","into","local_lookup","local_lookup","local_lookup","max_packet_size","neighborhood","neighborhood","neighborhood","new","on_connection_handler_event","on_swarm_event","outlet","peer_fail_threshold","peer_id","poll","protocol_name","protocol_name","query_timeout","remote_neighborhood","replication_factor","to_owned","to_owned","to_string","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","vzip","vzip","vzip","vzip","vzip","contact","count","key","out","out","out","out","peer","peer"],"q":[[0,"kademlia"],[103,"kademlia::Command"],[112,"particle_protocol::contact"],[113,"libp2p_identity::peer_id"],[114,"multiaddr"],[115,"alloc::vec"],[116,"core::result"],[117,"futures_core::future"],[118,"tokio::sync::oneshot"],[119,"core::fmt"],[120,"core::fmt"],[121,"libp2p_swarm"],[122,"libp2p_swarm"],[123,"core::option"],[124,"multihash::multihash"],[125,"libp2p_metrics"],[126,"alloc::sync"],[127,"libp2p_swarm"],[128,"core::task::wake"],[129,"libp2p_swarm"],[130,"libp2p_swarm::stream_protocol"],[131,"alloc::string"],[132,"core::any"]],"d":["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","","","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""],"i":[14,14,9,0,14,0,0,0,0,0,14,14,9,9,9,9,9,36,3,5,3,13,36,3,5,3,14,5,13,9,3,14,5,13,9,5,13,5,13,36,3,5,14,5,13,9,9,3,14,5,13,9,3,3,3,3,3,14,5,13,9,36,3,5,13,36,3,5,3,3,3,5,13,13,3,3,13,13,3,13,5,13,9,3,14,5,13,9,3,14,5,13,9,3,14,5,13,9,3,14,5,13,9,37,38,38,39,40,41,38,39,41],"f":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[-1,1],2,[]],[[3,1],4],[[5,1],2],[[3,6,[8,[7]]],4],0,[-1,[[11,[[10,[4,9]]]]],[]],[[3,[12,[[10,[4,9]]]]],4],[5,[[11,[[10,[4,9]]]]]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[5,5],[13,13],[[-1,-2],4,[],[]],[[-1,-2],4,[],[]],[[-1,6],[[11,[[10,[[8,[7]],9]]]]],[]],[[3,6,[12,[[10,[[8,[7]],9]]]]],4],[[5,6],[[11,[[10,[[8,[7]],9]]]]]],[[14,15],16],[[5,15],16],[[13,15],16],[[9,15],16],[[9,15],16],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[[3,17,6,7,7],[[10,[[18,[3]],19]]]],[[3,17,6,7,20],[[10,[[18,[3]],19]]]],[[3,17,7,7],[[10,[4,19]]]],[[3,17,[21,[6]],[22,[7]],20],[[10,[[8,[7]],19]]]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[[-1,6],[[11,[[10,[[8,[7]],9]]]]],[]],[[3,6,[12,[[8,[7]]]]],4],[[5,6],[[11,[[10,[[8,[7]],9]]]]]],0,[[-1,23,24],[[11,[[10,[[8,[6]],9]]]]],[]],[[3,23,24,[12,[[10,[[8,[6]],9]]]]],4],[[5,23,24],[[11,[[10,[[8,[6]],9]]]]]],[[13,[21,[[26,[25]]]]],[[4,[3,5]]]],[[3,6,17,[27,[3]]],4],[[3,28],4],0,0,0,[[3,29],[[32,[[31,[4,[30,[3]]]]]]]],[3,33],0,0,[[3,23,[12,[[10,[[8,[6]],9]]]]],4],0,[-1,-2,[],[]],[-1,-2,[],[]],[-1,34,[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,35,[]],[-1,35,[]],[-1,35,[]],[-1,35,[]],[-1,35,[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],0,0,0,0,0,0,0,0,0],"c":[],"p":[[3,"Contact",112],[15,"bool"],[3,"Kademlia",0],[15,"tuple"],[3,"KademliaApi",0],[3,"PeerId",113],[3,"Multiaddr",114],[3,"Vec",115],[4,"KademliaError",0],[4,"Result",116],[6,"BoxFuture",117],[3,"Sender",118],[3,"KademliaConfig",0],[4,"Command",0],[3,"Formatter",119],[6,"Result",119],[3,"ConnectionId",120],[6,"THandler",121],[3,"ConnectionDenied",121],[4,"Endpoint",122],[4,"Option",123],[15,"slice"],[3,"Multihash",124],[15,"usize"],[3,"Metrics",125],[3,"Arc",126],[6,"THandlerOutEvent",121],[4,"FromSwarm",127],[3,"Context",128],[6,"THandlerInEvent",121],[4,"ToSwarm",127],[4,"Poll",129],[3,"StreamProtocol",130],[3,"String",131],[3,"TypeId",132],[8,"KademliaApiT",0],[13,"AddContact",103],[13,"Neighborhood",103],[13,"LocalLookup",103],[13,"Bootstrap",103],[13,"DiscoverPeer",103]],"b":[[45,"impl-Display-for-KademliaError"],[46,"impl-Debug-for-KademliaError"]]},\ +"local_vm":{"doc":"","t":"DNNDNNEENNDNGNNNNNNLMLLLLLLLLLLLLLLLFLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLFLLLLLLLLLLLLLLLLLLLLLLLLLLLLFFFLLLLLLLLLMMFLLLLLLMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMLLLLLF","n":["AVMRunner","Call","CleanupData","ClientFunctionsResult","CreateAnomalyDir","CreateDataStore","DataStoreError","Instruction","None","Null","ParticleDataStore","ReadData","Returned","Seq","SerializeAnomaly","Some","StoreData","VaultError","WriteAnomaly","add","anomaly_data_store","anomaly_dir","batch_cleanup_data","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","call","call","call_tracing","client_functions","clone","clone_into","create_runtime","data_file","debug","debug","debug","debug","debug","deref","deref","deref","deref","deref","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","detect_anomaly","drop","drop","drop","drop","drop","eq","equivalent","equivalent","equivalent","equivalent","equivalent","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","host_call","init","init","init","init","init","initialize","into","into","into","into","into","into_air","into_any","into_any","into_any","into_any","into_any","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_effects","make_particle","make_vm","make_wasm_backend","memory_stats","memory_stats","new","new","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","outcome","particle_data_store","read_args","read_data","references","references","references","references","references","returned","save_anomaly_data","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","source","store_data","to_human_readable_data","to_owned","to_string","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_name","type_name","type_name","type_name","type_name","vault","vzip","vzip","vzip","vzip","vzip","wrap_script"],"q":[[0,"local_vm"],[173,"alloc::string"],[174,"std::path"],[175,"libp2p_identity::peer_id"],[176,"alloc::vec"],[177,"avm_interface::call_service_result"],[178,"std::collections::hash::map"],[179,"fluence_keypair::key_pair"],[180,"avm_interface::raw_outcome"],[181,"avm_server::errors"],[182,"core::result"],[183,"marine_wasm_backend_traits"],[184,"core::convert"],[185,"marine_wasmtime_backend"],[186,"avm_interface::particle_parameters"],[187,"core::future::future"],[188,"alloc::boxed"],[189,"core::pin"],[190,"core::marker"],[191,"serde_json::value"],[192,"particle_args::args"],[193,"core::task::wake"],[194,"core::fmt"],[195,"core::fmt"],[196,"core::fmt"],[197,"system_interface::fs::fd_flags"],[198,"std::io::error"],[199,"core::any"],[200,"alloc::sync"],[201,"alloc::rc"],[202,"aquamarine::particle_effects"],[203,"particle_protocol::particle"],[204,"core::option"],[205,"std::path"],[206,"avm_server::runner"],[207,"libipld_core::raw"],[208,"anyhow"],[209,"std::io"],[210,"cid::cid"],[211,"core::iter::traits::collect"],[212,"core::error"],[213,"core::any"]],"d":["","","","","","","","","No value.","","","","","","","Some value of type T.","","","","","","Returns $ANOMALY_DATA_STORE/$particle_id/$timestamp","","","","","","","","","","","","","","","","","","Creates AVM in background (on blocking threadpool)","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","Returns the argument unchanged.","","","","","","","","","","","","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","Create AVM with the provided config.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""],"i":[0,1,38,0,38,38,0,0,42,1,0,38,0,1,38,42,38,38,38,1,3,3,3,1,30,11,3,38,1,30,11,3,38,11,11,11,0,3,3,11,3,1,30,11,3,38,1,30,11,3,38,1,30,11,3,38,3,1,30,11,3,38,1,1,1,1,1,1,1,30,3,38,38,1,30,11,3,38,38,1,30,11,3,38,0,1,30,11,3,38,3,1,30,11,3,38,1,1,30,11,3,38,1,30,11,3,38,1,30,11,3,38,11,0,0,0,11,11,11,3,1,30,11,3,38,30,3,0,3,1,30,11,3,38,30,3,1,30,11,3,38,38,3,11,3,38,1,30,11,3,38,1,30,11,3,38,1,30,11,3,38,1,30,11,3,38,3,1,30,11,3,38,0],"f":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[1,2],1],0,[[3,4,4,[6,[5]]],7],[[3,[9,[[10,[2,8,[9,[5]],2]]]]],10],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[[[11,[-1]],-2,-3,-4,-5,12,13,-6,[15,[13,14]],16,2],[[19,[17,18]]],20,[[21,[2]]],[[21,[[9,[5]]]]],[[21,[[9,[5]]]]],[[21,[2]]],[[21,[2]]]],[[[11,[22]],-1,-2,-3,23,[15,[13,14]],16],[[26,[[25,[24]]]]],[[21,[2]],27],[[21,[[9,[5]]]],27],[[21,[[9,[5]]]],27]],[[[11,[-1]],-2,-3,-4,-5,12,13,-6,[15,[13,14]],2,5,5,[9,[5]],2],[[19,[17,18]]],20,[[21,[2]]],[[21,[[9,[5]]]]],[[21,[[9,[5]]]]],[[21,[2]]],[[21,[2]]]],[[[15,[2,28]],29],30],[3,3],[[-1,-2],10,[],[]],[[22,31],[[19,[[11,[22]]]]]],[[3,4,4,[6,[5]]],7],[32,[[19,[10,33]]]],[32,[[19,[10,33]]]],[32,[[19,[10,33]]]],[32,[[19,[10,33]]]],[32,[[19,[10,33]]]],[34,-1,[]],[34,-1,[]],[34,-1,[]],[34,-1,[]],[34,-1,[]],[34,-1,[]],[34,-1,[]],[34,-1,[]],[34,-1,[]],[34,-1,[]],[[3,35,34,17],36],[34,10],[34,10],[34,10],[34,10],[34,10],[[1,1],36],[[-1,-2],36,[],[]],[[-1,-2],36,[],[]],[[-1,-2],36,[],[]],[[-1,-2],36,[],[]],[[-1,-2],36,[],[]],[[1,32],37],[[30,32],37],[[3,32],[[19,[10,33]]]],[[38,32],[[19,[10,33]]]],[[38,32],[[19,[10,33]]]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[39,38],[-1,-1,[]],[-1,[[19,[40,41]]],[]],[-1,[[19,[40,41]]],[]],[-1,[[19,[40,41]]],[]],[-1,[[19,[40,41]]],[]],[-1,[[19,[40,41]]],[]],[[[15,[2,28]],29],[[10,[14,42]]]],[[],34],[[],34],[[],34],[[],34],[[],34],[3,[[19,[10,38]]]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[1,2],[[[25,[-1]]],[[25,[43]]],[]],[[[25,[-1]]],[[25,[43]]],[]],[[[25,[-1]]],[[25,[43]]],[]],[[[25,[-1]]],[[25,[43]]],[]],[[[25,[-1]]],[[25,[43]]],[]],[[[44,[-1]]],[[44,[43]]],[]],[[[44,[-1]]],[[44,[43]]],[]],[[[44,[-1]]],[[44,[43]]],[]],[[[44,[-1]]],[[44,[43]]],[]],[[[44,[-1]]],[[44,[43]]],[]],[[[45,[-1]]],[[45,[43]]],[]],[[[45,[-1]]],[[45,[43]]],[]],[[[45,[-1]]],[[45,[43]]],[]],[[[45,[-1]]],[[45,[43]]],[]],[[[45,[-1]]],[[45,[43]]],[]],[[[19,[17]],2],46],[[8,[15,[2,28]],2,-1,[11,[22]],[44,[3]],36,35,16],47,[[21,[[48,[8]]]]]],[49,[[11,[22]]]],[[],22],[[[11,[-1]]],50,20],[[[11,[22]]],50],[[7,[48,[12]],51,52,-1],[[19,[[11,[-1]],18]]],20],[[7,7,7],3],[[-1,40],[[19,[[53,[-2]],41]]],[],54],[[-1,40],[[19,[[53,[-2]],41]]],[],54],[[-1,40],[[19,[[53,[-2]],41]]],[],54],[[-1,40],[[19,[[53,[-2]],41]]],[],54],[[-1,40],[[19,[[53,[-2]],41]]],[],54],0,0,[[47,8,[11,[22]],[44,[3]],16],[[48,[[19,[[9,[28]],[9,[28]]]]]]]],[[3,4,4,[6,[5]]],[[19,[[9,[5]],38]]]],[[55,-1,-2],[[19,[10,56]]],57,[[59,[58]]]],[[55,-1,-2],[[19,[10,56]]],57,[[59,[58]]]],[[55,-1,-2],[[19,[10,56]]],57,[[59,[58]]]],[[55,-1,-2],[[19,[10,56]]],57,[[59,[58]]]],[[55,-1,-2],[[19,[10,56]]],57,[[59,[58]]]],0,[[3,4,[6,[5]],[15,[13,14]],23,[6,[5]],17,35,34],[[19,[10,38]]]],[[-1,[53,[-2]]],[[19,[10,41]]],[],54],[[-1,[53,[-2]]],[[19,[10,41]]],[],54],[[-1,[53,[-2]]],[[19,[10,41]]],[],54],[[-1,[53,[-2]]],[[19,[10,41]]],[],54],[[-1,[53,[-2]]],[[19,[10,41]]],[],54],[38,[[48,[60]]]],[[3,[6,[5]],4,4,[6,[5]]],[[19,[10,38]]]],[[[11,[-1]],[9,[5]]],[[19,[2,18]]],20],[-1,-2,[],[]],[-1,2,[]],[-1,[[19,[-2]]],[],[]],[-1,[[19,[-2]]],[],[]],[-1,[[19,[-2]]],[],[]],[-1,[[19,[-2]]],[],[]],[-1,[[19,[-2]]],[],[]],[-1,[[19,[-2]]],[],[]],[-1,[[19,[-2]]],[],[]],[-1,[[19,[-2]]],[],[]],[-1,[[19,[-2]]],[],[]],[-1,[[19,[-2]]],[],[]],[-1,61,[]],[-1,61,[]],[-1,61,[]],[-1,61,[]],[-1,61,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],0,[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[[2,[15,[2,28]],-1,36,[48,[8]]],2,[[21,[[48,[8]]]]]]],"c":[],"p":[[4,"Instruction",0],[3,"String",173],[3,"ParticleDataStore",0],[15,"str"],[15,"u8"],[15,"slice"],[3,"PathBuf",174],[3,"PeerId",175],[3,"Vec",176],[15,"tuple"],[3,"AVMRunner",0],[15,"u64"],[15,"u32"],[3,"CallServiceResult",177],[3,"HashMap",178],[4,"KeyPair",179],[3,"RawAVMOutcome",180],[4,"RunnerError",181],[4,"Result",182],[8,"WasmBackend",183],[8,"Into",184],[3,"WasmtimeWasmBackend",185],[3,"ParticleParameters",186],[8,"Future",187],[3,"Box",188],[3,"Pin",189],[8,"Send",190],[4,"Value",191],[3,"Args",192],[3,"ClientFunctionsResult",0],[3,"Waker",193],[3,"Formatter",194],[3,"Error",194],[15,"usize"],[3,"Duration",195],[15,"bool"],[6,"Result",194],[4,"DataStoreError",0],[4,"VaultError",196],[3,"FdFlags",197],[3,"Error",198],[6,"Returned",0],[8,"Any",199],[3,"Arc",200],[3,"Rc",201],[3,"ParticleEffects",202],[3,"Particle",203],[4,"Option",204],[3,"Path",174],[3,"AVMMemoryStats",205],[3,"AVMRuntimeLimits",205],[15,"i32"],[3,"SetFdFlags",197],[8,"AsFilelike",206],[3,"RawCodec",207],[3,"Error",208],[8,"Read",209],[3,"Cid",210],[8,"Extend",211],[8,"Error",212],[3,"TypeId",199]],"b":[[33,"impl-AVMRunner%3CWB%3E"],[34,"impl-AquaRuntime-for-AVMRunner%3CWasmtimeWasmBackend%3E"],[71,"impl-Debug-for-DataStoreError"],[72,"impl-Display-for-DataStoreError"],[116,"impl-AVMRunner%3CWB%3E"],[117,"impl-AquaRuntime-for-AVMRunner%3CWasmtimeWasmBackend%3E"]]},\ +"log_format":{"doc":"","t":"DLLLLLLLLLLLLLLLLLL","n":["Format","borrow","borrow_mut","clone","clone_into","default","fmt","format_event","from","into","to_owned","try_from","try_into","type_id","with_display_span_list","with_level","with_target","with_timer","without_time"],"q":[[0,"log_format"],[19,"core::clone"],[20,"tracing_subscriber::fmt::time"],[21,"core::fmt"],[22,"core::fmt"],[23,"tracing_subscriber::fmt::format"],[24,"tracing_core::event"],[25,"tracing_subscriber::fmt::time"],[26,"tracing_subscriber::registry"],[27,"tracing_subscriber::fmt::format"],[28,"core::any"]],"d":["","","","","","","","","Returns the argument unchanged.","Calls U::from(self).","","","","","Sets whether or not an event’s spans is displayed.","Sets whether or not an event’s level is displayed.","Sets whether or not an event’s target is displayed.","Use the given timer for log message timestamps.","Do not emit timestamps with log messages."],"i":[0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],"f":[0,[-1,-2,[],[]],[-1,-2,[],[]],[[[1,[-1]]],[[1,[-1]]],2],[[-1,-2],3,[],[]],[[],[[1,[4]]]],[[[1,[-1]],5],6,7],[[[1,[-1]],[8,[-2,-3]],9,10],6,11,[12,13],14],[-1,-1,[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,[[15,[-2]]],[],[]],[-1,[[15,[-2]]],[],[]],[-1,16,[]],[[[1,[-1]],17],[[1,[-1]]],[]],[[[1,[-1]],17],[[1,[-1]]],[]],[[[1,[-1]],17],[[1,[-1]]],[]],[[[1,[-1]],-2],[[1,[-2]]],[],[]],[[[1,[-1]]],[[1,[3]]],[]]],"c":[],"p":[[3,"Format",0],[8,"Clone",19],[15,"tuple"],[3,"SystemTime",20],[3,"Formatter",21],[6,"Result",21],[8,"Debug",21],[3,"FmtContext",22],[3,"Writer",23],[3,"Event",24],[8,"FormatTime",20],[8,"Subscriber",25],[8,"LookupSpan",26],[8,"FormatFields",23],[4,"Result",27],[3,"TypeId",28],[15,"bool"]],"b":[]},\ +"log_utils":{"doc":"","t":"DLLLFFLLLLLLLLLL","n":["LogSpec","borrow","borrow_mut","default","enable_logs","enable_logs_for","from","into","new","try_from","try_into","type_id","with_defaults","with_directives","with_level","with_wasm_level"],"q":[[0,"log_utils"],[16,"tracing_subscriber::filter::env::directive"],[17,"alloc::vec"],[18,"core::result"],[19,"core::any"],[20,"tracing_core::metadata"],[21,"log"]],"d":["","","","","","","Returns the argument unchanged.","Calls U::from(self).","","","","","","","",""],"i":[0,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1],"f":[0,[-1,-2,[],[]],[-1,-2,[],[]],[[],1],[[],2],[1,2],[-1,-1,[]],[-1,-2,[],[]],[[[4,[3]]],1],[-1,[[5,[-2]]],[],[]],[-1,[[5,[-2]]],[],[]],[-1,6,[]],[1,1],[[1,[4,[3]]],1],[[1,7],1],[[1,8],1]],"c":[],"p":[[3,"LogSpec",0],[15,"tuple"],[3,"Directive",16],[3,"Vec",17],[4,"Result",18],[3,"TypeId",19],[3,"Level",20],[4,"Level",21]],"b":[]},\ +"now_millis":{"doc":"","t":"FFF","n":["now","now_ms","now_sec"],"q":[[0,"now_millis"],[3,"core::time"]],"d":["Returns UNIX timestamp as Duration","Returns UNIX timestamp in milliseconds","Returns UNIX timestamp in seconds"],"i":[0,0,0],"f":[[[],1],[[],2],[[],3]],"c":[],"p":[[3,"Duration",3],[15,"u128"],[15,"u64"]],"b":[]},\ +"nox":{"doc":"","t":"NNNNNEDNNNNDENNNNENNNDNNDDMLLLLLLLLLLMMMLLLLLLLLLLLLLLLLLMMLLLLMMLLLLLLLLLLLLLLLLLLLLLLLLLMLLLLLLLLFLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMLLMFMLLLLLLLLLLLMLLMLLLLLLLLLLLMLLLLLLLLLMLLLMMLLFLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMMMMMMMMMMMMMMMMMMMMMMM","n":["AddContact","Bootstrap","Connect","ConnectionLimits","ConnectionPool","ConnectionPoolCommand","Connectivity","CountConnections","Dial","Disconnect","DiscoverPeer","FluenceNetworkBehaviour","FluenceNetworkBehaviourEvent","GetContact","Identify","IsConnected","Kademlia","KademliaCommand","LifecycleEvents","LocalLookup","Neighborhood","Node","Ping","Send","StartedHttp","Versions","aquamarine_api","as_","as_","as_","as_","as_","as_","as_","as_","as_ref","as_ref","avm_version","bootstrap_frequency","bootstrap_nodes","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","builtins","builtins_management_peer_id","chain_listener","clone","clone","clone_into","clone_into","connection_pool","connectivity","debug","debug","debug","debug","debug","debug","debug","debug","deref","deref","deref","deref","deref","deref","deref","deref","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","discover_peer","dispatcher","drop","drop","drop","drop","drop","drop","drop","drop","env_filter","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from_ref","from_ref","from_ref","from_ref","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","handle_established_inbound_connection","handle_established_outbound_connection","handle_pending_inbound_connection","handle_pending_outbound_connection","health","init","init","init","init","init","init","init","init","inject_identify_event","into","into","into","into","into","into","into","into","into_any","into_any","into_any","into_any","into_any","into_any","into_any","into_any","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_request","into_request","into_request","into_request","into_request","into_request","into_request","into_request","kademlia","kademlia_bootstrap","listen","listen_addr","log_layer","metrics","new","new","new","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","node_version","on_connection_handler_event","on_swarm_event","peer_id","poll","reconnect_bootstraps","references","references","references","references","references","references","references","references","resolve_contact","scope","send","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","spell_version","start","start","swarm","swarm","system_service","to_owned","to_owned","tracing_layer","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_name","type_name","type_name","type_name","type_name","type_name","type_name","type_name","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","with","addr","contact","out","out","out","out","out","out","out","out","particle","peer_id","peer_id","peer_id","to","contact","count","key","out","out","out","out","peer","peer"],"q":[[0,"nox"],[268,"nox::ConnectionPoolCommand"],[283,"nox::KademliaCommand"],[292,"bnum::cast"],[293,"connection_pool::api"],[294,"kademlia::api"],[295,"particle_builtins::builtins"],[296,"peer_metrics::services_metrics"],[297,"workers::key_storage"],[298,"alloc::sync"],[299,"workers::workers"],[300,"workers::scope"],[301,"health"],[302,"core::option"],[303,"particle_builtins::builtins"],[304,"core::fmt"],[305,"libp2p_identity::peer_id"],[306,"particle_protocol::contact"],[307,"kademlia::error"],[308,"tracing_subscriber::layer"],[309,"tracing_core::subscriber"],[310,"tracing_subscriber::registry"],[311,"core::fmt"],[312,"std::io::error"],[313,"libp2p_swarm::connection"],[314,"multiaddr"],[315,"libp2p_swarm"],[316,"libp2p_swarm"],[317,"alloc::vec"],[318,"libp2p_identify::behaviour"],[319,"alloc::boxed"],[320,"core::any"],[321,"alloc::rc"],[322,"tonic::request"],[323,"libp2p_core::transport"],[324,"aquamarine::aqua_runtime"],[325,"core::convert"],[326,"tracing_appender::non_blocking"],[327,"server_config::resolved_config"],[328,"core_distributor::distributor"],[329,"cpu_utils::pinning"],[330,"aquamarine::config"],[331,"system_services::distro"],[332,"eyre"],[333,"server_config::network_config"],[334,"particle_protocol::particle"],[335,"tokio::sync::mpsc::bounded"],[336,"alloc::string"],[337,"system_services::distro"],[338,"libp2p_swarm"],[339,"core::task::wake"],[340,"libp2p_swarm"],[341,"libipld_core::raw"],[342,"anyhow"],[343,"std::io"],[344,"cid::cid"],[345,"core::iter::traits::collect"],[346,"libp2p_identity::keypair"],[347,"libp2p_core::muxing::boxed"],[348,"libp2p_core::transport::boxed"],[349,"prometheus_client::registry"],[350,"libp2p_swarm"],[351,"aquamarine::error"],[352,"aquamarine::aquamarine"],[353,"aquamarine::aquamarine"],[354,"spell_event_bus::api"],[355,"spell_event_bus::bus"],[356,"spell_event_bus::api"],[357,"sorcerer::sorcerer"],[358,"libp2p_metrics"],[359,"peer_metrics::services_metrics::backend"],[360,"core::net::socket_addr"],[361,"chain_listener::listener"]],"d":["","","","","","","This structure is just a composition of Kademlia and …","","","","","Coordinates protocols, so they can cooperate","NetworkBehaviour::ToSwarm produced by …","","","","","","","","","","","","","","","","","","","","","","","","","","Bootstrap will be executed after [1, N, 2N, 3N, …] …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Discover a peer via Kademlia","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","","","","","","","","","","","","","","","","","","","","","","","","","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Run kademlia bootstrap after first bootstrap is connected, …","Starts node service listener.","","","","","","","","","","","","","","","","","","","","Dial bootstraps, and then re-dial on each disconnection","","","","","","","","","","","","","","","","","","","","","Starts node service","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""],"i":[26,26,27,30,30,0,0,27,27,27,26,0,0,27,30,27,30,0,27,26,26,0,30,27,0,0,47,26,27,47,2,28,33,30,14,2,2,14,2,2,26,27,47,2,28,33,30,14,26,27,47,2,28,33,30,14,47,47,47,2,14,2,14,2,47,26,27,47,2,28,33,30,14,26,27,47,2,28,33,30,14,26,27,47,2,28,33,30,14,2,47,26,27,47,2,28,33,30,14,0,26,27,28,30,14,26,27,47,2,28,33,30,14,2,2,14,14,26,27,47,2,28,33,30,14,33,33,33,33,2,26,27,47,2,28,33,30,14,33,26,27,47,2,28,33,30,14,26,27,47,2,28,33,30,14,26,27,2,28,14,26,27,47,2,28,33,30,14,26,27,47,2,28,33,30,14,2,2,47,28,0,2,47,33,14,26,27,47,2,28,33,30,14,14,33,33,2,33,2,26,27,47,2,28,33,30,14,2,47,2,26,27,47,2,28,33,30,14,14,47,2,47,47,14,2,14,0,26,27,47,2,28,33,30,14,26,27,47,2,28,33,30,14,26,27,47,2,28,33,30,14,26,27,47,2,28,33,30,14,26,27,47,2,28,33,30,14,47,98,99,99,100,98,101,102,103,104,105,100,101,102,103,100,106,107,107,108,109,110,107,108,110],"f":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[2,3],[2,4],0,0,0,[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[[5,2,6,[8,[7]],[8,[9]],10,[12,[11]]],[[13,[2]]]],0,0,[2,2],[14,14],[[-1,-2],15,[],[]],[[-1,-2],15,[],[]],0,0,[16,[[18,[15,17]]]],[16,[[18,[15,17]]]],[16,[[18,[15,17]]]],[16,[[18,[15,17]]]],[16,[[18,[15,17]]]],[16,[[18,[15,17]]]],[16,[[18,[15,17]]]],[16,[[18,[15,17]]]],[19,-1,[]],[19,-1,[]],[19,-1,[]],[19,-1,[]],[19,-1,[]],[19,-1,[]],[19,-1,[]],[19,-1,[]],[19,-1,[]],[19,-1,[]],[19,-1,[]],[19,-1,[]],[19,-1,[]],[19,-1,[]],[19,-1,[]],[19,-1,[]],[[2,20],[[18,[[12,[21]],22]]]],0,[19,15],[19,15],[19,15],[19,15],[19,15],[19,15],[19,15],[19,15],[[],[[0,[[23,[-1]]]]],[24,25]],[[26,16],[[18,[15,17]]]],[[27,16],[[18,[15,17]]]],[[28,16],29],[[30,16],[[18,[15,17]]]],[[14,16],29],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,[[18,[31,32]]],[]],[-1,[[18,[31,32]]],[]],[-1,[[18,[31,32]]],[]],[-1,[[18,[31,32]]],[]],[-1,[[18,[31,32]]],[]],[-1,[[18,[31,32]]],[]],[-1,[[18,[31,32]]],[]],[-1,[[18,[31,32]]],[]],[[33,34,20,35,35],[[18,[[36,[33]],37]]]],[[33,34,20,35,38],[[18,[[36,[33]],37]]]],[[33,34,35,35],[[18,[15,37]]]],[[33,34,[12,[20]],[39,[35]],38],[[18,[[40,[35]],37]]]],0,[[],19],[[],19],[[],19],[[],19],[[],19],[[],19],[[],19],[[],19],[[33,41,42],15],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[[[43,[-1]]],[[43,[44]]],[]],[[[43,[-1]]],[[43,[44]]],[]],[[[43,[-1]]],[[43,[44]]],[]],[[[43,[-1]]],[[43,[44]]],[]],[[[43,[-1]]],[[43,[44]]],[]],[[[43,[-1]]],[[43,[44]]],[]],[[[43,[-1]]],[[43,[44]]],[]],[[[43,[-1]]],[[43,[44]]],[]],[[[8,[-1]]],[[8,[44]]],[]],[[[8,[-1]]],[[8,[44]]],[]],[[[8,[-1]]],[[8,[44]]],[]],[[[8,[-1]]],[[8,[44]]],[]],[[[8,[-1]]],[[8,[44]]],[]],[[[45,[-1]]],[[45,[44]]],[]],[[[45,[-1]]],[[45,[44]]],[]],[[[45,[-1]]],[[45,[44]]],[]],[[[45,[-1]]],[[45,[44]]],[]],[[[45,[-1]]],[[45,[44]]],[]],[[[45,[-1]]],[[45,[44]]],[]],[[[45,[-1]]],[[45,[44]]],[]],[[[45,[-1]]],[[45,[44]]],[]],[-1,[[46,[-2]]],[],[]],[-1,[[46,[-2]]],[],[]],[-1,[[46,[-2]]],[],[]],[-1,[[46,[-2]]],[],[]],[-1,[[46,[-2]]],[],[]],[-1,[[46,[-2]]],[],[]],[-1,[[46,[-2]]],[],[]],[-1,[[46,[-2]]],[],[]],0,[2,15],[[[47,[-1]],-2],[[18,[15,[48,[32]]]]],49,[[50,[[40,[35]]]]]],0,[[],[[15,[[0,[[23,[-1]]]],51]]],[24,25]],0,[[52,[8,[53]],[8,[54]],55,56,56,57],[[58,[[43,[[47,[-1]]]]]]],49],[[59,[12,[11]]],[[15,[33,2,[61,[60]]]]]],[[62,62,62,63],14],[[-1,31],[[18,[[64,[-2]],32]]],[],65],[[-1,31],[[18,[[64,[-2]],32]]],[],65],[[-1,31],[[18,[[64,[-2]],32]]],[],65],[[-1,31],[[18,[[64,[-2]],32]]],[],65],[[-1,31],[[18,[[64,[-2]],32]]],[],65],[[-1,31],[[18,[[64,[-2]],32]]],[],65],[[-1,31],[[18,[[64,[-2]],32]]],[],65],[[-1,31],[[18,[[64,[-2]],32]]],[],65],0,[[33,20,34,[66,[33]]],15],[[33,67],15],0,[[33,68],[[71,[[70,[[69,[33]]]]]]]],[2,15],[[72,-1,-2],[[18,[15,73]]],74,[[76,[75]]]],[[72,-1,-2],[[18,[15,73]]],74,[[76,[75]]]],[[72,-1,-2],[[18,[15,73]]],74,[[76,[75]]]],[[72,-1,-2],[[18,[15,73]]],74,[[76,[75]]]],[[72,-1,-2],[[18,[15,73]]],74,[[76,[75]]]],[[72,-1,-2],[[18,[15,73]]],74,[[76,[75]]]],[[72,-1,-2],[[18,[15,73]]],74,[[76,[75]]]],[[72,-1,-2],[[18,[15,73]]],74,[[76,[75]]]],[[2,20,56],[[12,[21]]]],0,[[2,21,60],42],[[-1,[64,[-2]]],[[18,[15,32]]],[],65],[[-1,[64,[-2]]],[[18,[15,32]]],[],65],[[-1,[64,[-2]]],[[18,[15,32]]],[],65],[[-1,[64,[-2]]],[[18,[15,32]]],[],65],[[-1,[64,[-2]]],[[18,[15,32]]],[],65],[[-1,[64,[-2]]],[[18,[15,32]]],[],65],[[-1,[64,[-2]]],[[18,[15,32]]],[],65],[[-1,[64,[-2]]],[[18,[15,32]]],[],65],0,[[[43,[[47,[-1]]]],20],[[58,[0]]],49],0,[[77,59,[79,[[15,[20,78]]]],[40,[35]],[12,[11]],[12,[80]]],[[58,[[15,[[81,[33]],2,[61,[60]]]]]]]],0,0,[-1,-2,[],[]],[-1,-2,[],[]],[[82,20,56],[[58,[[12,[[0,[[23,[-1]]]]]]]]],[24,25]],[-1,[[18,[-2]]],[],[]],[-1,[[18,[-2]]],[],[]],[-1,[[18,[-2]]],[],[]],[-1,[[18,[-2]]],[],[]],[-1,[[18,[-2]]],[],[]],[-1,[[18,[-2]]],[],[]],[-1,[[18,[-2]]],[],[]],[-1,[[18,[-2]]],[],[]],[-1,[[18,[-2]]],[],[]],[-1,[[18,[-2]]],[],[]],[-1,[[18,[-2]]],[],[]],[-1,[[18,[-2]]],[],[]],[-1,[[18,[-2]]],[],[]],[-1,[[18,[-2]]],[],[]],[-1,[[18,[-2]]],[],[]],[-1,[[18,[-2]]],[],[]],[-1,83,[]],[-1,83,[]],[-1,83,[]],[-1,83,[]],[-1,83,[]],[-1,83,[]],[-1,83,[]],[-1,83,[]],[-1,56,[]],[-1,56,[]],[-1,56,[]],[-1,56,[]],[-1,56,[]],[-1,56,[]],[-1,56,[]],[-1,56,[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"c":[],"p":[[8,"CastFrom",292],[3,"Connectivity",0],[3,"ConnectionPoolApi",293],[3,"KademliaApi",294],[3,"BuiltinsConfig",295],[3,"ServicesMetrics",296],[3,"KeyStorage",297],[3,"Arc",298],[3,"Workers",299],[3,"PeerScopes",300],[3,"HealthCheckRegistry",301],[4,"Option",302],[3,"Builtins",295],[3,"Versions",0],[15,"tuple"],[3,"Formatter",303],[3,"Error",303],[4,"Result",304],[15,"usize"],[3,"PeerId",305],[3,"Contact",306],[4,"KademliaError",307],[8,"Layer",308],[8,"Subscriber",309],[8,"LookupSpan",310],[4,"KademliaCommand",0],[4,"ConnectionPoolCommand",0],[3,"StartedHttp",0],[6,"Result",303],[4,"FluenceNetworkBehaviourEvent",0],[3,"FdFlags",311],[3,"Error",312],[3,"FluenceNetworkBehaviour",0],[3,"ConnectionId",313],[3,"Multiaddr",314],[6,"THandler",315],[3,"ConnectionDenied",315],[4,"Endpoint",316],[15,"slice"],[3,"Vec",317],[4,"Event",318],[15,"bool"],[3,"Box",319],[8,"Any",320],[3,"Rc",321],[3,"Request",322],[3,"Node",0],[4,"TransportError",323],[8,"AquaRuntime",324],[8,"Into",325],[3,"WorkerGuard",326],[3,"ResolvedConfig",327],[8,"CoreDistributor",328],[8,"ThreadPinner",329],[3,"DataStoreConfig",330],[15,"str"],[3,"SystemServiceDistros",331],[6,"Result",332],[3,"NetworkConfig",333],[3,"ExtendedParticle",334],[3,"Receiver",335],[3,"String",336],[3,"Versions",331],[3,"SetFdFlags",311],[8,"AsFilelike",337],[6,"THandlerOutEvent",315],[4,"FromSwarm",338],[3,"Context",339],[6,"THandlerInEvent",315],[4,"ToSwarm",338],[4,"Poll",340],[3,"RawCodec",341],[3,"Error",342],[8,"Read",343],[3,"Cid",344],[8,"Extend",345],[3,"Keypair",346],[3,"StreamMuxerBox",347],[3,"Boxed",348],[3,"Registry",349],[3,"Swarm",315],[4,"TracingConfig",327],[3,"TypeId",320],[3,"RemoteRoutingEffects",350],[4,"AquamarineApiError",351],[3,"AquamarineApi",352],[3,"AquamarineBackend",352],[3,"Deployer",353],[3,"SpellEventBusApi",354],[3,"SpellEventBus",355],[3,"TriggerEvent",354],[3,"UnboundedReceiver",356],[3,"Sorcerer",357],[3,"Metrics",358],[3,"ServicesMetricsBackend",359],[4,"SocketAddr",360],[3,"ChainListener",361],[13,"Dial",268],[13,"Connect",268],[13,"Send",268],[13,"Disconnect",268],[13,"IsConnected",268],[13,"GetContact",268],[13,"CountConnections",268],[13,"LifecycleEvents",268],[13,"AddContact",283],[13,"Neighborhood",283],[13,"LocalLookup",283],[13,"Bootstrap",283],[13,"DiscoverPeer",283]],"b":[[35,"impl-AsRef%3CConnectionPoolApi%3E-for-Connectivity"],[36,"impl-AsRef%3CKademliaApi%3E-for-Connectivity"]]},\ +"particle_args":{"doc":"","t":"ENDENNNNDNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLFLLLLLLLMMLLLLLLLLLLLLLLLLLLLMLLLLLMLLLLLLLLLLLLLLLLLLLLLLMMMMMMMMM","n":["AVMError","AnomalyDataSeError","Args","ArgsError","DataStoreError","DeserializeError","InterpreterFailed","InvalidFormat","JError","MissingField","NonUnaryOption","RunnerError","SerdeJson","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone_into","clone_into","debug","debug","debug","debug","deref","deref","deref","deref","deref_mut","deref_mut","deref_mut","deref_mut","drop","drop","drop","drop","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from_base58","from_eyre","from_fd","from_filelike","from_grip","from_into_filelike","from_into_socketlike","from_socketlike","function_args","function_name","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","init","init","init","init","into","into","into","into","new","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","next","next_opt","service_id","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","source","tetraplets","to_owned","to_owned","to_string","to_string","to_string","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","vzip","vzip","vzip","vzip","err","err","expected_type","field","field","field","field","length","value"],"q":[[0,"particle_args"],[114,"particle_args::ArgsError"],[123,"core::fmt"],[124,"core::fmt"],[125,"core::fmt"],[126,"alloc::vec"],[127,"core::iter::traits::iterator"],[128,"eyre"],[129,"std::os::fd::owned"],[130,"io_lifetimes::portability"],[131,"io_lifetimes::portability"],[132,"std::io::error"],[133,"core::convert"],[134,"system_interface::fs::fd_flags"],[135,"core::option"],[136,"alloc::string"],[137,"avm_interface::call_request_parameters"],[138,"core::any"]],"d":["","This errors are encountered from serialization of data …","Arguments passed by VM to host on call_service","","This errors are encountered from a data store object.","","This error contains interpreter outcome in case when …","","An error that can be created from any other error …","","","This errors are encountered from an AVM runner.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","","","Returns the argument unchanged.","","Returns the argument unchanged.","","","","","","","","","","","","","","","","","","","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","Retrieves next json value from iterator, parse it to T …","Retrieves a json value from iterator if it’s not empty, …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""],"i":[0,10,0,0,10,9,10,9,0,9,9,10,9,1,9,2,10,1,9,2,10,1,2,1,2,1,9,2,10,1,9,2,10,1,9,2,10,1,9,2,10,1,9,9,2,2,10,10,1,9,2,2,2,10,10,10,0,2,10,10,10,10,10,10,1,1,1,9,2,10,1,9,2,10,1,9,2,10,2,1,9,2,10,1,1,1,1,9,2,10,10,1,1,2,9,2,10,1,1,9,2,10,1,9,2,10,1,9,2,10,1,9,2,10,33,34,35,33,34,36,35,36,35],"f":[0,0,0,0,0,0,0,0,0,0,0,0,0,[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[1,1],[2,2],[[-1,-2],3,[],[]],[[-1,-2],3,[],[]],[4,[[6,[3,5]]]],[4,[[6,[3,5]]]],[4,[[6,[3,5]]]],[4,[[6,[3,5]]]],[7,-1,[]],[7,-1,[]],[7,-1,[]],[7,-1,[]],[7,-1,[]],[7,-1,[]],[7,-1,[]],[7,-1,[]],[7,3],[7,3],[7,3],[7,3],[[1,4],8],[[9,4],8],[[9,4],8],[[2,4],8],[[2,4],8],[[[10,[-1]],4],[[6,[3,5]]],11],[[[10,[-1]],4],[[6,[3,5]]],12],[-1,-1,[]],[-1,-1,[]],[-1,2,13],[14,-1,[]],[-1,-1,[]],[14,-1,[]],[-1,-1,[]],[-1,[[10,[-1]]],[]],[[15,-1],[[6,[[17,[16]],9]]],18],[19,2],[20,-1,[]],[20,-1,[]],[20,-1,[]],[-1,-2,21,[]],[-1,-2,22,[]],[20,-1,[]],0,0,[-1,[[6,[23,24]]],[]],[-1,[[6,[23,24]]],[]],[-1,[[6,[23,24]]],[]],[-1,[[6,[23,24]]],[]],[[],7],[[],7],[[],7],[[],7],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,2,[[25,[15]]]],[[-1,23],[[6,[[26,[-2]],24]]],[],27],[[-1,23],[[6,[[26,[-2]],24]]],[],27],[[-1,23],[[6,[[26,[-2]],24]]],[],27],[[-1,23],[[6,[[26,[-2]],24]]],[],27],[[15,-1],[[6,[-2,9]]],18,28],[[15,-1],[[6,[[29,[-2]],9]]],18,28],0,[[-1,[26,[-2]]],[[6,[3,24]]],[],27],[[-1,[26,[-2]]],[[6,[3,24]]],[],27],[[-1,[26,[-2]]],[[6,[3,24]]],[],27],[[-1,[26,[-2]]],[[6,[3,24]]],[],27],[[[10,[-1]]],[[29,[13]]],13],0,[-1,-2,[],[]],[-1,-2,[],[]],[-1,30,[]],[-1,30,[]],[-1,30,[]],[31,[[6,[1]]]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,32,[]],[-1,32,[]],[-1,32,[]],[-1,32,[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],0,0,0,0,0,0,0,0,0],"c":[],"p":[[3,"Args",0],[3,"JError",0],[15,"tuple"],[3,"Formatter",123],[3,"Error",123],[4,"Result",124],[15,"usize"],[6,"Result",123],[4,"ArgsError",0],[4,"AVMError",0],[8,"Debug",123],[8,"Display",123],[8,"Error",125],[15,"never"],[15,"str"],[15,"u8"],[3,"Vec",126],[8,"Iterator",127],[3,"Report",128],[3,"OwnedFd",129],[8,"IntoFilelike",130],[8,"IntoSocketlike",130],[3,"FdFlags",131],[3,"Error",132],[8,"AsRef",133],[3,"SetFdFlags",131],[8,"AsFilelike",130],[8,"Deserialize",134],[4,"Option",135],[3,"String",136],[3,"CallRequestParams",137],[3,"TypeId",138],[13,"SerdeJson",114],[13,"InvalidFormat",114],[13,"DeserializeError",114],[13,"NonUnaryOption",114]],"b":[[42,"impl-Display-for-ArgsError"],[43,"impl-Debug-for-ArgsError"],[44,"impl-Debug-for-JError"],[45,"impl-Display-for-JError"],[46,"impl-Debug-for-AVMError%3CE%3E"],[47,"impl-Display-for-AVMError%3CE%3E"]]},\ +"particle_builtins":{"doc":"","t":"DDDDDMMMMLLLLLLLLLLLMLLLLLLMLMLLLLLMLLLLLLLLLLLLLLLMMLMMLLLLLLLLLMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMMMMMLLLLLLLLLMFMMMLLLLLLLMMLLLLLMLLLLLLLLLLLLLLLLLLLLLLLLLLLMFF","n":["Builtins","BuiltinsConfig","CustomService","NodeInfo","ParticleAppServicesConfig","air_version","allowed_binaries","allowed_effectors","blueprint_dir","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","builtins_call","builtins_management_peer_id","call","call","clone","clone","clone_into","clone_into","connectivity","custom_service_call","custom_services","debug","debug","debug","debug","debug","default_service_memory_limit","deref","deref","deref","deref","deref","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","drop","drop","drop","drop","drop","envs","ephemeral_work_dir","extend","external_addresses","fallback","fmt","fmt","fmt","fmt","from","from","from","from","from","functions","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","init","init","init","init","init","into","into","into","into","into","into_any","into_any","into_any","into_any","into_any","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","is_dev_mode","local_peer_id","management_peer_id","modules","modules_dir","mounted_binaries_mapping","new","new","new","new","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","node_version","ok","particle_app_services","particles_vault_dir","persistent_work_dir","references","references","references","references","references","remove","serialize","services","services_dir","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","spell_version","to_owned","to_owned","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_name","type_name","type_name","type_name","type_name","vzip","vzip","vzip","vzip","vzip","wasm_backend_config","wrap","wrap_unit"],"q":[[0,"particle_builtins"],[161,"particle_args::args"],[162,"particle_execution::particle_params"],[163,"particle_execution::function_outcome"],[164,"core::clone"],[165,"core::marker"],[166,"core::marker"],[167,"core::convert"],[168,"connection_pool::api"],[169,"core::future::future"],[170,"alloc::boxed"],[171,"core::pin"],[172,"core::fmt"],[173,"core::fmt"],[174,"alloc::string"],[175,"particle_execution::particle_function"],[176,"std::collections::hash::map"],[177,"core::option"],[178,"core::fmt"],[179,"std::io::error"],[180,"core::any"],[181,"alloc::sync"],[182,"alloc::rc"],[183,"alloc::vec"],[184,"peer_metrics::services_metrics"],[185,"workers::key_storage"],[186,"workers::workers"],[187,"workers::scope"],[188,"health"],[189,"std::path"],[190,"cid_utils::hash"],[191,"libp2p_identity::peer_id"],[192,"bytesize"],[193,"particle_services::config"],[194,"system_interface::fs::fd_flags"],[195,"serde_json::value"],[196,"libipld_core::raw"],[197,"anyhow"],[198,"std::io"],[199,"cid::cid"],[200,"core::iter::traits::collect"],[201,"serde::ser"],[202,"core::any"]],"d":["","","","","","","","List of allowed effector modules by CID","Path of the blueprint directory containing blueprints and …","","","","","","","","","","","","key to manage builtins services initialization","","","","","","","","","","","","","","","Default heap size in bytes available for the module unless …","","","","","","","","","","","","","","","","Opaque environment variables to be passed on each service …","Ephemeral working dir for services","","","if set, all function_name mismatches with …","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","(function_name -> service function)","","","","","","","","","","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","Is in the developer mode","Peer id of the current node","key that could manage services","","Dir to store .wasm modules and their configs","Mapping of binary names to their paths for mounted …","","","","","","","","","","","","","Dir to store directories shared between services in the …","Persistent working dir for services","","","","","","","","","Dir to persist info about running services","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","config for the wasmtime backend","",""],"i":[0,0,0,0,0,14,14,27,27,35,1,27,14,15,35,1,27,14,15,1,15,1,1,14,15,14,15,1,1,1,35,1,27,14,15,15,35,1,27,14,15,35,1,27,14,15,35,1,27,14,15,15,15,1,14,35,1,27,14,15,35,1,27,14,15,35,35,1,27,14,15,35,1,27,14,15,35,1,27,14,15,35,1,27,14,15,35,1,27,14,15,35,1,27,14,15,27,15,15,1,27,27,35,1,27,15,35,1,27,14,15,14,0,27,15,15,35,1,27,14,15,1,14,1,15,35,1,27,14,15,14,14,15,35,1,27,14,15,35,1,27,14,15,35,1,27,14,15,35,1,27,14,15,35,1,27,14,15,15,0,0],"f":[0,0,0,0,0,0,0,0,0,[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[[[1,[-1]],2,3],4,[5,6,7,[9,[8]],[9,[10]]]],0,[[[1,[-1]],2,3],4,[5,6,7,[9,[8]],[9,[10]]]],[[[1,[-1]],2,3],[[13,[[12,[11]]]]],[5,6,7,[9,[8]],[9,[10]]]],[14,14],[15,15],[[-1,-2],16,[],[]],[[-1,-2],16,[],[]],0,[[[1,[-1]],2,3],4,[5,6,7,[9,[8]],[9,[10]]]],0,[17,[[19,[16,18]]]],[17,[[19,[16,18]]]],[17,[[19,[16,18]]]],[17,[[19,[16,18]]]],[17,[[19,[16,18]]]],0,[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,16],[20,16],[20,16],[20,16],[20,16],0,0,[[[1,[-1]],21,[23,[21,22]],[24,[22]]],[[13,[[12,[11]]]]],[5,6,7,[9,[8]],[9,[10]]]],0,0,[[[1,[-1]],17],25,26],[[27,17],25],[[14,17],25],[[15,17],[[19,[16,18]]]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],0,[-1,[[19,[28,29]]],[]],[-1,[[19,[28,29]]],[]],[-1,[[19,[28,29]]],[]],[-1,[[19,[28,29]]],[]],[-1,[[19,[28,29]]],[]],[[],20],[[],20],[[],20],[[],20],[[],20],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[[[12,[-1]]],[[12,[30]]],[]],[[[12,[-1]]],[[12,[30]]],[]],[[[12,[-1]]],[[12,[30]]],[]],[[[12,[-1]]],[[12,[30]]],[]],[[[12,[-1]]],[[12,[30]]],[]],[[[31,[-1]]],[[31,[30]]],[]],[[[31,[-1]]],[[31,[30]]],[]],[[[31,[-1]]],[[31,[30]]],[]],[[[31,[-1]]],[[31,[30]]],[]],[[[31,[-1]]],[[31,[30]]],[]],[[[32,[-1]]],[[32,[30]]],[]],[[[32,[-1]]],[[32,[30]]],[]],[[[32,[-1]]],[[32,[30]]],[]],[[[32,[-1]]],[[32,[30]]],[]],[[[32,[-1]]],[[32,[30]]],[]],0,0,0,0,0,0,[[[34,[[16,[33,22]]]],[24,[22]]],35],[[27,-1,36,[31,[37]],[31,[38]],39,[24,[40]]],[[1,[-1]]],[5,6,7,[9,[8]],[9,[10]]]],[[15,41,[23,[42,[23,[21,41]]]],[23,[21,41]],43],[[19,[27,29]]]],[[44,41,41,41,[23,[21,21]],44,44,[24,[45]],46],[[19,[15,29]]]],[[-1,28],[[19,[[47,[-2]],29]]],[],48],[[-1,28],[[19,[[47,[-2]],29]]],[],48],[[-1,28],[[19,[[47,[-2]],29]]],[],48],[[-1,28],[[19,[[47,[-2]],29]]],[],48],[[-1,28],[[19,[[47,[-2]],29]]],[],48],0,[49,4],0,0,0,[[50,-1,-2],[[19,[16,51]]],52,[[54,[53]]]],[[50,-1,-2],[[19,[16,51]]],52,[[54,[53]]]],[[50,-1,-2],[[19,[16,51]]],52,[[54,[53]]]],[[50,-1,-2],[[19,[16,51]]],52,[[54,[53]]]],[[50,-1,-2],[[19,[16,51]]],52,[[54,[53]]]],[[[1,[-1]],33],[[13,[[12,[11]]]]],[5,6,7,[9,[8]],[9,[10]]]],[[14,-1],19,55],0,0,[[-1,[47,[-2]]],[[19,[16,29]]],[],48],[[-1,[47,[-2]]],[[19,[16,29]]],[],48],[[-1,[47,[-2]]],[[19,[16,29]]],[],48],[[-1,[47,[-2]]],[[19,[16,29]]],[],48],[[-1,[47,[-2]]],[[19,[16,29]]],[],48],0,[-1,-2,[],[]],[-1,-2,[],[]],[-1,[[19,[-2]]],[],[]],[-1,[[19,[-2]]],[],[]],[-1,[[19,[-2]]],[],[]],[-1,[[19,[-2]]],[],[]],[-1,[[19,[-2]]],[],[]],[-1,[[19,[-2]]],[],[]],[-1,[[19,[-2]]],[],[]],[-1,[[19,[-2]]],[],[]],[-1,[[19,[-2]]],[],[]],[-1,[[19,[-2]]],[],[]],[-1,56,[]],[-1,56,[]],[-1,56,[]],[-1,56,[]],[-1,56,[]],[-1,33,[]],[-1,33,[]],[-1,33,[]],[-1,33,[]],[-1,33,[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],0,[[[19,[49,57]]],4],[[[19,[16,57]]],4]],"c":[],"p":[[3,"Builtins",0],[3,"Args",161],[3,"ParticleParams",162],[4,"FunctionOutcome",163],[8,"Clone",164],[8,"Send",165],[8,"Sync",165],[3,"KademliaApi",166],[8,"AsRef",167],[3,"ConnectionPoolApi",168],[8,"Future",169],[3,"Box",170],[3,"Pin",171],[3,"NodeInfo",0],[3,"ParticleAppServicesConfig",0],[15,"tuple"],[3,"Formatter",172],[3,"Error",172],[4,"Result",173],[15,"usize"],[3,"String",174],[4,"ServiceFunction",175],[3,"HashMap",176],[4,"Option",177],[6,"Result",172],[8,"Debug",172],[3,"BuiltinsConfig",0],[3,"FdFlags",178],[3,"Error",179],[8,"Any",180],[3,"Arc",181],[3,"Rc",182],[15,"str"],[3,"Vec",183],[3,"CustomService",0],[3,"ServicesMetrics",184],[3,"KeyStorage",185],[3,"Workers",186],[3,"PeerScopes",187],[3,"HealthCheckRegistry",188],[3,"PathBuf",189],[3,"Hash",190],[15,"bool"],[3,"PeerId",191],[3,"ByteSize",192],[3,"WasmBackendConfig",193],[3,"SetFdFlags",178],[8,"AsFilelike",194],[4,"Value",195],[3,"RawCodec",196],[3,"Error",197],[8,"Read",198],[3,"Cid",199],[8,"Extend",200],[8,"Serializer",201],[3,"TypeId",180],[3,"JError",202]],"b":[[21,"impl-Builtins%3CC%3E"],[22,"impl-ParticleFunction-for-Builtins%3CC%3E"]]},\ +"particle_execution":{"doc":"","t":"NNNNENNNNNNIIGIDDNEGGRENNLLLLLLLLLLLKKLKLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLKKLLLLLLLLLLLLLLLLLLLLLLLMLLLLLMLLLLLLLLLLLLLLLLLLMLLLKKMLLLLLMLMLLLLLLMLLLLLLLLLLMLLLLLLLLLLLMM","n":["CleanupVault","CreateVault","Empty","Err","FunctionOutcome","Immut","InitializeVault","Mut","NotDefined","NotFound","Ok","ParticleFunction","ParticleFunctionMut","ParticleFunctionOutput","ParticleFunctionStatic","ParticleParams","ParticleVault","ReadVault","ServiceFunction","ServiceFunctionImmut","ServiceFunctionMut","VIRTUAL_PARTICLE_VAULT_PREFIX","VaultError","WriteVault","WrongVault","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","branch","call","call","call","call_mut","cat","cat_slice","cleanup","clone","clone","clone","clone_from","clone_into","clone_into","clone_into","create","debug","debug","debug","debug","debug","deref","deref","deref","deref","deref","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","drop","drop","drop","drop","drop","extend","extend","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from_output","from_residual","from_residual","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_spell_id","id","init","init","init","init","init","init_peer_id","initialize","initialize_worker","inject_vault","into","into","into","into","into","is_defined","is_spell_particle","new","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","not_err","or_else","peer_scope","put","real_particle_vault","real_worker_particle_vault","remove","remove","script","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","signature","source","timestamp","to_owned","to_owned","to_owned","to_particle_parameters","to_real_path","to_string","token","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","ttl","type_id","type_id","type_id","type_id","type_id","virtual_particle_vault","vzip","vzip","vzip","vzip","vzip","args","params"],"q":[[0,"particle_execution"],[165,"particle_execution::FunctionOutcome"],[167,"core::ops::control_flow"],[168,"particle_args::args"],[169,"core::future::future"],[170,"alloc::boxed"],[171,"core::pin"],[172,"libp2p_identity::peer_id"],[173,"std::path"],[174,"alloc::string"],[175,"core::result"],[176,"alloc::vec"],[177,"particle_protocol::particle"],[178,"types::peer_scope"],[179,"core::fmt"],[180,"core::fmt"],[181,"core::option"],[182,"core::fmt"],[183,"particle_args::args_error"],[184,"core::convert"],[185,"core::convert"],[186,"std::io::error"],[187,"marine::wasmtime"],[188,"eyre"],[189,"std::path"],[190,"core::ops::function"],[191,"marine_call_parameters"],[192,"core::any"]],"d":["","","","","","","","","","","","","","","","Lightweight, static version of the [Particle] structure It …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","","Returns the argument unchanged.","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","","","","","","","","","","","","","","","","","","Map vault_dir/$current-peer-id to /tmp/vault inside the …","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Returns false if variant is [NotDefined]","","","","","","","","Returns false if variant is Err","","","","Returns Particle File Vault path on Nox’s filesystem","","","","","","","","","","","","Unix timestamp in milliseconds","","","","","Converts virtual path with VIRTUAL_PARTICLE_VAULT_PREFIX …","","","","","","","","","","","","","TTL in milliseconds","","","","","","Returns Particle File Vault path on Marine’s filesystem …","","","","","","",""],"i":[14,14,1,1,0,8,14,8,1,14,1,0,0,0,0,0,0,14,0,0,0,0,0,14,14,8,1,4,10,14,8,1,4,10,14,1,46,47,8,48,10,10,10,1,4,10,4,1,4,10,10,8,1,4,10,14,8,1,4,10,14,8,1,4,10,14,8,1,4,10,14,46,47,1,4,10,14,14,8,8,8,1,1,1,4,10,14,1,1,1,8,1,4,10,14,4,4,8,1,4,10,14,4,10,10,10,8,1,4,10,14,1,4,10,8,1,4,10,14,1,1,4,10,10,10,46,47,4,8,1,4,10,14,4,14,4,1,4,10,4,10,14,4,8,1,4,10,14,8,1,4,10,14,4,8,1,4,10,14,10,8,1,4,10,14,49,49],"f":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[1,2],[[-1,3,4],[[7,[[6,[5]]]]],[]],[[-1,3,4],[[7,[[6,[5]]]]],[]],[[8,3,4],1],[[-1,3,4],9,[]],[[10,11,4,12],[[15,[13,14]]]],[[10,11,4,12],[[15,[[17,[16]],14]]]],[[10,11,18,18],[[15,[19,14]]]],[1,1],[4,4],[10,10],[[20,21,13],4],[[-1,-2],19,[],[]],[[-1,-2],19,[],[]],[[-1,-2],19,[],[]],[[10,11,18,18],[[15,[19,14]]]],[22,[[15,[19,23]]]],[22,[[15,[19,23]]]],[22,[[15,[19,23]]]],[22,[[15,[19,23]]]],[22,[[15,[19,23]]]],[24,-1,[]],[24,-1,[]],[24,-1,[]],[24,-1,[]],[24,-1,[]],[24,-1,[]],[24,-1,[]],[24,-1,[]],[24,-1,[]],[24,-1,[]],[24,19],[24,19],[24,19],[24,19],[24,19],[[-1,13,[25,[13,8]],[26,[8]]],[[7,[[6,[5]]]]],[]],[[-1,13,[25,[13,8]],[26,[8]]],[[7,[[6,[5]]]]],[]],[[1,22],27],[[4,22],27],[[10,22],27],[[14,22],27],[[14,22],27],[28,8],[-1,-1,[]],[29,8],[-1,-1,[]],[30,-1,[]],[-1,1,31],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[[],1],[32,1],[[[15,[33,-1]]],1,[[34,[32]]]],[-1,[[15,[35,36]]],[]],[-1,[[15,[35,36]]],[]],[-1,[[15,[35,36]]],[]],[-1,[[15,[35,36]]],[]],[-1,[[15,[35,36]]],[]],[18,[[26,[13]]]],0,[[],24],[[],24],[[],24],[[],24],[[],24],0,[10,[[15,[19,14]]]],[[10,11],[[15,[19,14]]]],[[10,11,37],[[38,[19]]]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[1,39],[18,39],[40,10],[[-1,35],[[15,[[41,[-2]],36]]],[],42],[[-1,35],[[15,[[41,[-2]],36]]],[],42],[[-1,35],[[15,[[41,[-2]],36]]],[],42],[[-1,35],[[15,[[41,[-2]],36]]],[],42],[[-1,35],[[15,[[41,[-2]],36]]],[],42],[1,39],[[1,-1],1,43],0,[[10,11,4,13,18],[[15,[40,14]]]],[[10,11,18,18],40],[[10,11],40],[[-1,18],[[7,[[6,[5]]]]],[]],[[-1,18],[[7,[[6,[5]]]]],[]],0,[[-1,[41,[-2]]],[[15,[19,36]]],[],42],[[-1,[41,[-2]]],[[15,[19,36]]],[],42],[[-1,[41,[-2]]],[[15,[19,36]]],[],42],[[-1,[41,[-2]]],[[15,[19,36]]],[],42],[[-1,[41,[-2]]],[[15,[19,36]]],[],42],0,[14,[[26,[31]]]],0,[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[4,44],[[10,11,4,12],[[15,[40,14]]]],[-1,13,[]],0,[-1,[[15,[-2]]],[],[]],[-1,[[15,[-2]]],[],[]],[-1,[[15,[-2]]],[],[]],[-1,[[15,[-2]]],[],[]],[-1,[[15,[-2]]],[],[]],[-1,[[15,[-2]]],[],[]],[-1,[[15,[-2]]],[],[]],[-1,[[15,[-2]]],[],[]],[-1,[[15,[-2]]],[],[]],[-1,[[15,[-2]]],[],[]],0,[-1,45,[]],[-1,45,[]],[-1,45,[]],[-1,45,[]],[-1,45,[]],[[10,18,18],40],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],0,0],"c":[],"p":[[4,"FunctionOutcome",0],[4,"ControlFlow",167],[3,"Args",168],[3,"ParticleParams",0],[8,"Future",169],[3,"Box",170],[3,"Pin",171],[4,"ServiceFunction",0],[6,"ParticleFunctionOutput",0],[3,"ParticleVault",0],[3,"PeerId",172],[3,"Path",173],[3,"String",174],[4,"VaultError",0],[4,"Result",175],[15,"u8"],[3,"Vec",176],[15,"str"],[15,"tuple"],[3,"Particle",177],[4,"PeerScope",178],[3,"Formatter",179],[3,"Error",179],[15,"usize"],[3,"HashMap",180],[4,"Option",181],[6,"Result",179],[6,"ServiceFunctionImmut",0],[6,"ServiceFunctionMut",0],[15,"never"],[8,"Error",182],[3,"JError",183],[4,"Infallible",184],[8,"Into",184],[3,"FdFlags",185],[3,"Error",186],[6,"ModuleDescriptor",187],[6,"Result",188],[15,"bool"],[3,"PathBuf",173],[3,"SetFdFlags",185],[8,"AsFilelike",189],[8,"FnOnce",190],[3,"ParticleParameters",191],[3,"TypeId",192],[8,"ParticleFunction",0],[8,"ParticleFunctionStatic",0],[8,"ParticleFunctionMut",0],[13,"NotDefined",165]],"b":[[76,"impl-Debug-for-VaultError"],[77,"impl-Display-for-VaultError"],[78,"impl-From%3CBox%3Cdyn+Fn(Args,+ParticleParams)+-%3E+Pin%3CBox%3Cdyn+Future%3COutput+=+FunctionOutcome%3E+%2B+Send%3E%3E+%2B+Send+%2B+Sync%3E%3E-for-ServiceFunction"],[80,"impl-From%3CBox%3Cdyn+FnMut(Args,+ParticleParams)+-%3E+Pin%3CBox%3Cdyn+Future%3COutput+=+FunctionOutcome%3E+%2B+Send%3E%3E+%2B+Send+%2B+Sync%3E%3E-for-ServiceFunction"],[88,"impl-FromResidual-for-FunctionOutcome"],[89,"impl-FromResidual%3CResult%3CInfallible,+E%3E%3E-for-FunctionOutcome"]]},\ +"particle_modules":{"doc":"","t":"DNNDNNNNNNNNNNNNDNENNNDDNNNNNNNNDNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMLLLLLLLLLLLLMLLLLLLLLLLLLLLLLLLLLLLLLLMMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLFLFMFLFMMMMMMMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM","n":["AddBlueprint","AddModule","BlueprintNotFound","EffectorsMode","EmptyDependenciesList","FacadeShouldBeHash","ForbiddenEffector","IncorrectBlueprint","IncorrectModuleConfig","IncorrectVaultModuleConfig","InvalidEffectorMountedBinary","InvalidModuleConfigPath","InvalidModuleName","InvalidModulePath","InvalidModuleReference","MaxHeapSizeOverflow","ModuleConfig","ModuleConvertError","ModuleError","ModuleInfo","ModuleInvalidBase64","ModuleNotFound","ModuleRepository","NamedModuleConfig","NoModuleConfig","NoSuchBlueprint","ReadModuleInterfaceError","SerializeBlueprint","SerializeBlueprintJson","SerializeConfig","SerializeConfigJson","Vault","WASIConfig","WriteBlueprint","WriteConfig","WrongModuleHash","add_blueprint","add_module","add_module_base64","add_module_from_vault","add_system_module","all_effectors","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","config","debug","debug","debug","debug","debug","debug","debug","decode","default","default","default","default","dependencies","deref","deref","deref","deref","deref","deref","deref","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deserialize","deserialize","deserialize","drop","drop","drop","drop","drop","drop","drop","encode","envs","file_name","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","from","get_blueprint_from_cache","get_blueprints","get_facade_interface","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_interface","get_interface_by_hash","get_ipld","init","init","init","init","init","init","init","into","into","into","into","into","into","into","list_files","list_modules","load_blueprint","load_from","load_module_by_path","load_module_config_from_vault","load_module_descriptor","logger_enabled","logging_mask","mapped_dirs","modules_dir","mounted_binaries","name","name","new","new","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","references","references","references","references","references","references","references","resolve_blueprint","restricted_effectors","serialize","serialize","serialize","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","source","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_string","to_string","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","vzip","vzip","vzip","vzip","vzip","vzip","vzip","wasi","binary_name","blueprint","config","config_path","config_path","err","err","err","err","err","err","err","err","err","err","err","err","err","err","err","err","forbidden_cid","id","id","id","max_heap_size_allowed","max_heap_size_wanted","module_cid","module_name","module_name","module_path","path","path","path","path","path","path","path","reference"],"q":[[0,"particle_modules"],[235,"particle_modules::ModuleError"],[274,"alloc::string"],[275,"core::result"],[276,"alloc::vec"],[277,"cid_utils::hash"],[278,"particle_execution::particle_vault"],[279,"libp2p_identity::peer_id"],[280,"particle_execution::particle_params"],[281,"std::path"],[282,"std::collections::hash::map"],[283,"core::fmt"],[284,"core::fmt"],[285,"serde::de"],[286,"core::fmt"],[287,"marine_module_info_parser::errors"],[288,"particle_execution::particle_vault"],[289,"serde_json::value"],[290,"system_interface::fs::fd_flags"],[291,"std::io::error"],[292,"particle_args::args_error"],[293,"libipld_core::ipld"],[294,"std::path"],[295,"core::option"],[296,"marine::wasmtime"],[297,"system_interface::fs::fd_flags"],[298,"libipld_core::raw"],[299,"anyhow"],[300,"std::io"],[301,"cid::cid"],[302,"core::iter::traits::collect"],[303,"serde::ser"],[304,"core::error"],[305,"core::any"]],"d":["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Saves new blueprint to disk","","Adds a module to the filesystem, overwriting existing …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","encode IPLD object with DAG JSON codec","","","","","","","","","","","Returns the argument unchanged.","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","Get available blueprints","","","","","","","","","","","","","","","","","","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","List files in directory","","Load blueprint from disk","","","","Load ModuleDescriptor from disk for a given module name","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""],"i":[0,4,4,0,4,4,4,4,4,4,4,4,4,4,4,4,0,4,0,4,4,4,0,0,4,4,4,4,4,4,4,4,0,4,4,4,1,1,1,1,1,15,2,4,15,1,9,16,17,2,4,15,1,9,16,17,2,15,1,9,16,17,2,15,1,9,16,17,9,2,4,15,1,9,16,17,2,15,9,16,17,2,2,4,15,1,9,16,17,2,4,15,1,9,16,17,9,16,17,2,4,15,1,9,16,17,2,17,9,2,4,4,15,1,9,16,17,2,4,4,4,4,4,15,1,9,16,17,1,1,1,2,4,15,1,9,16,17,1,1,2,2,4,15,1,9,16,17,2,4,15,1,9,16,17,0,1,0,9,0,1,0,16,16,17,1,16,2,9,2,1,2,4,15,1,9,16,17,2,4,15,1,9,16,17,1,15,9,16,17,2,4,15,1,9,16,17,4,2,15,1,9,16,17,2,4,2,4,15,1,9,16,17,2,4,15,1,9,16,17,2,4,15,1,9,16,17,2,4,15,1,9,16,17,16,50,51,52,53,54,55,52,51,56,57,58,59,60,61,62,63,64,65,66,53,54,67,68,69,70,71,71,50,67,50,66,55,56,57,59,61,63,64,72],"f":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[1,2],[[5,[3,4]]]],[[1,3,[7,[6]]],[[5,[8,4]]]],[[1,3,9],[[5,[3,4]]]],[[1,10,11,3,3,12],[[5,[3,4]]]],[[1,[7,[6]],9],[[5,[8,4]]]],[[[14,[8,[14,[3,13]]]],[14,[3,13]]],15],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[2,2],[15,15],[1,1],[9,9],[16,16],[17,17],[[-1,-2],18,[],[]],[[-1,-2],18,[],[]],[[-1,-2],18,[],[]],[[-1,-2],18,[],[]],[[-1,-2],18,[],[]],[[-1,-2],18,[],[]],0,[19,[[5,[18,20]]]],[19,[[5,[18,20]]]],[19,[[5,[18,20]]]],[19,[[5,[18,20]]]],[19,[[5,[18,20]]]],[19,[[5,[18,20]]]],[19,[[5,[18,20]]]],[[[21,[6]]],[[5,[2,22]]]],[[],15],[[],9],[[],16],[[],17],0,[23,-1,[]],[23,-1,[]],[23,-1,[]],[23,-1,[]],[23,-1,[]],[23,-1,[]],[23,-1,[]],[23,-1,[]],[23,-1,[]],[23,-1,[]],[23,-1,[]],[23,-1,[]],[23,-1,[]],[23,-1,[]],[-1,[[5,[9]]],24],[-1,[[5,[16]]],24],[-1,[[5,[17]]],24],[23,18],[23,18],[23,18],[23,18],[23,18],[23,18],[23,18],[2,[[5,[[7,[6]],22]]]],0,0,[[2,19],[[5,[18,20]]]],[[4,19],25],[[4,19],25],[[15,19],25],[[1,19],25],[[9,19],[[5,[18,20]]]],[[16,19],[[5,[18,20]]]],[[17,19],[[5,[18,20]]]],[-1,-1,[]],[22,4],[26,4],[27,4],[28,4],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[[1,29],[[5,[30,4]]]],[1,[[7,[30]]]],[[1,29],[[5,[31,4]]]],[-1,[[5,[32,33]]],[]],[-1,[[5,[32,33]]],[]],[-1,[[5,[32,33]]],[]],[-1,[[5,[32,33]]],[]],[-1,[[5,[32,33]]],[]],[-1,[[5,[32,33]]],[]],[-1,[[5,[32,33]]],[]],[[1,29],[[5,[31,34]]]],[[1,8],[[5,[31,4]]]],[2,35],[[],23],[[],23],[[],23],[[],23],[[],23],[[],23],[[],23],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[36,[[38,[[0,[37]]]]]],[1,[[5,[31,34]]]],[[36,29],[[5,[30,4]]]],0,[36,[[5,[[7,[6]],4]]]],[[10,11,3,12],[[5,[9,4]]]],[[36,8],[[5,[39,4]]]],0,0,0,0,0,0,0,[[3,[7,[8]]],2],[[36,36,15],1],[[-1,32],[[5,[[40,[-2]],33]]],[],41],[[-1,32],[[5,[[40,[-2]],33]]],[],41],[[-1,32],[[5,[[40,[-2]],33]]],[],41],[[-1,32],[[5,[[40,[-2]],33]]],[],41],[[-1,32],[[5,[[40,[-2]],33]]],[],41],[[-1,32],[[5,[[40,[-2]],33]]],[],41],[[-1,32],[[5,[[40,[-2]],33]]],[],41],[[42,-1,-2],[[5,[18,43]]],44,[[46,[45]]]],[[42,-1,-2],[[5,[18,43]]],44,[[46,[45]]]],[[42,-1,-2],[[5,[18,43]]],44,[[46,[45]]]],[[42,-1,-2],[[5,[18,43]]],44,[[46,[45]]]],[[42,-1,-2],[[5,[18,43]]],44,[[46,[45]]]],[[42,-1,-2],[[5,[18,43]]],44,[[46,[45]]]],[[42,-1,-2],[[5,[18,43]]],44,[[46,[45]]]],[[1,29],[[5,[[7,[39]],4]]]],[[[14,[8,[14,[3,13]]]]],15],[[9,-1],5,47],[[16,-1],5,47],[[17,-1],5,47],[[-1,[40,[-2]]],[[5,[18,33]]],[],41],[[-1,[40,[-2]]],[[5,[18,33]]],[],41],[[-1,[40,[-2]]],[[5,[18,33]]],[],41],[[-1,[40,[-2]]],[[5,[18,33]]],[],41],[[-1,[40,[-2]]],[[5,[18,33]]],[],41],[[-1,[40,[-2]]],[[5,[18,33]]],[],41],[[-1,[40,[-2]]],[[5,[18,33]]],[],41],[4,[[38,[48]]]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[2,[[5,[3,22]]]],[-1,3,[]],[-1,[[5,[-2]]],[],[]],[-1,[[5,[-2]]],[],[]],[-1,[[5,[-2]]],[],[]],[-1,[[5,[-2]]],[],[]],[-1,[[5,[-2]]],[],[]],[-1,[[5,[-2]]],[],[]],[-1,[[5,[-2]]],[],[]],[-1,[[5,[-2]]],[],[]],[-1,[[5,[-2]]],[],[]],[-1,[[5,[-2]]],[],[]],[-1,[[5,[-2]]],[],[]],[-1,[[5,[-2]]],[],[]],[-1,[[5,[-2]]],[],[]],[-1,[[5,[-2]]],[],[]],[-1,49,[]],[-1,49,[]],[-1,49,[]],[-1,49,[]],[-1,49,[]],[-1,49,[]],[-1,49,[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"c":[],"p":[[3,"ModuleRepository",0],[3,"AddBlueprint",0],[3,"String",274],[4,"ModuleError",0],[4,"Result",275],[15,"u8"],[3,"Vec",276],[3,"Hash",277],[3,"NamedModuleConfig",0],[3,"ParticleVault",278],[3,"PeerId",279],[3,"ParticleParams",280],[3,"PathBuf",281],[3,"HashMap",282],[3,"EffectorsMode",0],[3,"ModuleConfig",0],[3,"WASIConfig",0],[15,"tuple"],[3,"Formatter",283],[3,"Error",283],[15,"slice"],[3,"Report",284],[15,"usize"],[8,"Deserializer",285],[6,"Result",283],[4,"DecodeError",286],[4,"ModuleInfoError",287],[4,"VaultError",278],[15,"str"],[3,"Blueprint",288],[4,"Value",289],[3,"FdFlags",290],[3,"Error",291],[3,"JError",292],[4,"Ipld",293],[3,"Path",281],[8,"Iterator",294],[4,"Option",295],[6,"ModuleDescriptor",296],[3,"SetFdFlags",290],[8,"AsFilelike",297],[3,"RawCodec",298],[3,"Error",299],[8,"Read",300],[3,"Cid",301],[8,"Extend",302],[8,"Serializer",303],[8,"Error",304],[3,"TypeId",305],[13,"InvalidEffectorMountedBinary",235],[13,"SerializeBlueprint",235],[13,"SerializeConfig",235],[13,"InvalidModuleConfigPath",235],[13,"IncorrectVaultModuleConfig",235],[13,"AddModule",235],[13,"WriteConfig",235],[13,"NoSuchBlueprint",235],[13,"IncorrectBlueprint",235],[13,"NoModuleConfig",235],[13,"IncorrectModuleConfig",235],[13,"WriteBlueprint",235],[13,"ModuleConvertError",235],[13,"ModuleNotFound",235],[13,"ReadModuleInterfaceError",235],[13,"ModuleInvalidBase64",235],[13,"InvalidModulePath",235],[13,"ForbiddenEffector",235],[13,"BlueprintNotFound",235],[13,"EmptyDependenciesList",235],[13,"FacadeShouldBeHash",235],[13,"MaxHeapSizeOverflow",235],[13,"InvalidModuleReference",235]],"b":[[110,"impl-Display-for-ModuleError"],[111,"impl-Debug-for-ModuleError"],[118,"impl-From%3CReport%3E-for-ModuleError"],[119,"impl-From%3CDecodeError%3E-for-ModuleError"],[120,"impl-From%3CModuleInfoError%3E-for-ModuleError"],[121,"impl-From%3CVaultError%3E-for-ModuleError"]]},\ +"particle_protocol":{"doc":"","t":"ENDNDENNNNNNNRDNEDNEENNNNNMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMLLLLLLLLLLLLLLLMLMMLLLLMLLLLLMLMLMLLLLLLLLLLLLLLLLLLLLLLLLLLLMLLLLLLLLLLLLLMLLLLLLLLLLMMMMMMMMMMMM","n":["CompletionChannel","ConnectionPoolDied","Contact","DecodingError","ExtendedParticle","HandlerMessage","Ignore","InParticle","InvalidKeypair","NotConnected","Ok","Oneshot","OutParticle","PROTOCOL_NAME","Particle","Particle","ParticleError","ProtocolConfig","ProtocolError","ProtocolMessage","SendStatus","SignatureVerificationFailed","SigningFailed","TimedOut","Upgrade","Upgrade","addresses","as_ref","as_ref","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","data","deadline","default","default","default","default","deserialize","deserialize","deserialize","deserialize","eq","eq","eq","equivalent","equivalent","equivalent","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","from","id","init_peer_id","into","into","into","into","into","into","into","into","into","into_protocol_message","is_expired","linked","new","new","new","outbound_substream_timeout","outlet","particle","peer_id","protocol_info","protocol_info","protocol_info","protocol_info","script","serialize","serialize","serialize","serialize","sign","signature","source","span","time_to_live","timestamp","to_owned","to_owned","to_owned","to_owned","to_owned","to_string","to_string","to_string","to_string","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","ttl","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","upgrade_inbound","upgrade_inbound","upgrade_outbound","upgrade_outbound","upgrade_timeout","verify","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","err","err","err","given_peer_id","init_peer_id","particle_id","particle_id","particle_id","particle_id","peer_id","after","error"],"q":[[0,"particle_protocol"],[185,"particle_protocol::ParticleError"],[195,"particle_protocol::SendStatus"],[197,"core::option"],[198,"core::result"],[199,"serde::de"],[200,"core::fmt"],[201,"core::fmt"],[202,"tracing::span"],[203,"alloc::sync"],[204,"core::time"],[205,"libp2p_identity::peer_id"],[206,"multiaddr"],[207,"alloc::vec"],[208,"serde::ser"],[209,"fluence_keypair::key_pair"],[210,"core::error"],[211,"alloc::string"],[212,"core::any"],[213,"libp2p_swarm::stream"],[214,"futures_io::if_std"],[215,"core::marker"],[216,"core::marker"]],"d":["","","","","","","","Particle being received from a remote peer. Receive-only, …","","","","","Particle being sent to remote peer. Contains a channel to …","","","","","","","","","","","","Dummy plug. Generated by the OneshotHandler when Inbound …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","base64-encoded","Deadline in milliseconds","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","","Returns the argument unchanged.","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","","Timeout for outbound substream upgrades.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Timeout for applying the given upgrade on a substream","","","","","","","","","","","","","","","","","","","","","",""],"i":[0,10,0,18,0,0,11,17,18,10,10,11,17,0,0,4,0,0,10,0,0,18,18,10,17,4,6,1,1,10,11,17,4,5,6,18,1,3,10,11,17,4,5,6,18,1,3,4,5,6,1,3,4,5,6,1,3,3,3,10,11,5,3,4,5,6,3,4,6,3,6,6,6,10,11,17,4,4,5,6,6,18,18,1,3,3,10,11,17,17,17,4,5,6,18,1,3,3,3,10,11,17,4,5,6,18,1,3,17,3,1,5,6,1,5,11,1,6,17,17,5,5,3,4,5,6,3,3,3,18,1,3,3,4,5,6,1,3,4,6,18,3,10,11,17,4,5,6,18,1,3,10,11,17,4,5,6,18,1,3,3,10,11,17,4,5,6,18,1,3,5,5,17,17,5,3,10,11,17,4,5,6,18,1,3,36,37,38,39,39,39,36,37,38,37,40,40],"f":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[1,2],[1,3],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[4,4],[5,5],[6,6],[1,1],[3,3],[[-1,-2],7,[],[]],[[-1,-2],7,[],[]],[[-1,-2],7,[],[]],[[-1,-2],7,[],[]],[[-1,-2],7,[],[]],0,[3,[[9,[8]]]],[[],10],[[],11],[[],5],[[],3],[-1,[[12,[4]]],13],[-1,[[12,[5]]],13],[-1,[[12,[6]]],13],[-1,[[12,[3]]],13],[[4,4],14],[[6,6],14],[[3,3],14],[[-1,-2],14,[],[]],[[-1,-2],14,[],[]],[[-1,-2],14,[],[]],[[10,15],16],[[11,15],16],[[17,15],16],[[4,15],16],[[4,15],16],[[5,15],16],[[6,15],16],[[6,15],16],[[18,15],16],[[18,15],16],[[1,15],16],[[3,15],16],[[3,15],16],[-1,-1,[]],[-1,-1,[]],[4,17],[-1,-1,[]],[7,17],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],0,0,[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[17,[[7,[4,[9,[[19,[10]]]]]]]],[3,14],[[3,[21,[20]]],1],[[22,22],5],[[23,[25,[24]]],6],[[3,20],1],0,[11,[[9,[[19,[10]]]]]],0,0,[17],[-1,[],[]],[5],[-1,[],[]],0,[[4,-1],12,26],[[5,-1],12,26],[[6,-1],12,26],[[3,-1],12,26],[[3,27],[[12,[7,18]]]],0,[18,[[9,[28]]]],0,[3,22],0,[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,29,[]],[-1,29,[]],[-1,29,[]],[-1,29,[]],[-1,[[12,[-2]]],[],[]],[-1,[[12,[-2]]],[],[]],[-1,[[12,[-2]]],[],[]],[-1,[[12,[-2]]],[],[]],[-1,[[12,[-2]]],[],[]],[-1,[[12,[-2]]],[],[]],[-1,[[12,[-2]]],[],[]],[-1,[[12,[-2]]],[],[]],[-1,[[12,[-2]]],[],[]],[-1,[[12,[-2]]],[],[]],[-1,[[12,[-2]]],[],[]],[-1,[[12,[-2]]],[],[]],[-1,[[12,[-2]]],[],[]],[-1,[[12,[-2]]],[],[]],[-1,[[12,[-2]]],[],[]],[-1,[[12,[-2]]],[],[]],[-1,[[12,[-2]]],[],[]],[-1,[[12,[-2]]],[],[]],0,[-1,30,[]],[-1,30,[]],[-1,30,[]],[-1,30,[]],[-1,30,[]],[-1,30,[]],[-1,30,[]],[-1,30,[]],[-1,30,[]],[[-1,31,-2],[],[],[]],[[5,-1],[],[32,33,34]],[[17,-1],[],[32,35,33,34]],[[-1,31,-2],[],[],[]],0,[3,[[12,[7,18]]]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],0,0,0,0,0,0,0,0,0,0,0,0],"c":[],"p":[[3,"ExtendedParticle",0],[15,"str"],[3,"Particle",0],[4,"ProtocolMessage",0],[3,"ProtocolConfig",0],[3,"Contact",0],[15,"tuple"],[15,"u64"],[4,"Option",197],[4,"SendStatus",0],[4,"CompletionChannel",0],[4,"Result",198],[8,"Deserializer",199],[15,"bool"],[3,"Formatter",200],[6,"Result",200],[4,"HandlerMessage",0],[4,"ParticleError",0],[3,"Sender",201],[3,"Span",202],[3,"Arc",203],[3,"Duration",204],[3,"PeerId",205],[3,"Multiaddr",206],[3,"Vec",207],[8,"Serializer",208],[4,"KeyPair",209],[8,"Error",210],[3,"String",211],[3,"TypeId",212],[3,"Stream",213],[8,"AsyncRead",214],[8,"Send",215],[8,"Unpin",215],[8,"AsyncWrite",214],[13,"SigningFailed",185],[13,"SignatureVerificationFailed",185],[13,"DecodingError",185],[13,"InvalidKeypair",185],[13,"TimedOut",195]],"b":[[27,"impl-AsRef%3Cstr%3E-for-ExtendedParticle"],[28,"impl-AsRef%3CParticle%3E-for-ExtendedParticle"],[76,"impl-Display-for-ProtocolMessage"],[77,"impl-Debug-for-ProtocolMessage"],[79,"impl-Debug-for-Contact"],[80,"impl-Display-for-Contact"],[81,"impl-Debug-for-ParticleError"],[82,"impl-Display-for-ParticleError"],[84,"impl-Debug-for-Particle"],[85,"impl-Display-for-Particle"],[88,"impl-From%3CProtocolMessage%3E-for-HandlerMessage"],[90,"impl-From%3C()%3E-for-HandlerMessage"]]},\ +"particle_services":{"doc":"","t":"NNNNNNNNNNNNNNNNNNNNNNNNNNNEENNNNNDDENNNNNNNNNNNNNEDENNNNNNNNNNNSSNNDNNNLMMMLLLLLLLLLLLLLLLLLLMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMLLMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMMMLLLLLLLLLLLMLLMMMLLLLLLLLLLLLLLLLMMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMLLLLLLLLLMMMMMMMMMMMMMMMMMMMMMMMMM","n":["AliasAsServiceId","ArgParseError","Array","Array","Boolean","Boolean","ByteArray","ByteArray","CallServiceFailedWrongWorker","CorruptedFaaSInterface","CreateServicesDir","DeserializePersistedService","Engine","F32","F32","F64","F64","FailedToCreateDirectory","Forbidden","ForbiddenAlias","ForbiddenAliasRoot","ForbiddenAliasWorker","Host","I32","I32","I64","I64","IType","IValue","InternalError","ModuleError","NoSuchAlias","NoSuchService","NoSuchServiceWithFunction","ParticleAppServices","ParticleAppServicesConfig","PeerScope","ReadPersistedService","Record","Record","S16","S16","S32","S32","S64","S64","S8","S8","SerializePersistedService","Service","ServiceError","ServiceInfo","ServiceType","Spell","String","String","U16","U16","U32","U32","U64","U64","U8","U8","VARIANT_COUNT","VARIANT_COUNT","VaultError","VaultLink","WasmBackendConfig","WorkerId","WorkerNotFound","WritePersistedService","add_alias","aliases","async_wasm_stack","blueprint_id","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","builtins_management_peer_id","call_function","call_service","check_service_worker_id","clone","clone","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","cmp","compare","create_persisted_services","create_service","debug","debug","debug","debug","debug","debug","debug","debug","debug","debug_info","default","default","default_service_memory_limit","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deserialize","deserialize","deserialize","drop","drop","drop","drop","drop","drop","drop","drop","drop","envs","ephemeral_work_dir","epoch_interruption_duration","eq","eq","eq","eq","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_hash","get_hash","get_interface","get_service","get_service_info","get_service_mem_stats","get_service_owner","hash","hash","id","init","init","init","init","init","init","init","init","init","into","into","into","into","into","into","into","into","into","into_any","into_any","into_any","into_any","into_any","into_any","into_any","into_any","into_any","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","is_spell","list_services","list_services_all","local_peer_id","management_peer_id","max_wasm_stack","metrics","new","new","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","owner_id","parse","partial_cmp","particles_vault_dir","peer_scope","persistent_work_dir","references","references","references","references","references","references","references","references","references","remove_service","remove_services","resolve_alias","serialize","serialize","serialize","service_exists","service_type","services_dir","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","source","to_bytes","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_service_id","to_string","to_string","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_name","type_name","type_name","type_name","type_name","type_name","type_name","type_name","type_name","vault","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","wasm_backend_config","wasm_backtrace","config","err","err","err","err","err","err","err","function","function","particle_id","path","path","path","path","path","peer_scope","reason","service","service_id","service_id","user","worker_id"],"q":[[0,"particle_services"],[391,"particle_services::ServiceError"],[414,"alloc::string"],[415,"libp2p_identity::peer_id"],[416,"core::result"],[417,"serde_json::value"],[418,"alloc::vec"],[419,"core::option"],[420,"core::time"],[421,"particle_execution::function_outcome"],[422,"particle_args::args"],[423,"particle_execution::particle_params"],[424,"core::cmp"],[425,"eyre"],[426,"core::fmt"],[427,"core::fmt"],[428,"core::fmt"],[429,"particle_execution::particle_vault"],[430,"particle_args::args_error"],[431,"fluence_app_service::errors"],[432,"system_interface::fs::fd_flags"],[433,"std::io::error"],[434,"core::hash"],[435,"core::marker"],[436,"core::hash"],[437,"particle_args::args_error"],[438,"core::any"],[439,"alloc::rc"],[440,"particle_modules::modules"],[441,"peer_metrics::services_metrics"],[442,"health"],[443,"workers::workers"],[444,"workers::scope"],[445,"std::path"],[446,"std::collections::hash::map"],[447,"bytesize"],[448,"system_interface::fs::fd_flags"],[449,"wast::parser"],[450,"wast"],[451,"libipld_core::raw"],[452,"anyhow"],[453,"std::io"],[454,"cid::cid"],[455,"core::iter::traits::collect"],[456,"serde::ser"],[457,"core::error"],[458,"std::io"]],"d":["","","An array of values of the same type.","A byte array.","Boolean.","Boolean value.","Specialization of arrays for byte vector.","Specialization of array type for byte vector.","","","","","","A 32-bits float.","A 32-bits float.","A 64-bits float.","A 64-bits float.","","","","","","","A 32-bits integer (as defined in WebAssembly core).","A 32-bits integer (as defined in WebAssembly core).","A 64-bits integer (as defined in WebAssembly core).","A 64-bits integer (as defined in WebAssembly core).","Represents the types supported by WIT.","A WIT value.","","","","","","","","","","A record contains record index from interfaces AST.","A record.","A 16-bits signed integer.","A 16-bits signed integer.","A 32-bits signed integer.","A 32-bits signed integer.","A 64-bits signed integer.","A 64-bits signed integer.","A 8-bits signed integer.","A 8-bits signed integer.","","","","","","","A string.","A string.","A 16-bits unsigned integer.","A 16-bits unsigned integer.","A 32-bits unsigned integer.","A 32-bits unsigned integer.","A 64-bits unsigned integer.","A 64-bits unsigned integer.","A 8-bits unsigned integer.","A 8-bits unsigned integer.","","","","","","","","","","","Configures the size of the stacks used for asynchronous …","","","","","","","","","","","","","","","","","","","","key to manage builtins services initialization","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Configures whether DWARF debug information will be emitted …","","","Default heap size in bytes available for the module unless …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Opaque environment variables to be passed on each service …","Ephemeral working dir for services","Enables the epoch interruption mechanism.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","Returns the argument unchanged.","","","","","","Returns the argument unchanged.","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Peer id of the current node","key that could manage services","Configures the maximum amount of stack space available for …","","","","","","","","","","","","","","","","Dir to store directories shared between services in the …","","Persistent working dir for services","","","","","","","","","","","","","","","","","","Dir to persist info about running services","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","config for the wasmtime backend","Configures whether the errors from the VM should collect …","","","","","","","","","","","","","","","","","","","","","","",""],"i":[6,6,18,19,18,19,18,19,6,6,6,6,6,18,19,18,19,6,6,6,6,6,2,18,19,18,19,0,0,6,6,6,6,6,0,0,0,6,18,19,18,19,18,19,18,19,18,19,6,17,0,0,0,17,18,19,18,19,18,19,18,19,18,19,18,19,6,6,0,2,6,6,1,29,21,29,2,17,29,1,18,6,19,20,21,2,17,29,1,18,6,19,20,21,20,1,1,1,2,17,1,18,19,20,21,2,17,1,18,19,20,21,2,2,1,1,2,17,29,1,18,6,19,20,21,21,19,21,20,2,17,29,1,18,6,19,20,21,2,17,29,1,18,6,19,20,21,2,17,18,2,17,29,1,18,6,19,20,21,20,20,21,2,17,18,19,2,2,2,2,2,17,17,17,17,17,18,18,18,18,18,2,17,29,1,18,6,6,19,20,21,2,17,29,1,18,6,6,6,6,6,19,19,19,19,19,19,19,19,19,19,19,19,19,20,21,2,17,29,1,18,6,19,20,21,2,18,1,1,1,1,1,2,18,29,2,17,29,1,18,6,19,20,21,2,17,29,1,18,6,19,20,21,2,17,29,1,18,6,19,20,21,2,17,29,1,18,6,19,20,21,2,17,29,1,18,6,19,20,21,17,1,1,20,20,21,1,1,20,2,17,29,1,18,6,19,20,21,29,18,2,20,29,20,2,17,29,1,18,6,19,20,21,1,1,1,2,17,18,1,29,20,2,17,29,1,18,6,19,20,21,6,18,2,17,1,18,19,20,21,1,18,6,2,17,29,1,18,6,19,20,21,2,17,29,1,18,6,19,20,21,2,17,29,1,18,6,19,20,21,2,17,29,1,18,6,19,20,21,1,2,17,29,1,18,6,19,20,21,20,21,76,77,78,79,80,76,81,82,83,84,80,77,78,79,81,82,85,84,83,85,80,84,86],"f":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[1,2,3,3,4],[[7,[5,6]]]],0,0,0,[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],0,[[1,2,8,8,[10,[9]],[11,[3]],4,12],13],[[1,14,15,16],13],[[1,2,3,8],[[7,[5,6]]]],[2,2],[17,17],[1,1],[18,18],[19,19],[20,20],[21,21],[[-1,-2],5,[],[]],[[-1,-2],5,[],[]],[[-1,-2],5,[],[]],[[-1,-2],5,[],[]],[[-1,-2],5,[],[]],[[-1,-2],5,[],[]],[[-1,-2],5,[],[]],[[2,2],22],[[-1,-2],22,[],[]],[1,[[23,[5]]]],[[1,2,17,3,4],[[7,[3,6]]]],[24,[[7,[5,25]]]],[24,[[7,[5,25]]]],[24,[[7,[5,25]]]],[24,[[7,[5,25]]]],[24,[[7,[5,25]]]],[24,[[7,[5,25]]]],[24,[[7,[5,25]]]],[24,[[7,[5,25]]]],[24,[[7,[5,25]]]],0,[[],19],[[],21],0,[26,-1,[]],[26,-1,[]],[26,-1,[]],[26,-1,[]],[26,-1,[]],[26,-1,[]],[26,-1,[]],[26,-1,[]],[26,-1,[]],[26,-1,[]],[26,-1,[]],[26,-1,[]],[26,-1,[]],[26,-1,[]],[26,-1,[]],[26,-1,[]],[26,-1,[]],[26,-1,[]],[-1,[[7,[2]]],27],[-1,[[7,[17]]],27],[-1,[[7,[18]]],27],[26,5],[26,5],[26,5],[26,5],[26,5],[26,5],[26,5],[26,5],[26,5],0,0,0,[[2,2],16],[[17,17],16],[[18,18],16],[[19,19],16],[[-1,-2],16,[],[]],[[-1,-2],16,[],[]],[[-1,-2],16,[],[]],[[-1,-2],16,[],[]],[[-1,-2],16,[],[]],[[-1,-2],16,[],[]],[[-1,-2],16,[],[]],[[-1,-2],16,[],[]],[[-1,-2],16,[],[]],[[-1,-2],16,[],[]],[[-1,-2],16,[],[]],[[-1,-2],16,[],[]],[[-1,-2],16,[],[]],[[-1,-2],16,[],[]],[[-1,-2],16,[],[]],[[2,24],[[7,[5,25]]]],[[17,24],28],[[29,24],28],[[1,24],28],[[18,24],[[7,[5,25]]]],[[6,24],28],[[6,24],28],[[19,24],[[7,[5,25]]]],[[20,24],28],[[21,24],28],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[30,6],[-1,-1,[]],[31,6],[32,6],[33,6],[34,19],[35,19],[-1,-1,[]],[36,19],[37,19],[38,19],[39,19],[40,19],[41,19],[42,19],[43,19],[[[10,[34]]],19],[3,19],[-1,-1,[]],[-1,-1,[]],[-1,[[7,[44,45]]],[]],[-1,[[7,[44,45]]],[]],[-1,[[7,[44,45]]],[]],[-1,[[7,[44,45]]],[]],[-1,[[7,[44,45]]],[]],[-1,[[7,[44,45]]],[]],[-1,[[7,[44,45]]],[]],[-1,[[7,[44,45]]],[]],[-1,[[7,[44,45]]],[]],[[-1,-2],41,[46,47],48],[[-1,-2],41,[46,47],48],[[1,2,3,8],[[7,[9,6]]]],[[1,2,3,8],[[7,[[5,[[49,[0]],3]],6]]]],[[1,2,3,8],[[7,[29,6]]]],[[1,2,3,8],[[7,[[10,[9]],50]]]],[[1,2,3,8],[[7,[4,6]]]],[[2,-1],5,51],[[18,-1],5,51],0,[[],26],[[],26],[[],26],[[],26],[[],26],[[],26],[[],26],[[],26],[[],26],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[[[52,[-1]]],[[52,[53]]],[]],[[[52,[-1]]],[[52,[53]]],[]],[[[52,[-1]]],[[52,[53]]],[]],[[[52,[-1]]],[[52,[53]]],[]],[[[52,[-1]]],[[52,[53]]],[]],[[[52,[-1]]],[[52,[53]]],[]],[[[52,[-1]]],[[52,[53]]],[]],[[[52,[-1]]],[[52,[53]]],[]],[[[52,[-1]]],[[52,[53]]],[]],[[[49,[-1]]],[[49,[53]]],[]],[[[49,[-1]]],[[49,[53]]],[]],[[[49,[-1]]],[[49,[53]]],[]],[[[49,[-1]]],[[49,[53]]],[]],[[[49,[-1]]],[[49,[53]]],[]],[[[49,[-1]]],[[49,[53]]],[]],[[[49,[-1]]],[[49,[53]]],[]],[[[49,[-1]]],[[49,[53]]],[]],[[[49,[-1]]],[[49,[53]]],[]],[[[54,[-1]]],[[54,[53]]],[]],[[[54,[-1]]],[[54,[53]]],[]],[[[54,[-1]]],[[54,[53]]],[]],[[[54,[-1]]],[[54,[53]]],[]],[[[54,[-1]]],[[54,[53]]],[]],[[[54,[-1]]],[[54,[53]]],[]],[[[54,[-1]]],[[54,[53]]],[]],[[[54,[-1]]],[[54,[53]]],[]],[[[54,[-1]]],[[54,[53]]],[]],[17,16],[[1,2],[[10,[29]]]],[1,[[10,[29]]]],0,0,0,0,[[20,55,[11,[56]],[11,[57]],[49,[58]],59],[[7,[1,6]]]],[[4,60,60,60,[61,[3,3]],4,4,[11,[62]],21],[[7,[20,45]]]],[[-1,44],[[7,[[63,[-2]],45]]],[],64],[[-1,44],[[7,[[63,[-2]],45]]],[],64],[[-1,44],[[7,[[63,[-2]],45]]],[],64],[[-1,44],[[7,[[63,[-2]],45]]],[],64],[[-1,44],[[7,[[63,[-2]],45]]],[],64],[[-1,44],[[7,[[63,[-2]],45]]],[],64],[[-1,44],[[7,[[63,[-2]],45]]],[],64],[[-1,44],[[7,[[63,[-2]],45]]],[],64],[[-1,44],[[7,[[63,[-2]],45]]],[],64],0,[65,[[7,[18,66]]]],[[2,2],[[11,[22]]]],0,0,0,[[67,-1,-2],[[7,[5,68]]],69,[[71,[70]]]],[[67,-1,-2],[[7,[5,68]]],69,[[71,[70]]]],[[67,-1,-2],[[7,[5,68]]],69,[[71,[70]]]],[[67,-1,-2],[[7,[5,68]]],69,[[71,[70]]]],[[67,-1,-2],[[7,[5,68]]],69,[[71,[70]]]],[[67,-1,-2],[[7,[5,68]]],69,[[71,[70]]]],[[67,-1,-2],[[7,[5,68]]],69,[[71,[70]]]],[[67,-1,-2],[[7,[5,68]]],69,[[71,[70]]]],[[67,-1,-2],[[7,[5,68]]],69,[[71,[70]]]],[[1,2,8,8,4,16],[[7,[5,6]]]],[[1,2],[[7,[5,6]]]],[[1,2,3,8],[[7,[3,6]]]],[[2,-1],7,72],[[17,-1],7,72],[[18,-1],7,72],[[1,2,8],16],0,0,[[-1,[63,[-2]]],[[7,[5,45]]],[],64],[[-1,[63,[-2]]],[[7,[5,45]]],[],64],[[-1,[63,[-2]]],[[7,[5,45]]],[],64],[[-1,[63,[-2]]],[[7,[5,45]]],[],64],[[-1,[63,[-2]]],[[7,[5,45]]],[],64],[[-1,[63,[-2]]],[[7,[5,45]]],[],64],[[-1,[63,[-2]]],[[7,[5,45]]],[],64],[[-1,[63,[-2]]],[[7,[5,45]]],[],64],[[-1,[63,[-2]]],[[7,[5,45]]],[],64],[6,[[11,[73]]]],[[18,-1],[[7,[5,45]]],74],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[[1,2,3,8],[[7,[3,6]]]],[18,3],[-1,3,[]],[-1,[[7,[-2]]],[],[]],[-1,[[7,[-2]]],[],[]],[-1,[[7,[-2]]],[],[]],[-1,[[7,[-2]]],[],[]],[-1,[[7,[-2]]],[],[]],[-1,[[7,[-2]]],[],[]],[-1,[[7,[-2]]],[],[]],[-1,[[7,[-2]]],[],[]],[-1,[[7,[-2]]],[],[]],[-1,[[7,[-2]]],[],[]],[-1,[[7,[-2]]],[],[]],[-1,[[7,[-2]]],[],[]],[-1,[[7,[-2]]],[],[]],[-1,[[7,[-2]]],[],[]],[-1,[[7,[-2]]],[],[]],[-1,[[7,[-2]]],[],[]],[-1,[[7,[-2]]],[],[]],[-1,[[7,[-2]]],[],[]],[-1,75,[]],[-1,75,[]],[-1,75,[]],[-1,75,[]],[-1,75,[]],[-1,75,[]],[-1,75,[]],[-1,75,[]],[-1,75,[]],[-1,8,[]],[-1,8,[]],[-1,8,[]],[-1,8,[]],[-1,8,[]],[-1,8,[]],[-1,8,[]],[-1,8,[]],[-1,8,[]],0,[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"c":[],"p":[[3,"ParticleAppServices",0],[4,"PeerScope",0],[3,"String",414],[3,"PeerId",415],[15,"tuple"],[4,"ServiceError",0],[4,"Result",416],[15,"str"],[4,"Value",417],[3,"Vec",418],[4,"Option",419],[3,"Duration",420],[4,"FunctionOutcome",421],[3,"Args",422],[3,"ParticleParams",423],[15,"bool"],[4,"ServiceType",0],[4,"IType",0],[4,"IValue",0],[3,"ParticleAppServicesConfig",0],[3,"WasmBackendConfig",0],[4,"Ordering",424],[6,"Result",425],[3,"Formatter",426],[3,"Error",426],[15,"usize"],[8,"Deserializer",427],[6,"Result",426],[3,"ServiceInfo",0],[4,"ModuleError",428],[4,"VaultError",429],[4,"ArgsError",430],[4,"AppServiceError",431],[15,"u8"],[15,"f32"],[15,"u32"],[15,"i16"],[15,"i64"],[15,"u16"],[15,"i8"],[15,"u64"],[15,"f64"],[15,"i32"],[3,"FdFlags",432],[3,"Error",433],[8,"Hash",434],[8,"Sized",435],[8,"BuildHasher",434],[3,"Arc",436],[3,"JError",430],[8,"Hasher",434],[3,"Box",437],[8,"Any",438],[3,"Rc",439],[3,"ModuleRepository",440],[3,"ServicesMetrics",441],[3,"HealthCheckRegistry",442],[3,"Workers",443],[3,"PeerScopes",444],[3,"PathBuf",445],[3,"HashMap",446],[3,"ByteSize",447],[3,"SetFdFlags",432],[8,"AsFilelike",448],[3,"Parser",449],[3,"Error",450],[3,"RawCodec",451],[3,"Error",452],[8,"Read",453],[3,"Cid",454],[8,"Extend",455],[8,"Serializer",456],[8,"Error",457],[8,"Write",453],[3,"TypeId",438],[13,"SerializePersistedService",391],[13,"ReadPersistedService",391],[13,"DeserializePersistedService",391],[13,"CreateServicesDir",391],[13,"VaultLink",391],[13,"WritePersistedService",391],[13,"FailedToCreateDirectory",391],[13,"NoSuchServiceWithFunction",391],[13,"Forbidden",391],[13,"CallServiceFailedWrongWorker",391],[13,"WorkerNotFound",391]],"b":[[186,"impl-Debug-for-ServiceError"],[187,"impl-Display-for-ServiceError"],[196,"impl-From%3CModuleError%3E-for-ServiceError"],[198,"impl-From%3CVaultError%3E-for-ServiceError"],[199,"impl-From%3CArgsError%3E-for-ServiceError"],[200,"impl-From%3CAppServiceError%3E-for-ServiceError"],[201,"impl-From%3Cu8%3E-for-IValue"],[202,"impl-From%3Cf32%3E-for-IValue"],[204,"impl-From%3Cu32%3E-for-IValue"],[205,"impl-From%3Ci16%3E-for-IValue"],[206,"impl-From%3Ci64%3E-for-IValue"],[207,"impl-From%3Cu16%3E-for-IValue"],[208,"impl-From%3Ci8%3E-for-IValue"],[209,"impl-From%3Cu64%3E-for-IValue"],[210,"impl-From%3Cf64%3E-for-IValue"],[211,"impl-From%3Ci32%3E-for-IValue"],[212,"impl-From%3CVec%3Cu8%3E%3E-for-IValue"],[213,"impl-From%3CString%3E-for-IValue"]]},\ +"peer_metrics":{"doc":"","t":"NDNNDDDNENNNNNNDNDEENNEDEDDDDNNDNDNDEFMMMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMMMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMLMMMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMLLLLLLLLLLMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMMLLLLLLLLLLLLLLLLLLLLMLMMMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMLLLLLLLLLLLLLLLLLLLLMMMMMLMMMLLLMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMMMMMMMMMMLLLLLLLLLLLLLLLLLLLLLLLMMMMM","n":["Builtin","ChainListenerMetrics","Common","ConnectionFailed","ConnectionPoolMetrics","ConnectivityMetrics","DispatcherMetrics","Fail","FunctionKind","Host","Kademlia","KademliaError","KademliaNotFound","Local","NotHappened","ParticleExecutorMetrics","ParticleFunction","ParticleLabel","ParticleType","Resolution","Service","Service","ServiceCallStats","ServiceMemoryStat","ServiceType","ServicesMetrics","ServicesMetricsBackend","ServicesMetricsBuiltin","ServicesMetricsExternal","Spell","Spell","SpellMetrics","Success","VmPoolMetrics","Worker","WorkerLabel","WorkerType","add_info_metrics","alive_actors","bootstrap_connected","bootstrap_disconnected","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","builtin","call_failed_count","call_success_count","call_time_sec","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","connected_peers","count_resolution","creation_count","creation_failure_count","creation_time_msec","debug","debug","debug","debug","debug","debug","debug","debug","debug","debug","debug","debug","debug","debug","debug","debug","debug","debug","debug","debug","default","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","encode","encode","encode","encode","encode","encode","encode","eq","eq","eq","eq","eq","eq","eq","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","expired_particles","external","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","free_vms","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_hash","get_hash","get_hash","get_hash","get_hash","get_hash","get_hash","get_used_memory","get_vm","hash","hash","hash","hash","hash","hash","hash","incoming_particle","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","interpretation_failures","interpretation_successes","interpretation_time_sec","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","lock_wait_time_sec","measure_memory","memory_metrics","modules_in_services_count","modules_stats","new","new","new","new","new","new","new","new","new","new","new","new","new","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","no_free_vm","observe_builtins","observe_ccp_reply","observe_ccp_request","observe_created","observe_created","observe_created_failed","observe_finished_spell","observe_new_block","observe_processed_block","observe_proof_failed","observe_proof_submitted","observe_proof_tx_failed","observe_proof_tx_success","observe_removed","observe_removed","observe_service_state","observe_service_state_failed","observe_spell_cast","observe_started_spell","particle_expired","particle_queue_size","particle_send_failure","particle_send_success","particle_sizes","put_vm","read","received_particles","removal_count","removal_time_msec","send_particle_failed","send_particle_ok","service_call","services_count","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_pool_size","start","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","total_actors_mailbox","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","update","used_mem","vm_mem_avg","vm_mem_cma","vm_mem_histo","vm_mem_max","vm_mem_max_value","vm_mem_measures","vm_mem_min","vm_mem_min_value","vm_mem_total","vm_mems","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","with_external_backend","with_external_metrics","with_simple_backend","call_time_sec","lock_wait_time_sec","memory_delta_bytes","timestamp","timestamp"],"q":[[0,"peer_metrics"],[574,"peer_metrics::ServiceCallStats"],[579,"prometheus_client::registry"],[580,"alloc::string"],[581,"core::fmt"],[582,"core::fmt"],[583,"prometheus_client::encoding"],[584,"prometheus_client::encoding"],[585,"std::io::error"],[586,"core::hash"],[587,"core::marker"],[588,"core::hash"],[589,"core::hash"],[590,"core::option"],[591,"tokio::sync::mpsc::unbounded"],[592,"core::time"],[593,"tokio::runtime::task::join"],[594,"core::any"]],"d":["","","","","","","","","","","","","","","","","","","","","","","Service function call stats to store in memory","","","","The backend creates a separate threads that processes …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Service call time","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Number of (srv create) calls","Number of (srv create) failures","How long it took to create a service","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","Memory metrics","How many modules a service includes.","Memory used by the modules that belongs to the service","Create a backend with only builtin metrics gathering …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Collect all metrics that are relevant on service creation.","","","","","","","","","Collect all metrics that are relevant on service removal.","","","","","","","","","","","","","","Number of (srv remove) calls","How long it took to remove a service","","","","Number of currently running services","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Memory used by the service","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Create fully a functional backend for both external and …","","","","","",""],"i":[14,0,19,6,0,0,0,30,0,12,6,6,6,6,9,0,9,0,0,0,9,14,0,0,0,0,0,0,0,14,19,0,30,0,12,0,0,0,10,7,7,43,4,5,6,7,8,9,10,11,12,13,14,15,30,24,16,17,18,19,20,43,4,5,6,7,8,9,10,11,12,13,14,15,30,24,16,17,18,19,20,16,15,15,15,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,5,7,15,15,15,43,4,5,6,7,8,9,10,11,12,13,14,15,30,24,16,17,18,19,20,24,43,4,5,6,7,8,9,10,11,12,13,14,15,30,24,16,17,18,19,20,43,4,5,6,7,8,9,10,11,12,13,14,15,30,24,16,17,18,19,20,43,4,5,6,7,8,9,10,11,12,13,14,15,30,24,16,17,18,19,20,6,9,11,12,14,19,20,6,9,11,12,14,19,20,6,6,6,6,6,9,9,9,9,9,11,11,11,11,11,12,12,12,12,12,14,14,14,14,14,19,19,19,19,19,20,20,20,20,20,8,16,6,9,11,12,14,30,24,16,19,20,18,43,4,5,6,7,8,9,10,11,12,13,14,15,30,24,16,17,18,19,20,43,4,5,6,7,8,9,10,11,12,13,14,15,30,24,16,17,18,19,20,6,9,11,12,14,19,20,13,18,6,9,11,12,14,19,20,5,43,4,5,6,7,8,9,10,11,12,13,14,15,30,24,16,17,18,19,20,10,10,10,43,4,5,6,7,8,9,10,11,12,13,14,15,30,24,16,17,18,19,20,15,18,15,15,24,43,4,5,7,8,10,11,13,15,24,16,17,18,43,4,5,6,7,8,9,10,11,12,13,14,15,30,24,16,17,18,19,20,18,16,4,4,15,16,16,17,4,4,4,4,4,4,15,16,16,16,17,17,8,5,7,7,5,18,13,5,15,15,7,7,10,15,43,4,5,6,7,8,9,10,11,12,13,14,15,30,24,16,17,18,19,20,18,43,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,10,43,4,5,6,7,8,9,10,11,12,13,14,15,30,24,16,17,18,19,20,43,4,5,6,7,8,9,10,11,12,13,14,15,30,24,16,17,18,19,20,43,4,5,6,7,8,9,10,11,12,13,14,15,30,24,16,17,18,19,20,13,24,18,18,18,18,18,18,18,18,18,18,43,4,5,6,7,8,9,10,11,12,13,14,15,30,24,16,17,18,19,20,16,43,16,52,52,52,52,53],"f":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[1,2,2,2],3],0,0,0,[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],0,0,0,0,[4,4],[5,5],[6,6],[7,7],[8,8],[9,9],[10,10],[11,11],[12,12],[13,13],[14,14],[15,15],[16,16],[17,17],[18,18],[19,19],[20,20],[[-1,-2],3,[],[]],[[-1,-2],3,[],[]],[[-1,-2],3,[],[]],[[-1,-2],3,[],[]],[[-1,-2],3,[],[]],[[-1,-2],3,[],[]],[[-1,-2],3,[],[]],[[-1,-2],3,[],[]],[[-1,-2],3,[],[]],[[-1,-2],3,[],[]],[[-1,-2],3,[],[]],[[-1,-2],3,[],[]],[[-1,-2],3,[],[]],[[-1,-2],3,[],[]],[[-1,-2],3,[],[]],[[-1,-2],3,[],[]],[[-1,-2],3,[],[]],0,[[7,6],3],0,0,0,[21,[[23,[3,22]]]],[21,[[23,[3,22]]]],[21,[[23,[3,22]]]],[21,[[23,[3,22]]]],[21,[[23,[3,22]]]],[21,[[23,[3,22]]]],[21,[[23,[3,22]]]],[21,[[23,[3,22]]]],[21,[[23,[3,22]]]],[21,[[23,[3,22]]]],[21,[[23,[3,22]]]],[21,[[23,[3,22]]]],[21,[[23,[3,22]]]],[21,[[23,[3,22]]]],[21,[[23,[3,22]]]],[21,[[23,[3,22]]]],[21,[[23,[3,22]]]],[21,[[23,[3,22]]]],[21,[[23,[3,22]]]],[21,[[23,[3,22]]]],[[],24],[25,-1,[]],[25,-1,[]],[25,-1,[]],[25,-1,[]],[25,-1,[]],[25,-1,[]],[25,-1,[]],[25,-1,[]],[25,-1,[]],[25,-1,[]],[25,-1,[]],[25,-1,[]],[25,-1,[]],[25,-1,[]],[25,-1,[]],[25,-1,[]],[25,-1,[]],[25,-1,[]],[25,-1,[]],[25,-1,[]],[25,-1,[]],[25,-1,[]],[25,-1,[]],[25,-1,[]],[25,-1,[]],[25,-1,[]],[25,-1,[]],[25,-1,[]],[25,-1,[]],[25,-1,[]],[25,-1,[]],[25,-1,[]],[25,-1,[]],[25,-1,[]],[25,-1,[]],[25,-1,[]],[25,-1,[]],[25,-1,[]],[25,-1,[]],[25,-1,[]],[25,3],[25,3],[25,3],[25,3],[25,3],[25,3],[25,3],[25,3],[25,3],[25,3],[25,3],[25,3],[25,3],[25,3],[25,3],[25,3],[25,3],[25,3],[25,3],[25,3],[[6,26],[[23,[3,22]]]],[[9,26],[[23,[3,22]]]],[[11,27],[[23,[3,22]]]],[[12,26],[[23,[3,22]]]],[[14,26],[[23,[3,22]]]],[[19,26],[[23,[3,22]]]],[[20,27],[[23,[3,22]]]],[[6,6],28],[[9,9],28],[[11,11],28],[[12,12],28],[[14,14],28],[[19,19],28],[[20,20],28],[[-1,-2],28,[],[]],[[-1,-2],28,[],[]],[[-1,-2],28,[],[]],[[-1,-2],28,[],[]],[[-1,-2],28,[],[]],[[-1,-2],28,[],[]],[[-1,-2],28,[],[]],[[-1,-2],28,[],[]],[[-1,-2],28,[],[]],[[-1,-2],28,[],[]],[[-1,-2],28,[],[]],[[-1,-2],28,[],[]],[[-1,-2],28,[],[]],[[-1,-2],28,[],[]],[[-1,-2],28,[],[]],[[-1,-2],28,[],[]],[[-1,-2],28,[],[]],[[-1,-2],28,[],[]],[[-1,-2],28,[],[]],[[-1,-2],28,[],[]],[[-1,-2],28,[],[]],[[-1,-2],28,[],[]],[[-1,-2],28,[],[]],[[-1,-2],28,[],[]],[[-1,-2],28,[],[]],[[-1,-2],28,[],[]],[[-1,-2],28,[],[]],[[-1,-2],28,[],[]],[[-1,-2],28,[],[]],[[-1,-2],28,[],[]],[[-1,-2],28,[],[]],[[-1,-2],28,[],[]],[[-1,-2],28,[],[]],[[-1,-2],28,[],[]],[[-1,-2],28,[],[]],0,0,[[6,21],29],[[9,21],29],[[11,21],29],[[12,21],29],[[14,21],29],[[30,21],29],[[24,21],29],[[16,21],29],[[19,21],29],[[20,21],29],0,[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,[[23,[31,32]]],[]],[-1,[[23,[31,32]]],[]],[-1,[[23,[31,32]]],[]],[-1,[[23,[31,32]]],[]],[-1,[[23,[31,32]]],[]],[-1,[[23,[31,32]]],[]],[-1,[[23,[31,32]]],[]],[-1,[[23,[31,32]]],[]],[-1,[[23,[31,32]]],[]],[-1,[[23,[31,32]]],[]],[-1,[[23,[31,32]]],[]],[-1,[[23,[31,32]]],[]],[-1,[[23,[31,32]]],[]],[-1,[[23,[31,32]]],[]],[-1,[[23,[31,32]]],[]],[-1,[[23,[31,32]]],[]],[-1,[[23,[31,32]]],[]],[-1,[[23,[31,32]]],[]],[-1,[[23,[31,32]]],[]],[-1,[[23,[31,32]]],[]],[[-1,-2],33,[34,35],36],[[-1,-2],33,[34,35],36],[[-1,-2],33,[34,35],36],[[-1,-2],33,[34,35],36],[[-1,-2],33,[34,35],36],[[-1,-2],33,[34,35],36],[[-1,-2],33,[34,35],36],[37,33],0,[[6,-1],3,38],[[9,-1],3,38],[[11,-1],3,38],[[12,-1],3,38],[[14,-1],3,38],[[19,-1],3,38],[[20,-1],3,38],[[5,39,40,41],3],[[],25],[[],25],[[],25],[[],25],[[],25],[[],25],[[],25],[[],25],[[],25],[[],25],[[],25],[[],25],[[],25],[[],25],[[],25],[[],25],[[],25],[[],25],[[],25],[[],25],0,0,0,[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],0,[[18,25,33],3],0,0,0,[[13,[42,[0]]],43],[1,4],[1,5],[1,7],[[1,[44,[25]]],8],[1,10],[[12,2],11],[25,13],[1,15],[37,24],[[[44,[15]],[45,[0]],25],16],[1,17],[1,18],[[-1,31],[[23,[[46,[-2]],32]]],[],47],[[-1,31],[[23,[[46,[-2]],32]]],[],47],[[-1,31],[[23,[[46,[-2]],32]]],[],47],[[-1,31],[[23,[[46,[-2]],32]]],[],47],[[-1,31],[[23,[[46,[-2]],32]]],[],47],[[-1,31],[[23,[[46,[-2]],32]]],[],47],[[-1,31],[[23,[[46,[-2]],32]]],[],47],[[-1,31],[[23,[[46,[-2]],32]]],[],47],[[-1,31],[[23,[[46,[-2]],32]]],[],47],[[-1,31],[[23,[[46,[-2]],32]]],[],47],[[-1,31],[[23,[[46,[-2]],32]]],[],47],[[-1,31],[[23,[[46,[-2]],32]]],[],47],[[-1,31],[[23,[[46,[-2]],32]]],[],47],[[-1,31],[[23,[[46,[-2]],32]]],[],47],[[-1,31],[[23,[[46,[-2]],32]]],[],47],[[-1,31],[[23,[[46,[-2]],32]]],[],47],[[-1,31],[[23,[[46,[-2]],32]]],[],47],[[-1,31],[[23,[[46,[-2]],32]]],[],47],[[-1,31],[[23,[[46,[-2]],32]]],[],47],[[-1,31],[[23,[[46,[-2]],32]]],[],47],0,[[16,28,41],3],[[4,41],3],[4,3],[[15,14,41,41],3],[[16,2,14,24,41],3],[16,3],[17,3],[[4,33],3],[[4,33],3],[4,3],[4,3],[[4,2],3],[4,3],[[15,14,41],3],[[16,14,41],3],[[16,2,2,14,24,30],3],[[16,2,[44,[2]],14,30],3],[17,3],[[17,48],3],[[8,39],3],0,0,0,0,0,[[13,2],[[44,[0]]]],0,0,0,[[7,39],3],[[7,39],3],[[10,28,9,[44,[49]]],3],0,[[-1,[46,[-2]]],[[23,[3,32]]],[],47],[[-1,[46,[-2]]],[[23,[3,32]]],[],47],[[-1,[46,[-2]]],[[23,[3,32]]],[],47],[[-1,[46,[-2]]],[[23,[3,32]]],[],47],[[-1,[46,[-2]]],[[23,[3,32]]],[],47],[[-1,[46,[-2]]],[[23,[3,32]]],[],47],[[-1,[46,[-2]]],[[23,[3,32]]],[],47],[[-1,[46,[-2]]],[[23,[3,32]]],[],47],[[-1,[46,[-2]]],[[23,[3,32]]],[],47],[[-1,[46,[-2]]],[[23,[3,32]]],[],47],[[-1,[46,[-2]]],[[23,[3,32]]],[],47],[[-1,[46,[-2]]],[[23,[3,32]]],[],47],[[-1,[46,[-2]]],[[23,[3,32]]],[],47],[[-1,[46,[-2]]],[[23,[3,32]]],[],47],[[-1,[46,[-2]]],[[23,[3,32]]],[],47],[[-1,[46,[-2]]],[[23,[3,32]]],[],47],[[-1,[46,[-2]]],[[23,[3,32]]],[],47],[[-1,[46,[-2]]],[[23,[3,32]]],[],47],[[-1,[46,[-2]]],[[23,[3,32]]],[],47],[[-1,[46,[-2]]],[[23,[3,32]]],[],47],[[18,25],3],[43,[[50,[3]]]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],0,[-1,[[23,[-2]]],[],[]],[-1,[[23,[-2]]],[],[]],[-1,[[23,[-2]]],[],[]],[-1,[[23,[-2]]],[],[]],[-1,[[23,[-2]]],[],[]],[-1,[[23,[-2]]],[],[]],[-1,[[23,[-2]]],[],[]],[-1,[[23,[-2]]],[],[]],[-1,[[23,[-2]]],[],[]],[-1,[[23,[-2]]],[],[]],[-1,[[23,[-2]]],[],[]],[-1,[[23,[-2]]],[],[]],[-1,[[23,[-2]]],[],[]],[-1,[[23,[-2]]],[],[]],[-1,[[23,[-2]]],[],[]],[-1,[[23,[-2]]],[],[]],[-1,[[23,[-2]]],[],[]],[-1,[[23,[-2]]],[],[]],[-1,[[23,[-2]]],[],[]],[-1,[[23,[-2]]],[],[]],[-1,[[23,[-2]]],[],[]],[-1,[[23,[-2]]],[],[]],[-1,[[23,[-2]]],[],[]],[-1,[[23,[-2]]],[],[]],[-1,[[23,[-2]]],[],[]],[-1,[[23,[-2]]],[],[]],[-1,[[23,[-2]]],[],[]],[-1,[[23,[-2]]],[],[]],[-1,[[23,[-2]]],[],[]],[-1,[[23,[-2]]],[],[]],[-1,[[23,[-2]]],[],[]],[-1,[[23,[-2]]],[],[]],[-1,[[23,[-2]]],[],[]],[-1,[[23,[-2]]],[],[]],[-1,[[23,[-2]]],[],[]],[-1,[[23,[-2]]],[],[]],[-1,[[23,[-2]]],[],[]],[-1,[[23,[-2]]],[],[]],[-1,[[23,[-2]]],[],[]],[-1,[[23,[-2]]],[],[]],[-1,51,[]],[-1,51,[]],[-1,51,[]],[-1,51,[]],[-1,51,[]],[-1,51,[]],[-1,51,[]],[-1,51,[]],[-1,51,[]],[-1,51,[]],[-1,51,[]],[-1,51,[]],[-1,51,[]],[-1,51,[]],[-1,51,[]],[-1,51,[]],[-1,51,[]],[-1,51,[]],[-1,51,[]],[-1,51,[]],[[13,2,2,30],3],0,0,0,0,0,0,0,0,0,0,0,[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[[49,25,1],[[3,[43,16]]]],0,[25,[[3,[43,16]]]],0,0,0,0,0],"c":[],"p":[[3,"Registry",579],[3,"String",580],[15,"tuple"],[3,"ChainListenerMetrics",0],[3,"ConnectionPoolMetrics",0],[4,"Resolution",0],[3,"ConnectivityMetrics",0],[3,"DispatcherMetrics",0],[4,"FunctionKind",0],[3,"ParticleExecutorMetrics",0],[3,"WorkerLabel",0],[4,"WorkerType",0],[3,"ServicesMetricsBuiltin",0],[4,"ServiceType",0],[3,"ServicesMetricsExternal",0],[3,"ServicesMetrics",0],[3,"SpellMetrics",0],[3,"VmPoolMetrics",0],[4,"ParticleType",0],[3,"ParticleLabel",0],[3,"Formatter",581],[3,"Error",581],[4,"Result",582],[3,"ServiceMemoryStat",0],[15,"usize"],[3,"LabelValueEncoder",583],[3,"LabelSetEncoder",583],[15,"bool"],[6,"Result",581],[4,"ServiceCallStats",0],[3,"FdFlags",584],[3,"Error",585],[15,"u64"],[8,"Hash",586],[8,"Sized",587],[8,"BuildHasher",586],[3,"MemoryStats",588],[8,"Hasher",586],[15,"str"],[15,"i64"],[15,"f64"],[3,"UnboundedReceiver",589],[3,"ServicesMetricsBackend",0],[4,"Option",590],[3,"UnboundedSender",589],[3,"SetFdFlags",584],[8,"AsFilelike",591],[15,"u32"],[3,"Duration",592],[3,"JoinHandle",593],[3,"TypeId",594],[13,"Success",574],[13,"Fail",574]],"b":[]},\ +"server_config":{"doc":"","t":"CDDDDNNCNDNEDDNDNNCEDDMMMALLLLLLLLLLLLMFMMMMMMMMMMMLLLLLLLLLLLLLLLLLLLLLLLLMMMMLLLLLLLLLLLLLLLLLLLLMMMMMMLLLLLLLLLLLLLLFFFMFFFFFFFFFFFFFFFFFFFFFFFFFFFFFMFFFFFFFMFFFFFFFFFFFLLLLLLLLLLLLLLLLLLLLLLLLLLMLLLLLLLMMMLLLLLLLLLLLLMFMLLMLMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMMMMLFFMMMMMMMMMMMMMMMMLLLLLLLLLLLLLMMMMMMMMMFMMMMMMMLLLLLLLLLLLLMLMMLLLLLLLLLLMFMLLLLLLLLLLLLMMMALLLLLLLLLLMMMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMLLLLLLLLLLLLMMMLMMNDNENNDNDELLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNDDNDNDEDNLMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMLLLLLLMMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMLLLLLLMMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMLLLLLLLLLLLLMMMMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMM","n":["AquaIpfsConfig","BootstrapConfig","ChainConfig","ChainListenerConfig","ConfigData","Custom","Dar","DeciderConfig","Disabled","KademliaConfig","Kras","Network","NetworkConfig","NodeConfig","Otlp","ResolvedConfig","Stage","Stdout","SystemServicesConfig","TracingConfig","TransportConfig","UnresolvedConfig","allow_local_addresses","allowed_effectors","aquavm_pool_size","args","as_","as_","as_","as_","as_","as_","as_","as_","as_","as_","as_","as_","authors","avm_base_dir","avm_config","ban_cooldown","binary_name","bootstrap","bootstrap_config","bootstrap_delay","bootstrap_frequency","bootstrap_frequency","bootstrap_max_delay","bootstrap_nodes","bootstrap_nodes","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","builtins_key_pair","ccp_endpoint","chain_config","chain_listener_config","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","connection_idle_timeout","connection_idle_timeout","connection_limits","connection_pool_metrics","connectivity_metrics","cpus_range","debug","debug","debug","debug","debug","debug","debug","debug","debug","debug","debug","debug","default","default","default_allowed_binaries","default_aquavm_pool_size","default_base_dir","default_base_fee","default_binaries_mapping","default_bootstrap_frequency","default_bootstrap_nodes","default_builtins_keypair_path","default_connection_idle_timeout","default_cpus_range","default_curl_binary_path","default_decider_spell_period_sec","default_effectors","default_effects_queue_buffer_size","default_epoch_end_window","default_execution_timeout","default_health_check_enabled","default_http_port","default_ipfs_binary_path","default_ipfs_multiaddr","default_key_format","default_keypair_path","default_listen_ip","default_management_peer_id","default_max_batch_count","default_max_builtin_metrics_storage_size","default_max_established_per_peer_limit","default_max_proof_batch_size","default_max_spell_particle_ttl","default_metrics_enabled","default_min_batch_count","default_particle_processor_parallelism","default_particle_queue_buffer_size","default_priority_fee","default_processing_timeout","default_proof_poll_period","default_registry_expired_spell_period_sec","default_registry_renew_spell_period_sec","default_registry_replicate_spell_period_sec","default_registry_spell_period_sec","default_service_memory_limit","default_service_memory_limit","default_services_metrics_timer_resolution","default_socket_timeout","default_system_cpu_count","default_system_services","default_tcp_port","default_tokio_metrics_enabled","default_tokio_metrics_poll_histogram_enabled","default_transport","default_websocket_port","default_worker_spell_period_sec","default_workers_queue_buffer_size","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","description","deserialize","deserialize","deserialize","deserialize","deserialize","deserialize","deserialize","dev_mode_config","diamond_contract_address","dir_config","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","effects_queue_buffer","ephemeral_dir","epoch_end_window","eq","eq","external_address","external_addresses","external_multiaddresses","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","from","from","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","health_config","http_config","http_endpoint","http_listen_addr","init","init","init","init","init","init","init","init","init","init","init","init","into","into","into","into","into","into","into","into","into","into","into","into","into_any","into_any","into_any","into_any","into_any","into_any","into_any","into_any","into_any","into_any","into_any","into_any","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","kademlia","kademlia_config","key_pair","libp2p_metrics","listen_config","listen_multiaddrs","load_config","load_config_with_args","local_peer_id","management_peer_id","max_batch_count","max_established","max_established_incoming","max_established_outgoing","max_established_per_peer","max_packet_size","max_pending_incoming","max_pending_outgoing","max_proof_batch_size","max_spell_particle_ttl","metrics_config","min_batch_count","network","network_id","new","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","no_banner","node_config","node_config","node_version","particle_execution_timeout","particle_processor_parallelism","particle_queue_buffer","particle_queue_buffer","peer_fail_threshold","persistent_dir","print_config","proof_poll_period","protocol_config","protocol_config","protocol_name","query_timeout","reconnect_delay","references","references","references","references","references","references","references","references","references","references","references","references","replication_factor","resolve","root_key_pair","root_weights","serialize","serialize","serialize","serialize","serialize","serialize","serialize","serialize","serialize","serialize","services","services_dir","services_envs","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","socket_timeout","system_cpu_count","system_services","system_services_config","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","tracing","transport","transport_config","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_name","type_name","type_name","type_name","type_name","type_name","type_name","type_name","type_name","type_name","type_name","type_name","version","vm","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","wallet_key","workers_queue_buffer","ws_endpoint","zero","endpoint","sample_ratio","All","DevModeArgs","Disabled","EnabledSystemServices","None","Otlp","RootKeyPairArgs","Some","TracingArgs","TracingType","as_","as_","as_","as_","as_","augment_args","augment_args","augment_args","augment_args_for_update","augment_args_for_update","augment_args_for_update","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","command","command_for_update","debug","debug","debug","debug","debug","deref","deref","deref","deref","deref","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","drop","drop","drop","drop","drop","endpoint","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from_arg_matches","from_arg_matches","from_arg_matches","from_arg_matches_mut","from_arg_matches_mut","from_arg_matches_mut","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","group_id","group_id","group_id","init","init","init","init","init","into","into","into","into","into","into_any","into_any","into_any","into_any","into_any","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","references","references","references","references","references","serialize","serialize","serialize","serialize","serialize","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","to_owned","to_owned","to_owned","to_owned","to_owned","to_possible_value","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_name","type_name","type_name","type_name","type_name","update_from_arg_matches","update_from_arg_matches","update_from_arg_matches","update_from_arg_matches_mut","update_from_arg_matches_mut","update_from_arg_matches_mut","value_variants","vzip","vzip","vzip","vzip","vzip","AquaIpfs","AquaIpfsConfig","ConnectorConfig","Decider","DeciderConfig","Registry","RegistryConfig","ServiceKey","SystemServicesConfig","TrustGraph","all_values","aqua_ipfs","as_","as_","as_","as_","as_","as_","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","connector","curl_binary_path","debug","debug","debug","debug","debug","debug","decider","decider_period_sec","default","default","default","default","default","deref","deref","deref","deref","deref","deref","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deserialize","deserialize","deserialize","deserialize","deserialize","deserialize","drop","drop","drop","drop","drop","drop","enable","eq","equivalent","equivalent","equivalent","equivalent","equivalent","expired_period_sec","external_api_multiaddr","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from_string","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_hash","hash","init","init","init","init","init","init","into","into","into","into","into","into","into_any","into_any","into_any","into_any","into_any","into_any","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","ipfs_binary_path","local_api_multiaddr","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","references","references","references","references","references","references","registry","registry_period_sec","renew_period_sec","replicate_period_sec","serialize","serialize","serialize","serialize","serialize","serialize","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_string","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_name","type_name","type_name","type_name","type_name","type_name","vzip","vzip","vzip","vzip","vzip","vzip","worker_ipfs_multiaddr","worker_period_sec"],"q":[[0,"server_config"],[505,"server_config::TracingConfig"],[507,"server_config::args"],[678,"server_config::system_services_config"],[889,"bnum::cast"],[890,"std::path"],[891,"std::path"],[892,"core::fmt"],[893,"alloc::string"],[894,"alloc::vec"],[895,"alloc::collections::btree::map"],[896,"multiaddr"],[897,"core::time"],[898,"core_distributor::core_range"],[899,"core::option"],[900,"std::collections::hash::map"],[901,"core::net::ip_addr"],[902,"libp2p_identity::peer_id"],[903,"bytesize"],[904,"fluence_libp2p::transport"],[905,"serde::de"],[906,"core::fmt"],[907,"std::io::error"],[908,"core::net::socket_addr"],[909,"alloc::boxed"],[910,"core::any"],[911,"alloc::sync"],[912,"alloc::rc"],[913,"eyre"],[914,"std::ffi::os_str"],[915,"libp2p_metrics"],[916,"peer_metrics::connectivity"],[917,"peer_metrics::connection_pool"],[918,"libp2p_identity::keypair"],[919,"libp2p_connection_limits"],[920,"system_interface::fs::fd_flags"],[921,"libipld_core::raw"],[922,"anyhow"],[923,"std::io"],[924,"cid::cid"],[925,"core::iter::traits::collect"],[926,"serde::ser"],[927,"core::any"],[928,"clap_builder::parser::matches::arg_matches"],[929,"clap_builder"],[930,"clap_builder::util::id"],[931,"clap_builder::builder::possible_value"],[932,"core::hash"],[933,"core::marker"],[934,"core::hash"]],"d":["","","","","","","","","","see libp2p_kad::KademliaConfig","","","","","","","","","","","","","","","Number of AVMs to create. By default, num_cpus::get() * 2 …","","","","","","","","","","","","","","","","These are the AquaVM limits that are used by the AquaVM …","Period after which peer ban is lifted","","","","","","","","","Bootstrap nodes to join to the Fluence network","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","If none, comes from the chain","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","If none, comes from the chain","","","","","","","","Default heap size in bytes available for a WASM service …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Defined how much time before epoch end to send all found …","","","External address to advertise via identify protocol","","External multiaddresses to advertise; more flexible that …","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Hierarchically loads the configuration using args and envs.","","","","Max number of proofs in a batch for CU to be sent on chain","","","","","","","","Max number of proofs batches to be sent on chain","","","Min number of proofs in a batch for CU to be sent on chain","","","","","","","","","","","","","","","","","","","","","","","","Number of times peer is failed to be discovered before it …","","","How often to poll proofs","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Socket timeout for main transport","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Creates config with all values to zero, so no delays. …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","","","","","","","","","","","","","","","","","","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","","","","","","","","","","","","","","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""],"i":[0,0,0,0,0,6,6,0,12,0,6,0,0,0,12,0,6,12,0,0,0,0,7,7,7,0,53,44,4,5,6,7,8,9,10,11,12,13,44,0,7,5,44,53,7,4,53,7,4,53,7,53,44,4,5,6,7,8,9,10,11,12,13,53,44,4,5,6,7,8,9,10,11,12,13,7,10,7,7,4,5,6,7,8,9,10,11,12,13,4,5,6,7,8,9,10,11,12,13,53,8,53,53,53,7,53,44,4,5,6,7,8,9,10,11,12,13,4,6,0,0,0,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9,0,0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,53,44,4,5,6,7,8,9,10,11,12,13,13,53,44,4,5,6,7,8,9,10,11,12,13,13,44,4,6,8,9,10,11,12,7,9,13,53,44,4,5,6,7,8,9,10,11,12,13,7,0,10,6,12,7,13,7,4,5,6,7,8,9,10,11,12,13,53,44,4,5,6,7,8,9,10,11,12,13,53,44,4,5,6,7,8,9,10,11,12,13,7,7,9,13,53,44,4,5,6,7,8,9,10,11,12,13,53,44,4,5,6,7,8,9,10,11,12,13,53,44,4,5,6,7,8,9,10,11,12,13,53,44,4,5,6,7,8,9,10,11,12,13,53,44,4,5,6,7,8,9,10,11,12,13,7,53,53,53,7,13,0,0,53,7,10,8,8,8,8,5,8,8,10,7,7,10,7,9,53,53,44,4,5,6,7,8,9,10,11,12,13,11,11,13,53,7,7,53,7,5,0,11,10,53,7,5,5,4,53,44,4,5,6,7,8,9,10,11,12,13,5,11,7,7,4,5,6,7,8,9,10,11,12,13,7,0,7,53,44,4,5,6,7,8,9,10,11,12,13,8,7,7,0,4,5,6,7,8,9,10,11,12,13,11,8,7,53,44,4,5,6,7,8,9,10,11,12,13,53,44,4,5,6,7,8,9,10,11,12,13,53,44,4,5,6,7,8,9,10,11,12,13,53,44,4,5,6,7,8,9,10,11,12,13,44,7,53,44,4,5,6,7,8,9,10,11,12,13,9,7,10,4,84,84,67,0,66,0,67,66,0,67,0,0,64,65,66,67,68,64,65,68,64,65,68,64,65,66,67,68,64,65,66,67,68,64,65,66,67,68,64,65,66,67,68,68,68,64,65,66,67,68,64,65,66,67,68,64,65,66,67,68,64,65,66,67,68,65,64,65,66,67,68,64,65,66,67,68,64,65,68,64,65,68,64,65,66,67,68,64,65,68,64,65,66,67,68,64,65,66,67,68,64,65,66,67,68,64,65,66,67,68,64,65,66,67,68,64,65,66,67,68,64,65,66,67,68,64,65,66,67,68,64,65,66,67,68,64,65,66,67,68,66,64,65,66,67,68,64,65,66,67,68,64,65,66,67,68,64,65,66,67,68,64,65,68,64,65,68,66,64,65,66,67,68,33,0,0,33,0,33,0,0,0,33,33,74,33,74,75,76,77,78,33,74,75,76,77,78,33,74,75,76,77,78,33,74,75,76,77,78,33,74,75,76,77,78,74,76,33,74,75,76,77,78,74,77,74,75,76,77,78,33,74,75,76,77,78,33,74,75,76,77,78,33,74,75,76,77,78,33,74,75,76,77,78,74,33,33,33,33,33,33,78,75,33,33,74,75,76,77,78,33,74,75,76,77,78,33,33,74,75,76,77,78,33,33,33,74,75,76,77,78,33,74,75,76,77,78,33,74,75,76,77,78,33,74,75,76,77,78,33,74,75,76,77,78,75,75,33,74,75,76,77,78,33,74,75,76,77,78,74,78,78,78,33,74,75,76,77,78,33,74,75,76,77,78,33,74,75,76,77,78,33,33,74,75,76,77,78,33,74,75,76,77,78,33,74,75,76,77,78,33,74,75,76,77,78,33,74,75,76,77,78,77,77],"f":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],0,[2,3],0,0,0,0,0,0,0,0,0,0,0,[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],0,0,0,0,[4,4],[5,5],[6,6],[7,7],[8,8],[9,9],[10,10],[11,11],[12,12],[13,13],[[-1,-2],14,[],[]],[[-1,-2],14,[],[]],[[-1,-2],14,[],[]],[[-1,-2],14,[],[]],[[-1,-2],14,[],[]],[[-1,-2],14,[],[]],[[-1,-2],14,[],[]],[[-1,-2],14,[],[]],[[-1,-2],14,[],[]],[[-1,-2],14,[],[]],0,0,0,0,0,0,[15,[[17,[14,16]]]],[15,[[17,[14,16]]]],[15,[[17,[14,16]]]],[15,[[17,[14,16]]]],[15,[[17,[14,16]]]],[15,[[17,[14,16]]]],[15,[[17,[14,16]]]],[15,[[17,[14,16]]]],[15,[[17,[14,16]]]],[15,[[17,[14,16]]]],[15,[[17,[14,16]]]],[15,[[17,[14,16]]]],[[],4],[[],6],[[],[[19,[18]]]],[[],20],[[],3],0,[[],[[21,[18,3]]]],[[],20],[[],[[19,[22]]]],0,[[],23],[[],[[25,[24]]]],[[],3],[[],26],[[],[[27,[18,[14,[18,[27,[18,3]]]]]]]],[[],20],[[],23],[[],23],[[],28],[[],29],[[],3],[[],18],[[],18],0,[[],30],[[],31],[[],20],[[],20],[[],[[25,[26]]]],[[],20],[[],23],[[],28],[[],20],[[],[[25,[20]]]],[[],20],0,[[],23],[[],23],[[],26],[[],26],[[],26],[[],26],[[],32],0,[[],23],[[],23],[[],20],[[],[[19,[33]]]],[[],29],[[],28],[[],28],[[],34],[[],29],[[],26],[[],20],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[13],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[13],[20,-1,[]],0,[-1,[[17,[4]]],35],[-1,[[17,[6]]],35],[-1,[[17,[8]]],35],[-1,[[17,[9]]],35],[-1,[[17,[10]]],35],[-1,[[17,[11]]],35],[-1,[[17,[12]]],35],0,0,0,[20,14],[20,14],[20,14],[20,14],[20,14],[20,14],[20,14],[20,14],[20,14],[20,14],[20,14],[20,14],0,[2,3],0,[[6,6],28],[[12,12],28],0,[13,[[19,[22]]]],0,[[4,15],36],[[5,15],36],[[6,15],36],[[7,15],36],[[8,15],36],[[9,15],36],[[10,15],36],[[11,15],36],[[12,15],36],[[13,15],36],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,[[17,[37,38]]],[]],[-1,[[17,[37,38]]],[]],[-1,[[17,[37,38]]],[]],[-1,[[17,[37,38]]],[]],[-1,[[17,[37,38]]],[]],[-1,[[17,[37,38]]],[]],[-1,[[17,[37,38]]],[]],[-1,[[17,[37,38]]],[]],[-1,[[17,[37,38]]],[]],[-1,[[17,[37,38]]],[]],[-1,[[17,[37,38]]],[]],[-1,[[17,[37,38]]],[]],0,0,0,[13,[[25,[39]]]],[[],20],[[],20],[[],20],[[],20],[[],20],[[],20],[[],20],[[],20],[[],20],[[],20],[[],20],[[],20],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[[[40,[-1]]],[[40,[41]]],[]],[[[40,[-1]]],[[40,[41]]],[]],[[[40,[-1]]],[[40,[41]]],[]],[[[40,[-1]]],[[40,[41]]],[]],[[[40,[-1]]],[[40,[41]]],[]],[[[40,[-1]]],[[40,[41]]],[]],[[[40,[-1]]],[[40,[41]]],[]],[[[40,[-1]]],[[40,[41]]],[]],[[[40,[-1]]],[[40,[41]]],[]],[[[40,[-1]]],[[40,[41]]],[]],[[[40,[-1]]],[[40,[41]]],[]],[[[40,[-1]]],[[40,[41]]],[]],[[[42,[-1]]],[[42,[41]]],[]],[[[42,[-1]]],[[42,[41]]],[]],[[[42,[-1]]],[[42,[41]]],[]],[[[42,[-1]]],[[42,[41]]],[]],[[[42,[-1]]],[[42,[41]]],[]],[[[42,[-1]]],[[42,[41]]],[]],[[[42,[-1]]],[[42,[41]]],[]],[[[42,[-1]]],[[42,[41]]],[]],[[[42,[-1]]],[[42,[41]]],[]],[[[42,[-1]]],[[42,[41]]],[]],[[[42,[-1]]],[[42,[41]]],[]],[[[42,[-1]]],[[42,[41]]],[]],[[[43,[-1]]],[[43,[41]]],[]],[[[43,[-1]]],[[43,[41]]],[]],[[[43,[-1]]],[[43,[41]]],[]],[[[43,[-1]]],[[43,[41]]],[]],[[[43,[-1]]],[[43,[41]]],[]],[[[43,[-1]]],[[43,[41]]],[]],[[[43,[-1]]],[[43,[41]]],[]],[[[43,[-1]]],[[43,[41]]],[]],[[[43,[-1]]],[[43,[41]]],[]],[[[43,[-1]]],[[43,[41]]],[]],[[[43,[-1]]],[[43,[41]]],[]],[[[43,[-1]]],[[43,[41]]],[]],0,0,0,0,0,[13,[[19,[22]]]],[[[25,[44]]],[[45,[11]]]],[[[19,[46]],[25,[44]]],[[45,[11]]]],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[[25,[[42,[47]]]],[25,[48]],[25,[49]],50,13,51,52],53],[[-1,37],[[17,[[54,[-2]],38]]],[],55],[[-1,37],[[17,[[54,[-2]],38]]],[],55],[[-1,37],[[17,[[54,[-2]],38]]],[],55],[[-1,37],[[17,[[54,[-2]],38]]],[],55],[[-1,37],[[17,[[54,[-2]],38]]],[],55],[[-1,37],[[17,[[54,[-2]],38]]],[],55],[[-1,37],[[17,[[54,[-2]],38]]],[],55],[[-1,37],[[17,[[54,[-2]],38]]],[],55],[[-1,37],[[17,[[54,[-2]],38]]],[],55],[[-1,37],[[17,[[54,[-2]],38]]],[],55],[[-1,37],[[17,[[54,[-2]],38]]],[],55],[[-1,37],[[17,[[54,[-2]],38]]],[],55],0,0,0,0,0,0,0,0,0,[2,3],0,0,0,0,0,0,0,[[56,-1,-2],[[17,[14,57]]],58,[[60,[59]]]],[[56,-1,-2],[[17,[14,57]]],58,[[60,[59]]]],[[56,-1,-2],[[17,[14,57]]],58,[[60,[59]]]],[[56,-1,-2],[[17,[14,57]]],58,[[60,[59]]]],[[56,-1,-2],[[17,[14,57]]],58,[[60,[59]]]],[[56,-1,-2],[[17,[14,57]]],58,[[60,[59]]]],[[56,-1,-2],[[17,[14,57]]],58,[[60,[59]]]],[[56,-1,-2],[[17,[14,57]]],58,[[60,[59]]]],[[56,-1,-2],[[17,[14,57]]],58,[[60,[59]]]],[[56,-1,-2],[[17,[14,57]]],58,[[60,[59]]]],[[56,-1,-2],[[17,[14,57]]],58,[[60,[59]]]],[[56,-1,-2],[[17,[14,57]]],58,[[60,[59]]]],0,[11,[[45,[13]]]],0,0,[[4,-1],17,61],[[5,-1],17,61],[[6,-1],17,61],[[7,-1],17,61],[[8,-1],17,61],[[9,-1],17,61],[[10,-1],17,61],[[11,-1],17,61],[[12,-1],17,61],[[13,-1],17,61],0,[2,3],0,[[-1,[54,[-2]]],[[17,[14,38]]],[],55],[[-1,[54,[-2]]],[[17,[14,38]]],[],55],[[-1,[54,[-2]]],[[17,[14,38]]],[],55],[[-1,[54,[-2]]],[[17,[14,38]]],[],55],[[-1,[54,[-2]]],[[17,[14,38]]],[],55],[[-1,[54,[-2]]],[[17,[14,38]]],[],55],[[-1,[54,[-2]]],[[17,[14,38]]],[],55],[[-1,[54,[-2]]],[[17,[14,38]]],[],55],[[-1,[54,[-2]]],[[17,[14,38]]],[],55],[[-1,[54,[-2]]],[[17,[14,38]]],[],55],[[-1,[54,[-2]]],[[17,[14,38]]],[],55],[[-1,[54,[-2]]],[[17,[14,38]]],[],55],0,0,0,0,[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],0,0,0,[-1,[[17,[-2]]],[],[]],[-1,[[17,[-2]]],[],[]],[-1,[[17,[-2]]],[],[]],[-1,[[17,[-2]]],[],[]],[-1,[[17,[-2]]],[],[]],[-1,[[17,[-2]]],[],[]],[-1,[[17,[-2]]],[],[]],[-1,[[17,[-2]]],[],[]],[-1,[[17,[-2]]],[],[]],[-1,[[17,[-2]]],[],[]],[-1,[[17,[-2]]],[],[]],[-1,[[17,[-2]]],[],[]],[-1,[[17,[-2]]],[],[]],[-1,[[17,[-2]]],[],[]],[-1,[[17,[-2]]],[],[]],[-1,[[17,[-2]]],[],[]],[-1,[[17,[-2]]],[],[]],[-1,[[17,[-2]]],[],[]],[-1,[[17,[-2]]],[],[]],[-1,[[17,[-2]]],[],[]],[-1,[[17,[-2]]],[],[]],[-1,[[17,[-2]]],[],[]],[-1,[[17,[-2]]],[],[]],[-1,[[17,[-2]]],[],[]],[-1,62,[]],[-1,62,[]],[-1,62,[]],[-1,62,[]],[-1,62,[]],[-1,62,[]],[-1,62,[]],[-1,62,[]],[-1,62,[]],[-1,62,[]],[-1,62,[]],[-1,62,[]],[-1,51,[]],[-1,51,[]],[-1,51,[]],[-1,51,[]],[-1,51,[]],[-1,51,[]],[-1,51,[]],[-1,51,[]],[-1,51,[]],[-1,51,[]],[-1,51,[]],[-1,51,[]],0,0,[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],0,0,0,[[],4],0,0,0,0,0,0,0,0,0,0,0,0,[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[63,63],[63,63],[63,63],[63,63],[63,63],[63,63],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[64,64],[65,65],[66,66],[67,67],[68,68],[[-1,-2],14,[],[]],[[-1,-2],14,[],[]],[[-1,-2],14,[],[]],[[-1,-2],14,[],[]],[[-1,-2],14,[],[]],[[],63],[[],63],[15,[[17,[14,16]]]],[15,[[17,[14,16]]]],[15,[[17,[14,16]]]],[15,[[17,[14,16]]]],[15,[[17,[14,16]]]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,14],[20,14],[20,14],[20,14],[20,14],0,[[64,15],36],[[65,15],36],[[66,15],36],[[67,15],36],[[68,15],36],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[69,[[17,[64,70]]]],[69,[[17,[65,70]]]],[69,[[17,[68,70]]]],[69,[[17,[64,70]]]],[69,[[17,[65,70]]]],[69,[[17,[68,70]]]],[-1,[[17,[37,38]]],[]],[-1,[[17,[37,38]]],[]],[-1,[[17,[37,38]]],[]],[-1,[[17,[37,38]]],[]],[-1,[[17,[37,38]]],[]],[[],[[25,[71]]]],[[],[[25,[71]]]],[[],[[25,[71]]]],[[],20],[[],20],[[],20],[[],20],[[],20],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[[[40,[-1]]],[[40,[41]]],[]],[[[40,[-1]]],[[40,[41]]],[]],[[[40,[-1]]],[[40,[41]]],[]],[[[40,[-1]]],[[40,[41]]],[]],[[[40,[-1]]],[[40,[41]]],[]],[[[42,[-1]]],[[42,[41]]],[]],[[[42,[-1]]],[[42,[41]]],[]],[[[42,[-1]]],[[42,[41]]],[]],[[[42,[-1]]],[[42,[41]]],[]],[[[42,[-1]]],[[42,[41]]],[]],[[[43,[-1]]],[[43,[41]]],[]],[[[43,[-1]]],[[43,[41]]],[]],[[[43,[-1]]],[[43,[41]]],[]],[[[43,[-1]]],[[43,[41]]],[]],[[[43,[-1]]],[[43,[41]]],[]],[[-1,37],[[17,[[54,[-2]],38]]],[],55],[[-1,37],[[17,[[54,[-2]],38]]],[],55],[[-1,37],[[17,[[54,[-2]],38]]],[],55],[[-1,37],[[17,[[54,[-2]],38]]],[],55],[[-1,37],[[17,[[54,[-2]],38]]],[],55],[[56,-1,-2],[[17,[14,57]]],58,[[60,[59]]]],[[56,-1,-2],[[17,[14,57]]],58,[[60,[59]]]],[[56,-1,-2],[[17,[14,57]]],58,[[60,[59]]]],[[56,-1,-2],[[17,[14,57]]],58,[[60,[59]]]],[[56,-1,-2],[[17,[14,57]]],58,[[60,[59]]]],[[64,-1],17,61],[[65,-1],17,61],[[66,-1],17,61],[[67,-1],17,61],[[68,-1],17,61],[[-1,[54,[-2]]],[[17,[14,38]]],[],55],[[-1,[54,[-2]]],[[17,[14,38]]],[],55],[[-1,[54,[-2]]],[[17,[14,38]]],[],55],[[-1,[54,[-2]]],[[17,[14,38]]],[],55],[[-1,[54,[-2]]],[[17,[14,38]]],[],55],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[66,[[25,[72]]]],[-1,[[17,[-2]]],[],[]],[-1,[[17,[-2]]],[],[]],[-1,[[17,[-2]]],[],[]],[-1,[[17,[-2]]],[],[]],[-1,[[17,[-2]]],[],[]],[-1,[[17,[-2]]],[],[]],[-1,[[17,[-2]]],[],[]],[-1,[[17,[-2]]],[],[]],[-1,[[17,[-2]]],[],[]],[-1,[[17,[-2]]],[],[]],[-1,62,[]],[-1,62,[]],[-1,62,[]],[-1,62,[]],[-1,62,[]],[-1,51,[]],[-1,51,[]],[-1,51,[]],[-1,51,[]],[-1,51,[]],[[64,69],[[17,[14,70]]]],[[65,69],[[17,[14,70]]]],[[68,69],[[17,[14,70]]]],[[64,69],[[17,[14,70]]]],[[65,69],[[17,[14,70]]]],[[68,69],[[17,[14,70]]]],[[],[[73,[66]]]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],0,0,0,0,0,0,0,0,0,0,[[],[[19,[33]]]],0,[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[33,33],[74,74],[75,75],[76,76],[77,77],[78,78],[[-1,-2],14,[],[]],[[-1,-2],14,[],[]],[[-1,-2],14,[],[]],[[-1,-2],14,[],[]],[[-1,-2],14,[],[]],[[-1,-2],14,[],[]],0,0,[15,[[17,[14,16]]]],[15,[[17,[14,16]]]],[15,[[17,[14,16]]]],[15,[[17,[14,16]]]],[15,[[17,[14,16]]]],[15,[[17,[14,16]]]],0,0,[[],74],[[],75],[[],76],[[],77],[[],78],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[-1,[[17,[33]]],35],[-1,[[17,[74]]],35],[-1,[[17,[75]]],35],[-1,[[17,[76]]],35],[-1,[[17,[77]]],35],[-1,[[17,[78]]],35],[20,14],[20,14],[20,14],[20,14],[20,14],[20,14],0,[[33,33],28],[[-1,-2],28,[],[]],[[-1,-2],28,[],[]],[[-1,-2],28,[],[]],[[-1,-2],28,[],[]],[[-1,-2],28,[],[]],0,0,[[33,15],36],[[33,15],36],[[74,15],36],[[75,15],36],[[76,15],36],[[77,15],36],[[78,15],36],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[51,[[25,[33]]]],[-1,[[17,[37,38]]],[]],[-1,[[17,[37,38]]],[]],[-1,[[17,[37,38]]],[]],[-1,[[17,[37,38]]],[]],[-1,[[17,[37,38]]],[]],[-1,[[17,[37,38]]],[]],[[-1,-2],79,[80,81],82],[[33,-1],14,83],[[],20],[[],20],[[],20],[[],20],[[],20],[[],20],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[[[40,[-1]]],[[40,[41]]],[]],[[[40,[-1]]],[[40,[41]]],[]],[[[40,[-1]]],[[40,[41]]],[]],[[[40,[-1]]],[[40,[41]]],[]],[[[40,[-1]]],[[40,[41]]],[]],[[[40,[-1]]],[[40,[41]]],[]],[[[42,[-1]]],[[42,[41]]],[]],[[[42,[-1]]],[[42,[41]]],[]],[[[42,[-1]]],[[42,[41]]],[]],[[[42,[-1]]],[[42,[41]]],[]],[[[42,[-1]]],[[42,[41]]],[]],[[[42,[-1]]],[[42,[41]]],[]],[[[43,[-1]]],[[43,[41]]],[]],[[[43,[-1]]],[[43,[41]]],[]],[[[43,[-1]]],[[43,[41]]],[]],[[[43,[-1]]],[[43,[41]]],[]],[[[43,[-1]]],[[43,[41]]],[]],[[[43,[-1]]],[[43,[41]]],[]],0,0,[[-1,37],[[17,[[54,[-2]],38]]],[],55],[[-1,37],[[17,[[54,[-2]],38]]],[],55],[[-1,37],[[17,[[54,[-2]],38]]],[],55],[[-1,37],[[17,[[54,[-2]],38]]],[],55],[[-1,37],[[17,[[54,[-2]],38]]],[],55],[[-1,37],[[17,[[54,[-2]],38]]],[],55],[[56,-1,-2],[[17,[14,57]]],58,[[60,[59]]]],[[56,-1,-2],[[17,[14,57]]],58,[[60,[59]]]],[[56,-1,-2],[[17,[14,57]]],58,[[60,[59]]]],[[56,-1,-2],[[17,[14,57]]],58,[[60,[59]]]],[[56,-1,-2],[[17,[14,57]]],58,[[60,[59]]]],[[56,-1,-2],[[17,[14,57]]],58,[[60,[59]]]],0,0,0,0,[[33,-1],17,61],[[74,-1],17,61],[[75,-1],17,61],[[76,-1],17,61],[[77,-1],17,61],[[78,-1],17,61],[[-1,[54,[-2]]],[[17,[14,38]]],[],55],[[-1,[54,[-2]]],[[17,[14,38]]],[],55],[[-1,[54,[-2]]],[[17,[14,38]]],[],55],[[-1,[54,[-2]]],[[17,[14,38]]],[],55],[[-1,[54,[-2]]],[[17,[14,38]]],[],55],[[-1,[54,[-2]]],[[17,[14,38]]],[],55],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,18,[]],[-1,[[17,[-2]]],[],[]],[-1,[[17,[-2]]],[],[]],[-1,[[17,[-2]]],[],[]],[-1,[[17,[-2]]],[],[]],[-1,[[17,[-2]]],[],[]],[-1,[[17,[-2]]],[],[]],[-1,[[17,[-2]]],[],[]],[-1,[[17,[-2]]],[],[]],[-1,[[17,[-2]]],[],[]],[-1,[[17,[-2]]],[],[]],[-1,[[17,[-2]]],[],[]],[-1,[[17,[-2]]],[],[]],[-1,62,[]],[-1,62,[]],[-1,62,[]],[-1,62,[]],[-1,62,[]],[-1,62,[]],[-1,51,[]],[-1,51,[]],[-1,51,[]],[-1,51,[]],[-1,51,[]],[-1,51,[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],0,0],"c":[],"p":[[8,"CastFrom",889],[3,"Path",890],[3,"PathBuf",890],[3,"BootstrapConfig",0],[3,"KademliaConfig",0],[4,"Network",0],[3,"NodeConfig",0],[3,"TransportConfig",0],[3,"ChainConfig",0],[3,"ChainListenerConfig",0],[3,"UnresolvedConfig",0],[4,"TracingConfig",0],[3,"ResolvedConfig",0],[15,"tuple"],[3,"Formatter",891],[3,"Error",891],[4,"Result",892],[3,"String",893],[3,"Vec",894],[15,"usize"],[3,"BTreeMap",895],[3,"Multiaddr",896],[3,"Duration",897],[3,"CoreRange",898],[4,"Option",899],[15,"u32"],[3,"HashMap",900],[15,"bool"],[15,"u16"],[4,"IpAddr",901],[3,"PeerId",902],[3,"ByteSize",903],[4,"ServiceKey",678],[4,"Transport",904],[8,"Deserializer",905],[6,"Result",891],[3,"FdFlags",906],[3,"Error",907],[4,"SocketAddr",908],[3,"Box",909],[8,"Any",910],[3,"Arc",911],[3,"Rc",912],[3,"ConfigData",0],[6,"Result",913],[3,"OsString",914],[3,"Metrics",915],[3,"ConnectivityMetrics",916],[3,"ConnectionPoolMetrics",917],[3,"Keypair",918],[15,"str"],[3,"ConnectionLimits",919],[3,"NetworkConfig",0],[3,"SetFdFlags",906],[8,"AsFilelike",920],[3,"RawCodec",921],[3,"Error",922],[8,"Read",923],[3,"Cid",924],[8,"Extend",925],[8,"Serializer",926],[3,"TypeId",910],[3,"Command",927],[3,"RootKeyPairArgs",507],[3,"TracingArgs",507],[4,"TracingType",507],[4,"EnabledSystemServices",507],[3,"DevModeArgs",507],[3,"ArgMatches",928],[6,"Error",929],[3,"Id",930],[3,"PossibleValue",931],[15,"slice"],[3,"SystemServicesConfig",678],[3,"AquaIpfsConfig",678],[3,"ConnectorConfig",678],[3,"DeciderConfig",678],[3,"RegistryConfig",678],[15,"u64"],[8,"Hash",932],[8,"Sized",933],[8,"BuildHasher",932],[8,"Hasher",932],[13,"Otlp",505]],"b":[[768,"impl-Display-for-ServiceKey"],[769,"impl-Debug-for-ServiceKey"]]},\ +"service_modules":{"doc":"","t":"DDDLFFLLLLLLLLLLLLLMMLLLLLLLFLLLLLLLLLLLMLLLFFFFFFFFFMMLLLLLLLLFLLLLLLLLLLLLLL","n":["AddBlueprint","Blueprint","Hash","as_bytes","blueprint_file_name","blueprint_fname","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone","clone_into","clone_into","clone_into","decode","dependencies","dependencies","deserialize","deserialize","encode","eq","equivalent","equivalent","equivalent","extract_module_file_name","fmt","fmt","fmt","fmt","from","from","from","from_string","get_facade_module","get_ipld","hash","id","into","into","into","is_blueprint","is_module_wasm","is_service","load_module","module_config","module_config_name_hash","module_config_name_json","module_file_name","module_file_name_hash","name","name","new","new","new","references","references","references","serialize","serialize","service_file_name","to_owned","to_owned","to_owned","to_string","to_string","try_from","try_from","try_from","try_into","try_into","try_into","type_id","type_id","type_id"],"q":[[0,"service_modules"],[78,"alloc::vec"],[79,"alloc::string"],[80,"eyre"],[81,"core::result"],[82,"serde::de"],[83,"std::path"],[84,"core::option"],[85,"core::fmt"],[86,"core::fmt"],[87,"libipld_core::ipld"],[88,"core::hash"],[89,"core::convert"],[90,"serde_json::value"],[91,"eyre"],[92,"anyhow"],[93,"std::io"],[94,"cid::cid"],[95,"core::iter::traits::collect"],[96,"serde::ser"],[97,"core::any"]],"d":["","","","","Calculates filename of the blueprint","","","","","","","","","","","","","","","","","","","encode IPLD object with DAG JSON codec","","","","","Return file name with .wasm extension stripped. None if …","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","","","","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Returns true if file is named like a blueprint would be","","","","","Calculates filename of the config for a wasm module","Calculates filename of the config for a wasm module, given …","Calculates the name of a wasm module file, given a hash or …","Calculates the name of a wasm module file, given a hash of …","","","","","","","","","","","","","","","","","","","","","","","","",""],"i":[0,0,0,1,0,0,7,4,1,7,4,1,7,4,1,7,4,1,7,7,4,4,1,7,1,1,1,1,0,7,4,1,1,7,4,1,1,4,7,1,4,7,4,1,0,0,0,0,0,0,0,0,0,7,4,7,4,1,7,4,1,4,1,0,7,4,1,7,1,7,4,1,7,4,1,7,4,1],"f":[0,0,0,[1,[[3,[2]]]],[4,5],[6,5],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[7,7],[4,4],[1,1],[[-1,-2],8,[],[]],[[-1,-2],8,[],[]],[[-1,-2],8,[],[]],[[[9,[2]]],[[10,[7]]]],0,0,[-1,[[11,[4]]],12],[-1,[[11,[1]]],12],[7,[[10,[[3,[2]]]]]],[[1,1],13],[[-1,-2],13,[],[]],[[-1,-2],13,[],[]],[[-1,-2],13,[],[]],[14,[[15,[6]]]],[[7,16],17],[[4,16],17],[[1,16],[[11,[8,18]]]],[[1,16],[[11,[8,18]]]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[6,[[11,[1,19]]]],[4,[[15,[1]]]],[7,20],[[1,-1],8,21],0,[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[6,13],[14,13],[14,13],[[6,-1],[[10,[[3,[2]]]]],[[22,[5]]]],[6,23],[1,5],[1,5],[6,5],[1,5],0,0,[[5,[3,[1]]],7],[7,[[10,[4]]]],[[[9,[2]]],[[11,[1,24]]]],[[25,-1,-2],[[11,[8,26]]],27,[[29,[28]]]],[[25,-1,-2],[[11,[8,26]]],27,[[29,[28]]]],[[25,-1,-2],[[11,[8,26]]],27,[[29,[28]]]],[[4,-1],11,30],[[1,-1],11,30],[6,5],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[7,[[10,[5]]]],[-1,5,[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,31,[]],[-1,31,[]],[-1,31,[]]],"c":[],"p":[[3,"Hash",0],[15,"u8"],[3,"Vec",78],[3,"Blueprint",0],[3,"String",79],[15,"str"],[3,"AddBlueprint",0],[15,"tuple"],[15,"slice"],[6,"Result",80],[4,"Result",81],[8,"Deserializer",82],[15,"bool"],[3,"Path",83],[4,"Option",84],[3,"Formatter",85],[6,"Result",85],[3,"Error",85],[4,"Error",86],[4,"Ipld",87],[8,"Hasher",88],[8,"Into",89],[4,"Value",90],[3,"Report",80],[3,"RawCodec",91],[3,"Error",92],[8,"Read",93],[3,"Cid",94],[8,"Extend",95],[8,"Serializer",96],[3,"TypeId",97]],"b":[[31,"impl-Debug-for-Hash"],[32,"impl-Display-for-Hash"]]},\ +"sorcerer":{"doc":"","t":"DDMLLLLLLLLLLLLLLLLLLLLLLLLLFLLFLLLLLLLLMLLLLLFMMLMLLMMMMMLLLMLLLLLLLLLLMM","n":["Sorcerer","SpellInfo","aquamarine","as_","as_","borrow","borrow","borrow_mut","borrow_mut","clone","clone","clone_into","clone_into","debug","debug","deref","deref","deref_mut","deref_mut","deserialize","drop","drop","execute_script","fmt","from","from","get_fd_flags","get_fd_flags","get_spell_info","init","init","install_spell","into","into","into_any","into_any","into_any_arc","into_any_arc","into_any_rc","into_any_rc","key_storage","new","new_set_fd_flags","new_set_fd_flags","references","references","remove_spell","scopes","script","serialize","services","set_fd_flags","set_fd_flags","spell_event_bus_api","spell_metrics","spell_script_particle_ttl","spell_service_api","spell_storage","start","to_owned","to_owned","trigger_config","try_from","try_from","try_into","try_into","type_id","type_id","type_name","type_name","vzip","vzip","worker_period_sec","workers"],"q":[[0,"sorcerer"],[74,"bnum::cast"],[75,"core::fmt"],[76,"core::fmt"],[77,"serde::de"],[78,"spell_event_bus::api"],[79,"tracing::span"],[80,"alloc::sync"],[81,"core::fmt"],[82,"std::io::error"],[83,"spell_service_api"],[84,"types::peer_scope"],[85,"core::time"],[86,"alloc::string"],[87,"libp2p_identity::peer_id"],[88,"particle_args::args_error"],[89,"particle_services::app_services"],[90,"spell_storage::storage"],[91,"spell_event_bus::api"],[92,"serde_json::value"],[93,"alloc::boxed"],[94,"core::any"],[95,"alloc::rc"],[96,"particle_modules::modules"],[97,"aquamarine::aquamarine"],[98,"server_config::resolved_config"],[99,"workers::workers"],[100,"workers::key_storage"],[101,"workers::scope"],[102,"peer_metrics::spell_metrics"],[103,"core::option"],[104,"particle_builtins::builtins"],[105,"std::collections::hash::map"],[106,"system_interface::fs::fd_flags"],[107,"libipld_core::raw"],[108,"anyhow"],[109,"std::io"],[110,"cid::cid"],[111,"core::iter::traits::collect"],[112,"serde::ser"],[113,"tokio::sync::mpsc::unbounded"],[114,"tokio::runtime::task::join"],[115,"core::any"]],"d":["","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","","","","","","","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""],"i":[0,0,2,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,3,2,3,2,3,2,3,2,3,0,2,3,0,2,3,2,3,2,3,2,3,2,2,2,3,2,3,0,2,3,3,2,2,3,2,2,2,2,2,2,2,3,3,2,3,2,3,2,3,2,3,2,3,2,2],"f":[0,0,0,[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[2,2],[3,3],[[-1,-2],4,[],[]],[[-1,-2],4,[],[]],[5,[[7,[4,6]]]],[5,[[7,[4,6]]]],[8,-1,[]],[8,-1,[]],[8,-1,[]],[8,-1,[]],[-1,[[7,[3]]],9],[8,4],[8,4],[[2,10,[12,[11]]],4],[[3,5],13],[-1,-1,[]],[-1,-1,[]],[-1,[[7,[14,15]]],[]],[-1,[[7,[14,15]]],[]],[[16,17,18,19,20],[[7,[3,21]]]],[[],8],[[],8],[[22,23,24,16,17,19,18,25,19,26,20],[[7,[19,21]]]],[-1,-2,[],[]],[-1,-2,[],[]],[[[27,[-1]]],[[27,[28]]],[]],[[[27,[-1]]],[[27,[28]]],[]],[[[12,[-1]]],[[12,[28]]],[]],[[[12,[-1]]],[[12,[28]]],[]],[[[29,[-1]]],[[29,[28]]],[]],[[[29,[-1]]],[[29,[28]]],[]],0,[[22,30,31,32,24,[12,[33]],[12,[34]],35,16,[37,[36]]],[[4,[2,[39,[19,38]],19]]]],[[-1,14],[[7,[[40,[-2]],15]]],[],41],[[-1,14],[[7,[[40,[-2]],15]]],[],41],[[42,-1,-2],[[7,[4,43]]],44,[[46,[45]]]],[[42,-1,-2],[[7,[4,43]]],44,[[46,[45]]]],[[47,23,22,24,47,17,20],[[7,[4,21]]]],0,0,[[3,-1],7,48],0,[[-1,[40,[-2]]],[[7,[4,15]]],[],41],[[-1,[40,[-2]]],[[7,[4,15]]],[],41],0,0,0,0,0,[[2,[49,[10]]],[[50,[4]]]],[-1,-2,[],[]],[-1,-2,[],[]],0,[-1,[[7,[-2]]],[],[]],[-1,[[7,[-2]]],[],[]],[-1,[[7,[-2]]],[],[]],[-1,[[7,[-2]]],[],[]],[-1,51,[]],[-1,51,[]],[-1,47,[]],[-1,47,[]],[-1,-2,[],[]],[-1,-2,[],[]],0,0],"c":[],"p":[[8,"CastFrom",74],[3,"Sorcerer",0],[3,"SpellInfo",0],[15,"tuple"],[3,"Formatter",75],[3,"Error",75],[4,"Result",76],[15,"usize"],[8,"Deserializer",77],[3,"TriggerEvent",78],[3,"Span",79],[3,"Arc",80],[6,"Result",75],[3,"FdFlags",81],[3,"Error",82],[3,"SpellServiceApi",83],[4,"PeerScope",84],[3,"Duration",85],[3,"String",86],[3,"PeerId",87],[3,"JError",88],[3,"ParticleAppServices",89],[3,"SpellStorage",90],[3,"SpellEventBusApi",78],[3,"TriggerConfig",91],[4,"Value",92],[3,"Box",93],[8,"Any",94],[3,"Rc",95],[3,"ModuleRepository",96],[3,"AquamarineApi",97],[3,"ResolvedConfig",98],[3,"Workers",99],[3,"KeyStorage",100],[3,"PeerScopes",101],[3,"SpellMetrics",102],[4,"Option",103],[3,"CustomService",104],[3,"HashMap",105],[3,"SetFdFlags",81],[8,"AsFilelike",106],[3,"RawCodec",107],[3,"Error",108],[8,"Read",109],[3,"Cid",110],[8,"Extend",111],[15,"str"],[8,"Serializer",112],[3,"UnboundedReceiver",113],[3,"JoinHandle",114],[3,"TypeId",94]],"b":[]},\ +"spell_event_bus":{"doc":"","t":"AAEENNENNRNDENNDGDNNNDDEDNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLFLLLLLLLLLLLLLMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMLLLLLLLLLLLLLLMLLMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMDLLLLLLLLLLLLLLLLLL","n":["api","bus","Action","ConfigError","Connected","Disconnected","EventBusError","InvalidEndSec","InvalidPeriod","MAX_PERIOD_SEC","Peer","PeerEvent","PeerEventType","ReplyError","SendError","SpellEventBusApi","SpellId","SpellTriggerConfigs","Start","Subscribe","Timer","TimerEvent","TriggerEvent","TriggerInfo","TriggerInfoAqua","Unsubscribe","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","connected","debug","debug","debug","debug","debug","debug","debug","debug","debug","debug","debug","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deserialize","deserialize","deserialize","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","eq","equivalent","equivalent","equivalent","equivalent","equivalent","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from_user_config","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_hash","hash","info","init","init","init","init","init","init","init","init","init","init","init","into","into","into","into","into","into","into","into","into","into","into","into_rescheduled","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","peer_id","serialize","serialize","serialize","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","spell_id","start_scheduling","subscribe","timestamp","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_string","to_string","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","unsubscribe","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","action","reason","SpellEventBus","borrow","borrow_mut","debug","deref","deref_mut","drop","from","get_fd_flags","init","into","new","new_set_fd_flags","set_fd_flags","start","try_from","try_into","type_id","vzip"],"q":[[0,"spell_event_bus"],[2,"spell_event_bus::api"],[268,"spell_event_bus::api::EventBusError"],[270,"spell_event_bus::bus"],[289,"core::fmt"],[290,"core::fmt"],[291,"serde::de"],[292,"core::fmt"],[293,"fluence_spell_dtos::trigger_config"],[294,"core::option"],[295,"system_interface::fs::fd_flags"],[296,"std::io::error"],[297,"core::hash"],[298,"core::marker"],[299,"core::hash"],[300,"serde::ser"],[301,"alloc::string"],[302,"core::any"],[303,"peer_metrics::spell_metrics"],[304,"futures_core::stream"],[305,"alloc::vec"],[306,"tokio::sync::mpsc::unbounded"],[307,"tokio::runtime::task::join"]],"d":["","","","","","","","","","Max period is 100 years in secs: 60 sec * 60 min * 24 …","Event is triggered by a peer event.","Event is triggered by connection pool event","Types of events that are available for subscription.","","","","","","Actually start the scheduling","Subscribe a spell to a list of triggers","Event is triggered by timer.","","","","","Remove all subscriptions of a spell","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","","Returns the argument unchanged.","Returns the argument unchanged.","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Convert user-friendly config to event-bus-friendly config, …","","","","","","","","","","","","","","","","","","","","","","","","","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Subscribe a spell to a list of events The spell can be …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Unsubscribe a spell from all events.","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","","","Calls U::from(self).","","","","","","","",""],"i":[0,0,0,0,5,5,0,19,19,0,2,0,0,18,18,0,0,0,6,6,2,0,0,0,0,6,1,2,3,4,5,15,6,18,7,19,8,1,2,3,4,5,15,6,18,7,19,8,1,2,3,4,5,6,7,8,1,2,3,4,5,6,7,8,4,1,2,3,4,5,15,6,18,7,19,8,1,2,3,4,5,15,6,18,7,19,8,1,2,3,4,5,15,6,18,7,19,8,3,4,15,1,2,3,4,5,15,6,18,7,19,8,5,5,5,5,5,5,1,2,3,4,5,15,6,18,18,7,19,19,8,1,2,2,3,4,4,5,15,15,6,18,7,19,8,0,1,2,3,4,5,15,6,18,7,19,8,5,5,1,1,2,3,4,5,15,6,18,7,19,8,1,2,3,4,5,15,6,18,7,19,8,8,1,2,3,4,5,15,6,18,7,19,8,4,3,4,15,1,2,3,4,5,15,6,18,7,19,8,1,7,7,3,1,2,3,4,5,6,7,8,18,19,1,2,3,4,5,15,6,18,7,19,8,1,2,3,4,5,15,6,18,7,19,8,1,2,3,4,5,15,6,18,7,19,8,7,1,2,3,4,5,15,6,18,7,19,8,42,42,0,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39],"f":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[1,1],[2,2],[3,3],[4,4],[5,5],[6,6],[7,7],[8,8],[[-1,-2],9,[],[]],[[-1,-2],9,[],[]],[[-1,-2],9,[],[]],[[-1,-2],9,[],[]],[[-1,-2],9,[],[]],[[-1,-2],9,[],[]],[[-1,-2],9,[],[]],[[-1,-2],9,[],[]],0,[10,[[12,[9,11]]]],[10,[[12,[9,11]]]],[10,[[12,[9,11]]]],[10,[[12,[9,11]]]],[10,[[12,[9,11]]]],[10,[[12,[9,11]]]],[10,[[12,[9,11]]]],[10,[[12,[9,11]]]],[10,[[12,[9,11]]]],[10,[[12,[9,11]]]],[10,[[12,[9,11]]]],[13,-1,[]],[13,-1,[]],[13,-1,[]],[13,-1,[]],[13,-1,[]],[13,-1,[]],[13,-1,[]],[13,-1,[]],[13,-1,[]],[13,-1,[]],[13,-1,[]],[13,-1,[]],[13,-1,[]],[13,-1,[]],[13,-1,[]],[13,-1,[]],[13,-1,[]],[13,-1,[]],[13,-1,[]],[13,-1,[]],[13,-1,[]],[13,-1,[]],[-1,[[12,[3]]],14],[-1,[[12,[4]]],14],[-1,[[12,[15]]],14],[13,9],[13,9],[13,9],[13,9],[13,9],[13,9],[13,9],[13,9],[13,9],[13,9],[13,9],[[5,5],16],[[-1,-2],16,[],[]],[[-1,-2],16,[],[]],[[-1,-2],16,[],[]],[[-1,-2],16,[],[]],[[-1,-2],16,[],[]],[[1,10],17],[[2,10],17],[[3,10],17],[[4,10],17],[[5,10],17],[[15,10],17],[[6,10],17],[[18,10],17],[[18,10],17],[[7,10],17],[[19,10],17],[[19,10],17],[[8,10],17],[-1,-1,[]],[15,2],[-1,-1,[]],[-1,-1,[]],[20,4],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[2,15],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[21,[[12,[[22,[8]],19]]]],[-1,[[12,[23,24]]],[]],[-1,[[12,[23,24]]],[]],[-1,[[12,[23,24]]],[]],[-1,[[12,[23,24]]],[]],[-1,[[12,[23,24]]],[]],[-1,[[12,[23,24]]],[]],[-1,[[12,[23,24]]],[]],[-1,[[12,[23,24]]],[]],[-1,[[12,[23,24]]],[]],[-1,[[12,[23,24]]],[]],[-1,[[12,[23,24]]],[]],[[-1,-2],25,[26,27],28],[[5,-1],9,29],0,[[],13],[[],13],[[],13],[[],13],[[],13],[[],13],[[],13],[[],13],[[],13],[[],13],[[],13],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[8,[[22,[8]]]],[[-1,23],[[12,[[30,[-2]],24]]],[],31],[[-1,23],[[12,[[30,[-2]],24]]],[],31],[[-1,23],[[12,[[30,[-2]],24]]],[],31],[[-1,23],[[12,[[30,[-2]],24]]],[],31],[[-1,23],[[12,[[30,[-2]],24]]],[],31],[[-1,23],[[12,[[30,[-2]],24]]],[],31],[[-1,23],[[12,[[30,[-2]],24]]],[],31],[[-1,23],[[12,[[30,[-2]],24]]],[],31],[[-1,23],[[12,[[30,[-2]],24]]],[],31],[[-1,23],[[12,[[30,[-2]],24]]],[],31],[[-1,23],[[12,[[30,[-2]],24]]],[],31],0,[[3,-1],12,32],[[4,-1],12,32],[[15,-1],12,32],[[-1,[30,[-2]]],[[12,[9,24]]],[],31],[[-1,[30,[-2]]],[[12,[9,24]]],[],31],[[-1,[30,[-2]]],[[12,[9,24]]],[],31],[[-1,[30,[-2]]],[[12,[9,24]]],[],31],[[-1,[30,[-2]]],[[12,[9,24]]],[],31],[[-1,[30,[-2]]],[[12,[9,24]]],[],31],[[-1,[30,[-2]]],[[12,[9,24]]],[],31],[[-1,[30,[-2]]],[[12,[9,24]]],[],31],[[-1,[30,[-2]]],[[12,[9,24]]],[],31],[[-1,[30,[-2]]],[[12,[9,24]]],[],31],[[-1,[30,[-2]]],[[12,[9,24]]],[],31],0,[7,[[12,[9,18]]]],[[7,33,8],[[12,[9,18]]]],0,[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,34,[]],[-1,34,[]],[-1,[[12,[-2]]],[],[]],[-1,[[12,[-2]]],[],[]],[-1,[[12,[-2]]],[],[]],[-1,[[12,[-2]]],[],[]],[-1,[[12,[-2]]],[],[]],[-1,[[12,[-2]]],[],[]],[-1,[[12,[-2]]],[],[]],[-1,[[12,[-2]]],[],[]],[-1,[[12,[-2]]],[],[]],[-1,[[12,[-2]]],[],[]],[-1,[[12,[-2]]],[],[]],[-1,[[12,[-2]]],[],[]],[-1,[[12,[-2]]],[],[]],[-1,[[12,[-2]]],[],[]],[-1,[[12,[-2]]],[],[]],[-1,[[12,[-2]]],[],[]],[-1,[[12,[-2]]],[],[]],[-1,[[12,[-2]]],[],[]],[-1,[[12,[-2]]],[],[]],[-1,[[12,[-2]]],[],[]],[-1,[[12,[-2]]],[],[]],[-1,[[12,[-2]]],[],[]],[-1,35,[]],[-1,35,[]],[-1,35,[]],[-1,35,[]],[-1,35,[]],[-1,35,[]],[-1,35,[]],[-1,35,[]],[-1,35,[]],[-1,35,[]],[-1,35,[]],[[7,33],[[12,[9,18]]]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],0,0,0,[-1,-2,[],[]],[-1,-2,[],[]],[10,[[12,[9,11]]]],[13,-1,[]],[13,-1,[]],[13,9],[-1,-1,[]],[-1,[[12,[23,24]]],[]],[[],13],[-1,-2,[],[]],[[[22,[36]],[38,[[37,[4]]]]],[[9,[39,7,[40,[1]]]]]],[[-1,23],[[12,[[30,[-2]],24]]],[],31],[[-1,[30,[-2]]],[[12,[9,24]]],[],31],[39,[[41,[9]]]],[-1,[[12,[-2]]],[],[]],[-1,[[12,[-2]]],[],[]],[-1,35,[]],[-1,-2,[],[]]],"c":[],"p":[[3,"TriggerEvent",2],[4,"TriggerInfo",2],[3,"TimerEvent",2],[3,"PeerEvent",2],[4,"PeerEventType",2],[4,"Action",2],[3,"SpellEventBusApi",2],[3,"SpellTriggerConfigs",2],[15,"tuple"],[3,"Formatter",289],[3,"Error",289],[4,"Result",290],[15,"usize"],[8,"Deserializer",291],[3,"TriggerInfoAqua",2],[15,"bool"],[6,"Result",289],[4,"EventBusError",2],[4,"ConfigError",2],[4,"LifecycleEvent",292],[3,"TriggerConfig",293],[4,"Option",294],[3,"FdFlags",295],[3,"Error",296],[15,"u64"],[8,"Hash",297],[8,"Sized",298],[8,"BuildHasher",297],[8,"Hasher",297],[3,"SetFdFlags",295],[8,"AsFilelike",299],[8,"Serializer",300],[6,"SpellId",2],[3,"String",301],[3,"TypeId",302],[3,"SpellMetrics",303],[6,"BoxStream",304],[3,"Vec",305],[3,"SpellEventBus",270],[3,"UnboundedReceiver",306],[3,"JoinHandle",307],[13,"SendError",268]],"b":[[125,"impl-Debug-for-EventBusError"],[126,"impl-Display-for-EventBusError"],[128,"impl-Display-for-ConfigError"],[129,"impl-Debug-for-ConfigError"]]},\ +"spell_service_api":{"doc":"","t":"EDNNNNNDLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMMMMMMMMMMMMM","n":["CallError","CallParams","EmptyResult","ExecutionError","OtherError","ResultParseError","ServiceNotFound","SpellServiceApi","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone_into","clone_into","debug","debug","debug","deref","deref","deref","deref_mut","deref_mut","deref_mut","drop","drop","drop","fmt","fmt","fmt","from","from","from","from","get_counter","get_fd_flags","get_fd_flags","get_fd_flags","get_script","get_string","get_trigger_config","init","init","init","into","into","into","into_any","into_any","into_any","into_any_arc","into_any_arc","into_any_arc","into_any_rc","into_any_rc","into_any_rc","local","new","new","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","references","references","references","set_counter","set_fd_flags","set_fd_flags","set_fd_flags","set_script","set_string","set_trigger_config","set_trigger_event","store_error","to_owned","to_owned","to_string","try_from","try_from","try_from","try_into","try_into","try_into","type_id","type_id","type_id","type_name","type_name","type_name","update_kv","vzip","vzip","vzip","function_name","function_name","function_name","function_name","function_name","reason","reason","reason","spell_id","spell_id","spell_id","spell_id","spell_id","target_type"],"q":[[0,"spell_service_api"],[96,"spell_service_api::CallError"],[110,"core::fmt"],[111,"core::fmt"],[112,"core::fmt"],[113,"particle_execution::particle_params"],[114,"core::option"],[115,"system_interface::fs::fd_flags"],[116,"std::io::error"],[117,"fluence_spell_dtos::trigger_config"],[118,"alloc::boxed"],[119,"core::any"],[120,"alloc::sync"],[121,"alloc::rc"],[122,"types::peer_scope"],[123,"libp2p_identity::peer_id"],[124,"core::time"],[125,"particle_services::app_services"],[126,"system_interface::fs::fd_flags"],[127,"libipld_core::raw"],[128,"anyhow"],[129,"std::io"],[130,"cid::cid"],[131,"core::iter::traits::collect"],[132,"serde_json::value"],[133,"alloc::vec"],[134,"core::any"]],"d":["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","","Returns the argument unchanged.","Returns the argument unchanged.","Load the counter (how many times the spell was run)","","","","","","","","","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","","Update the counter (how many times the spell was run) …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""],"i":[0,0,8,8,8,8,8,0,8,1,2,8,1,2,1,2,1,2,8,1,2,8,1,2,8,1,2,8,1,2,8,8,2,8,1,1,2,2,8,1,2,2,2,2,8,1,2,8,1,2,8,1,2,8,1,2,8,1,2,1,1,2,8,1,2,8,1,2,2,8,1,2,2,2,2,2,2,1,2,8,8,1,2,8,1,2,8,1,2,8,1,2,2,8,1,2,36,37,38,39,40,38,39,40,36,37,38,39,40,39],"f":[0,0,0,0,0,0,0,0,[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[1,1],[2,2],[[-1,-2],3,[],[]],[[-1,-2],3,[],[]],[4,[[6,[3,5]]]],[4,[[6,[3,5]]]],[4,[[6,[3,5]]]],[7,-1,[]],[7,-1,[]],[7,-1,[]],[7,-1,[]],[7,-1,[]],[7,-1,[]],[7,3],[7,3],[7,3],[[8,4],9],[[8,4],9],[[2,4],9],[-1,-1,[]],[[10,11],1],[-1,-1,[]],[-1,-1,[]],[[2,1],[[6,[[13,[12]],8]]]],[-1,[[6,[14,15]]],[]],[-1,[[6,[14,15]]],[]],[-1,[[6,[14,15]]],[]],[[2,1],[[6,[10,8]]]],[[2,1,10],[[6,[[13,[10]],8]]]],[[2,1],[[6,[16,8]]]],[[],7],[[],7],[[],7],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[[[17,[-1]]],[[17,[18]]],[]],[[[17,[-1]]],[[17,[18]]],[]],[[[17,[-1]]],[[17,[18]]],[]],[[[19,[-1]]],[[19,[18]]],[]],[[[19,[-1]]],[[19,[18]]],[]],[[[19,[-1]]],[[19,[18]]],[]],[[[20,[-1]]],[[20,[18]]],[]],[[[20,[-1]]],[[20,[18]]],[]],[[[20,[-1]]],[[20,[18]]],[]],[[21,10,22,23],1],[[22,21,10,[13,[10]],23],1],[24,2],[[-1,14],[[6,[[25,[-2]],15]]],[],26],[[-1,14],[[6,[[25,[-2]],15]]],[],26],[[-1,14],[[6,[[25,[-2]],15]]],[],26],[[27,-1,-2],[[6,[3,28]]],29,[[31,[30]]]],[[27,-1,-2],[[6,[3,28]]],29,[[31,[30]]]],[[27,-1,-2],[[6,[3,28]]],29,[[31,[30]]]],[[2,1,12],[[6,[3,8]]]],[[-1,[25,[-2]]],[[6,[3,15]]],[],26],[[-1,[25,[-2]]],[[6,[3,15]]],[],26],[[-1,[25,[-2]]],[[6,[3,15]]],[],26],[[2,1,10],[[6,[3,8]]]],[[2,1,10,10],[[6,[3,8]]]],[[2,1,16],[[6,[3,8]]]],[[2,1,10],[[6,[3,8]]]],[[2,1,[33,[32]]],[[6,[3,8]]]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,10,[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,34,[]],[-1,34,[]],[-1,34,[]],[-1,35,[]],[-1,35,[]],[-1,35,[]],[[2,1,32],[[6,[3,8]]]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],0,0,0,0,0,0,0,0,0,0,0,0,0,0],"c":[],"p":[[3,"CallParams",0],[3,"SpellServiceApi",0],[15,"tuple"],[3,"Formatter",110],[3,"Error",110],[4,"Result",111],[15,"usize"],[4,"CallError",0],[6,"Result",110],[3,"String",112],[3,"ParticleParams",113],[15,"u32"],[4,"Option",114],[3,"FdFlags",115],[3,"Error",116],[3,"TriggerConfig",117],[3,"Box",118],[8,"Any",119],[3,"Arc",120],[3,"Rc",121],[4,"PeerScope",122],[3,"PeerId",123],[3,"Duration",124],[3,"ParticleAppServices",125],[3,"SetFdFlags",115],[8,"AsFilelike",126],[3,"RawCodec",127],[3,"Error",128],[8,"Read",129],[3,"Cid",130],[8,"Extend",131],[4,"Value",132],[3,"Vec",133],[3,"TypeId",119],[15,"str"],[13,"ServiceNotFound",96],[13,"EmptyResult",96],[13,"OtherError",96],[13,"ResultParseError",96],[13,"ExecutionError",96]],"b":[[30,"impl-Display-for-CallError"],[31,"impl-Debug-for-CallError"]]},\ +"spell_storage":{"doc":"","t":"DLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL","n":["SpellStorage","borrow","borrow_mut","clone","clone_into","create","debug","deref","deref_mut","drop","fmt","from","get_blueprint","get_fd_flags","get_registered_spells","get_registered_spells_by","get_scope","init","into","into_any","into_any_arc","into_any_rc","new_set_fd_flags","references","register_spell","set_fd_flags","to_owned","try_from","try_into","type_id","type_name","unregister_spell","vzip"],"q":[[0,"spell_storage"],[33,"std::path"],[34,"particle_services::app_services"],[35,"particle_modules::modules"],[36,"alloc::string"],[37,"eyre"],[38,"core::fmt"],[39,"core::fmt"],[40,"core::fmt"],[41,"std::io::error"],[42,"types::peer_scope"],[43,"alloc::vec"],[44,"std::collections::hash::map"],[45,"core::option"],[46,"alloc::boxed"],[47,"core::any"],[48,"alloc::sync"],[49,"alloc::rc"],[50,"system_interface::fs::fd_flags"],[51,"libipld_core::raw"],[52,"anyhow"],[53,"std::io"],[54,"cid::cid"],[55,"core::iter::traits::collect"],[56,"core::any"]],"d":["","","","","","","","","","","","Returns the argument unchanged.","","","","","","","Calls U::from(self).","","","","","","","","","","","","","",""],"i":[0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],"f":[0,[-1,-2,[],[]],[-1,-2,[],[]],[1,1],[[-1,-2],2,[],[]],[[3,4,5],[[7,[[2,[1,6]]]]]],[8,[[10,[2,9]]]],[11,-1,[]],[11,-1,[]],[11,2],[[1,8],12],[-1,-1,[]],[1,6],[-1,[[10,[13,14]]],[]],[1,[[17,[15,[16,[6]]]]]],[[1,15],[[16,[6]]]],[[1,6],[[18,[15]]]],[[],11],[-1,-2,[],[]],[[[19,[-1]]],[[19,[20]]],[]],[[[21,[-1]]],[[21,[20]]],[]],[[[22,[-1]]],[[22,[20]]],[]],[[-1,13],[[10,[[23,[-2]],14]]],[],24],[[25,-1,-2],[[10,[2,26]]],27,[[29,[28]]]],[[1,15,6],2],[[-1,[23,[-2]]],[[10,[2,14]]],[],24],[-1,-2,[],[]],[-1,[[10,[-2]]],[],[]],[-1,[[10,[-2]]],[],[]],[-1,30,[]],[-1,31,[]],[[1,15,31],2],[-1,-2,[],[]]],"c":[],"p":[[3,"SpellStorage",0],[15,"tuple"],[3,"Path",33],[3,"ParticleAppServices",34],[3,"ModuleRepository",35],[3,"String",36],[6,"Result",37],[3,"Formatter",38],[3,"Error",38],[4,"Result",39],[15,"usize"],[6,"Result",38],[3,"FdFlags",40],[3,"Error",41],[4,"PeerScope",42],[3,"Vec",43],[3,"HashMap",44],[4,"Option",45],[3,"Box",46],[8,"Any",47],[3,"Arc",48],[3,"Rc",49],[3,"SetFdFlags",40],[8,"AsFilelike",50],[3,"RawCodec",51],[3,"Error",52],[8,"Read",53],[3,"Cid",54],[8,"Extend",55],[3,"TypeId",47],[15,"str"]],"b":[]},\ +"system_services":{"doc":"","t":"INDDNIDDEDDDMMLLLLLLLLLLLLLLLLLLLLLLLLKLLLLLLLLLLLLLLLLMLLLLLLLLMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLKLLLLLLLLMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMMMMLLLLLLLLLLLLLLLLLMMMLLLLLLLLMMLLLLLLLLMMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMLLLLLLLLL","n":["CallService","Created","Deployer","Deployment","Existing","InitService","PackageDistro","ServiceDistro","ServiceStatus","SpellDistro","SystemServiceDistros","Versions","air","aqua_ipfs_version","as_","as_","as_","as_","as_","as_","as_","as_","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","call","clone","clone","clone","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","config","debug","debug","debug","debug","debug","debug","debug","debug","decider_version","default_from","deploy_system_services","deref","deref","deref","deref","deref","deref","deref","deref","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","drop","drop","drop","drop","drop","drop","drop","drop","extend","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","get_fd_flags","init","init","init","init","init","init","init","init","init","init","into","into","into","into","into","into","into","into","into_any","into_any","into_any","into_any","into_any","into_any","into_any","into_any","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","kv","modules","name","name","name","new","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","new_set_fd_flags","references","references","references","references","references","references","references","references","registry_version","services","services","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","set_fd_flags","spells","spells","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","trigger_config","trust_graph_version","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_name","type_name","type_name","type_name","type_name","type_name","type_name","type_name","version","versions","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip"],"q":[[0,"system_services"],[245,"bnum::cast"],[246,"alloc::string"],[247,"serde_json::value"],[248,"alloc::vec"],[249,"core::future::future"],[250,"alloc::boxed"],[251,"core::pin"],[252,"core::fmt"],[253,"core::fmt"],[254,"server_config::system_services_config"],[255,"eyre"],[256,"core::fmt"],[257,"std::io::error"],[258,"core::any"],[259,"alloc::sync"],[260,"alloc::rc"],[261,"particle_services::app_services"],[262,"particle_modules::modules"],[263,"spell_storage::storage"],[264,"spell_event_bus::api"],[265,"spell_service_api"],[266,"libp2p_identity::peer_id"],[267,"system_interface::fs::fd_flags"],[268,"libipld_core::raw"],[269,"anyhow"],[270,"std::io"],[271,"cid::cid"],[272,"core::iter::traits::collect"],[273,"core::any"]],"d":["Call service functions. Accepts","Id of a newly created service","","Status of package deployment for each services and spells …","Id of a already existing service","Initialization function to initialize services","Package distribution description Contains enough …","Service distribution description that provides enough …","A status of a service/spell after deployment","Spell distribution description that provides enough …","","","The AIR script of the spell","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Marine config of the service","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","With overriding existing packages","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","","","","","","","","","","","","","","","","","Optionally, initialization function for the services.","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","Initial values for the KV storage of the spell Note that …","WASM modules of the service by their names","High-level name of the package. For the system services …","High-level names of the service used as an alias","The name of the spell which is also used as an alias for …","","","","","","","","","","","","","","","","","","","Statuses of services deployment","List services needed by the package","","","","","","","","","Statuses of spells deployment","List of spells needed by the package","","","","","","","","","The trigger config for the spell","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Version of the package, the field is used to display …","","","","","","","","",""],"i":[0,15,0,0,15,0,0,0,0,0,0,0,14,9,8,9,10,11,12,13,14,15,8,9,10,11,12,13,14,15,8,9,10,11,12,13,14,15,26,8,9,10,11,12,13,14,15,8,9,10,11,12,13,14,15,13,8,9,10,11,12,13,14,15,9,10,8,8,9,10,11,12,13,14,15,8,9,10,11,12,13,14,15,8,9,10,11,12,13,14,15,10,8,9,10,11,12,13,14,15,8,9,10,11,12,13,14,15,8,9,10,11,12,13,14,15,45,8,9,10,11,12,13,14,15,12,8,9,10,11,12,13,14,15,8,9,10,11,12,13,14,15,8,9,10,11,12,13,14,15,8,9,10,11,12,13,14,15,14,13,12,13,14,8,8,9,10,11,12,13,14,15,8,9,10,11,12,13,14,15,9,11,12,8,9,10,11,12,13,14,15,11,12,8,9,10,11,12,13,14,15,14,9,8,9,10,11,12,13,14,15,8,9,10,11,12,13,14,15,8,9,10,11,12,13,14,15,8,9,10,11,12,13,14,15,12,8,8,9,10,11,12,13,14,15],"f":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[[-1,2,2,[4,[3]]],[[7,[[6,[5]]]]],[]],[8,8],[9,9],[10,10],[11,11],[12,12],[13,13],[14,14],[15,15],[[-1,-2],16,[],[]],[[-1,-2],16,[],[]],[[-1,-2],16,[],[]],[[-1,-2],16,[],[]],[[-1,-2],16,[],[]],[[-1,-2],16,[],[]],[[-1,-2],16,[],[]],[[-1,-2],16,[],[]],0,[17,[[19,[16,18]]]],[17,[[19,[16,18]]]],[17,[[19,[16,18]]]],[17,[[19,[16,18]]]],[17,[[19,[16,18]]]],[17,[[19,[16,18]]]],[17,[[19,[16,18]]]],[17,[[19,[16,18]]]],0,[20,[[21,[10]]]],[8,[[21,[16]]]],[22,-1,[]],[22,-1,[]],[22,-1,[]],[22,-1,[]],[22,-1,[]],[22,-1,[]],[22,-1,[]],[22,-1,[]],[22,-1,[]],[22,-1,[]],[22,-1,[]],[22,-1,[]],[22,-1,[]],[22,-1,[]],[22,-1,[]],[22,-1,[]],[22,16],[22,16],[22,16],[22,16],[22,16],[22,16],[22,16],[22,16],[[10,[4,[12]]],10],[[8,17],23],[[9,17],23],[[10,17],23],[[11,17],23],[[12,17],23],[[13,17],23],[[14,17],23],[[15,17],23],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,[[19,[24,25]]],[]],[-1,[[19,[24,25]]],[]],[-1,[[19,[24,25]]],[]],[-1,[[19,[24,25]]],[]],[-1,[[19,[24,25]]],[]],[-1,[[19,[24,25]]],[]],[-1,[[19,[24,25]]],[]],[-1,[[19,[24,25]]],[]],[[-1,26,11],[[7,[[6,[5]]]]],[]],[[],22],[[],22],[[],22],[[],22],[[],22],[[],22],[[],22],[[],22],0,[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[[[6,[-1]]],[[6,[27]]],[]],[[[6,[-1]]],[[6,[27]]],[]],[[[6,[-1]]],[[6,[27]]],[]],[[[6,[-1]]],[[6,[27]]],[]],[[[6,[-1]]],[[6,[27]]],[]],[[[6,[-1]]],[[6,[27]]],[]],[[[6,[-1]]],[[6,[27]]],[]],[[[6,[-1]]],[[6,[27]]],[]],[[[28,[-1]]],[[28,[27]]],[]],[[[28,[-1]]],[[28,[27]]],[]],[[[28,[-1]]],[[28,[27]]],[]],[[[28,[-1]]],[[28,[27]]],[]],[[[28,[-1]]],[[28,[27]]],[]],[[[28,[-1]]],[[28,[27]]],[]],[[[28,[-1]]],[[28,[27]]],[]],[[[28,[-1]]],[[28,[27]]],[]],[[[29,[-1]]],[[29,[27]]],[]],[[[29,[-1]]],[[29,[27]]],[]],[[[29,[-1]]],[[29,[27]]],[]],[[[29,[-1]]],[[29,[27]]],[]],[[[29,[-1]]],[[29,[27]]],[]],[[[29,[-1]]],[[29,[27]]],[]],[[[29,[-1]]],[[29,[27]]],[]],[[[29,[-1]]],[[29,[27]]],[]],0,0,0,0,0,[[30,31,32,33,34,35,35,10],8],[[-1,24],[[19,[[36,[-2]],25]]],[],37],[[-1,24],[[19,[[36,[-2]],25]]],[],37],[[-1,24],[[19,[[36,[-2]],25]]],[],37],[[-1,24],[[19,[[36,[-2]],25]]],[],37],[[-1,24],[[19,[[36,[-2]],25]]],[],37],[[-1,24],[[19,[[36,[-2]],25]]],[],37],[[-1,24],[[19,[[36,[-2]],25]]],[],37],[[-1,24],[[19,[[36,[-2]],25]]],[],37],[[38,-1,-2],[[19,[16,39]]],40,[[42,[41]]]],[[38,-1,-2],[[19,[16,39]]],40,[[42,[41]]]],[[38,-1,-2],[[19,[16,39]]],40,[[42,[41]]]],[[38,-1,-2],[[19,[16,39]]],40,[[42,[41]]]],[[38,-1,-2],[[19,[16,39]]],40,[[42,[41]]]],[[38,-1,-2],[[19,[16,39]]],40,[[42,[41]]]],[[38,-1,-2],[[19,[16,39]]],40,[[42,[41]]]],[[38,-1,-2],[[19,[16,39]]],40,[[42,[41]]]],0,0,0,[[-1,[36,[-2]]],[[19,[16,25]]],[],37],[[-1,[36,[-2]]],[[19,[16,25]]],[],37],[[-1,[36,[-2]]],[[19,[16,25]]],[],37],[[-1,[36,[-2]]],[[19,[16,25]]],[],37],[[-1,[36,[-2]]],[[19,[16,25]]],[],37],[[-1,[36,[-2]]],[[19,[16,25]]],[],37],[[-1,[36,[-2]]],[[19,[16,25]]],[],37],[[-1,[36,[-2]]],[[19,[16,25]]],[],37],0,0,[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],0,0,[-1,[[19,[-2]]],[],[]],[-1,[[19,[-2]]],[],[]],[-1,[[19,[-2]]],[],[]],[-1,[[19,[-2]]],[],[]],[-1,[[19,[-2]]],[],[]],[-1,[[19,[-2]]],[],[]],[-1,[[19,[-2]]],[],[]],[-1,[[19,[-2]]],[],[]],[-1,[[19,[-2]]],[],[]],[-1,[[19,[-2]]],[],[]],[-1,[[19,[-2]]],[],[]],[-1,[[19,[-2]]],[],[]],[-1,[[19,[-2]]],[],[]],[-1,[[19,[-2]]],[],[]],[-1,[[19,[-2]]],[],[]],[-1,[[19,[-2]]],[],[]],[-1,43,[]],[-1,43,[]],[-1,43,[]],[-1,43,[]],[-1,43,[]],[-1,43,[]],[-1,43,[]],[-1,43,[]],[-1,44,[]],[-1,44,[]],[-1,44,[]],[-1,44,[]],[-1,44,[]],[-1,44,[]],[-1,44,[]],[-1,44,[]],0,[8,9],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]]],"c":[],"p":[[8,"CastFrom",245],[3,"String",246],[4,"Value",247],[3,"Vec",248],[8,"Future",249],[3,"Box",250],[3,"Pin",251],[3,"Deployer",0],[3,"Versions",0],[3,"SystemServiceDistros",0],[3,"Deployment",0],[3,"PackageDistro",0],[3,"ServiceDistro",0],[3,"SpellDistro",0],[4,"ServiceStatus",0],[15,"tuple"],[3,"Formatter",252],[3,"Error",252],[4,"Result",253],[3,"SystemServicesConfig",254],[6,"Result",255],[15,"usize"],[6,"Result",252],[3,"FdFlags",256],[3,"Error",257],[8,"CallService",0],[8,"Any",258],[3,"Arc",259],[3,"Rc",260],[3,"ParticleAppServices",261],[3,"ModuleRepository",262],[3,"SpellStorage",263],[3,"SpellEventBusApi",264],[3,"SpellServiceApi",265],[3,"PeerId",266],[3,"SetFdFlags",256],[8,"AsFilelike",267],[3,"RawCodec",268],[3,"Error",269],[8,"Read",270],[3,"Cid",271],[8,"Extend",272],[3,"TypeId",258],[15,"str"],[8,"InitService",0]],"b":[]},\ +"test_constants":{"doc":"","t":"HHHHHH","n":["EXECUTION_TIMEOUT","IDLE_CONNECTION_TIMEOUT","PARTICLE_TTL","SHORT_TIMEOUT","TIMEOUT","TRANSPORT_TIMEOUT"],"q":[[0,"test_constants"]],"d":["","","","","In debug, VM startup time is big, account for that",""],"i":[0,0,0,0,0,0],"f":[0,0,0,0,0,0],"c":[],"p":[],"b":[]},\ +"test_utils":{"doc":"","t":"DDLLLLLLLLLLFFLLLLLLLLMLLLLFLLMLLLLLLLLLLLLALLFMMLLFFLLLLLLLLLLLLRDLLLLLLLLLLLLLLLLLLLLLLLL","n":["CreatedService","RetStruct","as_","as_","borrow","borrow","borrow_mut","borrow_mut","clone","clone","clone_into","clone_into","create_service","create_service_worker","debug","debug","deref","deref","deref_mut","deref_mut","drop","drop","error","fmt","fmt","from","from","get_default_chain_config","get_fd_flags","get_fd_flags","id","init","init","into","into","into_any","into_any","into_any_arc","into_any_arc","into_any_rc","into_any_rc","new_set_fd_flags","new_set_fd_flags","pinning","references","references","response_to_return","result","ret_code","set_fd_flags","set_fd_flags","string_result","timeout","to_owned","to_owned","try_from","try_from","try_into","try_into","type_id","type_id","type_name","type_name","vzip","vzip","DUMMY","DummyThreadPinner","as_","borrow","borrow_mut","debug","deref","deref_mut","drop","from","get_fd_flags","init","into","into_any","into_any_arc","into_any_rc","new_set_fd_flags","pin_current_thread_to","pin_current_thread_to_cpuset","references","set_fd_flags","try_from","try_into","type_id","type_name","vzip"],"q":[[0,"test_utils"],[65,"test_utils::pinning"],[91,"bnum::cast"],[92,"connected_client::connected_client"],[93,"alloc::vec"],[94,"alloc::string"],[95,"core::fmt"],[96,"core::fmt"],[97,"core::fmt"],[98,"system_interface::fs::fd_flags"],[99,"std::io::error"],[100,"alloc::boxed"],[101,"core::any"],[102,"alloc::sync"],[103,"alloc::rc"],[104,"system_interface::fs::fd_flags"],[105,"libipld_core::raw"],[106,"anyhow"],[107,"std::io"],[108,"cid::cid"],[109,"core::iter::traits::collect"],[110,"fluence_it_types::values"],[111,"core::time"],[112,"eyre"],[113,"core::future::future"],[114,"core::any"]],"d":["","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","","","","","","","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","","","Calls U::from(self).","","","","","","","","","","","","",""],"i":[0,0,2,3,2,3,2,3,2,3,2,3,0,0,2,3,2,3,2,3,2,3,3,2,3,2,3,0,2,3,2,2,3,2,3,2,3,2,3,2,3,2,3,0,2,3,0,3,3,2,3,0,0,2,3,2,3,2,3,2,3,2,3,2,3,0,0,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34],"f":[0,0,[-1,-3,[],[],[[1,[-2]]]],[-1,-3,[],[],[[1,[-2]]]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[2,2],[3,3],[[-1,-2],4,[],[]],[[-1,-2],4,[],[]],[[5,6,[8,[7]]],2],[[5,6,[8,[7]],9],2],[10,[[12,[4,11]]]],[10,[[12,[4,11]]]],[13,-1,[]],[13,-1,[]],[13,-1,[]],[13,-1,[]],[13,4],[13,4],0,[[2,10],14],[[3,10],14],[-1,-1,[]],[-1,-1,[]],[6,15],[-1,[[12,[16,17]]],[]],[-1,[[12,[16,17]]],[]],0,[[],13],[[],13],[-1,-2,[],[]],[-1,-2,[],[]],[[[18,[-1]]],[[18,[19]]],[]],[[[18,[-1]]],[[18,[19]]],[]],[[[20,[-1]]],[[20,[19]]],[]],[[[20,[-1]]],[[20,[19]]],[]],[[[21,[-1]]],[[21,[19]]],[]],[[[21,[-1]]],[[21,[19]]],[]],[[-1,16],[[12,[[22,[-2]],17]]],[],23],[[-1,16],[[12,[[22,[-2]],17]]],[],23],0,[[24,-1,-2],[[12,[4,25]]],26,[[28,[27]]]],[[24,-1,-2],[[12,[4,25]]],26,[[28,[27]]]],[29,3],0,0,[[-1,[22,[-2]]],[[12,[4,17]]],[],23],[[-1,[22,[-2]]],[[12,[4,17]]],[],23],[3,[[12,[9,9]]]],[[30,-1],[[31,[-2]]],32,[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,[[12,[-2]]],[],[]],[-1,[[12,[-2]]],[],[]],[-1,[[12,[-2]]],[],[]],[-1,[[12,[-2]]],[],[]],[-1,33,[]],[-1,33,[]],[-1,6,[]],[-1,6,[]],[-1,-2,[],[]],[-1,-2,[],[]],0,0,[-1,-3,[],[],[[1,[-2]]]],[-1,-2,[],[]],[-1,-2,[],[]],[10,[[12,[4,11]]]],[13,-1,[]],[13,-1,[]],[13,4],[-1,-1,[]],[-1,[[12,[16,17]]],[]],[[],13],[-1,-2,[],[]],[[[18,[-1]]],[[18,[19]]],[]],[[[20,[-1]]],[[20,[19]]],[]],[[[21,[-1]]],[[21,[19]]],[]],[[-1,16],[[12,[[22,[-2]],17]]],[],23],[[34,35],36],[[34,[37,[35]]],36],[[24,-1,-2],[[12,[4,25]]],26,[[28,[27]]]],[[-1,[22,[-2]]],[[12,[4,17]]],[],23],[-1,[[12,[-2]]],[],[]],[-1,[[12,[-2]]],[],[]],[-1,33,[]],[-1,6,[]],[-1,-2,[],[]]],"c":[],"p":[[8,"CastFrom",91],[3,"CreatedService",0],[3,"RetStruct",0],[15,"tuple"],[3,"ConnectedClient",92],[15,"str"],[15,"u8"],[3,"Vec",93],[3,"String",94],[3,"Formatter",95],[3,"Error",95],[4,"Result",96],[15,"usize"],[6,"Result",95],[3,"ChainConfig",97],[3,"FdFlags",98],[3,"Error",99],[3,"Box",100],[8,"Any",101],[3,"Arc",102],[3,"Rc",103],[3,"SetFdFlags",98],[8,"AsFilelike",104],[3,"RawCodec",105],[3,"Error",106],[8,"Read",107],[3,"Cid",108],[8,"Extend",109],[4,"IValue",110],[3,"Duration",111],[6,"Result",112],[8,"Future",113],[3,"TypeId",101],[3,"DummyThreadPinner",65],[3,"LogicalCoreId",114],[15,"bool"],[15,"slice"]],"b":[]},\ +"toml_utils":{"doc":"","t":"F","n":["table"],"q":[[0,"toml_utils"],[1,"alloc::string"],[2,"alloc::vec"],[3,"toml::value"]],"d":[""],"i":[0],"f":[[[[3,[[2,[1,1]]]]],4]],"c":[],"p":[[3,"String",1],[15,"tuple"],[3,"Vec",2],[6,"Table",3]],"b":[]},\ +"toy_vms":{"doc":"","t":"DLLLLLLLLLLLLLLLLLLLLLLLLL","n":["EasyVM","borrow","borrow_mut","call","create_runtime","debug","deref","deref_mut","drop","from","get_fd_flags","init","into","into_any","into_any_arc","into_any_rc","into_effects","memory_stats","new_set_fd_flags","references","set_fd_flags","try_from","try_into","type_id","type_name","vzip"],"q":[[0,"toy_vms"],[26,"avm_interface::particle_parameters"],[27,"avm_interface::call_service_result"],[28,"fluence_keypair::key_pair"],[29,"core::future::future"],[30,"alloc::boxed"],[31,"core::pin"],[32,"alloc::string"],[33,"core::convert"],[34,"core::marker"],[35,"alloc::vec"],[36,"core::time"],[37,"core::option"],[38,"marine_wasmtime_backend"],[39,"core::task::wake"],[40,"core::result"],[41,"core::fmt"],[42,"core::fmt"],[43,"std::io::error"],[44,"core::any"],[45,"alloc::sync"],[46,"alloc::rc"],[47,"avm_interface::raw_outcome"],[48,"aquamarine::particle_effects"],[49,"avm_server::runner"],[50,"system_interface::fs::fd_flags"],[51,"libipld_core::raw"],[52,"anyhow"],[53,"std::io"],[54,"cid::cid"],[55,"core::iter::traits::collect"],[56,"core::any"]],"d":["","","","","","","","","","Returns the argument unchanged.","","","Calls U::from(self).","","","","","","","","","","","","",""],"i":[0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],"f":[0,[-1,-2,[],[]],[-1,-2,[],[]],[[1,-1,-2,-3,2,3,4],[[7,[[6,[5]]]]],[[9,[8]],10],[[9,[[12,[11]]]],10],[[9,[[12,[11]]]],10]],[[[14,[13]],15,16],[[17,[1]]]],[18,[[17,[19,20]]]],[21,-1,[]],[21,-1,[]],[21,19],[-1,-1,[]],[-1,[[17,[22,23]]],[]],[[],21],[-1,-2,[],[]],[[[6,[-1]]],[[6,[24]]],[]],[[[25,[-1]]],[[25,[24]]],[]],[[[26,[-1]]],[[26,[24]]],[]],[[[17,[27]],8],28],[1,29],[[-1,22],[[17,[[30,[-2]],23]]],[],31],[[32,-1,-2],[[17,[19,33]]],34,[[36,[35]]]],[[-1,[30,[-2]]],[[17,[19,23]]],[],31],[-1,[[17,[-2]]],[],[]],[-1,[[17,[-2]]],[],[]],[-1,37,[]],[-1,38,[]],[-1,-2,[],[]]],"c":[],"p":[[3,"EasyVM",0],[3,"ParticleParameters",26],[6,"CallResults",27],[4,"KeyPair",28],[8,"Future",29],[3,"Box",30],[3,"Pin",31],[3,"String",32],[8,"Into",33],[8,"Send",34],[15,"u8"],[3,"Vec",35],[3,"Duration",36],[4,"Option",37],[3,"WasmtimeWasmBackend",38],[3,"Waker",39],[4,"Result",40],[3,"Formatter",41],[15,"tuple"],[3,"Error",41],[15,"usize"],[3,"FdFlags",42],[3,"Error",43],[8,"Any",44],[3,"Arc",45],[3,"Rc",46],[3,"RawAVMOutcome",47],[3,"ParticleEffects",48],[3,"AVMMemoryStats",49],[3,"SetFdFlags",42],[8,"AsFilelike",50],[3,"RawCodec",51],[3,"Error",52],[8,"Read",53],[3,"Cid",54],[8,"Extend",55],[3,"TypeId",44],[15,"str"]],"b":[]},\ +"types":{"doc":"","t":"DLLLLLLLLLLLLLLLLLLLLLLLAALLLLLLLLAFFNEDNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL","n":["DealId","as_str","borrow","borrow_mut","clone","clone_into","cmp","deserialize","eq","eq","eq","eq","eq","fmt","fmt","from","from","from","get_contract_address","hash","into","is_valid","normalize","partial_cmp","peer_id","peer_scope","serialize","to_address","to_owned","to_string","try_from","try_into","type_id","vzip","serde","deserialize","serialize","Host","PeerScope","WorkerId","WorkerId","borrow","borrow","borrow_mut","borrow_mut","clone","clone","clone_into","clone_into","cmp","cmp","deserialize","deserialize","eq","eq","fmt","fmt","fmt","from","from","from","hash","hash","into","into","partial_cmp","partial_cmp","serialize","serialize","to_owned","to_owned","to_string","try_from","try_from","try_into","try_into","type_id","type_id","vzip","vzip"],"q":[[0,"types"],[34,"types::peer_id"],[35,"types::peer_id::serde"],[37,"types::peer_scope"],[80,"core::cmp"],[81,"core::result"],[82,"serde::de"],[83,"alloc::string"],[84,"core::fmt"],[85,"core::fmt"],[86,"core::option"],[87,"serde::ser"],[88,"core::any"],[89,"libp2p_identity::peer_id"]],"d":["","","","","","","","","","","","","","","","Returns the argument unchanged.","","","","","Calls U::from(self).","40 hex chars + 2 for “0x” prefix; Deal ID is EVM …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","","Returns the argument unchanged.","","","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","",""],"i":[0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,0,0,0,16,0,0,16,16,17,16,17,16,17,16,17,16,17,16,17,16,17,16,17,17,16,17,17,16,17,16,17,16,17,16,17,16,17,17,16,17,16,17,16,17,16,17],"f":[0,[1,2],[-1,-2,[],[]],[-1,-2,[],[]],[1,1],[[-1,-2],3,[],[]],[[1,1],4],[-1,[[5,[1]]],6],[[1,2],7],[[1,2],7],[[1,8],7],[[1,8],7],[[1,1],7],[[1,9],10],[[1,9],10],[-1,-1,[]],[8,1],[2,1],[1,8],[[1,-1],3,11],[-1,-2,[],[]],[1,7],[2,8],[[1,1],[[12,[4]]]],0,0,[[1,-1],5,13],[1,8],[-1,-2,[],[]],[-1,8,[]],[-1,[[5,[-2]]],[],[]],[-1,[[5,[-2]]],[],[]],[-1,14,[]],[-1,-2,[],[]],0,[-1,[[5,[15]]],6],[[15,-1],5,13],0,0,0,0,[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[16,16],[17,17],[[-1,-2],3,[],[]],[[-1,-2],3,[],[]],[[16,16],4],[[17,17],4],[-1,[[5,[16]]],6],[-1,[[5,[17]]],6],[[16,16],7],[[17,17],7],[[16,9],10],[[17,9],10],[[17,9],10],[-1,-1,[]],[15,17],[-1,-1,[]],[[16,-1],3,11],[[17,-1],3,11],[-1,-2,[],[]],[-1,-2,[],[]],[[16,16],[[12,[4]]]],[[17,17],[[12,[4]]]],[[16,-1],5,13],[[17,-1],5,13],[-1,-2,[],[]],[-1,-2,[],[]],[-1,8,[]],[-1,[[5,[-2]]],[],[]],[-1,[[5,[-2]]],[],[]],[-1,[[5,[-2]]],[],[]],[-1,[[5,[-2]]],[],[]],[-1,14,[]],[-1,14,[]],[-1,-2,[],[]],[-1,-2,[],[]]],"c":[],"p":[[3,"DealId",0],[15,"str"],[15,"tuple"],[4,"Ordering",80],[4,"Result",81],[8,"Deserializer",82],[15,"bool"],[3,"String",83],[3,"Formatter",84],[6,"Result",84],[8,"Hasher",85],[4,"Option",86],[8,"Serializer",87],[3,"TypeId",88],[3,"PeerId",89],[4,"PeerScope",37],[3,"WorkerId",37]],"b":[[8,"impl-PartialEq%3C%26str%3E-for-DealId"],[9,"impl-PartialEq%3C%26str%3E-for-%26DealId"],[10,"impl-PartialEq%3CString%3E-for-DealId"],[11,"impl-PartialEq%3CString%3E-for-%26DealId"],[12,"impl-PartialEq-for-DealId"],[13,"impl-Debug-for-DealId"],[14,"impl-Display-for-DealId"],[16,"impl-From%3CString%3E-for-DealId"],[17,"impl-From%3C%26str%3E-for-DealId"],[56,"impl-Debug-for-WorkerId"],[57,"impl-Display-for-WorkerId"]]},\ +"uuid_utils":{"doc":"","t":"F","n":["uuid"],"q":[[0,"uuid_utils"],[1,"alloc::string"]],"d":[""],"i":[0],"f":[[[],1]],"c":[],"p":[[3,"String",1]],"b":[]},\ +"vm_utils":{"doc":"","t":"NNDNNNNNNNNNNDNNNNNNENELLLLLLLLLLLLLLLLLLFLLLLLLLLLLLLLLLLLLLLLLLLMLLLLLLLLLLLLLLLLLLLLLLLLLLLLFFFLLLLFFFLMLLLLLLLLLLLLLLLLLLLLLMMMMMMMMMMMMMMMMM","n":["Blocked","Crashed","CreateVMDomainParams","FailedToConnect","FailedToCreateVMDomain","FailedToGetInfo","FailedToGetVMId","FailedToRebootVM","FailedToRemoveVMDomain","FailedToResetVM","FailedToStartVM","FailedToStopVM","NoState","NonEmpty","PMSuspended","Paused","Running","Shutdown","Shutoff","UnknownState","VmError","VmNotFound","VmStatus","append","binary_search","binary_search_by","binary_search_by_key","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","capacity","clone","clone_into","cmp","collect","contains","create_domain","default","eq","extend","first","first_mut","flat_map","flatten","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from_slice","from_u32","from_vec","get","get_mut","hash","head","index","index_mut","insert","into","into","into","into","into_iter","into_iter","is_empty","iter","iter_mut","last","last_mut","len","len_nonzero","map","maximum","maximum_by","maximum_by_key","minimum","minimum_by","minimum_by_key","new","new","partial_cmp","pop","push","reboot_vm","remove_domain","reset_vm","singleton","source","split","split_first","start_vm","status_vm","stop_vm","tail","tail","to_owned","to_string","to_string","truncate","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_map","type_id","type_id","type_id","type_id","vzip","vzip","vzip","vzip","err","err","err","err","err","err","err","err","err","name","name","name","name","name","name","name","name"],"q":[[0,"vm_utils"],[128,"vm_utils::VmError"],[145,"alloc::vec"],[146,"core::result"],[147,"core::cmp"],[148,"core::ops::function"],[149,"core::clone"],[150,"core::cmp"],[151,"core::iter::traits::collect"],[152,"core::cmp"],[153,"core::fmt"],[154,"core::fmt"],[155,"core::hash"],[156,"core::iter::traits::iterator"],[157,"core::iter::traits::double_ended"],[158,"core::num::nonzero"],[159,"alloc::string"],[160,"std::path"],[161,"ccp_shared::types::core"],[162,"core::cmp"],[163,"core::any"]],"d":["","","","","","","","","","","","","","Non-empty vector.","","","","","","","","","","Append a Vec to the tail of the NonEmpty.","Binary searches this sorted non-empty vector for a given …","Binary searches this sorted non-empty with a comparator …","Binary searches this sorted non-empty vector with a key …","","","","","","","","","Get the capacity of the list.","","","","Attempt to convert an iterator into a NonEmpty vector. …","Check whether an element is contained in the list.","","","","","Get the first element. Never fails.","Get the mutable reference to the first element. Never …","When we have a function that goes from some T to a …","Flatten nested NonEmptys into a single one.","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Turns a pair of an element and a Vec into a NonEmpty.","Often we have a Vec (or slice &[T]) but want to ensure …","","Often we have a Vec (or slice &[T]) but want to ensure …","Get an element by index.","Get an element by index, mutably.","","","","","Inserts an element at position index within the vector, …","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","Always returns false.","","","Get the last element. Never fails.","Get the last element mutably.","Get the length of the list.","Gets the length of the list as a NonZeroUsize.","A structure preserving map. This is useful for when we …","Returns the maximum element in the non-empty vector.","Returns the element that gives the maximum value with …","Returns the element that gives the maximum value with …","Returns the minimum element in the non-empty vector.","Returns the element that gives the minimum value with …","Returns the element that gives the minimum value with …","","Alias for NonEmpty::singleton.","","Pop an element from the end of the list.","Push an element to the end of the list.","","","","Create a new non-empty list with an initial element.","","Deconstruct a NonEmpty into its first, last, and middle …","Deconstruct a NonEmpty into its head and tail. This …","","","","Get the possibly-empty tail of the list.","","","","","Truncate the list to a certain size. Must be greater than 0…","","","","","","","","","A structure preserving, fallible mapping function.","","","","","","","","","","","","","","","","","","","","","","","","",""],"i":[20,20,0,16,16,16,16,16,16,16,16,16,20,0,20,20,20,20,20,20,0,16,0,1,1,1,1,15,16,20,1,15,16,20,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,15,16,16,20,20,1,15,16,20,1,1,1,20,1,1,1,1,1,1,1,1,15,16,20,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,15,1,1,1,1,0,0,0,1,16,1,1,0,0,0,1,1,1,16,20,1,15,16,20,1,15,16,20,1,1,15,16,20,1,15,16,20,1,37,38,39,40,41,42,43,44,45,39,40,41,42,46,43,44,45],"f":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[[1,[-1]],[2,[-1]]],3,[]],[[[1,[-1]],-1],[[5,[4,4]]],6],[[[1,[-1]],-2],[[5,[4,4]]],[],7],[[[1,[-1]],-2,-3],[[5,[4,4]]],[],6,7],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[[[1,[-1]]],4,[]],[[[1,[-1]]],[[1,[-1]]],8],[[-1,-2],3,[],[]],[[[1,[-1]],[1,[-1]]],9,6],[-1,[[10,[[1,[-2]]]]],11,[]],[[[1,[-1]],-1],12,13],[[14,15],[[5,[3,16]]]],[[],[[1,[-1]]],17],[[[1,[-1]],[1,[-1]]],12,13],[[[1,[-1]],-2],3,[],11],[[[1,[-1]]],-1,[]],[[[1,[-1]]],-1,[]],[[[1,[-1]],-2],[[1,[-3]]],[],7,[]],[[[1,[[1,[-1]]]]],[[1,[-1]]],[]],[[15,18],19],[[16,18],19],[[16,18],19],[[20,18],19],[[20,18],19],[[[1,[-1]],18],[[5,[3,21]]],22],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[[[3,[-1,[2,[-1]]]]],[[1,[-1]]],[]],[[[23,[-1]]],[[10,[[1,[-1]]]]],8],[24,20],[[[2,[-1]]],[[10,[[1,[-1]]]]],[]],[[[1,[-1]],4],[[10,[-1]]],[]],[[[1,[-1]],4],[[10,[-1]]],[]],[[[1,[-1]],-2],3,25,26],0,[[[1,[-1]],4],-1,[]],[[[1,[-1]],4],-1,[]],[[[1,[-1]],4,-1],3,[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[[[1,[-1]]],[],[]],[[[1,[-1]]],[],[]],[[[1,[-1]]],12,[]],[[[1,[-1]]],[[27,[-1]]],[]],[[[1,[-1]]],[[0,[28,29]]],[]],[[[1,[-1]]],-1,[]],[[[1,[-1]]],-1,[]],[[[1,[-1]]],4,[]],[[[1,[-1]]],30,[]],[[[1,[-1]],-2],[[1,[-3]]],[],7,[]],[[[1,[-1]]],-1,6],[[[1,[-1]],-2],-1,[],7],[[[1,[-1]],-2],-1,[],7],[[[1,[-1]]],-1,6],[[[1,[-1]],-2],-1,[],7],[[[1,[-1]],-2],-1,[],7],[[31,32,[1,[33]],31],15],[-1,[[1,[-1]]],[]],[[[1,[-1]],[1,[-1]]],[[10,[9]]],34],[[[1,[-1]]],[[10,[-1]]],[]],[[[1,[-1]],-1],3,[]],[[14,14],[[5,[3,16]]]],[[14,14],[[5,[3,16]]]],[[14,14],[[5,[3,16]]]],[-1,[[1,[-1]]],[]],[16,[[10,[35]]]],[[[1,[-1]]],[[3,[-1,[23,[-1]],-1]]],[]],[[[1,[-1]]],[[3,[-1,[23,[-1]]]]],[]],[[14,14],[[5,[24,16]]]],[[14,14],[[5,[20,16]]]],[[14,14],[[5,[3,16]]]],[[[1,[-1]]],[[23,[-1]]],[]],0,[-1,-2,[],[]],[-1,31,[]],[-1,31,[]],[[[1,[-1]],4],3,[]],[-1,[[5,[-2]]],[],[]],[-1,[[5,[-2]]],[],[]],[-1,[[5,[-2]]],[],[]],[-1,[[5,[-2]]],[],[]],[-1,[[5,[-2]]],[],[]],[-1,[[5,[-2]]],[],[]],[-1,[[5,[-2]]],[],[]],[-1,[[5,[-2]]],[],[]],[[[1,[-1]],-2],[[5,[[1,[-3]],-4]]],[],7,[],[]],[-1,36,[]],[-1,36,[]],[-1,36,[]],[-1,36,[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"c":[],"p":[[3,"NonEmpty",0],[3,"Vec",145],[15,"tuple"],[15,"usize"],[4,"Result",146],[8,"Ord",147],[8,"FnMut",148],[8,"Clone",149],[4,"Ordering",147],[4,"Option",150],[8,"IntoIterator",151],[15,"bool"],[8,"PartialEq",147],[15,"str"],[3,"CreateVMDomainParams",0],[4,"VmError",0],[8,"Default",152],[3,"Formatter",153],[6,"Result",153],[4,"VmStatus",0],[3,"Error",153],[8,"Debug",153],[15,"slice"],[15,"u32"],[8,"Hash",154],[8,"Hasher",154],[3,"Iter",155],[8,"Iterator",156],[8,"DoubleEndedIterator",157],[3,"NonZeroUsize",158],[3,"String",159],[3,"PathBuf",160],[3,"LogicalCoreId",161],[8,"PartialOrd",147],[8,"Error",162],[3,"TypeId",163],[13,"FailedToConnect",128],[13,"FailedToCreateVMDomain",128],[13,"FailedToRemoveVMDomain",128],[13,"FailedToStartVM",128],[13,"VmNotFound",128],[13,"FailedToStopVM",128],[13,"FailedToRebootVM",128],[13,"FailedToResetVM",128],[13,"FailedToGetInfo",128],[13,"FailedToGetVMId",128]],"b":[[50,"impl-Debug-for-VmError"],[51,"impl-Display-for-VmError"],[52,"impl-Debug-for-VmStatus"],[53,"impl-Display-for-VmStatus"],[74,"impl-IntoIterator-for-NonEmpty%3CT%3E"],[75,"impl-IntoIterator-for-%26NonEmpty%3CT%3E"]]},\ +"workers":{"doc":"","t":"DNINNNNNNNENNNNDENNDNNDNNDNNNNNNDNNNNDNNDNNDDENNNKLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLKLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLKLLLLMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM","n":["CUID","CannotExtractRSASecretKey","CoreDistributor","CreateKeypairsDir","CreateRuntime","CreateWorkerKeyPair","CreateWorkersDir","DeserializePersistedKeypair","DeserializePersistedWorker","DirectoryListError","Event","FailedToAssignCores","FailedToCopyVMImage","FailedToNotifySubsystem","FeatureDisabled","KeyStorage","KeyStorageError","KeypairNotFound","KeypairNotFound","PeerScopes","PersistedKeypairDecodingError","PersistedKeypairInvalidKeyFormat","PersistentCoreDistributor","ReadPersistedKeypair","ReadPersistedWorker","Receiver","RemoveErrorPersistedKeypair","RemoveErrorPersistedWorker","RemoveWorkerKeyPair","SerializePersistedKeypair","SerializePersistedWorker","VMImageNotFile","VmConfig","VmError","VmNotFound","WorkerAlreadyExists","WorkerCreated","WorkerId","WorkerNotFound","WorkerNotFoundByDeal","WorkerParams","WorkerRemoved","WorkerStorageDirectory","Workers","WorkersConfig","WorkersError","WriteErrorPersistedKeypair","WriteErrorPersistedWorker","WrongAssignment","acquire_worker_cores","acquire_worker_cores","activate_worker","as_ref","blocking_recv","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone","clone_into","clone_into","clone_into","close","cmp","cmp","compare","compare","create_key_pair","create_vm","create_worker","deactivate_worker","default","deserialize","deserialize","encode_hex","encode_hex_upper","eq","eq","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from_hex","from_path","from_path","from_path","from_str","get_deal_id","get_host_peer_id","get_keypair","get_runtime_handle","get_system_cpu_assignment","get_system_cpu_assignment","get_worker_assignment","get_worker_creator","get_worker_id","get_worker_key_pair","hash","hash","into","into","into","into","into","into","into","into","into","into","into","into","into","into_any","into_any","into_any","into_any","into_any","into_any","into_any","into_any","into_any","into_any","into_any","into_any","into_any","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","is_host","is_management","is_worker_active","list_workers","new","new","new","new","new","partial_cmp","partial_cmp","poll_recv","poll_recv_many","reboot_vm","recv","recv_many","release_worker_cores","release_worker_cores","remove_key_pair","remove_worker","reset_vm","root_key_pair","scope","serialize","serialize","shutdown","source","source","start_vm","status_vm","stop_vm","to_owned","to_owned","to_owned","to_peer_id","to_string","to_string","to_string","to_string","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_recv","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_name","type_name","type_name","type_name","type_name","type_name","type_name","type_name","type_name","type_name","type_name","type_name","type_name","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","thread_count","worker_id","worker_id","err","err","err","err","err","err","err","err","err","path","path","path","path","path","path","path","path","worker_id","deal_id","err","err","err","err","err","err","err","err","err","err","err","err","image","image","path","path","path","path","path","path","worker_id","worker_id","worker_id","worker_id","worker_id"],"q":[[0,"workers"],[308,"workers::Event"],[311,"workers::KeyStorageError"],[329,"workers::WorkersError"],[355,"core_distributor::types"],[356,"core_distributor::types"],[357,"core::result"],[358,"core::option"],[359,"core::cmp"],[360,"fluence_keypair::key_pair"],[361,"std::path"],[362,"alloc::string"],[363,"serde::de"],[364,"core::iter::traits::collect"],[365,"core::fmt"],[366,"core::fmt"],[367,"vm_utils::vm_utils"],[368,"core::convert"],[369,"std::path"],[370,"core_distributor::core_range"],[371,"core_distributor::strategy"],[372,"cpu_utils::cpu_topology"],[373,"alloc::sync"],[374,"core_distributor::persistence"],[375,"core_distributor::errors"],[376,"types::deal_id"],[377,"types::peer_scope"],[378,"tokio::runtime::handle"],[379,"core_distributor::types"],[380,"alloc::boxed"],[381,"core::any"],[382,"alloc::rc"],[383,"alloc::vec"],[384,"core::task::wake"],[385,"core::task::poll"],[386,"serde::ser"],[387,"core::error"],[388,"vm_utils::vm_utils"],[389,"core::any"]],"d":["","","","","","","","","","","","","","","","","","","","Represents information about various peer IDs.","","","PersistentCoreDistributor is a CPU core distributor …","","","Receives values from the associated Sender.","","","","","","","","","","","","","","","","","","Manages a collection of workers.","","","","","","","","Activates the worker with the specified worker_id.","","Blocking receive to call outside of asynchronous contexts.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Closes the receiving half of a channel without dropping it.","","","","","","","Creates a new worker with the given deal_id and initial …","Deactivates the worker with the specified worker_id.","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","","Loads the state from file_name if exists. If not creates a …","Creates a Workers instance by loading persisted worker …","","Retrieves the deal ID associated with the specified worker …","","","","","","Retrieves the assignment associated with the specified …","Retrieves the creator PeerId associated with the specified …","Retrieves the worker ID associated with the specified …","","","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Checks the activation status of the worker with the …","Retrieves a list of all worker IDs.","","","","","","","","Polls to receive the next message on this channel.","Polls to receive multiple messages on this channel, …","","Receives the next value for this receiver.","Receives the next values for this receiver and extends …","","","","Removes a worker with the specified worker_id.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Tries to receive the next value for this receiver.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""],"i":[0,19,0,19,9,9,9,19,9,19,0,9,9,9,9,0,0,19,9,0,19,19,0,19,9,0,19,9,9,19,9,9,0,9,9,9,30,0,9,9,0,30,9,0,0,0,19,9,9,45,5,6,10,13,17,5,22,7,6,44,57,19,9,15,10,30,13,17,5,22,7,6,44,57,19,9,15,10,30,13,7,15,10,7,15,10,13,7,10,7,10,17,6,6,6,10,7,10,10,10,7,10,7,7,7,10,10,10,7,7,19,19,9,9,15,10,10,30,13,17,5,22,7,7,6,44,57,19,9,9,15,10,30,13,10,17,5,6,10,6,15,17,6,45,5,6,6,6,17,7,10,17,5,22,7,6,44,57,19,9,15,10,30,13,17,5,22,7,6,44,57,19,9,15,10,30,13,17,5,22,7,6,44,57,19,9,15,10,30,13,17,5,22,7,6,44,57,19,9,15,10,30,13,15,15,6,6,22,44,57,15,10,7,10,13,13,6,13,13,45,5,17,6,6,17,15,7,10,6,19,9,6,6,6,7,15,10,15,7,19,9,10,17,5,22,7,6,44,57,19,9,15,10,30,13,17,5,22,7,6,44,57,19,9,15,10,30,13,13,17,5,22,7,6,44,57,19,9,15,10,30,13,17,5,22,7,6,44,57,19,9,15,10,30,13,17,5,22,7,6,44,57,19,9,15,10,30,13,65,65,66,67,68,69,70,71,72,73,74,75,67,68,69,70,71,73,74,75,74,76,77,78,79,80,81,82,83,84,85,86,87,88,89,88,77,80,81,83,84,85,84,85,86,87,90],"f":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[-1,1],[[4,[2,3]]],[]],[[5,1],[[4,[2,3]]]],[[6,7],[[4,[8,9]]]],[10,[[12,[11]]]],[[[13,[-1]]],[[14,[-1]]],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[7,7],[15,15],[10,10],[[-1,-2],8,[],[]],[[-1,-2],8,[],[]],[[-1,-2],8,[],[]],[[[13,[-1]]],8,[]],[[7,7],16],[[10,10],16],[[-1,-2],16,[],[]],[[-1,-2],16,[],[]],[17,[[4,[18,19]]]],[[6,7,20],[[4,[21,9]]]],[[6,22],[[4,[7,9]]]],[[6,7],[[4,[8,9]]]],[[],10],[-1,[[4,[7]]],23],[-1,[[4,[10]]],23],[10,-1,[[25,[24]]]],[10,-1,[[25,[24]]]],[[7,7],26],[[10,10],26],[[-1,-2],26,[],[]],[[-1,-2],26,[],[]],[[-1,-2],26,[],[]],[[-1,-2],26,[],[]],[[-1,-2],26,[],[]],[[-1,-2],26,[],[]],[[7,27],[[4,[8,28]]]],[[7,27],[[4,[8,28]]]],[[19,27],29],[[19,27],29],[[9,27],29],[[9,27],29],[[15,27],29],[[10,27],[[4,[8,28]]]],[[10,27],[[4,[8,28]]]],[[30,27],29],[[[13,[-1]],27],[[4,[8,28]]],[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[31,7],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[32,9],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,[[4,[10]]],[[34,[[33,[11]]]]]],[[35,18],[[36,[17]]]],[[35,37,38,39,40],[[4,[[8,[[41,[5]],42]],43]]]],[[44,35,[41,[17]],[41,[45]],[41,[46]]],[[36,[[8,[6,[13,[30]]]]]]]],[47,[[4,[10]]]],[[6,7],[[4,[48,9]]]],[15,31],[[17,49],[[14,[18]]]],[[6,7],[[14,[50]]]],[-1,51,[]],[5,51],[[6,7],[[4,[2,9]]]],[[6,7],[[4,[31,9]]]],[[6,48],[[4,[7,9]]]],[[17,7],[[14,[18]]]],[[7,-1],8,52],[[10,-1],8,52],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[[[53,[-1]]],[[53,[54]]],[]],[[[53,[-1]]],[[53,[54]]],[]],[[[53,[-1]]],[[53,[54]]],[]],[[[53,[-1]]],[[53,[54]]],[]],[[[53,[-1]]],[[53,[54]]],[]],[[[53,[-1]]],[[53,[54]]],[]],[[[53,[-1]]],[[53,[54]]],[]],[[[53,[-1]]],[[53,[54]]],[]],[[[53,[-1]]],[[53,[54]]],[]],[[[53,[-1]]],[[53,[54]]],[]],[[[53,[-1]]],[[53,[54]]],[]],[[[53,[-1]]],[[53,[54]]],[]],[[[53,[-1]]],[[53,[54]]],[]],[[[41,[-1]]],[[41,[54]]],[]],[[[41,[-1]]],[[41,[54]]],[]],[[[41,[-1]]],[[41,[54]]],[]],[[[41,[-1]]],[[41,[54]]],[]],[[[41,[-1]]],[[41,[54]]],[]],[[[41,[-1]]],[[41,[54]]],[]],[[[41,[-1]]],[[41,[54]]],[]],[[[41,[-1]]],[[41,[54]]],[]],[[[41,[-1]]],[[41,[54]]],[]],[[[41,[-1]]],[[41,[54]]],[]],[[[41,[-1]]],[[41,[54]]],[]],[[[41,[-1]]],[[41,[54]]],[]],[[[41,[-1]]],[[41,[54]]],[]],[[[55,[-1]]],[[55,[54]]],[]],[[[55,[-1]]],[[55,[54]]],[]],[[[55,[-1]]],[[55,[54]]],[]],[[[55,[-1]]],[[55,[54]]],[]],[[[55,[-1]]],[[55,[54]]],[]],[[[55,[-1]]],[[55,[54]]],[]],[[[55,[-1]]],[[55,[54]]],[]],[[[55,[-1]]],[[55,[54]]],[]],[[[55,[-1]]],[[55,[54]]],[]],[[[55,[-1]]],[[55,[54]]],[]],[[[55,[-1]]],[[55,[54]]],[]],[[[55,[-1]]],[[55,[54]]],[]],[[[55,[-1]]],[[55,[54]]],[]],[[15,31],26],[[15,31],26],[[6,7],26],[6,[[56,[7]]]],[[48,31,[56,[10]]],22],[[37,[14,[57]]],44],[[21,21],57],[[31,31,31,[41,[17]]],15],[[[12,[11]]],10],[[7,7],[[14,[16]]]],[[10,10],[[14,[16]]]],[[[13,[-1]],58],[[59,[[14,[-1]]]]],[]],[[[13,[-1]],58,[56,[-1]],37],[[59,[37]]],[]],[[6,7],[[4,[8,9]]]],[[[13,[-1]]],[[14,[-1]]],[]],[[[13,[-1]],[56,[-1]],37],37,[]],[[-1,[33,[10]]],8,[]],[[5,[33,[10]]],8],[[17,7],[[4,[8,19]]]],[[6,7],[[4,[8,9]]]],[[6,7],[[4,[8,9]]]],0,[[15,31],[[4,[49,0]]]],[[7,-1],4,60],[[10,-1],4,60],[6,8],[19,[[14,[61]]]],[9,[[14,[61]]]],[[6,7],[[4,[8,9]]]],[[6,7],[[4,[62,9]]]],[[6,7],[[4,[8,9]]]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[[15,49],31],[-1,21,[]],[-1,21,[]],[-1,21,[]],[-1,21,[]],[-1,[[4,[-2]]],[],[]],[-1,[[4,[-2]]],[],[]],[-1,[[4,[-2]]],[],[]],[-1,[[4,[-2]]],[],[]],[-1,[[4,[-2]]],[],[]],[-1,[[4,[-2]]],[],[]],[-1,[[4,[-2]]],[],[]],[-1,[[4,[-2]]],[],[]],[-1,[[4,[-2]]],[],[]],[-1,[[4,[-2]]],[],[]],[-1,[[4,[-2]]],[],[]],[-1,[[4,[-2]]],[],[]],[-1,[[4,[-2]]],[],[]],[-1,[[4,[-2]]],[],[]],[-1,[[4,[-2]]],[],[]],[-1,[[4,[-2]]],[],[]],[-1,[[4,[-2]]],[],[]],[-1,[[4,[-2]]],[],[]],[-1,[[4,[-2]]],[],[]],[-1,[[4,[-2]]],[],[]],[-1,[[4,[-2]]],[],[]],[-1,[[4,[-2]]],[],[]],[-1,[[4,[-2]]],[],[]],[-1,[[4,[-2]]],[],[]],[-1,[[4,[-2]]],[],[]],[-1,[[4,[-2]]],[],[]],[[[13,[-1]]],[[4,[-1,63]]],[]],[-1,64,[]],[-1,64,[]],[-1,64,[]],[-1,64,[]],[-1,64,[]],[-1,64,[]],[-1,64,[]],[-1,64,[]],[-1,64,[]],[-1,64,[]],[-1,64,[]],[-1,64,[]],[-1,64,[]],[-1,47,[]],[-1,47,[]],[-1,47,[]],[-1,47,[]],[-1,47,[]],[-1,47,[]],[-1,47,[]],[-1,47,[]],[-1,47,[]],[-1,47,[]],[-1,47,[]],[-1,47,[]],[-1,47,[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"c":[],"p":[[3,"AcquireRequest",355],[3,"Assignment",355],[4,"AcquireError",356],[4,"Result",357],[3,"PersistentCoreDistributor",0],[3,"Workers",0],[3,"WorkerId",0],[15,"tuple"],[4,"WorkersError",0],[3,"CUID",0],[15,"u8"],[15,"array"],[3,"Receiver",0],[4,"Option",358],[3,"PeerScopes",0],[4,"Ordering",359],[3,"KeyStorage",0],[4,"KeyPair",360],[4,"KeyStorageError",0],[3,"Path",361],[3,"String",362],[3,"WorkerParams",0],[8,"Deserializer",363],[15,"char"],[8,"FromIterator",364],[15,"bool"],[3,"Formatter",365],[3,"Error",365],[6,"Result",365],[4,"Event",0],[3,"PeerId",366],[4,"VmError",367],[15,"slice"],[8,"AsRef",368],[3,"PathBuf",361],[6,"Result",369],[15,"usize"],[3,"CoreRange",370],[4,"AcquireStrategy",371],[8,"CPUTopology",372],[3,"Arc",373],[3,"PersistenceTask",374],[4,"LoadingError",356],[3,"WorkersConfig",0],[8,"CoreDistributor",0],[8,"ThreadPinner",375],[15,"str"],[3,"DealId",376],[4,"PeerScope",377],[3,"Handle",378],[3,"SystemAssignment",355],[8,"Hasher",379],[3,"Box",380],[8,"Any",381],[3,"Rc",382],[3,"Vec",383],[3,"VmConfig",0],[3,"Context",384],[4,"Poll",385],[8,"Serializer",386],[8,"Error",387],[4,"VmStatus",367],[4,"TryRecvError",388],[3,"TypeId",381],[13,"WorkerCreated",308],[13,"WorkerRemoved",308],[13,"ReadPersistedKeypair",311],[13,"DirectoryListError",311],[13,"DeserializePersistedKeypair",311],[13,"PersistedKeypairDecodingError",311],[13,"PersistedKeypairInvalidKeyFormat",311],[13,"SerializePersistedKeypair",311],[13,"WriteErrorPersistedKeypair",311],[13,"RemoveErrorPersistedKeypair",311],[13,"CreateKeypairsDir",311],[13,"WorkerAlreadyExists",329],[13,"CreateWorkersDir",329],[13,"CreateWorkerKeyPair",329],[13,"RemoveWorkerKeyPair",329],[13,"ReadPersistedWorker",329],[13,"DeserializePersistedWorker",329],[13,"SerializePersistedWorker",329],[13,"WriteErrorPersistedWorker",329],[13,"WorkerStorageDirectory",329],[13,"RemoveErrorPersistedWorker",329],[13,"CreateRuntime",329],[13,"FailedToAssignCores",329],[13,"FailedToCopyVMImage",329],[13,"VMImageNotFile",329],[13,"FailedToNotifySubsystem",329]],"b":[[108,"impl-Debug-for-WorkerId"],[109,"impl-Display-for-WorkerId"],[110,"impl-Debug-for-KeyStorageError"],[111,"impl-Display-for-KeyStorageError"],[112,"impl-Display-for-WorkersError"],[113,"impl-Debug-for-WorkersError"],[115,"impl-Display-for-CUID"],[116,"impl-Debug-for-CUID"]]}\ +}'); +if (typeof window !== 'undefined' && window.initSearch) {window.initSearch(searchIndex)}; +if (typeof exports !== 'undefined') {exports.searchIndex = searchIndex}; diff --git a/server_config/all.html b/server_config/all.html new file mode 100644 index 0000000000..e38a6720df --- /dev/null +++ b/server_config/all.html @@ -0,0 +1 @@ +List of all items in this crate

List of all items

Structs

Enums

Functions

\ No newline at end of file diff --git a/server_config/args/enum.EnabledSystemServices.html b/server_config/args/enum.EnabledSystemServices.html new file mode 100644 index 0000000000..7a01fc5079 --- /dev/null +++ b/server_config/args/enum.EnabledSystemServices.html @@ -0,0 +1,41 @@ +EnabledSystemServices in server_config::args - Rust
pub enum EnabledSystemServices {
+    All,
+    Some(Vec<String>),
+    None,
+}

Variants§

§

All

§

Some(Vec<String>)

§

None

Trait Implementations§

source§

impl Clone for EnabledSystemServices

source§

fn clone(&self) -> EnabledSystemServices

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for EnabledSystemServices

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Serialize for EnabledSystemServices

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/server_config/args/enum.TracingType.html b/server_config/args/enum.TracingType.html new file mode 100644 index 0000000000..514f17ef29 --- /dev/null +++ b/server_config/args/enum.TracingType.html @@ -0,0 +1,40 @@ +TracingType in server_config::args - Rust
pub enum TracingType {
+    Disabled,
+    Otlp,
+}

Variants§

§

Disabled

§

Otlp

Trait Implementations§

source§

impl Clone for TracingType

source§

fn clone(&self) -> TracingType

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for TracingType

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Serialize for TracingType

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl ValueEnum for TracingType

source§

fn value_variants<'a>() -> &'a [Self]

All possible argument values, in display order.
source§

fn to_possible_value<'a>(&self) -> Option<PossibleValue>

The canonical argument value. Read more
§

fn from_str(input: &str, ignore_case: bool) -> Result<Self, String>

Parse an argument into Self.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/server_config/args/index.html b/server_config/args/index.html new file mode 100644 index 0000000000..81bf1b1242 --- /dev/null +++ b/server_config/args/index.html @@ -0,0 +1 @@ +server_config::args - Rust

Module server_config::args

source ·

Structs

Enums

\ No newline at end of file diff --git a/server_config/args/sidebar-items.js b/server_config/args/sidebar-items.js new file mode 100644 index 0000000000..4ffb1b6a38 --- /dev/null +++ b/server_config/args/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["EnabledSystemServices","TracingType"],"struct":["DevModeArgs","RootKeyPairArgs","TracingArgs"]}; \ No newline at end of file diff --git a/server_config/args/struct.DevModeArgs.html b/server_config/args/struct.DevModeArgs.html new file mode 100644 index 0000000000..ce47975ff7 --- /dev/null +++ b/server_config/args/struct.DevModeArgs.html @@ -0,0 +1,53 @@ +DevModeArgs in server_config::args - Rust
pub struct DevModeArgs { /* private fields */ }

Trait Implementations§

source§

impl Args for DevModeArgs

source§

fn group_id() -> Option<Id>

Report the [ArgGroup::id][crate::ArgGroup::id] for this set of arguments
source§

fn augment_args<'b>(__clap_app: Command) -> Command

Append to [Command] so it can instantiate Self. Read more
source§

fn augment_args_for_update<'b>(__clap_app: Command) -> Command

Append to [Command] so it can update self. Read more
source§

impl Clone for DevModeArgs

source§

fn clone(&self) -> DevModeArgs

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl CommandFactory for DevModeArgs

source§

fn command<'b>() -> Command

Build a [Command] that can instantiate Self. Read more
source§

fn command_for_update<'b>() -> Command

Build a [Command] that can update self. Read more
source§

impl Debug for DevModeArgs

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl FromArgMatches for DevModeArgs

source§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

Instantiate Self from [ArgMatches], parsing the arguments as needed. Read more
source§

fn from_arg_matches_mut( + __clap_arg_matches: &mut ArgMatches +) -> Result<Self, Error>

Instantiate Self from [ArgMatches], parsing the arguments as needed. Read more
source§

fn update_from_arg_matches( + &mut self, + __clap_arg_matches: &ArgMatches +) -> Result<(), Error>

Assign values from ArgMatches to self.
source§

fn update_from_arg_matches_mut( + &mut self, + __clap_arg_matches: &mut ArgMatches +) -> Result<(), Error>

Assign values from ArgMatches to self.
source§

impl Parser for DevModeArgs

§

fn parse() -> Self

Parse from std::env::args_os(), [exit][Error::exit] on error.
§

fn try_parse() -> Result<Self, Error>

Parse from std::env::args_os(), return Err on error.
§

fn parse_from<I, T>(itr: I) -> Selfwhere + I: IntoIterator<Item = T>, + T: Into<OsString> + Clone,

Parse from iterator, [exit][Error::exit] on error.
§

fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>where + I: IntoIterator<Item = T>, + T: Into<OsString> + Clone,

Parse from iterator, return Err on error.
§

fn update_from<I, T>(&mut self, itr: I)where + I: IntoIterator<Item = T>, + T: Into<OsString> + Clone,

Update from iterator, [exit][Error::exit] on error.
§

fn try_update_from<I, T>(&mut self, itr: I) -> Result<(), Error>where + I: IntoIterator<Item = T>, + T: Into<OsString> + Clone,

Update from iterator, return Err on error.
source§

impl Serialize for DevModeArgs

source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>where + S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/server_config/args/struct.RootKeyPairArgs.html b/server_config/args/struct.RootKeyPairArgs.html new file mode 100644 index 0000000000..2df60e1d79 --- /dev/null +++ b/server_config/args/struct.RootKeyPairArgs.html @@ -0,0 +1,45 @@ +RootKeyPairArgs in server_config::args - Rust
pub struct RootKeyPairArgs { /* private fields */ }

Trait Implementations§

source§

impl Args for RootKeyPairArgs

source§

fn group_id() -> Option<Id>

Report the [ArgGroup::id][crate::ArgGroup::id] for this set of arguments
source§

fn augment_args<'b>(__clap_app: Command) -> Command

Append to [Command] so it can instantiate Self. Read more
source§

fn augment_args_for_update<'b>(__clap_app: Command) -> Command

Append to [Command] so it can update self. Read more
source§

impl Clone for RootKeyPairArgs

source§

fn clone(&self) -> RootKeyPairArgs

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for RootKeyPairArgs

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl FromArgMatches for RootKeyPairArgs

source§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

Instantiate Self from [ArgMatches], parsing the arguments as needed. Read more
source§

fn from_arg_matches_mut( + __clap_arg_matches: &mut ArgMatches +) -> Result<Self, Error>

Instantiate Self from [ArgMatches], parsing the arguments as needed. Read more
source§

fn update_from_arg_matches( + &mut self, + __clap_arg_matches: &ArgMatches +) -> Result<(), Error>

Assign values from ArgMatches to self.
source§

fn update_from_arg_matches_mut( + &mut self, + __clap_arg_matches: &mut ArgMatches +) -> Result<(), Error>

Assign values from ArgMatches to self.
source§

impl Serialize for RootKeyPairArgs

source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>where + S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/server_config/args/struct.TracingArgs.html b/server_config/args/struct.TracingArgs.html new file mode 100644 index 0000000000..244027c93c --- /dev/null +++ b/server_config/args/struct.TracingArgs.html @@ -0,0 +1,48 @@ +TracingArgs in server_config::args - Rust
pub struct TracingArgs {
+    pub endpoint: Option<String>,
+    /* private fields */
+}

Fields§

§endpoint: Option<String>

Trait Implementations§

source§

impl Args for TracingArgs

source§

fn group_id() -> Option<Id>

Report the [ArgGroup::id][crate::ArgGroup::id] for this set of arguments
source§

fn augment_args<'b>(__clap_app: Command) -> Command

Append to [Command] so it can instantiate Self. Read more
source§

fn augment_args_for_update<'b>(__clap_app: Command) -> Command

Append to [Command] so it can update self. Read more
source§

impl Clone for TracingArgs

source§

fn clone(&self) -> TracingArgs

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for TracingArgs

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl FromArgMatches for TracingArgs

source§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

Instantiate Self from [ArgMatches], parsing the arguments as needed. Read more
source§

fn from_arg_matches_mut( + __clap_arg_matches: &mut ArgMatches +) -> Result<Self, Error>

Instantiate Self from [ArgMatches], parsing the arguments as needed. Read more
source§

fn update_from_arg_matches( + &mut self, + __clap_arg_matches: &ArgMatches +) -> Result<(), Error>

Assign values from ArgMatches to self.
source§

fn update_from_arg_matches_mut( + &mut self, + __clap_arg_matches: &mut ArgMatches +) -> Result<(), Error>

Assign values from ArgMatches to self.
source§

impl Serialize for TracingArgs

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/server_config/bootstrap_config/struct.BootstrapConfig.html b/server_config/bootstrap_config/struct.BootstrapConfig.html new file mode 100644 index 0000000000..cedaae6c5a --- /dev/null +++ b/server_config/bootstrap_config/struct.BootstrapConfig.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../server_config/struct.BootstrapConfig.html...

+ + + \ No newline at end of file diff --git a/server_config/defaults/fn.avm_base_dir.html b/server_config/defaults/fn.avm_base_dir.html new file mode 100644 index 0000000000..edc7b5a1f5 --- /dev/null +++ b/server_config/defaults/fn.avm_base_dir.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../server_config/fn.avm_base_dir.html...

+ + + \ No newline at end of file diff --git a/server_config/defaults/fn.default_allowed_binaries.html b/server_config/defaults/fn.default_allowed_binaries.html new file mode 100644 index 0000000000..9d082bc4e2 --- /dev/null +++ b/server_config/defaults/fn.default_allowed_binaries.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../server_config/fn.default_allowed_binaries.html...

+ + + \ No newline at end of file diff --git a/server_config/defaults/fn.default_aquavm_pool_size.html b/server_config/defaults/fn.default_aquavm_pool_size.html new file mode 100644 index 0000000000..200b5e372d --- /dev/null +++ b/server_config/defaults/fn.default_aquavm_pool_size.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../server_config/fn.default_aquavm_pool_size.html...

+ + + \ No newline at end of file diff --git a/server_config/defaults/fn.default_base_dir.html b/server_config/defaults/fn.default_base_dir.html new file mode 100644 index 0000000000..a85887530c --- /dev/null +++ b/server_config/defaults/fn.default_base_dir.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../server_config/fn.default_base_dir.html...

+ + + \ No newline at end of file diff --git a/server_config/defaults/fn.default_binaries_mapping.html b/server_config/defaults/fn.default_binaries_mapping.html new file mode 100644 index 0000000000..56d95e2ba4 --- /dev/null +++ b/server_config/defaults/fn.default_binaries_mapping.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../server_config/fn.default_binaries_mapping.html...

+ + + \ No newline at end of file diff --git a/server_config/defaults/fn.default_bootstrap_frequency.html b/server_config/defaults/fn.default_bootstrap_frequency.html new file mode 100644 index 0000000000..04cf49ecc4 --- /dev/null +++ b/server_config/defaults/fn.default_bootstrap_frequency.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../server_config/fn.default_bootstrap_frequency.html...

+ + + \ No newline at end of file diff --git a/server_config/defaults/fn.default_bootstrap_nodes.html b/server_config/defaults/fn.default_bootstrap_nodes.html new file mode 100644 index 0000000000..cf8c7326e4 --- /dev/null +++ b/server_config/defaults/fn.default_bootstrap_nodes.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../server_config/fn.default_bootstrap_nodes.html...

+ + + \ No newline at end of file diff --git a/server_config/defaults/fn.default_builtins_keypair_path.html b/server_config/defaults/fn.default_builtins_keypair_path.html new file mode 100644 index 0000000000..abf0228c5c --- /dev/null +++ b/server_config/defaults/fn.default_builtins_keypair_path.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../server_config/fn.default_builtins_keypair_path.html...

+ + + \ No newline at end of file diff --git a/server_config/defaults/fn.default_connection_idle_timeout.html b/server_config/defaults/fn.default_connection_idle_timeout.html new file mode 100644 index 0000000000..0c8236e1de --- /dev/null +++ b/server_config/defaults/fn.default_connection_idle_timeout.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../server_config/fn.default_connection_idle_timeout.html...

+ + + \ No newline at end of file diff --git a/server_config/defaults/fn.default_cpus_range.html b/server_config/defaults/fn.default_cpus_range.html new file mode 100644 index 0000000000..05c6a2fc54 --- /dev/null +++ b/server_config/defaults/fn.default_cpus_range.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../server_config/fn.default_cpus_range.html...

+ + + \ No newline at end of file diff --git a/server_config/defaults/fn.default_curl_binary_path.html b/server_config/defaults/fn.default_curl_binary_path.html new file mode 100644 index 0000000000..81bed655ec --- /dev/null +++ b/server_config/defaults/fn.default_curl_binary_path.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../server_config/fn.default_curl_binary_path.html...

+ + + \ No newline at end of file diff --git a/server_config/defaults/fn.default_decider_spell_period_sec.html b/server_config/defaults/fn.default_decider_spell_period_sec.html new file mode 100644 index 0000000000..50bd0038ea --- /dev/null +++ b/server_config/defaults/fn.default_decider_spell_period_sec.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../server_config/fn.default_decider_spell_period_sec.html...

+ + + \ No newline at end of file diff --git a/server_config/defaults/fn.default_effectors.html b/server_config/defaults/fn.default_effectors.html new file mode 100644 index 0000000000..70a7e54215 --- /dev/null +++ b/server_config/defaults/fn.default_effectors.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../server_config/fn.default_effectors.html...

+ + + \ No newline at end of file diff --git a/server_config/defaults/fn.default_effects_queue_buffer_size.html b/server_config/defaults/fn.default_effects_queue_buffer_size.html new file mode 100644 index 0000000000..e0a08526ab --- /dev/null +++ b/server_config/defaults/fn.default_effects_queue_buffer_size.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../server_config/fn.default_effects_queue_buffer_size.html...

+ + + \ No newline at end of file diff --git a/server_config/defaults/fn.default_epoch_end_window.html b/server_config/defaults/fn.default_epoch_end_window.html new file mode 100644 index 0000000000..8bd88d153a --- /dev/null +++ b/server_config/defaults/fn.default_epoch_end_window.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../server_config/fn.default_epoch_end_window.html...

+ + + \ No newline at end of file diff --git a/server_config/defaults/fn.default_execution_timeout.html b/server_config/defaults/fn.default_execution_timeout.html new file mode 100644 index 0000000000..849b8099f3 --- /dev/null +++ b/server_config/defaults/fn.default_execution_timeout.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../server_config/fn.default_execution_timeout.html...

+ + + \ No newline at end of file diff --git a/server_config/defaults/fn.default_health_check_enabled.html b/server_config/defaults/fn.default_health_check_enabled.html new file mode 100644 index 0000000000..74089bc75d --- /dev/null +++ b/server_config/defaults/fn.default_health_check_enabled.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../server_config/fn.default_health_check_enabled.html...

+ + + \ No newline at end of file diff --git a/server_config/defaults/fn.default_http_port.html b/server_config/defaults/fn.default_http_port.html new file mode 100644 index 0000000000..479285f645 --- /dev/null +++ b/server_config/defaults/fn.default_http_port.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../server_config/fn.default_http_port.html...

+ + + \ No newline at end of file diff --git a/server_config/defaults/fn.default_ipfs_binary_path.html b/server_config/defaults/fn.default_ipfs_binary_path.html new file mode 100644 index 0000000000..47637d83c7 --- /dev/null +++ b/server_config/defaults/fn.default_ipfs_binary_path.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../server_config/fn.default_ipfs_binary_path.html...

+ + + \ No newline at end of file diff --git a/server_config/defaults/fn.default_ipfs_multiaddr.html b/server_config/defaults/fn.default_ipfs_multiaddr.html new file mode 100644 index 0000000000..aaec1ae847 --- /dev/null +++ b/server_config/defaults/fn.default_ipfs_multiaddr.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../server_config/fn.default_ipfs_multiaddr.html...

+ + + \ No newline at end of file diff --git a/server_config/defaults/fn.default_key_format.html b/server_config/defaults/fn.default_key_format.html new file mode 100644 index 0000000000..aa7562943d --- /dev/null +++ b/server_config/defaults/fn.default_key_format.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../server_config/fn.default_key_format.html...

+ + + \ No newline at end of file diff --git a/server_config/defaults/fn.default_keypair_path.html b/server_config/defaults/fn.default_keypair_path.html new file mode 100644 index 0000000000..32fb08c342 --- /dev/null +++ b/server_config/defaults/fn.default_keypair_path.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../server_config/fn.default_keypair_path.html...

+ + + \ No newline at end of file diff --git a/server_config/defaults/fn.default_listen_ip.html b/server_config/defaults/fn.default_listen_ip.html new file mode 100644 index 0000000000..95d60bd585 --- /dev/null +++ b/server_config/defaults/fn.default_listen_ip.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../server_config/fn.default_listen_ip.html...

+ + + \ No newline at end of file diff --git a/server_config/defaults/fn.default_management_peer_id.html b/server_config/defaults/fn.default_management_peer_id.html new file mode 100644 index 0000000000..12507588c0 --- /dev/null +++ b/server_config/defaults/fn.default_management_peer_id.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../server_config/fn.default_management_peer_id.html...

+ + + \ No newline at end of file diff --git a/server_config/defaults/fn.default_max_batch_count.html b/server_config/defaults/fn.default_max_batch_count.html new file mode 100644 index 0000000000..8ad97c5f14 --- /dev/null +++ b/server_config/defaults/fn.default_max_batch_count.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../server_config/fn.default_max_batch_count.html...

+ + + \ No newline at end of file diff --git a/server_config/defaults/fn.default_max_builtin_metrics_storage_size.html b/server_config/defaults/fn.default_max_builtin_metrics_storage_size.html new file mode 100644 index 0000000000..fbe9fc51a6 --- /dev/null +++ b/server_config/defaults/fn.default_max_builtin_metrics_storage_size.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../server_config/fn.default_max_builtin_metrics_storage_size.html...

+ + + \ No newline at end of file diff --git a/server_config/defaults/fn.default_max_established_per_peer_limit.html b/server_config/defaults/fn.default_max_established_per_peer_limit.html new file mode 100644 index 0000000000..86cf882aa4 --- /dev/null +++ b/server_config/defaults/fn.default_max_established_per_peer_limit.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../server_config/fn.default_max_established_per_peer_limit.html...

+ + + \ No newline at end of file diff --git a/server_config/defaults/fn.default_max_proof_batch_size.html b/server_config/defaults/fn.default_max_proof_batch_size.html new file mode 100644 index 0000000000..03afae2013 --- /dev/null +++ b/server_config/defaults/fn.default_max_proof_batch_size.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../server_config/fn.default_max_proof_batch_size.html...

+ + + \ No newline at end of file diff --git a/server_config/defaults/fn.default_max_spell_particle_ttl.html b/server_config/defaults/fn.default_max_spell_particle_ttl.html new file mode 100644 index 0000000000..e84df20703 --- /dev/null +++ b/server_config/defaults/fn.default_max_spell_particle_ttl.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../server_config/fn.default_max_spell_particle_ttl.html...

+ + + \ No newline at end of file diff --git a/server_config/defaults/fn.default_metrics_enabled.html b/server_config/defaults/fn.default_metrics_enabled.html new file mode 100644 index 0000000000..105910049e --- /dev/null +++ b/server_config/defaults/fn.default_metrics_enabled.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../server_config/fn.default_metrics_enabled.html...

+ + + \ No newline at end of file diff --git a/server_config/defaults/fn.default_min_batch_count.html b/server_config/defaults/fn.default_min_batch_count.html new file mode 100644 index 0000000000..6a1b4e253f --- /dev/null +++ b/server_config/defaults/fn.default_min_batch_count.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../server_config/fn.default_min_batch_count.html...

+ + + \ No newline at end of file diff --git a/server_config/defaults/fn.default_particle_processor_parallelism.html b/server_config/defaults/fn.default_particle_processor_parallelism.html new file mode 100644 index 0000000000..d86811602f --- /dev/null +++ b/server_config/defaults/fn.default_particle_processor_parallelism.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../server_config/fn.default_particle_processor_parallelism.html...

+ + + \ No newline at end of file diff --git a/server_config/defaults/fn.default_particle_queue_buffer_size.html b/server_config/defaults/fn.default_particle_queue_buffer_size.html new file mode 100644 index 0000000000..fc5186df0d --- /dev/null +++ b/server_config/defaults/fn.default_particle_queue_buffer_size.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../server_config/fn.default_particle_queue_buffer_size.html...

+ + + \ No newline at end of file diff --git a/server_config/defaults/fn.default_processing_timeout.html b/server_config/defaults/fn.default_processing_timeout.html new file mode 100644 index 0000000000..85fa116710 --- /dev/null +++ b/server_config/defaults/fn.default_processing_timeout.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../server_config/fn.default_processing_timeout.html...

+ + + \ No newline at end of file diff --git a/server_config/defaults/fn.default_proof_poll_period.html b/server_config/defaults/fn.default_proof_poll_period.html new file mode 100644 index 0000000000..c4e3998fdd --- /dev/null +++ b/server_config/defaults/fn.default_proof_poll_period.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../server_config/fn.default_proof_poll_period.html...

+ + + \ No newline at end of file diff --git a/server_config/defaults/fn.default_registry_expired_spell_period_sec.html b/server_config/defaults/fn.default_registry_expired_spell_period_sec.html new file mode 100644 index 0000000000..d22cbf1b83 --- /dev/null +++ b/server_config/defaults/fn.default_registry_expired_spell_period_sec.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../server_config/fn.default_registry_expired_spell_period_sec.html...

+ + + \ No newline at end of file diff --git a/server_config/defaults/fn.default_registry_renew_spell_period_sec.html b/server_config/defaults/fn.default_registry_renew_spell_period_sec.html new file mode 100644 index 0000000000..77cb218b13 --- /dev/null +++ b/server_config/defaults/fn.default_registry_renew_spell_period_sec.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../server_config/fn.default_registry_renew_spell_period_sec.html...

+ + + \ No newline at end of file diff --git a/server_config/defaults/fn.default_registry_replicate_spell_period_sec.html b/server_config/defaults/fn.default_registry_replicate_spell_period_sec.html new file mode 100644 index 0000000000..4f6db7459e --- /dev/null +++ b/server_config/defaults/fn.default_registry_replicate_spell_period_sec.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../server_config/fn.default_registry_replicate_spell_period_sec.html...

+ + + \ No newline at end of file diff --git a/server_config/defaults/fn.default_registry_spell_period_sec.html b/server_config/defaults/fn.default_registry_spell_period_sec.html new file mode 100644 index 0000000000..5110a0f9a9 --- /dev/null +++ b/server_config/defaults/fn.default_registry_spell_period_sec.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../server_config/fn.default_registry_spell_period_sec.html...

+ + + \ No newline at end of file diff --git a/server_config/defaults/fn.default_service_memory_limit.html b/server_config/defaults/fn.default_service_memory_limit.html new file mode 100644 index 0000000000..835ffd7b47 --- /dev/null +++ b/server_config/defaults/fn.default_service_memory_limit.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../server_config/fn.default_service_memory_limit.html...

+ + + \ No newline at end of file diff --git a/server_config/defaults/fn.default_services_metrics_timer_resolution.html b/server_config/defaults/fn.default_services_metrics_timer_resolution.html new file mode 100644 index 0000000000..97f84a801b --- /dev/null +++ b/server_config/defaults/fn.default_services_metrics_timer_resolution.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../server_config/fn.default_services_metrics_timer_resolution.html...

+ + + \ No newline at end of file diff --git a/server_config/defaults/fn.default_socket_timeout.html b/server_config/defaults/fn.default_socket_timeout.html new file mode 100644 index 0000000000..54948387f0 --- /dev/null +++ b/server_config/defaults/fn.default_socket_timeout.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../server_config/fn.default_socket_timeout.html...

+ + + \ No newline at end of file diff --git a/server_config/defaults/fn.default_system_cpu_count.html b/server_config/defaults/fn.default_system_cpu_count.html new file mode 100644 index 0000000000..5df56255bd --- /dev/null +++ b/server_config/defaults/fn.default_system_cpu_count.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../server_config/fn.default_system_cpu_count.html...

+ + + \ No newline at end of file diff --git a/server_config/defaults/fn.default_system_services.html b/server_config/defaults/fn.default_system_services.html new file mode 100644 index 0000000000..0057b83855 --- /dev/null +++ b/server_config/defaults/fn.default_system_services.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../server_config/fn.default_system_services.html...

+ + + \ No newline at end of file diff --git a/server_config/defaults/fn.default_tcp_port.html b/server_config/defaults/fn.default_tcp_port.html new file mode 100644 index 0000000000..8e3e380b45 --- /dev/null +++ b/server_config/defaults/fn.default_tcp_port.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../server_config/fn.default_tcp_port.html...

+ + + \ No newline at end of file diff --git a/server_config/defaults/fn.default_tokio_metrics_enabled.html b/server_config/defaults/fn.default_tokio_metrics_enabled.html new file mode 100644 index 0000000000..6a363ee658 --- /dev/null +++ b/server_config/defaults/fn.default_tokio_metrics_enabled.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../server_config/fn.default_tokio_metrics_enabled.html...

+ + + \ No newline at end of file diff --git a/server_config/defaults/fn.default_tokio_metrics_poll_histogram_enabled.html b/server_config/defaults/fn.default_tokio_metrics_poll_histogram_enabled.html new file mode 100644 index 0000000000..0e1b515717 --- /dev/null +++ b/server_config/defaults/fn.default_tokio_metrics_poll_histogram_enabled.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../server_config/fn.default_tokio_metrics_poll_histogram_enabled.html...

+ + + \ No newline at end of file diff --git a/server_config/defaults/fn.default_transport.html b/server_config/defaults/fn.default_transport.html new file mode 100644 index 0000000000..4e293ef0f8 --- /dev/null +++ b/server_config/defaults/fn.default_transport.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../server_config/fn.default_transport.html...

+ + + \ No newline at end of file diff --git a/server_config/defaults/fn.default_websocket_port.html b/server_config/defaults/fn.default_websocket_port.html new file mode 100644 index 0000000000..5c7b460895 --- /dev/null +++ b/server_config/defaults/fn.default_websocket_port.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../server_config/fn.default_websocket_port.html...

+ + + \ No newline at end of file diff --git a/server_config/defaults/fn.default_worker_spell_period_sec.html b/server_config/defaults/fn.default_worker_spell_period_sec.html new file mode 100644 index 0000000000..2db4416dd2 --- /dev/null +++ b/server_config/defaults/fn.default_worker_spell_period_sec.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../server_config/fn.default_worker_spell_period_sec.html...

+ + + \ No newline at end of file diff --git a/server_config/defaults/fn.default_workers_queue_buffer_size.html b/server_config/defaults/fn.default_workers_queue_buffer_size.html new file mode 100644 index 0000000000..b27c4daa99 --- /dev/null +++ b/server_config/defaults/fn.default_workers_queue_buffer_size.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../server_config/fn.default_workers_queue_buffer_size.html...

+ + + \ No newline at end of file diff --git a/server_config/defaults/fn.ephemeral_dir.html b/server_config/defaults/fn.ephemeral_dir.html new file mode 100644 index 0000000000..de36e01950 --- /dev/null +++ b/server_config/defaults/fn.ephemeral_dir.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../server_config/fn.ephemeral_dir.html...

+ + + \ No newline at end of file diff --git a/server_config/defaults/fn.persistent_dir.html b/server_config/defaults/fn.persistent_dir.html new file mode 100644 index 0000000000..f719fe1e8c --- /dev/null +++ b/server_config/defaults/fn.persistent_dir.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../server_config/fn.persistent_dir.html...

+ + + \ No newline at end of file diff --git a/server_config/defaults/fn.services_dir.html b/server_config/defaults/fn.services_dir.html new file mode 100644 index 0000000000..1fbfbe6cf4 --- /dev/null +++ b/server_config/defaults/fn.services_dir.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../server_config/fn.services_dir.html...

+ + + \ No newline at end of file diff --git a/server_config/enum.Network.html b/server_config/enum.Network.html new file mode 100644 index 0000000000..39bd60aae4 --- /dev/null +++ b/server_config/enum.Network.html @@ -0,0 +1,46 @@ +Network in server_config - Rust
pub enum Network {
+    Dar,
+    Stage,
+    Kras,
+    Custom([u8; 32]),
+}

Variants§

§

Dar

§

Stage

§

Kras

§

Custom([u8; 32])

Trait Implementations§

source§

impl Clone for Network

source§

fn clone(&self) -> Network

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Network

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Network

source§

fn default() -> Network

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for Network

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl PartialEq for Network

source§

fn eq(&self, other: &Network) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Serialize for Network

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl TryFrom<&Network> for StreamProtocol

§

type Error = InvalidProtocol

The type returned in the event of a conversion error.
source§

fn try_from(value: &Network) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl StructuralPartialEq for Network

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
source§

impl<T> DeserializeOwned for Twhere + T: for<'de> Deserialize<'de>,

\ No newline at end of file diff --git a/server_config/enum.TracingConfig.html b/server_config/enum.TracingConfig.html new file mode 100644 index 0000000000..5dfd89d782 --- /dev/null +++ b/server_config/enum.TracingConfig.html @@ -0,0 +1,48 @@ +TracingConfig in server_config - Rust
pub enum TracingConfig {
+    Disabled,
+    Stdout,
+    Otlp {
+        endpoint: Url,
+        sample_ratio: Option<f64>,
+    },
+}

Variants§

§

Disabled

§

Stdout

§

Otlp

Fields

§endpoint: Url
§sample_ratio: Option<f64>

Trait Implementations§

source§

impl Clone for TracingConfig

source§

fn clone(&self) -> TracingConfig

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for TracingConfig

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for TracingConfig

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl PartialEq for TracingConfig

source§

fn eq(&self, other: &TracingConfig) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Serialize for TracingConfig

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl StructuralPartialEq for TracingConfig

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
source§

impl<T> DeserializeOwned for Twhere + T: for<'de> Deserialize<'de>,

\ No newline at end of file diff --git a/server_config/fn.avm_base_dir.html b/server_config/fn.avm_base_dir.html new file mode 100644 index 0000000000..106641d38a --- /dev/null +++ b/server_config/fn.avm_base_dir.html @@ -0,0 +1 @@ +avm_base_dir in server_config - Rust
pub fn avm_base_dir(base_dir: &Path) -> PathBuf
\ No newline at end of file diff --git a/server_config/fn.default_allowed_binaries.html b/server_config/fn.default_allowed_binaries.html new file mode 100644 index 0000000000..c889cc604d --- /dev/null +++ b/server_config/fn.default_allowed_binaries.html @@ -0,0 +1 @@ +default_allowed_binaries in server_config - Rust
pub fn default_allowed_binaries() -> Vec<String>
\ No newline at end of file diff --git a/server_config/fn.default_aquavm_pool_size.html b/server_config/fn.default_aquavm_pool_size.html new file mode 100644 index 0000000000..7c59a07979 --- /dev/null +++ b/server_config/fn.default_aquavm_pool_size.html @@ -0,0 +1 @@ +default_aquavm_pool_size in server_config - Rust
pub fn default_aquavm_pool_size() -> usize
\ No newline at end of file diff --git a/server_config/fn.default_base_dir.html b/server_config/fn.default_base_dir.html new file mode 100644 index 0000000000..293b32bdf0 --- /dev/null +++ b/server_config/fn.default_base_dir.html @@ -0,0 +1 @@ +default_base_dir in server_config - Rust
pub fn default_base_dir() -> PathBuf
\ No newline at end of file diff --git a/server_config/fn.default_binaries_mapping.html b/server_config/fn.default_binaries_mapping.html new file mode 100644 index 0000000000..6594f5578d --- /dev/null +++ b/server_config/fn.default_binaries_mapping.html @@ -0,0 +1 @@ +default_binaries_mapping in server_config - Rust
pub fn default_binaries_mapping() -> BTreeMap<String, PathBuf>
\ No newline at end of file diff --git a/server_config/fn.default_bootstrap_frequency.html b/server_config/fn.default_bootstrap_frequency.html new file mode 100644 index 0000000000..a8c9b2d747 --- /dev/null +++ b/server_config/fn.default_bootstrap_frequency.html @@ -0,0 +1 @@ +default_bootstrap_frequency in server_config - Rust
pub fn default_bootstrap_frequency() -> usize
\ No newline at end of file diff --git a/server_config/fn.default_bootstrap_nodes.html b/server_config/fn.default_bootstrap_nodes.html new file mode 100644 index 0000000000..8ded2f8873 --- /dev/null +++ b/server_config/fn.default_bootstrap_nodes.html @@ -0,0 +1 @@ +default_bootstrap_nodes in server_config - Rust
pub fn default_bootstrap_nodes() -> Vec<Multiaddr>
\ No newline at end of file diff --git a/server_config/fn.default_builtins_keypair_path.html b/server_config/fn.default_builtins_keypair_path.html new file mode 100644 index 0000000000..b7015621c8 --- /dev/null +++ b/server_config/fn.default_builtins_keypair_path.html @@ -0,0 +1 @@ +default_builtins_keypair_path in server_config - Rust
pub fn default_builtins_keypair_path(persistent_base_dir: &Path) -> PathOrValue
\ No newline at end of file diff --git a/server_config/fn.default_connection_idle_timeout.html b/server_config/fn.default_connection_idle_timeout.html new file mode 100644 index 0000000000..c0cd9a98fa --- /dev/null +++ b/server_config/fn.default_connection_idle_timeout.html @@ -0,0 +1 @@ +default_connection_idle_timeout in server_config - Rust
pub fn default_connection_idle_timeout() -> Duration
\ No newline at end of file diff --git a/server_config/fn.default_cpus_range.html b/server_config/fn.default_cpus_range.html new file mode 100644 index 0000000000..1f63a8fdea --- /dev/null +++ b/server_config/fn.default_cpus_range.html @@ -0,0 +1 @@ +default_cpus_range in server_config - Rust
pub fn default_cpus_range() -> Option<CoreRange>
\ No newline at end of file diff --git a/server_config/fn.default_curl_binary_path.html b/server_config/fn.default_curl_binary_path.html new file mode 100644 index 0000000000..38c6b8e905 --- /dev/null +++ b/server_config/fn.default_curl_binary_path.html @@ -0,0 +1 @@ +default_curl_binary_path in server_config - Rust
pub fn default_curl_binary_path() -> PathBuf
\ No newline at end of file diff --git a/server_config/fn.default_decider_spell_period_sec.html b/server_config/fn.default_decider_spell_period_sec.html new file mode 100644 index 0000000000..9779edcf11 --- /dev/null +++ b/server_config/fn.default_decider_spell_period_sec.html @@ -0,0 +1 @@ +default_decider_spell_period_sec in server_config - Rust
pub fn default_decider_spell_period_sec() -> u32
\ No newline at end of file diff --git a/server_config/fn.default_effectors.html b/server_config/fn.default_effectors.html new file mode 100644 index 0000000000..4293250b50 --- /dev/null +++ b/server_config/fn.default_effectors.html @@ -0,0 +1,2 @@ +default_effectors in server_config - Rust
pub fn default_effectors(
+) -> HashMap<String, (String, HashMap<String, PathBuf>)>
\ No newline at end of file diff --git a/server_config/fn.default_effects_queue_buffer_size.html b/server_config/fn.default_effects_queue_buffer_size.html new file mode 100644 index 0000000000..1cd8f9015a --- /dev/null +++ b/server_config/fn.default_effects_queue_buffer_size.html @@ -0,0 +1 @@ +default_effects_queue_buffer_size in server_config - Rust
pub fn default_effects_queue_buffer_size() -> usize
\ No newline at end of file diff --git a/server_config/fn.default_epoch_end_window.html b/server_config/fn.default_epoch_end_window.html new file mode 100644 index 0000000000..123e4b7d08 --- /dev/null +++ b/server_config/fn.default_epoch_end_window.html @@ -0,0 +1 @@ +default_epoch_end_window in server_config - Rust
pub fn default_epoch_end_window() -> Duration
\ No newline at end of file diff --git a/server_config/fn.default_execution_timeout.html b/server_config/fn.default_execution_timeout.html new file mode 100644 index 0000000000..3fbd507fd2 --- /dev/null +++ b/server_config/fn.default_execution_timeout.html @@ -0,0 +1 @@ +default_execution_timeout in server_config - Rust
pub fn default_execution_timeout() -> Duration
\ No newline at end of file diff --git a/server_config/fn.default_health_check_enabled.html b/server_config/fn.default_health_check_enabled.html new file mode 100644 index 0000000000..65f20061c8 --- /dev/null +++ b/server_config/fn.default_health_check_enabled.html @@ -0,0 +1 @@ +default_health_check_enabled in server_config - Rust
pub fn default_health_check_enabled() -> bool
\ No newline at end of file diff --git a/server_config/fn.default_http_port.html b/server_config/fn.default_http_port.html new file mode 100644 index 0000000000..f410e6fa95 --- /dev/null +++ b/server_config/fn.default_http_port.html @@ -0,0 +1 @@ +default_http_port in server_config - Rust
pub fn default_http_port() -> u16
\ No newline at end of file diff --git a/server_config/fn.default_ipfs_binary_path.html b/server_config/fn.default_ipfs_binary_path.html new file mode 100644 index 0000000000..0b3db6e75b --- /dev/null +++ b/server_config/fn.default_ipfs_binary_path.html @@ -0,0 +1 @@ +default_ipfs_binary_path in server_config - Rust
pub fn default_ipfs_binary_path() -> PathBuf
\ No newline at end of file diff --git a/server_config/fn.default_ipfs_multiaddr.html b/server_config/fn.default_ipfs_multiaddr.html new file mode 100644 index 0000000000..d416a382a1 --- /dev/null +++ b/server_config/fn.default_ipfs_multiaddr.html @@ -0,0 +1 @@ +default_ipfs_multiaddr in server_config - Rust
pub fn default_ipfs_multiaddr() -> String
\ No newline at end of file diff --git a/server_config/fn.default_key_format.html b/server_config/fn.default_key_format.html new file mode 100644 index 0000000000..20da29f0e6 --- /dev/null +++ b/server_config/fn.default_key_format.html @@ -0,0 +1 @@ +default_key_format in server_config - Rust
pub fn default_key_format() -> String
\ No newline at end of file diff --git a/server_config/fn.default_keypair_path.html b/server_config/fn.default_keypair_path.html new file mode 100644 index 0000000000..d521cb5b04 --- /dev/null +++ b/server_config/fn.default_keypair_path.html @@ -0,0 +1 @@ +default_keypair_path in server_config - Rust
pub fn default_keypair_path(base_dir: &Path) -> PathOrValue
\ No newline at end of file diff --git a/server_config/fn.default_listen_ip.html b/server_config/fn.default_listen_ip.html new file mode 100644 index 0000000000..f95e2a339d --- /dev/null +++ b/server_config/fn.default_listen_ip.html @@ -0,0 +1 @@ +default_listen_ip in server_config - Rust
pub fn default_listen_ip() -> IpAddr
\ No newline at end of file diff --git a/server_config/fn.default_management_peer_id.html b/server_config/fn.default_management_peer_id.html new file mode 100644 index 0000000000..6bc2c0e586 --- /dev/null +++ b/server_config/fn.default_management_peer_id.html @@ -0,0 +1 @@ +default_management_peer_id in server_config - Rust
pub fn default_management_peer_id() -> PeerId
\ No newline at end of file diff --git a/server_config/fn.default_max_batch_count.html b/server_config/fn.default_max_batch_count.html new file mode 100644 index 0000000000..92b088889d --- /dev/null +++ b/server_config/fn.default_max_batch_count.html @@ -0,0 +1 @@ +default_max_batch_count in server_config - Rust
pub fn default_max_batch_count() -> usize
\ No newline at end of file diff --git a/server_config/fn.default_max_builtin_metrics_storage_size.html b/server_config/fn.default_max_builtin_metrics_storage_size.html new file mode 100644 index 0000000000..2783ad9c8a --- /dev/null +++ b/server_config/fn.default_max_builtin_metrics_storage_size.html @@ -0,0 +1 @@ +default_max_builtin_metrics_storage_size in server_config - Rust
pub fn default_max_builtin_metrics_storage_size() -> usize
\ No newline at end of file diff --git a/server_config/fn.default_max_established_per_peer_limit.html b/server_config/fn.default_max_established_per_peer_limit.html new file mode 100644 index 0000000000..e208ac3f4f --- /dev/null +++ b/server_config/fn.default_max_established_per_peer_limit.html @@ -0,0 +1 @@ +default_max_established_per_peer_limit in server_config - Rust
pub fn default_max_established_per_peer_limit() -> Option<u32>
\ No newline at end of file diff --git a/server_config/fn.default_max_proof_batch_size.html b/server_config/fn.default_max_proof_batch_size.html new file mode 100644 index 0000000000..24f4ebf7d6 --- /dev/null +++ b/server_config/fn.default_max_proof_batch_size.html @@ -0,0 +1 @@ +default_max_proof_batch_size in server_config - Rust
pub fn default_max_proof_batch_size() -> usize
\ No newline at end of file diff --git a/server_config/fn.default_max_spell_particle_ttl.html b/server_config/fn.default_max_spell_particle_ttl.html new file mode 100644 index 0000000000..9b287bc5ae --- /dev/null +++ b/server_config/fn.default_max_spell_particle_ttl.html @@ -0,0 +1 @@ +default_max_spell_particle_ttl in server_config - Rust
pub fn default_max_spell_particle_ttl() -> Duration
\ No newline at end of file diff --git a/server_config/fn.default_metrics_enabled.html b/server_config/fn.default_metrics_enabled.html new file mode 100644 index 0000000000..511472ab2d --- /dev/null +++ b/server_config/fn.default_metrics_enabled.html @@ -0,0 +1 @@ +default_metrics_enabled in server_config - Rust
pub fn default_metrics_enabled() -> bool
\ No newline at end of file diff --git a/server_config/fn.default_min_batch_count.html b/server_config/fn.default_min_batch_count.html new file mode 100644 index 0000000000..3293d77b48 --- /dev/null +++ b/server_config/fn.default_min_batch_count.html @@ -0,0 +1 @@ +default_min_batch_count in server_config - Rust
pub fn default_min_batch_count() -> usize
\ No newline at end of file diff --git a/server_config/fn.default_particle_processor_parallelism.html b/server_config/fn.default_particle_processor_parallelism.html new file mode 100644 index 0000000000..bc7f8f1f40 --- /dev/null +++ b/server_config/fn.default_particle_processor_parallelism.html @@ -0,0 +1 @@ +default_particle_processor_parallelism in server_config - Rust
pub fn default_particle_processor_parallelism() -> Option<usize>
\ No newline at end of file diff --git a/server_config/fn.default_particle_queue_buffer_size.html b/server_config/fn.default_particle_queue_buffer_size.html new file mode 100644 index 0000000000..da3870dda4 --- /dev/null +++ b/server_config/fn.default_particle_queue_buffer_size.html @@ -0,0 +1 @@ +default_particle_queue_buffer_size in server_config - Rust
pub fn default_particle_queue_buffer_size() -> usize
\ No newline at end of file diff --git a/server_config/fn.default_processing_timeout.html b/server_config/fn.default_processing_timeout.html new file mode 100644 index 0000000000..d00ece851a --- /dev/null +++ b/server_config/fn.default_processing_timeout.html @@ -0,0 +1 @@ +default_processing_timeout in server_config - Rust
pub fn default_processing_timeout() -> Duration
\ No newline at end of file diff --git a/server_config/fn.default_proof_poll_period.html b/server_config/fn.default_proof_poll_period.html new file mode 100644 index 0000000000..c45aebf2db --- /dev/null +++ b/server_config/fn.default_proof_poll_period.html @@ -0,0 +1 @@ +default_proof_poll_period in server_config - Rust
pub fn default_proof_poll_period() -> Duration
\ No newline at end of file diff --git a/server_config/fn.default_registry_expired_spell_period_sec.html b/server_config/fn.default_registry_expired_spell_period_sec.html new file mode 100644 index 0000000000..8683db44b6 --- /dev/null +++ b/server_config/fn.default_registry_expired_spell_period_sec.html @@ -0,0 +1 @@ +default_registry_expired_spell_period_sec in server_config - Rust
pub fn default_registry_expired_spell_period_sec() -> u32
\ No newline at end of file diff --git a/server_config/fn.default_registry_renew_spell_period_sec.html b/server_config/fn.default_registry_renew_spell_period_sec.html new file mode 100644 index 0000000000..81b8c7bf77 --- /dev/null +++ b/server_config/fn.default_registry_renew_spell_period_sec.html @@ -0,0 +1 @@ +default_registry_renew_spell_period_sec in server_config - Rust
pub fn default_registry_renew_spell_period_sec() -> u32
\ No newline at end of file diff --git a/server_config/fn.default_registry_replicate_spell_period_sec.html b/server_config/fn.default_registry_replicate_spell_period_sec.html new file mode 100644 index 0000000000..eab7be9471 --- /dev/null +++ b/server_config/fn.default_registry_replicate_spell_period_sec.html @@ -0,0 +1 @@ +default_registry_replicate_spell_period_sec in server_config - Rust
pub fn default_registry_replicate_spell_period_sec() -> u32
\ No newline at end of file diff --git a/server_config/fn.default_registry_spell_period_sec.html b/server_config/fn.default_registry_spell_period_sec.html new file mode 100644 index 0000000000..c26099dfc7 --- /dev/null +++ b/server_config/fn.default_registry_spell_period_sec.html @@ -0,0 +1 @@ +default_registry_spell_period_sec in server_config - Rust
pub fn default_registry_spell_period_sec() -> u32
\ No newline at end of file diff --git a/server_config/fn.default_service_memory_limit.html b/server_config/fn.default_service_memory_limit.html new file mode 100644 index 0000000000..bcbbcbe91d --- /dev/null +++ b/server_config/fn.default_service_memory_limit.html @@ -0,0 +1 @@ +default_service_memory_limit in server_config - Rust
pub fn default_service_memory_limit() -> ByteSize
\ No newline at end of file diff --git a/server_config/fn.default_services_metrics_timer_resolution.html b/server_config/fn.default_services_metrics_timer_resolution.html new file mode 100644 index 0000000000..de4cabafa7 --- /dev/null +++ b/server_config/fn.default_services_metrics_timer_resolution.html @@ -0,0 +1 @@ +default_services_metrics_timer_resolution in server_config - Rust
pub fn default_services_metrics_timer_resolution() -> Duration
\ No newline at end of file diff --git a/server_config/fn.default_socket_timeout.html b/server_config/fn.default_socket_timeout.html new file mode 100644 index 0000000000..4b7e7e8225 --- /dev/null +++ b/server_config/fn.default_socket_timeout.html @@ -0,0 +1 @@ +default_socket_timeout in server_config - Rust
pub fn default_socket_timeout() -> Duration
\ No newline at end of file diff --git a/server_config/fn.default_system_cpu_count.html b/server_config/fn.default_system_cpu_count.html new file mode 100644 index 0000000000..1f35f3b661 --- /dev/null +++ b/server_config/fn.default_system_cpu_count.html @@ -0,0 +1 @@ +default_system_cpu_count in server_config - Rust
pub fn default_system_cpu_count() -> usize
\ No newline at end of file diff --git a/server_config/fn.default_system_services.html b/server_config/fn.default_system_services.html new file mode 100644 index 0000000000..00e5bf50f3 --- /dev/null +++ b/server_config/fn.default_system_services.html @@ -0,0 +1 @@ +default_system_services in server_config - Rust
pub fn default_system_services() -> Vec<ServiceKey>
\ No newline at end of file diff --git a/server_config/fn.default_tcp_port.html b/server_config/fn.default_tcp_port.html new file mode 100644 index 0000000000..d4426d5a58 --- /dev/null +++ b/server_config/fn.default_tcp_port.html @@ -0,0 +1 @@ +default_tcp_port in server_config - Rust
pub fn default_tcp_port() -> u16
\ No newline at end of file diff --git a/server_config/fn.default_tokio_metrics_enabled.html b/server_config/fn.default_tokio_metrics_enabled.html new file mode 100644 index 0000000000..f00fc75d7d --- /dev/null +++ b/server_config/fn.default_tokio_metrics_enabled.html @@ -0,0 +1 @@ +default_tokio_metrics_enabled in server_config - Rust
pub fn default_tokio_metrics_enabled() -> bool
\ No newline at end of file diff --git a/server_config/fn.default_tokio_metrics_poll_histogram_enabled.html b/server_config/fn.default_tokio_metrics_poll_histogram_enabled.html new file mode 100644 index 0000000000..592dc0fea6 --- /dev/null +++ b/server_config/fn.default_tokio_metrics_poll_histogram_enabled.html @@ -0,0 +1 @@ +default_tokio_metrics_poll_histogram_enabled in server_config - Rust
pub fn default_tokio_metrics_poll_histogram_enabled() -> bool
\ No newline at end of file diff --git a/server_config/fn.default_transport.html b/server_config/fn.default_transport.html new file mode 100644 index 0000000000..70ba5e527d --- /dev/null +++ b/server_config/fn.default_transport.html @@ -0,0 +1 @@ +default_transport in server_config - Rust
pub fn default_transport() -> Transport
\ No newline at end of file diff --git a/server_config/fn.default_websocket_port.html b/server_config/fn.default_websocket_port.html new file mode 100644 index 0000000000..77c25f7465 --- /dev/null +++ b/server_config/fn.default_websocket_port.html @@ -0,0 +1 @@ +default_websocket_port in server_config - Rust
pub fn default_websocket_port() -> u16
\ No newline at end of file diff --git a/server_config/fn.default_worker_spell_period_sec.html b/server_config/fn.default_worker_spell_period_sec.html new file mode 100644 index 0000000000..7e1325e975 --- /dev/null +++ b/server_config/fn.default_worker_spell_period_sec.html @@ -0,0 +1 @@ +default_worker_spell_period_sec in server_config - Rust
pub fn default_worker_spell_period_sec() -> u32
\ No newline at end of file diff --git a/server_config/fn.default_workers_queue_buffer_size.html b/server_config/fn.default_workers_queue_buffer_size.html new file mode 100644 index 0000000000..6fb30e7287 --- /dev/null +++ b/server_config/fn.default_workers_queue_buffer_size.html @@ -0,0 +1 @@ +default_workers_queue_buffer_size in server_config - Rust
pub fn default_workers_queue_buffer_size() -> usize
\ No newline at end of file diff --git a/server_config/fn.ephemeral_dir.html b/server_config/fn.ephemeral_dir.html new file mode 100644 index 0000000000..6c66b53ba9 --- /dev/null +++ b/server_config/fn.ephemeral_dir.html @@ -0,0 +1 @@ +ephemeral_dir in server_config - Rust
pub fn ephemeral_dir(base_dir: &Path) -> PathBuf
\ No newline at end of file diff --git a/server_config/fn.load_config.html b/server_config/fn.load_config.html new file mode 100644 index 0000000000..81014e9580 --- /dev/null +++ b/server_config/fn.load_config.html @@ -0,0 +1,17 @@ +load_config in server_config - Rust

Function server_config::load_config

source ·
pub fn load_config(data: Option<ConfigData>) -> Result<UnresolvedConfig>
Expand description

Hierarchically loads the configuration using args and envs. +The source order is:

+
    +
  • Load and parse Config.toml from cwd, if exists
  • +
  • Load and parse files provided by FLUENCE_CONFIG env var
  • +
  • Load and parse files provided by –config arg
  • +
  • Load config values from env vars
  • +
  • Load config values from args (throw error on conflicts with env vars) +On each stage the values override the previous ones.
  • +
+

Arguments

+
    +
  • data: Optional ConfigData to customize the configuration.
  • +
+

Returns

+

Returns a Result containing the unresolved configuration or an Eyre error.

+
\ No newline at end of file diff --git a/server_config/fn.load_config_with_args.html b/server_config/fn.load_config_with_args.html new file mode 100644 index 0000000000..b138c3b43c --- /dev/null +++ b/server_config/fn.load_config_with_args.html @@ -0,0 +1,4 @@ +load_config_with_args in server_config - Rust
pub fn load_config_with_args(
+    raw_args: Vec<OsString>,
+    data: Option<ConfigData>
+) -> Result<UnresolvedConfig>
\ No newline at end of file diff --git a/server_config/fn.persistent_dir.html b/server_config/fn.persistent_dir.html new file mode 100644 index 0000000000..f781c5ea14 --- /dev/null +++ b/server_config/fn.persistent_dir.html @@ -0,0 +1 @@ +persistent_dir in server_config - Rust
pub fn persistent_dir(base_dir: &Path) -> PathBuf
\ No newline at end of file diff --git a/server_config/fn.services_dir.html b/server_config/fn.services_dir.html new file mode 100644 index 0000000000..24b0744a49 --- /dev/null +++ b/server_config/fn.services_dir.html @@ -0,0 +1 @@ +services_dir in server_config - Rust
pub fn services_dir(base_dir: &Path) -> PathBuf
\ No newline at end of file diff --git a/server_config/index.html b/server_config/index.html new file mode 100644 index 0000000000..401fc73d4e --- /dev/null +++ b/server_config/index.html @@ -0,0 +1,3 @@ +server_config - Rust

Crate server_config

source ·

Re-exports

Modules

Structs

Enums

Functions

\ No newline at end of file diff --git a/server_config/kademlia_config/struct.KademliaConfig.html b/server_config/kademlia_config/struct.KademliaConfig.html new file mode 100644 index 0000000000..a40a0d1ea2 --- /dev/null +++ b/server_config/kademlia_config/struct.KademliaConfig.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../server_config/struct.KademliaConfig.html...

+ + + \ No newline at end of file diff --git a/server_config/network_config/struct.NetworkConfig.html b/server_config/network_config/struct.NetworkConfig.html new file mode 100644 index 0000000000..c0b4a3b6a0 --- /dev/null +++ b/server_config/network_config/struct.NetworkConfig.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../server_config/struct.NetworkConfig.html...

+ + + \ No newline at end of file diff --git a/server_config/node_config/enum.Network.html b/server_config/node_config/enum.Network.html new file mode 100644 index 0000000000..6309997590 --- /dev/null +++ b/server_config/node_config/enum.Network.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../server_config/enum.Network.html...

+ + + \ No newline at end of file diff --git a/server_config/node_config/struct.ChainConfig.html b/server_config/node_config/struct.ChainConfig.html new file mode 100644 index 0000000000..95ee012338 --- /dev/null +++ b/server_config/node_config/struct.ChainConfig.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../server_config/struct.ChainConfig.html...

+ + + \ No newline at end of file diff --git a/server_config/node_config/struct.ChainListenerConfig.html b/server_config/node_config/struct.ChainListenerConfig.html new file mode 100644 index 0000000000..519c4d4071 --- /dev/null +++ b/server_config/node_config/struct.ChainListenerConfig.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../server_config/struct.ChainListenerConfig.html...

+ + + \ No newline at end of file diff --git a/server_config/node_config/struct.NodeConfig.html b/server_config/node_config/struct.NodeConfig.html new file mode 100644 index 0000000000..015aac0eab --- /dev/null +++ b/server_config/node_config/struct.NodeConfig.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../server_config/struct.NodeConfig.html...

+ + + \ No newline at end of file diff --git a/server_config/node_config/struct.TransportConfig.html b/server_config/node_config/struct.TransportConfig.html new file mode 100644 index 0000000000..1b3fc8df1e --- /dev/null +++ b/server_config/node_config/struct.TransportConfig.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../server_config/struct.TransportConfig.html...

+ + + \ No newline at end of file diff --git a/server_config/resolved_config/enum.TracingConfig.html b/server_config/resolved_config/enum.TracingConfig.html new file mode 100644 index 0000000000..c1a73b859e --- /dev/null +++ b/server_config/resolved_config/enum.TracingConfig.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../server_config/enum.TracingConfig.html...

+ + + \ No newline at end of file diff --git a/server_config/resolved_config/fn.load_config.html b/server_config/resolved_config/fn.load_config.html new file mode 100644 index 0000000000..8da036acdc --- /dev/null +++ b/server_config/resolved_config/fn.load_config.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../server_config/fn.load_config.html...

+ + + \ No newline at end of file diff --git a/server_config/resolved_config/fn.load_config_with_args.html b/server_config/resolved_config/fn.load_config_with_args.html new file mode 100644 index 0000000000..d3f80ae4c8 --- /dev/null +++ b/server_config/resolved_config/fn.load_config_with_args.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../server_config/fn.load_config_with_args.html...

+ + + \ No newline at end of file diff --git a/server_config/resolved_config/struct.ConfigData.html b/server_config/resolved_config/struct.ConfigData.html new file mode 100644 index 0000000000..d094c5df6e --- /dev/null +++ b/server_config/resolved_config/struct.ConfigData.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../server_config/struct.ConfigData.html...

+ + + \ No newline at end of file diff --git a/server_config/resolved_config/struct.ResolvedConfig.html b/server_config/resolved_config/struct.ResolvedConfig.html new file mode 100644 index 0000000000..ac354cc93c --- /dev/null +++ b/server_config/resolved_config/struct.ResolvedConfig.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../server_config/struct.ResolvedConfig.html...

+ + + \ No newline at end of file diff --git a/server_config/resolved_config/struct.UnresolvedConfig.html b/server_config/resolved_config/struct.UnresolvedConfig.html new file mode 100644 index 0000000000..5b2f4cd02e --- /dev/null +++ b/server_config/resolved_config/struct.UnresolvedConfig.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../server_config/struct.UnresolvedConfig.html...

+ + + \ No newline at end of file diff --git a/server_config/sidebar-items.js b/server_config/sidebar-items.js new file mode 100644 index 0000000000..fc04c583cc --- /dev/null +++ b/server_config/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["Network","TracingConfig"],"fn":["avm_base_dir","default_allowed_binaries","default_aquavm_pool_size","default_base_dir","default_binaries_mapping","default_bootstrap_frequency","default_bootstrap_nodes","default_builtins_keypair_path","default_connection_idle_timeout","default_cpus_range","default_curl_binary_path","default_decider_spell_period_sec","default_effectors","default_effects_queue_buffer_size","default_epoch_end_window","default_execution_timeout","default_health_check_enabled","default_http_port","default_ipfs_binary_path","default_ipfs_multiaddr","default_key_format","default_keypair_path","default_listen_ip","default_management_peer_id","default_max_batch_count","default_max_builtin_metrics_storage_size","default_max_established_per_peer_limit","default_max_proof_batch_size","default_max_spell_particle_ttl","default_metrics_enabled","default_min_batch_count","default_particle_processor_parallelism","default_particle_queue_buffer_size","default_processing_timeout","default_proof_poll_period","default_registry_expired_spell_period_sec","default_registry_renew_spell_period_sec","default_registry_replicate_spell_period_sec","default_registry_spell_period_sec","default_service_memory_limit","default_services_metrics_timer_resolution","default_socket_timeout","default_system_cpu_count","default_system_services","default_tcp_port","default_tokio_metrics_enabled","default_tokio_metrics_poll_histogram_enabled","default_transport","default_websocket_port","default_worker_spell_period_sec","default_workers_queue_buffer_size","ephemeral_dir","load_config","load_config_with_args","persistent_dir","services_dir"],"mod":["args","system_services_config"],"struct":["BootstrapConfig","ChainConfig","ChainListenerConfig","ConfigData","KademliaConfig","NetworkConfig","NodeConfig","ResolvedConfig","TransportConfig","UnresolvedConfig"]}; \ No newline at end of file diff --git a/server_config/struct.BootstrapConfig.html b/server_config/struct.BootstrapConfig.html new file mode 100644 index 0000000000..20dfcdfa95 --- /dev/null +++ b/server_config/struct.BootstrapConfig.html @@ -0,0 +1,44 @@ +BootstrapConfig in server_config - Rust
pub struct BootstrapConfig {
+    pub reconnect_delay: Duration,
+    pub bootstrap_delay: Duration,
+    pub bootstrap_max_delay: Duration,
+}

Fields§

§reconnect_delay: Duration§bootstrap_delay: Duration§bootstrap_max_delay: Duration

Implementations§

source§

impl BootstrapConfig

source

pub fn zero() -> BootstrapConfig

Creates config with all values to zero, so no delays. Useful for tests.

+

Trait Implementations§

source§

impl Clone for BootstrapConfig

source§

fn clone(&self) -> BootstrapConfig

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for BootstrapConfig

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for BootstrapConfig

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for BootstrapConfig

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Serialize for BootstrapConfig

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
source§

impl<T> DeserializeOwned for Twhere + T: for<'de> Deserialize<'de>,

\ No newline at end of file diff --git a/server_config/struct.ChainConfig.html b/server_config/struct.ChainConfig.html new file mode 100644 index 0000000000..5b73f09d0a --- /dev/null +++ b/server_config/struct.ChainConfig.html @@ -0,0 +1,48 @@ +ChainConfig in server_config - Rust
pub struct ChainConfig {
+    pub http_endpoint: String,
+    pub diamond_contract_address: String,
+    pub network_id: u64,
+    pub wallet_key: PrivateKey,
+    pub default_base_fee: Option<u64>,
+    pub default_priority_fee: Option<u64>,
+}

Fields§

§http_endpoint: String§diamond_contract_address: String§network_id: u64§wallet_key: PrivateKey§default_base_fee: Option<u64>

If none, comes from the chain

+
§default_priority_fee: Option<u64>

If none, comes from the chain

+

Trait Implementations§

source§

impl Clone for ChainConfig

source§

fn clone(&self) -> ChainConfig

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ChainConfig

source§

fn fmt(&self, __f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for ChainConfig

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Serialize for ChainConfig

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
source§

impl<T> DeserializeOwned for Twhere + T: for<'de> Deserialize<'de>,

\ No newline at end of file diff --git a/server_config/struct.ChainListenerConfig.html b/server_config/struct.ChainListenerConfig.html new file mode 100644 index 0000000000..f628f6f5f1 --- /dev/null +++ b/server_config/struct.ChainListenerConfig.html @@ -0,0 +1,52 @@ +ChainListenerConfig in server_config - Rust
pub struct ChainListenerConfig {
+    pub ws_endpoint: String,
+    pub ccp_endpoint: Option<String>,
+    pub proof_poll_period: Duration,
+    pub min_batch_count: usize,
+    pub max_batch_count: usize,
+    pub max_proof_batch_size: usize,
+    pub epoch_end_window: Duration,
+}

Fields§

§ws_endpoint: String§ccp_endpoint: Option<String>§proof_poll_period: Duration

How often to poll proofs

+
§min_batch_count: usize

Min number of proofs in a batch for CU to be sent on chain

+
§max_batch_count: usize

Max number of proofs in a batch for CU to be sent on chain

+
§max_proof_batch_size: usize

Max number of proofs batches to be sent on chain

+
§epoch_end_window: Duration

Defined how much time before epoch end to send all found proofs in any batches

+

Trait Implementations§

source§

impl Clone for ChainListenerConfig

source§

fn clone(&self) -> ChainListenerConfig

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ChainListenerConfig

source§

fn fmt(&self, __f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for ChainListenerConfig

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Serialize for ChainListenerConfig

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
source§

impl<T> DeserializeOwned for Twhere + T: for<'de> Deserialize<'de>,

\ No newline at end of file diff --git a/server_config/struct.ConfigData.html b/server_config/struct.ConfigData.html new file mode 100644 index 0000000000..b4da4e249d --- /dev/null +++ b/server_config/struct.ConfigData.html @@ -0,0 +1,40 @@ +ConfigData in server_config - Rust
pub struct ConfigData {
+    pub binary_name: String,
+    pub version: String,
+    pub authors: String,
+    pub description: String,
+}

Fields§

§binary_name: String§version: String§authors: String§description: String

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/server_config/struct.KademliaConfig.html b/server_config/struct.KademliaConfig.html new file mode 100644 index 0000000000..060b288b5e --- /dev/null +++ b/server_config/struct.KademliaConfig.html @@ -0,0 +1,47 @@ +KademliaConfig in server_config - Rust
pub struct KademliaConfig {
+    pub max_packet_size: Option<usize>,
+    pub query_timeout: Duration,
+    pub replication_factor: Option<usize>,
+    pub peer_fail_threshold: usize,
+    pub ban_cooldown: Duration,
+    pub protocol_name: StreamProtocol,
+}
Expand description

see libp2p_kad::KademliaConfig

+

Fields§

§max_packet_size: Option<usize>§query_timeout: Duration§replication_factor: Option<usize>§peer_fail_threshold: usize

Number of times peer is failed to be discovered before it is banned

+
§ban_cooldown: Duration

Period after which peer ban is lifted

+
§protocol_name: StreamProtocol

Trait Implementations§

source§

impl Clone for KademliaConfig

source§

fn clone(&self) -> KademliaConfig

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for KademliaConfig

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Serialize for KademliaConfig

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/server_config/struct.NetworkConfig.html b/server_config/struct.NetworkConfig.html new file mode 100644 index 0000000000..edcff9e2f2 --- /dev/null +++ b/server_config/struct.NetworkConfig.html @@ -0,0 +1,58 @@ +NetworkConfig in server_config - Rust
pub struct NetworkConfig {
Show 14 fields + pub key_pair: Keypair, + pub local_peer_id: PeerId, + pub node_version: &'static str, + pub bootstrap_nodes: Vec<Multiaddr>, + pub bootstrap: BootstrapConfig, + pub libp2p_metrics: Option<Arc<Metrics>>, + pub protocol_config: ProtocolConfig, + pub kademlia_config: KademliaConfig, + pub particle_queue_buffer: usize, + pub bootstrap_frequency: usize, + pub connectivity_metrics: Option<ConnectivityMetrics>, + pub connection_pool_metrics: Option<ConnectionPoolMetrics>, + pub connection_limits: ConnectionLimits, + pub connection_idle_timeout: Duration, +
}

Fields§

§key_pair: Keypair§local_peer_id: PeerId§node_version: &'static str§bootstrap_nodes: Vec<Multiaddr>§bootstrap: BootstrapConfig§libp2p_metrics: Option<Arc<Metrics>>§protocol_config: ProtocolConfig§kademlia_config: KademliaConfig§particle_queue_buffer: usize§bootstrap_frequency: usize§connectivity_metrics: Option<ConnectivityMetrics>§connection_pool_metrics: Option<ConnectionPoolMetrics>§connection_limits: ConnectionLimits§connection_idle_timeout: Duration

Implementations§

source§

impl NetworkConfig

source

pub fn new( + libp2p_metrics: Option<Arc<Metrics>>, + connectivity_metrics: Option<ConnectivityMetrics>, + connection_pool_metrics: Option<ConnectionPoolMetrics>, + key_pair: Keypair, + config: &ResolvedConfig, + node_version: &'static str, + connection_limits: ConnectionLimits +) -> Self

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/server_config/struct.NodeConfig.html b/server_config/struct.NodeConfig.html new file mode 100644 index 0000000000..4ba337fb2d --- /dev/null +++ b/server_config/struct.NodeConfig.html @@ -0,0 +1,81 @@ +NodeConfig in server_config - Rust
pub struct NodeConfig {
Show 37 fields + pub cpus_range: CoreRange, + pub system_cpu_count: usize, + pub root_key_pair: KeyPair, + pub builtins_key_pair: KeyPair, + pub transport_config: TransportConfig, + pub listen_config: ListenConfig, + pub bootstrap_nodes: Vec<Multiaddr>, + pub external_address: Option<IpAddr>, + pub external_multiaddresses: Vec<Multiaddr>, + pub metrics_config: MetricsConfig, + pub health_config: HealthConfig, + pub bootstrap_config: BootstrapConfig, + pub root_weights: HashMap<PeerIdSerializable, u32>, + pub services_envs: HashMap<String, String>, + pub protocol_config: ProtocolConfig, + pub aquavm_pool_size: usize, + pub default_service_memory_limit: Option<ByteSize>, + pub avm_config: AVMConfig, + pub kademlia: KademliaConfig, + pub particle_queue_buffer: usize, + pub effects_queue_buffer: usize, + pub workers_queue_buffer: usize, + pub particle_processor_parallelism: Option<usize>, + pub max_spell_particle_ttl: Duration, + pub bootstrap_frequency: usize, + pub allow_local_addresses: bool, + pub particle_execution_timeout: Duration, + pub management_peer_id: PeerId, + pub allowed_effectors: HashMap<Hash, HashMap<String, PathBuf>>, + pub dev_mode_config: DevModeConfig, + pub system_services: SystemServicesConfig, + pub http_config: Option<HttpConfig>, + pub chain_config: Option<ChainConfig>, + pub chain_listener_config: Option<ChainListenerConfig>, + pub services: ServicesConfig, + pub network: Network, + pub vm: Option<VmConfig>, +
}

Fields§

§cpus_range: CoreRange§system_cpu_count: usize§root_key_pair: KeyPair§builtins_key_pair: KeyPair§transport_config: TransportConfig§listen_config: ListenConfig§bootstrap_nodes: Vec<Multiaddr>

Bootstrap nodes to join to the Fluence network

+
§external_address: Option<IpAddr>

External address to advertise via identify protocol

+
§external_multiaddresses: Vec<Multiaddr>

External multiaddresses to advertise; more flexible that IpAddr

+
§metrics_config: MetricsConfig§health_config: HealthConfig§bootstrap_config: BootstrapConfig§root_weights: HashMap<PeerIdSerializable, u32>§services_envs: HashMap<String, String>§protocol_config: ProtocolConfig§aquavm_pool_size: usize

Number of AVMs to create. By default, num_cpus::get() * 2 is used

+
§default_service_memory_limit: Option<ByteSize>

Default heap size in bytes available for a WASM service unless otherwise specified.

+
§avm_config: AVMConfig

These are the AquaVM limits that are used by the AquaVM limit check.

+
§kademlia: KademliaConfig§particle_queue_buffer: usize§effects_queue_buffer: usize§workers_queue_buffer: usize§particle_processor_parallelism: Option<usize>§max_spell_particle_ttl: Duration§bootstrap_frequency: usize§allow_local_addresses: bool§particle_execution_timeout: Duration§management_peer_id: PeerId§allowed_effectors: HashMap<Hash, HashMap<String, PathBuf>>§dev_mode_config: DevModeConfig§system_services: SystemServicesConfig§http_config: Option<HttpConfig>§chain_config: Option<ChainConfig>§chain_listener_config: Option<ChainListenerConfig>§services: ServicesConfig§network: Network§vm: Option<VmConfig>

Trait Implementations§

source§

impl Clone for NodeConfig

source§

fn clone(&self) -> NodeConfig

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for NodeConfig

source§

fn fmt(&self, __f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Serialize for NodeConfig

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/server_config/struct.ResolvedConfig.html b/server_config/struct.ResolvedConfig.html new file mode 100644 index 0000000000..14e1d68f1d --- /dev/null +++ b/server_config/struct.ResolvedConfig.html @@ -0,0 +1,40 @@ +ResolvedConfig in server_config - Rust
pub struct ResolvedConfig {
+    pub dir_config: ResolvedDirConfig,
+    pub node_config: NodeConfig,
+}

Fields§

§dir_config: ResolvedDirConfig§node_config: NodeConfig

Implementations§

source§

impl ResolvedConfig

source

pub fn external_addresses(&self) -> Vec<Multiaddr>

source

pub fn http_listen_addr(&self) -> Option<SocketAddr>

source

pub fn listen_multiaddrs(&self) -> Vec<Multiaddr>

Trait Implementations§

source§

impl Clone for ResolvedConfig

source§

fn clone(&self) -> ResolvedConfig

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ResolvedConfig

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Deref for ResolvedConfig

§

type Target = NodeConfig

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl DerefMut for ResolvedConfig

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
source§

impl Serialize for ResolvedConfig

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/server_config/struct.TransportConfig.html b/server_config/struct.TransportConfig.html new file mode 100644 index 0000000000..d4d53c4803 --- /dev/null +++ b/server_config/struct.TransportConfig.html @@ -0,0 +1,50 @@ +TransportConfig in server_config - Rust
pub struct TransportConfig {
+    pub transport: Transport,
+    pub socket_timeout: Duration,
+    pub max_pending_incoming: Option<u32>,
+    pub max_pending_outgoing: Option<u32>,
+    pub max_established_incoming: Option<u32>,
+    pub max_established_outgoing: Option<u32>,
+    pub max_established_per_peer: Option<u32>,
+    pub max_established: Option<u32>,
+    pub connection_idle_timeout: Duration,
+}

Fields§

§transport: Transport§socket_timeout: Duration

Socket timeout for main transport

+
§max_pending_incoming: Option<u32>§max_pending_outgoing: Option<u32>§max_established_incoming: Option<u32>§max_established_outgoing: Option<u32>§max_established_per_peer: Option<u32>§max_established: Option<u32>§connection_idle_timeout: Duration

Trait Implementations§

source§

impl Clone for TransportConfig

source§

fn clone(&self) -> TransportConfig

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for TransportConfig

source§

fn fmt(&self, __f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for TransportConfig

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Serialize for TransportConfig

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Copy for TransportConfig

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
source§

impl<T> DeserializeOwned for Twhere + T: for<'de> Deserialize<'de>,

\ No newline at end of file diff --git a/server_config/struct.UnresolvedConfig.html b/server_config/struct.UnresolvedConfig.html new file mode 100644 index 0000000000..faba271659 --- /dev/null +++ b/server_config/struct.UnresolvedConfig.html @@ -0,0 +1,45 @@ +UnresolvedConfig in server_config - Rust
pub struct UnresolvedConfig {
+    pub node_config: UnresolvedNodeConfig,
+    pub tracing: Option<TracingConfig>,
+    pub no_banner: Option<bool>,
+    pub print_config: Option<bool>,
+    /* private fields */
+}

Fields§

§node_config: UnresolvedNodeConfig§tracing: Option<TracingConfig>§no_banner: Option<bool>§print_config: Option<bool>

Implementations§

Trait Implementations§

source§

impl Clone for UnresolvedConfig

source§

fn clone(&self) -> UnresolvedConfig

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for UnresolvedConfig

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for UnresolvedConfig

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Serialize for UnresolvedConfig

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
source§

impl<T> DeserializeOwned for Twhere + T: for<'de> Deserialize<'de>,

\ No newline at end of file diff --git a/server_config/system_services_config/enum.ServiceKey.html b/server_config/system_services_config/enum.ServiceKey.html new file mode 100644 index 0000000000..b81e814617 --- /dev/null +++ b/server_config/system_services_config/enum.ServiceKey.html @@ -0,0 +1,60 @@ +ServiceKey in server_config::system_services_config - Rust
pub enum ServiceKey {
+    AquaIpfs,
+    TrustGraph,
+    Registry,
+    Decider,
+}

Variants§

§

AquaIpfs

§

TrustGraph

§

Registry

§

Decider

Implementations§

Trait Implementations§

source§

impl Clone for ServiceKey

source§

fn clone(&self) -> ServiceKey

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ServiceKey

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for ServiceKey

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Display for ServiceKey

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Hash for ServiceKey

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for ServiceKey

source§

fn eq(&self, other: &ServiceKey) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Serialize for ServiceKey

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Eq for ServiceKey

source§

impl StructuralEq for ServiceKey

source§

impl StructuralPartialEq for ServiceKey

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> CallHasher for Twhere + T: Hash + ?Sized,

§

default fn get_hash<H, B>(value: &H, build_hasher: &B) -> u64where + H: Hash + ?Sized, + B: BuildHasher,

§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
source§

impl<T> DeserializeOwned for Twhere + T: for<'de> Deserialize<'de>,

\ No newline at end of file diff --git a/server_config/system_services_config/index.html b/server_config/system_services_config/index.html new file mode 100644 index 0000000000..8e722c37c1 --- /dev/null +++ b/server_config/system_services_config/index.html @@ -0,0 +1 @@ +server_config::system_services_config - Rust

Structs

Enums

\ No newline at end of file diff --git a/server_config/system_services_config/sidebar-items.js b/server_config/system_services_config/sidebar-items.js new file mode 100644 index 0000000000..2064d62624 --- /dev/null +++ b/server_config/system_services_config/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["ServiceKey"],"struct":["AquaIpfsConfig","ConnectorConfig","DeciderConfig","RegistryConfig","SystemServicesConfig"]}; \ No newline at end of file diff --git a/server_config/system_services_config/struct.AquaIpfsConfig.html b/server_config/system_services_config/struct.AquaIpfsConfig.html new file mode 100644 index 0000000000..4e311c61d4 --- /dev/null +++ b/server_config/system_services_config/struct.AquaIpfsConfig.html @@ -0,0 +1,43 @@ +AquaIpfsConfig in server_config::system_services_config - Rust
pub struct AquaIpfsConfig {
+    pub external_api_multiaddr: String,
+    pub local_api_multiaddr: String,
+    pub ipfs_binary_path: PathBuf,
+}

Fields§

§external_api_multiaddr: String§local_api_multiaddr: String§ipfs_binary_path: PathBuf

Trait Implementations§

source§

impl Clone for AquaIpfsConfig

source§

fn clone(&self) -> AquaIpfsConfig

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for AquaIpfsConfig

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for AquaIpfsConfig

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for AquaIpfsConfig

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Serialize for AquaIpfsConfig

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
source§

impl<T> DeserializeOwned for Twhere + T: for<'de> Deserialize<'de>,

\ No newline at end of file diff --git a/server_config/system_services_config/struct.ConnectorConfig.html b/server_config/system_services_config/struct.ConnectorConfig.html new file mode 100644 index 0000000000..329b8aacc8 --- /dev/null +++ b/server_config/system_services_config/struct.ConnectorConfig.html @@ -0,0 +1,41 @@ +ConnectorConfig in server_config::system_services_config - Rust
pub struct ConnectorConfig {
+    pub curl_binary_path: PathBuf,
+}

Fields§

§curl_binary_path: PathBuf

Trait Implementations§

source§

impl Clone for ConnectorConfig

source§

fn clone(&self) -> ConnectorConfig

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ConnectorConfig

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for ConnectorConfig

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for ConnectorConfig

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Serialize for ConnectorConfig

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
source§

impl<T> DeserializeOwned for Twhere + T: for<'de> Deserialize<'de>,

\ No newline at end of file diff --git a/server_config/system_services_config/struct.DeciderConfig.html b/server_config/system_services_config/struct.DeciderConfig.html new file mode 100644 index 0000000000..e2b31641df --- /dev/null +++ b/server_config/system_services_config/struct.DeciderConfig.html @@ -0,0 +1,43 @@ +DeciderConfig in server_config::system_services_config - Rust
pub struct DeciderConfig {
+    pub decider_period_sec: u32,
+    pub worker_period_sec: u32,
+    pub worker_ipfs_multiaddr: String,
+}

Fields§

§decider_period_sec: u32§worker_period_sec: u32§worker_ipfs_multiaddr: String

Trait Implementations§

source§

impl Clone for DeciderConfig

source§

fn clone(&self) -> DeciderConfig

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for DeciderConfig

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for DeciderConfig

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for DeciderConfig

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Serialize for DeciderConfig

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
source§

impl<T> DeserializeOwned for Twhere + T: for<'de> Deserialize<'de>,

\ No newline at end of file diff --git a/server_config/system_services_config/struct.RegistryConfig.html b/server_config/system_services_config/struct.RegistryConfig.html new file mode 100644 index 0000000000..ac6341e72c --- /dev/null +++ b/server_config/system_services_config/struct.RegistryConfig.html @@ -0,0 +1,44 @@ +RegistryConfig in server_config::system_services_config - Rust
pub struct RegistryConfig {
+    pub registry_period_sec: u32,
+    pub expired_period_sec: u32,
+    pub renew_period_sec: u32,
+    pub replicate_period_sec: u32,
+}

Fields§

§registry_period_sec: u32§expired_period_sec: u32§renew_period_sec: u32§replicate_period_sec: u32

Trait Implementations§

source§

impl Clone for RegistryConfig

source§

fn clone(&self) -> RegistryConfig

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for RegistryConfig

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for RegistryConfig

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for RegistryConfig

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Serialize for RegistryConfig

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
source§

impl<T> DeserializeOwned for Twhere + T: for<'de> Deserialize<'de>,

\ No newline at end of file diff --git a/server_config/system_services_config/struct.SystemServicesConfig.html b/server_config/system_services_config/struct.SystemServicesConfig.html new file mode 100644 index 0000000000..e01b3f1bf1 --- /dev/null +++ b/server_config/system_services_config/struct.SystemServicesConfig.html @@ -0,0 +1,45 @@ +SystemServicesConfig in server_config::system_services_config - Rust
pub struct SystemServicesConfig {
+    pub enable: Vec<ServiceKey>,
+    pub aqua_ipfs: AquaIpfsConfig,
+    pub decider: DeciderConfig,
+    pub registry: RegistryConfig,
+    pub connector: ConnectorConfig,
+}

Fields§

§enable: Vec<ServiceKey>§aqua_ipfs: AquaIpfsConfig§decider: DeciderConfig§registry: RegistryConfig§connector: ConnectorConfig

Trait Implementations§

source§

impl Clone for SystemServicesConfig

source§

fn clone(&self) -> SystemServicesConfig

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for SystemServicesConfig

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for SystemServicesConfig

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for SystemServicesConfig

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Serialize for SystemServicesConfig

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
source§

impl<T> DeserializeOwned for Twhere + T: for<'de> Deserialize<'de>,

\ No newline at end of file diff --git a/service_modules/all.html b/service_modules/all.html new file mode 100644 index 0000000000..6a8d4250f6 --- /dev/null +++ b/service_modules/all.html @@ -0,0 +1 @@ +List of all items in this crate

List of all items

Structs

Functions

\ No newline at end of file diff --git a/service_modules/fn.blueprint_file_name.html b/service_modules/fn.blueprint_file_name.html new file mode 100644 index 0000000000..cb0977f50a --- /dev/null +++ b/service_modules/fn.blueprint_file_name.html @@ -0,0 +1,2 @@ +blueprint_file_name in service_modules - Rust
pub fn blueprint_file_name(blueprint: &Blueprint) -> String
Expand description

Calculates filename of the blueprint

+
\ No newline at end of file diff --git a/service_modules/fn.blueprint_fname.html b/service_modules/fn.blueprint_fname.html new file mode 100644 index 0000000000..b5320aa146 --- /dev/null +++ b/service_modules/fn.blueprint_fname.html @@ -0,0 +1 @@ +blueprint_fname in service_modules - Rust
pub fn blueprint_fname(id: &str) -> String
\ No newline at end of file diff --git a/service_modules/fn.extract_module_file_name.html b/service_modules/fn.extract_module_file_name.html new file mode 100644 index 0000000000..7280851f2b --- /dev/null +++ b/service_modules/fn.extract_module_file_name.html @@ -0,0 +1,2 @@ +extract_module_file_name in service_modules - Rust
pub fn extract_module_file_name(path: &Path) -> Option<&str>
Expand description

Return file name with .wasm extension stripped. None if extension wasn’t .wasm

+
\ No newline at end of file diff --git a/service_modules/fn.is_blueprint.html b/service_modules/fn.is_blueprint.html new file mode 100644 index 0000000000..c9ece25dee --- /dev/null +++ b/service_modules/fn.is_blueprint.html @@ -0,0 +1,2 @@ +is_blueprint in service_modules - Rust
pub fn is_blueprint(name: &str) -> bool
Expand description

Returns true if file is named like a blueprint would be

+
\ No newline at end of file diff --git a/service_modules/fn.is_module_wasm.html b/service_modules/fn.is_module_wasm.html new file mode 100644 index 0000000000..5c65c537f6 --- /dev/null +++ b/service_modules/fn.is_module_wasm.html @@ -0,0 +1 @@ +is_module_wasm in service_modules - Rust
pub fn is_module_wasm(path: &Path) -> bool
\ No newline at end of file diff --git a/service_modules/fn.is_service.html b/service_modules/fn.is_service.html new file mode 100644 index 0000000000..55215663e0 --- /dev/null +++ b/service_modules/fn.is_service.html @@ -0,0 +1 @@ +is_service in service_modules - Rust
pub fn is_service(path: &Path) -> bool
\ No newline at end of file diff --git a/service_modules/fn.load_module.html b/service_modules/fn.load_module.html new file mode 100644 index 0000000000..a34a7b0ca7 --- /dev/null +++ b/service_modules/fn.load_module.html @@ -0,0 +1,4 @@ +load_module in service_modules - Rust
pub fn load_module(
+    path: &str,
+    module_name: impl Into<String>
+) -> Result<Vec<u8>>
\ No newline at end of file diff --git a/service_modules/fn.module_config.html b/service_modules/fn.module_config.html new file mode 100644 index 0000000000..756b501fba --- /dev/null +++ b/service_modules/fn.module_config.html @@ -0,0 +1 @@ +module_config in service_modules - Rust
pub fn module_config(import_name: &str) -> Value
\ No newline at end of file diff --git a/service_modules/fn.module_config_name_hash.html b/service_modules/fn.module_config_name_hash.html new file mode 100644 index 0000000000..22dbde518e --- /dev/null +++ b/service_modules/fn.module_config_name_hash.html @@ -0,0 +1,2 @@ +module_config_name_hash in service_modules - Rust
pub fn module_config_name_hash(config_hash: &Hash) -> String
Expand description

Calculates filename of the config for a wasm module

+
\ No newline at end of file diff --git a/service_modules/fn.module_config_name_json.html b/service_modules/fn.module_config_name_json.html new file mode 100644 index 0000000000..df18e212cc --- /dev/null +++ b/service_modules/fn.module_config_name_json.html @@ -0,0 +1,2 @@ +module_config_name_json in service_modules - Rust
pub fn module_config_name_json(hash: &Hash) -> String
Expand description

Calculates filename of the config for a wasm module, given a hash or name of the module.

+
\ No newline at end of file diff --git a/service_modules/fn.module_file_name.html b/service_modules/fn.module_file_name.html new file mode 100644 index 0000000000..dcd8ca295c --- /dev/null +++ b/service_modules/fn.module_file_name.html @@ -0,0 +1,2 @@ +module_file_name in service_modules - Rust
pub fn module_file_name(name: &str) -> String
Expand description

Calculates the name of a wasm module file, given a hash or name of the module.

+
\ No newline at end of file diff --git a/service_modules/fn.module_file_name_hash.html b/service_modules/fn.module_file_name_hash.html new file mode 100644 index 0000000000..6cc103ffb2 --- /dev/null +++ b/service_modules/fn.module_file_name_hash.html @@ -0,0 +1,2 @@ +module_file_name_hash in service_modules - Rust
pub fn module_file_name_hash(module_hash: &Hash) -> String
Expand description

Calculates the name of a wasm module file, given a hash of the module.

+
\ No newline at end of file diff --git a/service_modules/fn.service_file_name.html b/service_modules/fn.service_file_name.html new file mode 100644 index 0000000000..a218987ddb --- /dev/null +++ b/service_modules/fn.service_file_name.html @@ -0,0 +1 @@ +service_file_name in service_modules - Rust
pub fn service_file_name(service_id: &str) -> String
\ No newline at end of file diff --git a/service_modules/index.html b/service_modules/index.html new file mode 100644 index 0000000000..72a86dfe52 --- /dev/null +++ b/service_modules/index.html @@ -0,0 +1,2 @@ +service_modules - Rust

Crate service_modules

source ·

Structs

Functions

\ No newline at end of file diff --git a/service_modules/modules/blueprint/struct.AddBlueprint.html b/service_modules/modules/blueprint/struct.AddBlueprint.html new file mode 100644 index 0000000000..7fa06a7998 --- /dev/null +++ b/service_modules/modules/blueprint/struct.AddBlueprint.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../service_modules/struct.AddBlueprint.html...

+ + + \ No newline at end of file diff --git a/service_modules/modules/blueprint/struct.Blueprint.html b/service_modules/modules/blueprint/struct.Blueprint.html new file mode 100644 index 0000000000..ea431ce558 --- /dev/null +++ b/service_modules/modules/blueprint/struct.Blueprint.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../service_modules/struct.Blueprint.html...

+ + + \ No newline at end of file diff --git a/service_modules/modules/file_names/fn.blueprint_file_name.html b/service_modules/modules/file_names/fn.blueprint_file_name.html new file mode 100644 index 0000000000..0539e12ce0 --- /dev/null +++ b/service_modules/modules/file_names/fn.blueprint_file_name.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../service_modules/fn.blueprint_file_name.html...

+ + + \ No newline at end of file diff --git a/service_modules/modules/file_names/fn.blueprint_fname.html b/service_modules/modules/file_names/fn.blueprint_fname.html new file mode 100644 index 0000000000..5eb3a21047 --- /dev/null +++ b/service_modules/modules/file_names/fn.blueprint_fname.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../service_modules/fn.blueprint_fname.html...

+ + + \ No newline at end of file diff --git a/service_modules/modules/file_names/fn.extract_module_file_name.html b/service_modules/modules/file_names/fn.extract_module_file_name.html new file mode 100644 index 0000000000..96f3693b9e --- /dev/null +++ b/service_modules/modules/file_names/fn.extract_module_file_name.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../service_modules/fn.extract_module_file_name.html...

+ + + \ No newline at end of file diff --git a/service_modules/modules/file_names/fn.is_blueprint.html b/service_modules/modules/file_names/fn.is_blueprint.html new file mode 100644 index 0000000000..b132e079a5 --- /dev/null +++ b/service_modules/modules/file_names/fn.is_blueprint.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../service_modules/fn.is_blueprint.html...

+ + + \ No newline at end of file diff --git a/service_modules/modules/file_names/fn.is_module_wasm.html b/service_modules/modules/file_names/fn.is_module_wasm.html new file mode 100644 index 0000000000..d86bac8142 --- /dev/null +++ b/service_modules/modules/file_names/fn.is_module_wasm.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../service_modules/fn.is_module_wasm.html...

+ + + \ No newline at end of file diff --git a/service_modules/modules/file_names/fn.is_service.html b/service_modules/modules/file_names/fn.is_service.html new file mode 100644 index 0000000000..ec25e11463 --- /dev/null +++ b/service_modules/modules/file_names/fn.is_service.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../service_modules/fn.is_service.html...

+ + + \ No newline at end of file diff --git a/service_modules/modules/file_names/fn.module_config_name_hash.html b/service_modules/modules/file_names/fn.module_config_name_hash.html new file mode 100644 index 0000000000..bfc4d19f80 --- /dev/null +++ b/service_modules/modules/file_names/fn.module_config_name_hash.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../service_modules/fn.module_config_name_hash.html...

+ + + \ No newline at end of file diff --git a/service_modules/modules/file_names/fn.module_config_name_json.html b/service_modules/modules/file_names/fn.module_config_name_json.html new file mode 100644 index 0000000000..f71623ce53 --- /dev/null +++ b/service_modules/modules/file_names/fn.module_config_name_json.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../service_modules/fn.module_config_name_json.html...

+ + + \ No newline at end of file diff --git a/service_modules/modules/file_names/fn.module_file_name.html b/service_modules/modules/file_names/fn.module_file_name.html new file mode 100644 index 0000000000..bb0e000801 --- /dev/null +++ b/service_modules/modules/file_names/fn.module_file_name.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../service_modules/fn.module_file_name.html...

+ + + \ No newline at end of file diff --git a/service_modules/modules/file_names/fn.module_file_name_hash.html b/service_modules/modules/file_names/fn.module_file_name_hash.html new file mode 100644 index 0000000000..7d2c41c4a2 --- /dev/null +++ b/service_modules/modules/file_names/fn.module_file_name_hash.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../service_modules/fn.module_file_name_hash.html...

+ + + \ No newline at end of file diff --git a/service_modules/modules/file_names/fn.service_file_name.html b/service_modules/modules/file_names/fn.service_file_name.html new file mode 100644 index 0000000000..5b135cf649 --- /dev/null +++ b/service_modules/modules/file_names/fn.service_file_name.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../service_modules/fn.service_file_name.html...

+ + + \ No newline at end of file diff --git a/service_modules/modules/fixture/fn.load_module.html b/service_modules/modules/fixture/fn.load_module.html new file mode 100644 index 0000000000..d3b41f1df3 --- /dev/null +++ b/service_modules/modules/fixture/fn.load_module.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../service_modules/fn.load_module.html...

+ + + \ No newline at end of file diff --git a/service_modules/modules/fixture/fn.module_config.html b/service_modules/modules/fixture/fn.module_config.html new file mode 100644 index 0000000000..dc16075c36 --- /dev/null +++ b/service_modules/modules/fixture/fn.module_config.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../service_modules/fn.module_config.html...

+ + + \ No newline at end of file diff --git a/service_modules/sidebar-items.js b/service_modules/sidebar-items.js new file mode 100644 index 0000000000..1e6044f8ae --- /dev/null +++ b/service_modules/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"fn":["blueprint_file_name","blueprint_fname","extract_module_file_name","is_blueprint","is_module_wasm","is_service","load_module","module_config","module_config_name_hash","module_config_name_json","module_file_name","module_file_name_hash","service_file_name"],"struct":["AddBlueprint","Blueprint","Hash"]}; \ No newline at end of file diff --git a/service_modules/struct.AddBlueprint.html b/service_modules/struct.AddBlueprint.html new file mode 100644 index 0000000000..db9e498af6 --- /dev/null +++ b/service_modules/struct.AddBlueprint.html @@ -0,0 +1,23 @@ +AddBlueprint in service_modules - Rust
pub struct AddBlueprint {
+    pub name: String,
+    pub dependencies: Vec<Hash>,
+}

Fields§

§name: String§dependencies: Vec<Hash>

Implementations§

source§

impl AddBlueprint

source

pub fn new(name: String, dependencies: Vec<Hash>) -> Self

source

pub fn get_ipld(&self) -> Ipld

source

pub fn encode(&self) -> Result<Vec<u8>>

encode IPLD object with DAG JSON codec

+
source

pub fn to_string(&self) -> Result<String>

source

pub fn decode(data: &[u8]) -> Result<Self>

Trait Implementations§

source§

impl Clone for AddBlueprint

source§

fn clone(&self) -> AddBlueprint

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for AddBlueprint

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/service_modules/struct.Blueprint.html b/service_modules/struct.Blueprint.html new file mode 100644 index 0000000000..9c76d92a72 --- /dev/null +++ b/service_modules/struct.Blueprint.html @@ -0,0 +1,26 @@ +Blueprint in service_modules - Rust
pub struct Blueprint {
+    pub name: String,
+    pub id: String,
+    pub dependencies: Vec<Hash>,
+}

Fields§

§name: String§id: String§dependencies: Vec<Hash>

Implementations§

source§

impl Blueprint

source

pub fn new(add_blueprint: AddBlueprint) -> Result<Self>

source

pub fn get_facade_module(&self) -> Option<Hash>

Trait Implementations§

source§

impl Clone for Blueprint

source§

fn clone(&self) -> Blueprint

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Blueprint

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for Blueprint

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Serialize for Blueprint

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
source§

impl<T> DeserializeOwned for Twhere + T: for<'de> Deserialize<'de>,

\ No newline at end of file diff --git a/service_modules/struct.Hash.html b/service_modules/struct.Hash.html new file mode 100644 index 0000000000..4769f14889 --- /dev/null +++ b/service_modules/struct.Hash.html @@ -0,0 +1,37 @@ +Hash in service_modules - Rust

Struct service_modules::Hash

pub struct Hash(pub Cid<64>);

Tuple Fields§

§0: Cid<64>

Implementations§

§

impl Hash

pub fn new(bytes: &[u8]) -> Result<Hash, Report>

pub fn as_bytes(&self) -> Vec<u8>

pub fn from_string(s: &str) -> Result<Hash, Error>

Trait Implementations§

§

impl Clone for Hash

§

fn clone(&self) -> Hash

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for Hash

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl<'de> Deserialize<'de> for Hash

§

fn deserialize<D>( + deserializer: D +) -> Result<Hash, <D as Deserializer<'de>>::Error>where + D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
§

impl Display for Hash

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Hash for Hash

§

fn hash<__H>(&self, state: &mut __H)where + __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
§

impl PartialEq for Hash

§

fn eq(&self, other: &Hash) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
§

impl Serialize for Hash

§

fn serialize<S>( + &self, + s: S +) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where + S: Serializer,

Serialize this value into the given Serde serializer. Read more
§

impl Eq for Hash

§

impl StructuralEq for Hash

§

impl StructuralPartialEq for Hash

Auto Trait Implementations§

§

impl RefUnwindSafe for Hash

§

impl Send for Hash

§

impl Sync for Hash

§

impl Unpin for Hash

§

impl UnwindSafe for Hash

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
source§

impl<T> DeserializeOwned for Twhere + T: for<'de> Deserialize<'de>,

\ No newline at end of file diff --git a/settings.html b/settings.html new file mode 100644 index 0000000000..dbfe5352c9 --- /dev/null +++ b/settings.html @@ -0,0 +1 @@ +Settings

Rustdoc settings

Back
\ No newline at end of file diff --git a/sorcerer/all.html b/sorcerer/all.html new file mode 100644 index 0000000000..fb06352960 --- /dev/null +++ b/sorcerer/all.html @@ -0,0 +1 @@ +List of all items in this crate

List of all items

Structs

Functions

\ No newline at end of file diff --git a/sorcerer/fn.get_spell_info.html b/sorcerer/fn.get_spell_info.html new file mode 100644 index 0000000000..d0f50e6e83 --- /dev/null +++ b/sorcerer/fn.get_spell_info.html @@ -0,0 +1,7 @@ +get_spell_info in sorcerer - Rust

Function sorcerer::get_spell_info

source ·
pub async fn get_spell_info(
+    spell_service_api: &SpellServiceApi,
+    peer_scope: PeerScope,
+    ttl: Duration,
+    spell_id: String,
+    init_peer_id: PeerId
+) -> Result<SpellInfo, JError>
\ No newline at end of file diff --git a/sorcerer/fn.install_spell.html b/sorcerer/fn.install_spell.html new file mode 100644 index 0000000000..71ec351878 --- /dev/null +++ b/sorcerer/fn.install_spell.html @@ -0,0 +1,13 @@ +install_spell in sorcerer - Rust

Function sorcerer::install_spell

source ·
pub async fn install_spell(
+    services: &ParticleAppServices,
+    spell_storage: &SpellStorage,
+    spell_event_bus_api: &SpellEventBusApi,
+    spell_service_api: &SpellServiceApi,
+    peer_scope: PeerScope,
+    particle_id: String,
+    ttl: Duration,
+    user_config: TriggerConfig,
+    script: String,
+    init_data: Value,
+    owner_id: PeerId
+) -> Result<String, JError>
\ No newline at end of file diff --git a/sorcerer/fn.remove_spell.html b/sorcerer/fn.remove_spell.html new file mode 100644 index 0000000000..498bb41fa3 --- /dev/null +++ b/sorcerer/fn.remove_spell.html @@ -0,0 +1,9 @@ +remove_spell in sorcerer - Rust

Function sorcerer::remove_spell

source ·
pub async fn remove_spell(
+    particle_id: &str,
+    spell_storage: &SpellStorage,
+    services: &ParticleAppServices,
+    spell_event_bus_api: &SpellEventBusApi,
+    spell_id: &str,
+    peer_scope: PeerScope,
+    init_peer_id: PeerId
+) -> Result<(), JError>
\ No newline at end of file diff --git a/sorcerer/index.html b/sorcerer/index.html new file mode 100644 index 0000000000..c5212eb8f8 --- /dev/null +++ b/sorcerer/index.html @@ -0,0 +1,2 @@ +sorcerer - Rust

Crate sorcerer

source ·

Structs

Functions

\ No newline at end of file diff --git a/sorcerer/sidebar-items.js b/sorcerer/sidebar-items.js new file mode 100644 index 0000000000..62a6ac5ff6 --- /dev/null +++ b/sorcerer/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"fn":["get_spell_info","install_spell","remove_spell"],"struct":["Sorcerer","SpellInfo"]}; \ No newline at end of file diff --git a/sorcerer/sorcerer/struct.Sorcerer.html b/sorcerer/sorcerer/struct.Sorcerer.html new file mode 100644 index 0000000000..f7eb2ef165 --- /dev/null +++ b/sorcerer/sorcerer/struct.Sorcerer.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../sorcerer/struct.Sorcerer.html...

+ + + \ No newline at end of file diff --git a/sorcerer/spell_builtins/fn.get_spell_info.html b/sorcerer/spell_builtins/fn.get_spell_info.html new file mode 100644 index 0000000000..ac65467a0e --- /dev/null +++ b/sorcerer/spell_builtins/fn.get_spell_info.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../sorcerer/fn.get_spell_info.html...

+ + + \ No newline at end of file diff --git a/sorcerer/spell_builtins/fn.install_spell.html b/sorcerer/spell_builtins/fn.install_spell.html new file mode 100644 index 0000000000..5baac0a0c6 --- /dev/null +++ b/sorcerer/spell_builtins/fn.install_spell.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../sorcerer/fn.install_spell.html...

+ + + \ No newline at end of file diff --git a/sorcerer/spell_builtins/fn.remove_spell.html b/sorcerer/spell_builtins/fn.remove_spell.html new file mode 100644 index 0000000000..b8ddde23f9 --- /dev/null +++ b/sorcerer/spell_builtins/fn.remove_spell.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../sorcerer/fn.remove_spell.html...

+ + + \ No newline at end of file diff --git a/sorcerer/spell_builtins/struct.SpellInfo.html b/sorcerer/spell_builtins/struct.SpellInfo.html new file mode 100644 index 0000000000..d76a8f63fa --- /dev/null +++ b/sorcerer/spell_builtins/struct.SpellInfo.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../sorcerer/struct.SpellInfo.html...

+ + + \ No newline at end of file diff --git a/sorcerer/struct.Sorcerer.html b/sorcerer/struct.Sorcerer.html new file mode 100644 index 0000000000..0a049cad6b --- /dev/null +++ b/sorcerer/struct.Sorcerer.html @@ -0,0 +1,62 @@ +Sorcerer in sorcerer - Rust

Struct sorcerer::Sorcerer

source ·
pub struct Sorcerer {
+    pub aquamarine: AquamarineApi,
+    pub services: ParticleAppServices,
+    pub spell_storage: SpellStorage,
+    pub spell_event_bus_api: SpellEventBusApi,
+    pub spell_script_particle_ttl: Duration,
+    pub workers: Arc<Workers>,
+    pub key_storage: Arc<KeyStorage>,
+    pub scopes: PeerScopes,
+    pub spell_service_api: SpellServiceApi,
+    pub spell_metrics: Option<SpellMetrics>,
+    pub worker_period_sec: u32,
+}

Fields§

§aquamarine: AquamarineApi§services: ParticleAppServices§spell_storage: SpellStorage§spell_event_bus_api: SpellEventBusApi§spell_script_particle_ttl: Duration§workers: Arc<Workers>§key_storage: Arc<KeyStorage>§scopes: PeerScopes§spell_service_api: SpellServiceApi§spell_metrics: Option<SpellMetrics>§worker_period_sec: u32

Implementations§

source§

impl Sorcerer

source

pub async fn execute_script(&self, event: TriggerEvent, span: Arc<Span>)

source§

impl Sorcerer

source

pub async fn new( + services: ParticleAppServices, + modules: ModuleRepository, + aquamarine: AquamarineApi, + config: ResolvedConfig, + spell_event_bus_api: SpellEventBusApi, + workers: Arc<Workers>, + key_storage: Arc<KeyStorage>, + scope: PeerScopes, + spell_service_api: SpellServiceApi, + spell_metrics: Option<SpellMetrics> +) -> (Self, HashMap<String, CustomService>, String)

source

pub fn start( + self, + spell_events_receiver: UnboundedReceiver<TriggerEvent> +) -> JoinHandle<()>

Trait Implementations§

source§

impl Clone for Sorcerer

source§

fn clone(&self) -> Sorcerer

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/sorcerer/struct.SpellInfo.html b/sorcerer/struct.SpellInfo.html new file mode 100644 index 0000000000..99f27e61e2 --- /dev/null +++ b/sorcerer/struct.SpellInfo.html @@ -0,0 +1,42 @@ +SpellInfo in sorcerer - Rust

Struct sorcerer::SpellInfo

source ·
pub struct SpellInfo {
+    pub script: String,
+    pub trigger_config: TriggerConfig,
+}

Fields§

§script: String§trigger_config: TriggerConfig

Trait Implementations§

source§

impl Clone for SpellInfo

source§

fn clone(&self) -> SpellInfo

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for SpellInfo

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for SpellInfo

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Serialize for SpellInfo

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
source§

impl<T> DeserializeOwned for Twhere + T: for<'de> Deserialize<'de>,

\ No newline at end of file diff --git a/spell_event_bus/all.html b/spell_event_bus/all.html new file mode 100644 index 0000000000..3c8a4bac3e --- /dev/null +++ b/spell_event_bus/all.html @@ -0,0 +1 @@ +List of all items in this crate

List of all items

Structs

Enums

Functions

Type Aliases

Constants

\ No newline at end of file diff --git a/spell_event_bus/api/constant.MAX_PERIOD_SEC.html b/spell_event_bus/api/constant.MAX_PERIOD_SEC.html new file mode 100644 index 0000000000..ad066065c1 --- /dev/null +++ b/spell_event_bus/api/constant.MAX_PERIOD_SEC.html @@ -0,0 +1,2 @@ +MAX_PERIOD_SEC in spell_event_bus::api - Rust
pub const MAX_PERIOD_SEC: u32 = _; // 3_153_600_000u32
Expand description

Max period is 100 years in secs: 60 sec * 60 min * 24 hours * 365 days * 100 years

+
\ No newline at end of file diff --git a/spell_event_bus/api/enum.Action.html b/spell_event_bus/api/enum.Action.html new file mode 100644 index 0000000000..957d44b9e8 --- /dev/null +++ b/spell_event_bus/api/enum.Action.html @@ -0,0 +1,38 @@ +Action in spell_event_bus::api - Rust
pub enum Action {
+    Subscribe(SpellId, SpellTriggerConfigs),
+    Unsubscribe(SpellId),
+    Start,
+}

Variants§

§

Subscribe(SpellId, SpellTriggerConfigs)

Subscribe a spell to a list of triggers

+
§

Unsubscribe(SpellId)

Remove all subscriptions of a spell

+
§

Start

Actually start the scheduling

+

Trait Implementations§

source§

impl Clone for Action

source§

fn clone(&self) -> Action

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Action

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/spell_event_bus/api/enum.ConfigError.html b/spell_event_bus/api/enum.ConfigError.html new file mode 100644 index 0000000000..c6d06e7f7e --- /dev/null +++ b/spell_event_bus/api/enum.ConfigError.html @@ -0,0 +1,34 @@ +ConfigError in spell_event_bus::api - Rust
pub enum ConfigError {
+    InvalidPeriod,
+    InvalidEndSec,
+}

Variants§

§

InvalidPeriod

§

InvalidEndSec

Trait Implementations§

source§

impl Debug for ConfigError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for ConfigError

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for ConfigError

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/spell_event_bus/api/enum.EventBusError.html b/spell_event_bus/api/enum.EventBusError.html new file mode 100644 index 0000000000..d96353c976 --- /dev/null +++ b/spell_event_bus/api/enum.EventBusError.html @@ -0,0 +1,37 @@ +EventBusError in spell_event_bus::api - Rust
pub enum EventBusError {
+    SendError {
+        action: Action,
+        reason: Pin<Box<dyn Error + Send>>,
+    },
+    ReplyError(Action),
+}

Variants§

§

SendError

Fields

§action: Action
§reason: Pin<Box<dyn Error + Send>>
§

ReplyError(Action)

Trait Implementations§

source§

impl Debug for EventBusError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for EventBusError

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for EventBusError

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/spell_event_bus/api/enum.PeerEventType.html b/spell_event_bus/api/enum.PeerEventType.html new file mode 100644 index 0000000000..38511a5866 --- /dev/null +++ b/spell_event_bus/api/enum.PeerEventType.html @@ -0,0 +1,50 @@ +PeerEventType in spell_event_bus::api - Rust
pub enum PeerEventType {
+    Connected,
+    Disconnected,
+}
Expand description

Types of events that are available for subscription.

+

Variants§

§

Connected

§

Disconnected

Trait Implementations§

source§

impl Clone for PeerEventType

source§

fn clone(&self) -> PeerEventType

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for PeerEventType

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Hash for PeerEventType

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for PeerEventType

source§

fn eq(&self, other: &PeerEventType) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for PeerEventType

source§

impl StructuralEq for PeerEventType

source§

impl StructuralPartialEq for PeerEventType

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> CallHasher for Twhere + T: Hash + ?Sized,

§

default fn get_hash<H, B>(value: &H, build_hasher: &B) -> u64where + H: Hash + ?Sized, + B: BuildHasher,

§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/spell_event_bus/api/enum.TriggerInfo.html b/spell_event_bus/api/enum.TriggerInfo.html new file mode 100644 index 0000000000..3c09c37a8e --- /dev/null +++ b/spell_event_bus/api/enum.TriggerInfo.html @@ -0,0 +1,36 @@ +TriggerInfo in spell_event_bus::api - Rust
pub enum TriggerInfo {
+    Timer(TimerEvent),
+    Peer(PeerEvent),
+}

Variants§

§

Timer(TimerEvent)

Event is triggered by timer.

+
§

Peer(PeerEvent)

Event is triggered by a peer event.

+

Trait Implementations§

source§

impl Clone for TriggerInfo

source§

fn clone(&self) -> TriggerInfo

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for TriggerInfo

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<TriggerInfo> for TriggerInfoAqua

source§

fn from(i: TriggerInfo) -> Self

Converts to this type from the input type.
source§

impl From<TriggerInfoAqua> for TriggerInfo

source§

fn from(i: TriggerInfoAqua) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/spell_event_bus/api/fn.from_user_config.html b/spell_event_bus/api/fn.from_user_config.html new file mode 100644 index 0000000000..82181c9ea8 --- /dev/null +++ b/spell_event_bus/api/fn.from_user_config.html @@ -0,0 +1,4 @@ +from_user_config in spell_event_bus::api - Rust
pub fn from_user_config(
+    user_config: &TriggerConfig
+) -> Result<Option<SpellTriggerConfigs>, ConfigError>
Expand description

Convert user-friendly config to event-bus-friendly config, validating it in the process.

+
\ No newline at end of file diff --git a/spell_event_bus/api/index.html b/spell_event_bus/api/index.html new file mode 100644 index 0000000000..26ebde9dd5 --- /dev/null +++ b/spell_event_bus/api/index.html @@ -0,0 +1 @@ +spell_event_bus::api - Rust

Module spell_event_bus::api

source ·

Structs

Enums

Constants

  • Max period is 100 years in secs: 60 sec * 60 min * 24 hours * 365 days * 100 years

Functions

  • Convert user-friendly config to event-bus-friendly config, validating it in the process.

Type Aliases

\ No newline at end of file diff --git a/spell_event_bus/api/sidebar-items.js b/spell_event_bus/api/sidebar-items.js new file mode 100644 index 0000000000..15dd209afa --- /dev/null +++ b/spell_event_bus/api/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"constant":["MAX_PERIOD_SEC"],"enum":["Action","ConfigError","EventBusError","PeerEventType","TriggerInfo"],"fn":["from_user_config"],"struct":["PeerEvent","SpellEventBusApi","SpellTriggerConfigs","TimerEvent","TriggerEvent","TriggerInfoAqua"],"type":["SpellId"]}; \ No newline at end of file diff --git a/spell_event_bus/api/struct.PeerEvent.html b/spell_event_bus/api/struct.PeerEvent.html new file mode 100644 index 0000000000..5aa85c30af --- /dev/null +++ b/spell_event_bus/api/struct.PeerEvent.html @@ -0,0 +1,38 @@ +PeerEvent in spell_event_bus::api - Rust
pub struct PeerEvent {
+    pub peer_id: PeerId,
+    pub connected: bool,
+}
Expand description

Event is triggered by connection pool event

+

Fields§

§peer_id: PeerId§connected: bool

Trait Implementations§

source§

impl Clone for PeerEvent

source§

fn clone(&self) -> PeerEvent

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for PeerEvent

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for PeerEvent

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl From<LifecycleEvent> for PeerEvent

source§

fn from(e: LifecycleEvent) -> Self

Converts to this type from the input type.
source§

impl Serialize for PeerEvent

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
source§

impl<T> DeserializeOwned for Twhere + T: for<'de> Deserialize<'de>,

\ No newline at end of file diff --git a/spell_event_bus/api/struct.SpellEventBusApi.html b/spell_event_bus/api/struct.SpellEventBusApi.html new file mode 100644 index 0000000000..2e0e14527c --- /dev/null +++ b/spell_event_bus/api/struct.SpellEventBusApi.html @@ -0,0 +1,39 @@ +SpellEventBusApi in spell_event_bus::api - Rust
pub struct SpellEventBusApi { /* private fields */ }

Implementations§

source§

impl SpellEventBusApi

source

pub async fn subscribe( + &self, + spell_id: SpellId, + config: SpellTriggerConfigs +) -> Result<(), EventBusError>

Subscribe a spell to a list of events +The spell can be subscribed multiple times to different events, but to only one timer. +Note that multiple subscriptions to the same event will result in multiple events of the same type being sent.

+
source

pub async fn unsubscribe(&self, spell_id: SpellId) -> Result<(), EventBusError>

Unsubscribe a spell from all events.

+
source

pub async fn start_scheduling(&self) -> Result<(), EventBusError>

Trait Implementations§

source§

impl Clone for SpellEventBusApi

source§

fn clone(&self) -> SpellEventBusApi

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for SpellEventBusApi

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/spell_event_bus/api/struct.SpellTriggerConfigs.html b/spell_event_bus/api/struct.SpellTriggerConfigs.html new file mode 100644 index 0000000000..0707bd0ef7 --- /dev/null +++ b/spell_event_bus/api/struct.SpellTriggerConfigs.html @@ -0,0 +1,31 @@ +SpellTriggerConfigs in spell_event_bus::api - Rust
pub struct SpellTriggerConfigs { /* private fields */ }

Implementations§

Trait Implementations§

source§

impl Clone for SpellTriggerConfigs

source§

fn clone(&self) -> SpellTriggerConfigs

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for SpellTriggerConfigs

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/spell_event_bus/api/struct.TimerEvent.html b/spell_event_bus/api/struct.TimerEvent.html new file mode 100644 index 0000000000..3df3ac86aa --- /dev/null +++ b/spell_event_bus/api/struct.TimerEvent.html @@ -0,0 +1,36 @@ +TimerEvent in spell_event_bus::api - Rust
pub struct TimerEvent {
+    pub timestamp: u64,
+}

Fields§

§timestamp: u64

Trait Implementations§

source§

impl Clone for TimerEvent

source§

fn clone(&self) -> TimerEvent

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for TimerEvent

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for TimerEvent

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Serialize for TimerEvent

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
source§

impl<T> DeserializeOwned for Twhere + T: for<'de> Deserialize<'de>,

\ No newline at end of file diff --git a/spell_event_bus/api/struct.TriggerEvent.html b/spell_event_bus/api/struct.TriggerEvent.html new file mode 100644 index 0000000000..cb7f0c147a --- /dev/null +++ b/spell_event_bus/api/struct.TriggerEvent.html @@ -0,0 +1,34 @@ +TriggerEvent in spell_event_bus::api - Rust
pub struct TriggerEvent {
+    pub spell_id: SpellId,
+    pub info: TriggerInfo,
+}

Fields§

§spell_id: SpellId§info: TriggerInfo

Trait Implementations§

source§

impl Clone for TriggerEvent

source§

fn clone(&self) -> TriggerEvent

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for TriggerEvent

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/spell_event_bus/api/struct.TriggerInfoAqua.html b/spell_event_bus/api/struct.TriggerInfoAqua.html new file mode 100644 index 0000000000..f162fccf8e --- /dev/null +++ b/spell_event_bus/api/struct.TriggerInfoAqua.html @@ -0,0 +1,33 @@ +TriggerInfoAqua in spell_event_bus::api - Rust
pub struct TriggerInfoAqua { /* private fields */ }

Trait Implementations§

source§

impl Debug for TriggerInfoAqua

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for TriggerInfoAqua

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl From<TriggerInfo> for TriggerInfoAqua

source§

fn from(i: TriggerInfo) -> Self

Converts to this type from the input type.
source§

impl From<TriggerInfoAqua> for TriggerInfo

source§

fn from(i: TriggerInfoAqua) -> Self

Converts to this type from the input type.
source§

impl Serialize for TriggerInfoAqua

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
source§

impl<T> DeserializeOwned for Twhere + T: for<'de> Deserialize<'de>,

\ No newline at end of file diff --git a/spell_event_bus/api/type.SpellId.html b/spell_event_bus/api/type.SpellId.html new file mode 100644 index 0000000000..af19061166 --- /dev/null +++ b/spell_event_bus/api/type.SpellId.html @@ -0,0 +1 @@ +SpellId in spell_event_bus::api - Rust

Type Alias spell_event_bus::api::SpellId

source ·
pub type SpellId = String;

Aliased Type§

struct SpellId { /* private fields */ }
\ No newline at end of file diff --git a/spell_event_bus/bus/index.html b/spell_event_bus/bus/index.html new file mode 100644 index 0000000000..eaed30ea0e --- /dev/null +++ b/spell_event_bus/bus/index.html @@ -0,0 +1 @@ +spell_event_bus::bus - Rust

Module spell_event_bus::bus

source ·

Structs

\ No newline at end of file diff --git a/spell_event_bus/bus/sidebar-items.js b/spell_event_bus/bus/sidebar-items.js new file mode 100644 index 0000000000..3597d0293d --- /dev/null +++ b/spell_event_bus/bus/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":["SpellEventBus"]}; \ No newline at end of file diff --git a/spell_event_bus/bus/struct.SpellEventBus.html b/spell_event_bus/bus/struct.SpellEventBus.html new file mode 100644 index 0000000000..f0cf08996c --- /dev/null +++ b/spell_event_bus/bus/struct.SpellEventBus.html @@ -0,0 +1,33 @@ +SpellEventBus in spell_event_bus::bus - Rust
pub struct SpellEventBus { /* private fields */ }

Implementations§

source§

impl SpellEventBus

source

pub fn new( + spell_metrics: Option<SpellMetrics>, + sources: Vec<BoxStream<'static, PeerEvent>> +) -> (Self, SpellEventBusApi, UnboundedReceiver<TriggerEvent>)

source

pub fn start(self) -> JoinHandle<()>

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/spell_event_bus/config/constant.MAX_PERIOD_SEC.html b/spell_event_bus/config/constant.MAX_PERIOD_SEC.html new file mode 100644 index 0000000000..813b063ee8 --- /dev/null +++ b/spell_event_bus/config/constant.MAX_PERIOD_SEC.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../spell_event_bus/api/constant.MAX_PERIOD_SEC.html...

+ + + \ No newline at end of file diff --git a/spell_event_bus/config/enum.ConfigError.html b/spell_event_bus/config/enum.ConfigError.html new file mode 100644 index 0000000000..858fce546b --- /dev/null +++ b/spell_event_bus/config/enum.ConfigError.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../spell_event_bus/api/enum.ConfigError.html...

+ + + \ No newline at end of file diff --git a/spell_event_bus/config/fn.from_user_config.html b/spell_event_bus/config/fn.from_user_config.html new file mode 100644 index 0000000000..1aba5391c8 --- /dev/null +++ b/spell_event_bus/config/fn.from_user_config.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../spell_event_bus/api/fn.from_user_config.html...

+ + + \ No newline at end of file diff --git a/spell_event_bus/config/struct.SpellTriggerConfigs.html b/spell_event_bus/config/struct.SpellTriggerConfigs.html new file mode 100644 index 0000000000..e281789f66 --- /dev/null +++ b/spell_event_bus/config/struct.SpellTriggerConfigs.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../spell_event_bus/api/struct.SpellTriggerConfigs.html...

+ + + \ No newline at end of file diff --git a/spell_event_bus/index.html b/spell_event_bus/index.html new file mode 100644 index 0000000000..5c8ec34753 --- /dev/null +++ b/spell_event_bus/index.html @@ -0,0 +1,2 @@ +spell_event_bus - Rust

Crate spell_event_bus

source ·

Modules

\ No newline at end of file diff --git a/spell_event_bus/sidebar-items.js b/spell_event_bus/sidebar-items.js new file mode 100644 index 0000000000..92578e197d --- /dev/null +++ b/spell_event_bus/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"mod":["api","bus"]}; \ No newline at end of file diff --git a/spell_service_api/all.html b/spell_service_api/all.html new file mode 100644 index 0000000000..a336e04443 --- /dev/null +++ b/spell_service_api/all.html @@ -0,0 +1 @@ +List of all items in this crate

List of all items

Structs

Enums

\ No newline at end of file diff --git a/spell_service_api/enum.CallError.html b/spell_service_api/enum.CallError.html new file mode 100644 index 0000000000..9f1089f8c3 --- /dev/null +++ b/spell_service_api/enum.CallError.html @@ -0,0 +1,60 @@ +CallError in spell_service_api - Rust
pub enum CallError {
+    ServiceNotFound {
+        spell_id: String,
+        function_name: String,
+    },
+    EmptyResult {
+        spell_id: String,
+        function_name: String,
+    },
+    OtherError {
+        spell_id: String,
+        function_name: String,
+        reason: String,
+    },
+    ResultParseError {
+        spell_id: String,
+        function_name: String,
+        target_type: &'static str,
+        reason: String,
+    },
+    ExecutionError {
+        spell_id: String,
+        function_name: String,
+        reason: String,
+    },
+}

Variants§

§

ServiceNotFound

Fields

§spell_id: String
§function_name: String
§

EmptyResult

Fields

§spell_id: String
§function_name: String
§

OtherError

Fields

§spell_id: String
§function_name: String
§reason: String
§

ResultParseError

Fields

§spell_id: String
§function_name: String
§target_type: &'static str
§reason: String
§

ExecutionError

Fields

§spell_id: String
§function_name: String
§reason: String

Trait Implementations§

source§

impl Debug for CallError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for CallError

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for CallError

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/spell_service_api/index.html b/spell_service_api/index.html new file mode 100644 index 0000000000..4d12b2f72c --- /dev/null +++ b/spell_service_api/index.html @@ -0,0 +1,2 @@ +spell_service_api - Rust

Structs

Enums

\ No newline at end of file diff --git a/spell_service_api/sidebar-items.js b/spell_service_api/sidebar-items.js new file mode 100644 index 0000000000..27c1ab2030 --- /dev/null +++ b/spell_service_api/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["CallError"],"struct":["CallParams","SpellServiceApi"]}; \ No newline at end of file diff --git a/spell_service_api/struct.CallParams.html b/spell_service_api/struct.CallParams.html new file mode 100644 index 0000000000..e25d3c55dd --- /dev/null +++ b/spell_service_api/struct.CallParams.html @@ -0,0 +1,46 @@ +CallParams in spell_service_api - Rust
pub struct CallParams { /* private fields */ }

Implementations§

source§

impl CallParams

source

pub fn new( + init_peer_id: PeerId, + peer_scope: PeerScope, + spell_id: String, + particle_id: Option<String>, + ttl: Duration +) -> Self

source

pub fn from(spell_id: String, params: ParticleParams) -> Self

source

pub fn local( + peer_scope: PeerScope, + spell_id: String, + init_peer_id: PeerId, + ttl: Duration +) -> Self

Trait Implementations§

source§

impl Clone for CallParams

source§

fn clone(&self) -> CallParams

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/spell_service_api/struct.SpellServiceApi.html b/spell_service_api/struct.SpellServiceApi.html new file mode 100644 index 0000000000..4cad7bf13a --- /dev/null +++ b/spell_service_api/struct.SpellServiceApi.html @@ -0,0 +1,77 @@ +SpellServiceApi in spell_service_api - Rust
pub struct SpellServiceApi { /* private fields */ }

Implementations§

source§

impl SpellServiceApi

source

pub fn new(services: ParticleAppServices) -> Self

source

pub async fn set_script( + &self, + params: CallParams, + script: String +) -> Result<(), CallError>

source

pub async fn get_script(&self, params: CallParams) -> Result<String, CallError>

source

pub async fn set_trigger_config( + &self, + params: CallParams, + config: TriggerConfig +) -> Result<(), CallError>

source

pub async fn get_trigger_config( + &self, + params: CallParams +) -> Result<TriggerConfig, CallError>

source

pub async fn update_kv( + &self, + params: CallParams, + kv_data: Value +) -> Result<(), CallError>

source

pub async fn get_string( + &self, + params: CallParams, + key: String +) -> Result<Option<String>, CallError>

source

pub async fn set_string( + &self, + params: CallParams, + key: String, + value: String +) -> Result<(), CallError>

source

pub async fn get_counter( + &self, + params: CallParams +) -> Result<Option<u32>, CallError>

Load the counter (how many times the spell was run)

+
source

pub async fn set_counter( + &self, + params: CallParams, + counter: u32 +) -> Result<(), CallError>

Update the counter (how many times the spell was run) +TODO: permission check here or not?

+
source

pub async fn set_trigger_event( + &self, + params: CallParams, + event: String +) -> Result<(), CallError>

source

pub async fn store_error( + &self, + params: CallParams, + args: Vec<Value> +) -> Result<(), CallError>

Trait Implementations§

source§

impl Clone for SpellServiceApi

source§

fn clone(&self) -> SpellServiceApi

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for SpellServiceApi

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/spell_storage/all.html b/spell_storage/all.html new file mode 100644 index 0000000000..79bbfd0c5e --- /dev/null +++ b/spell_storage/all.html @@ -0,0 +1 @@ +List of all items in this crate

List of all items

Structs

\ No newline at end of file diff --git a/spell_storage/index.html b/spell_storage/index.html new file mode 100644 index 0000000000..efa29d263c --- /dev/null +++ b/spell_storage/index.html @@ -0,0 +1,2 @@ +spell_storage - Rust

Crate spell_storage

source ·

Structs

\ No newline at end of file diff --git a/spell_storage/sidebar-items.js b/spell_storage/sidebar-items.js new file mode 100644 index 0000000000..d378234790 --- /dev/null +++ b/spell_storage/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":["SpellStorage"]}; \ No newline at end of file diff --git a/spell_storage/storage/struct.SpellStorage.html b/spell_storage/storage/struct.SpellStorage.html new file mode 100644 index 0000000000..2a07e2eb98 --- /dev/null +++ b/spell_storage/storage/struct.SpellStorage.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../spell_storage/struct.SpellStorage.html...

+ + + \ No newline at end of file diff --git a/spell_storage/struct.SpellStorage.html b/spell_storage/struct.SpellStorage.html new file mode 100644 index 0000000000..345b46c233 --- /dev/null +++ b/spell_storage/struct.SpellStorage.html @@ -0,0 +1,39 @@ +SpellStorage in spell_storage - Rust
pub struct SpellStorage { /* private fields */ }

Implementations§

source§

impl SpellStorage

source

pub async fn create( + spells_base_dir: &Path, + services: &ParticleAppServices, + modules: &ModuleRepository +) -> Result<(Self, String)>

source

pub fn get_registered_spells(&self) -> HashMap<PeerScope, Vec<String>>

source

pub fn get_scope(&self, spell_id: String) -> Option<PeerScope>

source

pub fn get_registered_spells_by(&self, peer_scope: PeerScope) -> Vec<String>

source

pub fn get_blueprint(&self) -> String

source

pub fn register_spell(&self, peer_scope: PeerScope, spell_id: String)

source

pub fn unregister_spell(&self, peer_scope: PeerScope, spell_id: &str)

Trait Implementations§

source§

impl Clone for SpellStorage

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for SpellStorage

source§

fn fmt(&self, __f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/src-files.js b/src-files.js new file mode 100644 index 0000000000..34e27be368 --- /dev/null +++ b/src-files.js @@ -0,0 +1,50 @@ +var srcIndex = JSON.parse('{\ +"air_interpreter_fs":["",[],["air_interpreter.rs","lib.rs"]],\ +"aquamarine":["",[],["actor.rs","aqua_runtime.rs","aquamarine.rs","command.rs","config.rs","deadline.rs","error.rs","health.rs","lib.rs","log.rs","particle_data_store.rs","particle_effects.rs","particle_executor.rs","particle_functions.rs","plumber.rs","spawner.rs","vm_pool.rs"]],\ +"async_unlock":["",[],["lib.rs"]],\ +"chain_connector":["",[["function",[],["capacity.rs","core.rs","deal.rs","mod.rs","offer.rs"]]],["builtins.rs","connector.rs","error.rs","eth_call.rs","lib.rs","types.rs"]],\ +"chain_data":["",[],["block_header.rs","chain_data.rs","data_tokens.rs","error.rs","lib.rs","log.rs","utils.rs"]],\ +"chain_listener":["",[["event",[],["cc_activated.rs","compute_unit_matched.rs","mod.rs","unit_activated.rs","unit_deactivated.rs"]]],["lib.rs","listener.rs","persistence.rs","proof_tracker.rs","types.rs"]],\ +"cid_utils":["",[],["hash.rs","lib.rs","unixfs.rs"]],\ +"config_utils":["",[],["config.rs","lib.rs"]],\ +"connected_client":["",[],["api.rs","behaviour.rs","client.rs","command.rs","connected_client.rs","event.rs","lib.rs"]],\ +"connection_pool":["",[],["api.rs","behaviour.rs","connection_pool.rs","lib.rs"]],\ +"control_macro":["",[],["lib.rs"]],\ +"core_distributor":["",[],["core_range.rs","distributor.rs","dummy.rs","errors.rs","lib.rs","persistence.rs","strategy.rs","types.rs"]],\ +"created_swarm":["",[],["lib.rs","services.rs","swarm.rs"]],\ +"fluence_libp2p":["",[],["connected_point.rs","lib.rs","macros.rs","random_multiaddr.rs","random_peer_id.rs","serde.rs","transport.rs"]],\ +"fs_utils":["",[],["lib.rs"]],\ +"health":["",[],["lib.rs"]],\ +"hex_utils":["",[],["lib.rs"]],\ +"ivalue_utils":["",[],["lib.rs"]],\ +"json_utils":["",[],["base64_serde.rs","lib.rs"]],\ +"kademlia":["",[],["api.rs","behaviour.rs","error.rs","lib.rs"]],\ +"local_vm":["",[],["lib.rs","local_vm.rs"]],\ +"log_format":["",[],["lib.rs"]],\ +"log_utils":["",[],["lib.rs"]],\ +"now_millis":["",[],["lib.rs"]],\ +"nox":["",[["behaviour",[],["identify.rs","network.rs"]]],["builtins.rs","connectivity.rs","dispatcher.rs","effectors.rs","health.rs","http.rs","layers.rs","lib.rs","metrics.rs","node.rs","tasks.rs"]],\ +"particle_args":["",[],["args.rs","args_error.rs","base58.rs","lib.rs"]],\ +"particle_builtins":["",[],["builtins.rs","debug.rs","error.rs","func.rs","identify.rs","json.rs","lib.rs","math.rs","outcome.rs","particle_function.rs"]],\ +"particle_execution":["",[],["function_outcome.rs","lib.rs","particle_function.rs","particle_params.rs","particle_vault.rs"]],\ +"particle_modules":["",[],["error.rs","files.rs","lib.rs","modules.rs"]],\ +"particle_protocol":["",[["libp2p_protocol",[["codec",[],["fluence.rs","mod.rs"]]],["message.rs","upgrade.rs"]]],["contact.rs","error.rs","lib.rs","particle.rs"]],\ +"particle_services":["",[],["app_services.rs","config.rs","error.rs","health.rs","lib.rs","persistence.rs"]],\ +"peer_metrics":["",[["services_metrics",[],["backend.rs","builtin.rs","external.rs","message.rs","mod.rs"]]],["chain_listener.rs","connection_pool.rs","connectivity.rs","dispatcher.rs","info.rs","lib.rs","particle_executor.rs","spell_metrics.rs","vm_pool.rs"]],\ +"server_config":["",[],["args.rs","avm_config.rs","bootstrap_config.rs","defaults.rs","dir_config.rs","kademlia_config.rs","keys.rs","lib.rs","network_config.rs","node_config.rs","resolved_config.rs","services_config.rs","system_services_config.rs","wasm_backend_config.rs"]],\ +"service_modules":["",[["modules",[],["blueprint.rs","file_names.rs","fixture.rs"]]],["lib.rs"]],\ +"sorcerer":["",[],["error.rs","lib.rs","script_executor.rs","sorcerer.rs","spell_builtins.rs","utils.rs","worker_builins.rs"]],\ +"spell_event_bus":["",[],["api.rs","bus.rs","config.rs","lib.rs"]],\ +"spell_service_api":["",[],["lib.rs"]],\ +"spell_storage":["",[],["lib.rs","storage.rs"]],\ +"system_services":["",[],["deployer.rs","distro.rs","lib.rs"]],\ +"test_constants":["",[],["lib.rs"]],\ +"test_utils":["",[],["lib.rs","misc.rs","pinning.rs","service.rs","utils.rs"]],\ +"toml_utils":["",[],["lib.rs"]],\ +"toy_vms":["",[],["easy_vm.rs","lib.rs"]],\ +"types":["",[],["deal_id.rs","lib.rs","peer_id.rs","peer_scope.rs"]],\ +"uuid_utils":["",[],["lib.rs"]],\ +"vm_utils":["",[],["lib.rs","vm_utils.rs"]],\ +"workers":["",[],["error.rs","key_storage.rs","lib.rs","persistence.rs","scope.rs","workers.rs"]]\ +}'); +createSrcSidebar(); diff --git a/src/air_interpreter_fs/air_interpreter.rs.html b/src/air_interpreter_fs/air_interpreter.rs.html new file mode 100644 index 0000000000..51d47304b6 --- /dev/null +++ b/src/air_interpreter_fs/air_interpreter.rs.html @@ -0,0 +1,73 @@ +air_interpreter.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use eyre::{Result, WrapErr};
+use std::path::{Path, PathBuf};
+
+pub fn air_interpreter_path(base_dir: &Path) -> PathBuf {
+    use air_interpreter_wasm as interpreter;
+
+    base_dir.join(format!("aquamarine_{}.wasm", interpreter::VERSION))
+}
+
+pub fn write_default_air_interpreter(destination: &Path) -> Result<()> {
+    use air_interpreter_wasm::INTERPRETER_WASM;
+    use std::fs::write;
+
+    write(destination, INTERPRETER_WASM).wrap_err(format!(
+        "failed writing default INTERPRETER_WASM to {destination:?}"
+    ))
+}
+
\ No newline at end of file diff --git a/src/air_interpreter_fs/lib.rs.html b/src/air_interpreter_fs/lib.rs.html new file mode 100644 index 0000000000..ceeedaa2b9 --- /dev/null +++ b/src/air_interpreter_fs/lib.rs.html @@ -0,0 +1,69 @@ +lib.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+#![feature(try_blocks)]
+#![warn(rust_2018_idioms)]
+#![deny(
+    dead_code,
+    nonstandard_style,
+    unused_imports,
+    unused_mut,
+    unused_variables,
+    unused_unsafe,
+    unreachable_patterns
+)]
+
+mod air_interpreter;
+
+pub use air_interpreter::{air_interpreter_path, write_default_air_interpreter};
+
\ No newline at end of file diff --git a/src/aquamarine/actor.rs.html b/src/aquamarine/actor.rs.html new file mode 100644 index 0000000000..c0339d6e0c --- /dev/null +++ b/src/aquamarine/actor.rs.html @@ -0,0 +1,619 @@ +actor.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use futures::future::BoxFuture;
+use futures::FutureExt;
+use std::sync::Arc;
+use std::{
+    collections::VecDeque,
+    task::{Context, Poll, Waker},
+};
+use tracing::{instrument, Instrument, Span};
+
+use crate::deadline::Deadline;
+use crate::particle_effects::RawRoutingEffects;
+use crate::particle_executor::{FutResult, ParticleExecutor};
+use crate::particle_functions::{Functions, SingleCallStat};
+use crate::spawner::{SpawnFunctions, Spawner};
+use crate::{AquaRuntime, InterpretationStats, ParticleDataStore, ParticleEffects};
+use fluence_keypair::KeyPair;
+use fluence_libp2p::PeerId;
+use particle_execution::{ParticleFunctionStatic, ServiceFunction};
+use particle_protocol::{ExtendedParticle, Particle};
+use types::DealId;
+
+struct Reusables<RT> {
+    vm_id: usize,
+    vm: Option<RT>,
+}
+
+type AVMCallResult<RT> = FutResult<(usize, Option<RT>), RawRoutingEffects, InterpretationStats>;
+type AVMTask<RT> = BoxFuture<
+    'static,
+    (
+        Reusables<RT>,
+        ParticleEffects,
+        InterpretationStats,
+        Arc<Span>,
+    ),
+>;
+pub struct Actor<RT, F> {
+    /// Particle of that actor is expired after that deadline
+    deadline: Deadline,
+    future: Option<AVMTask<RT>>,
+    mailbox: VecDeque<ExtendedParticle>,
+    waker: Option<Waker>,
+    functions: Functions<F>,
+    /// Particle that's memoized on the actor creation.
+    /// Used to execute CallRequests when mailbox is empty.
+    /// Particle's data is empty.
+    particle: Particle,
+    /// Particles and call results will be processed in the security scope of this peer id
+    /// It's either `host_peer_id` or local worker peer id
+    current_peer_id: PeerId,
+    /// TODO: for the clean-up, I don't think we need it here!
+    particle_token: String,
+    key_pair: KeyPair,
+    data_store: Arc<ParticleDataStore>,
+    spawner: Spawner,
+    deal_id: Option<DealId>,
+}
+
+impl<RT, F> Actor<RT, F>
+where
+    RT: AquaRuntime,
+    F: ParticleFunctionStatic,
+{
+    // TODO: temporary (I hope), need to do smth clever with particle_token
+    #[allow(clippy::too_many_arguments)]
+    pub fn new(
+        particle: &Particle,
+        functions: Functions<F>,
+        current_peer_id: PeerId,
+        particle_token: String,
+        key_pair: KeyPair,
+        data_store: Arc<ParticleDataStore>,
+        deal_id: Option<DealId>,
+        spawner: Spawner,
+    ) -> Self {
+        Self {
+            deadline: Deadline::from(particle),
+            functions,
+            future: None,
+            mailbox: <_>::default(),
+            waker: None,
+            // Clone particle without data
+            particle: Particle {
+                data: vec![],
+                ..particle.clone()
+            },
+            current_peer_id,
+            particle_token,
+            key_pair,
+            data_store,
+            spawner,
+            deal_id,
+        }
+    }
+
+    pub fn is_expired(&self, now_ms: u64) -> bool {
+        self.deadline.is_expired(now_ms)
+    }
+
+    pub fn is_executing(&self) -> bool {
+        self.future.is_some()
+    }
+
+    pub fn cleanup_key(&self) -> (String, PeerId, Vec<u8>, String) {
+        let particle_id = self.particle.id.clone();
+        let signature = self.particle.signature.clone();
+        let token = self.particle_token.clone();
+        (particle_id, self.current_peer_id, signature, token)
+    }
+
+    pub fn mailbox_size(&self) -> usize {
+        self.mailbox.len()
+    }
+
+    pub fn set_function(&mut self, function: ServiceFunction) {
+        self.functions.set_function(function)
+    }
+
+    #[instrument(level = tracing::Level::INFO, skip_all)]
+    pub fn ingest(&mut self, particle: ExtendedParticle) {
+        self.mailbox.push_back(particle);
+        self.wake();
+    }
+
+    /// Polls actor for result on previously ingested particle
+    pub fn poll_completed(
+        &mut self,
+        cx: &mut Context<'_>,
+    ) -> Poll<FutResult<(usize, Option<RT>), RawRoutingEffects, InterpretationStats>> {
+        self.waker = Some(cx.waker().clone());
+
+        self.functions.poll(cx);
+
+        // Poll AquaVM future
+        if let Some(value) = self.poll_avm_future(cx) {
+            return value;
+        }
+
+        Poll::Pending
+    }
+
+    fn poll_avm_future(&mut self, cx: &mut Context<'_>) -> Option<Poll<AVMCallResult<RT>>> {
+        if let Some(Poll::Ready(res)) = self.future.as_mut().map(|f| f.poll_unpin(cx)) {
+            let (reusables, effects, stats, parent_span) = res;
+            let span = tracing::info_span!(
+                parent: parent_span.as_ref(),
+                "Actor::poll_avm_future::future_ready",
+                particle_id= self.particle.id,
+                deal_id = self.deal_id.as_ref().map(String::from)
+            );
+            let _span_guard = span.enter();
+
+            self.future.take();
+
+            let spawner = self.spawner.clone();
+            let waker = cx.waker().clone();
+            // Schedule execution of functions
+            self.functions.execute(
+                spawner,
+                self.particle.id.clone(),
+                effects.call_requests,
+                waker,
+                parent_span.clone(),
+            );
+
+            let effects = RawRoutingEffects {
+                particle: ExtendedParticle::linked(
+                    Particle {
+                        data: effects.new_data,
+                        ..self.particle.clone()
+                    },
+                    parent_span,
+                ),
+                next_peers: effects.next_peers,
+            };
+            return Some(Poll::Ready(FutResult {
+                runtime: (reusables.vm_id, reusables.vm),
+                effects,
+                stats,
+            }));
+        }
+        None
+    }
+
+    /// Provide actor with new `vm` to execute particles, if there are any.
+    ///
+    /// If actor is in the middle of executing previous particle, vm is returned
+    /// If actor's mailbox is empty, vm is returned
+    pub fn poll_next(&mut self, vm_id: usize, vm: RT, cx: &mut Context<'_>) -> ActorPoll<RT> {
+        self.waker = Some(cx.waker().clone());
+
+        self.functions.poll(cx);
+
+        // Return vm if previous particle is still executing
+        if self.is_executing() {
+            return ActorPoll::Vm(vm_id, vm);
+        }
+
+        // Gather CallResults
+        let (calls, stats, call_spans) = self.functions.drain();
+
+        // Take the next particle
+        let ext_particle = self.mailbox.pop_front();
+
+        if ext_particle.is_none() && calls.is_empty() {
+            debug_assert!(stats.is_empty(), "stats must be empty if calls are empty");
+            // Nothing to execute, return vm
+            return ActorPoll::Vm(vm_id, vm);
+        }
+
+        let particle = ext_particle
+            .as_ref()
+            .map(|p| p.particle.clone())
+            .unwrap_or_else(|| {
+                // If mailbox is empty, then take self.particle.
+                // Its data is empty, so `vm` will process `calls` on the old (saved on disk) data
+                self.particle.clone()
+            });
+
+        let waker = cx.waker().clone();
+        let data_store = self.data_store.clone();
+        let key_pair = self.key_pair.clone();
+        let peer_id = self.current_peer_id;
+
+        let (async_span, linking_span) =
+            self.create_spans(call_spans, ext_particle, particle.id.as_str());
+
+        let spawner = self.spawner.clone();
+        self.future = Some(
+            self.spawner
+                .wrap(async move {
+                    let res = vm
+                        .execute(
+                            spawner,
+                            data_store,
+                            (particle.clone(), calls),
+                            peer_id,
+                            key_pair,
+                        )
+                        .in_current_span()
+                        .await;
+
+                    waker.wake();
+
+                    let reusables = Reusables {
+                        vm_id,
+                        vm: res.runtime,
+                    };
+
+                    (reusables, res.effects, res.stats, linking_span)
+                })
+                .instrument(async_span)
+                .boxed(),
+        );
+        self.wake();
+
+        ActorPoll::Executing(stats)
+    }
+
+    fn create_spans(
+        &self,
+        call_spans: Vec<Arc<Span>>,
+        ext_particle: Option<ExtendedParticle>,
+        particle_id: &str,
+    ) -> (Span, Arc<Span>) {
+        let async_span = tracing::info_span!(
+            "Actor: async AVM process particle & call results",
+            particle_id = particle_id,
+            deal_id = self.deal_id.as_ref().map(String::from)
+        );
+        if let Some(ext_particle) = ext_particle.as_ref() {
+            async_span.follows_from(ext_particle.span.as_ref());
+        }
+        for span in call_spans {
+            async_span.follows_from(span.as_ref());
+        }
+        let linking_span = Arc::new(async_span.clone());
+        (async_span, linking_span)
+    }
+    fn wake(&self) {
+        if let Some(waker) = &self.waker {
+            waker.wake_by_ref();
+        }
+    }
+}
+
+pub enum ActorPoll<RT> {
+    Executing(Vec<SingleCallStat>),
+    Vm(usize, RT),
+}
+
\ No newline at end of file diff --git a/src/aquamarine/aqua_runtime.rs.html b/src/aquamarine/aqua_runtime.rs.html new file mode 100644 index 0000000000..e0e5d8361c --- /dev/null +++ b/src/aquamarine/aqua_runtime.rs.html @@ -0,0 +1,393 @@ +aqua_runtime.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use async_trait::async_trait;
+use std::str::FromStr;
+use std::{error::Error, task::Waker};
+
+use avm_server::avm_runner::{AVMRunner, RawAVMOutcome};
+use avm_server::{
+    AVMMemoryStats, AVMRuntimeLimits, CallRequests, CallResults, ParticleParameters, RunnerError,
+};
+use fluence_keypair::KeyPair;
+use libp2p::PeerId;
+use marine_wasmtime_backend::WasmtimeWasmBackend;
+use tracing::Level;
+
+use crate::config::VmConfig;
+use crate::error::{ExecutionError, FieldError};
+use crate::particle_effects::ParticleEffects;
+
+#[async_trait]
+pub trait AquaRuntime: Sized + Send + 'static {
+    type Config: Clone + Send + 'static;
+    type Error: Error + Send + Sync + 'static;
+
+    fn create_runtime(
+        config: Self::Config,
+        wasm_backend: WasmtimeWasmBackend,
+        waker: Waker,
+    ) -> Result<Self, Self::Error>;
+
+    // TODO: move into_effects inside call
+    fn into_effects(
+        outcome: Result<RawAVMOutcome, Self::Error>,
+        particle_id: String,
+    ) -> ParticleEffects;
+
+    async fn call(
+        &mut self,
+        air: impl Into<String> + Send,
+        prev_data: impl Into<Vec<u8>> + Send,
+        current_data: impl Into<Vec<u8>> + Send,
+        particle_params: ParticleParameters<'_>,
+        call_results: CallResults,
+        key_pair: &KeyPair,
+    ) -> Result<RawAVMOutcome, Self::Error>;
+
+    /// Return current size of memory. Use only for diagnostics purposes.
+    fn memory_stats(&self) -> AVMMemoryStats;
+}
+
+#[async_trait]
+impl AquaRuntime for AVMRunner<WasmtimeWasmBackend> {
+    type Config = VmConfig;
+    type Error = RunnerError;
+
+    /// Creates `AVM` in background (on blocking threadpool)
+    fn create_runtime(
+        config: Self::Config,
+        backend: WasmtimeWasmBackend,
+        waker: Waker,
+    ) -> Result<Self, Self::Error> {
+        let avm_runtime_limits = AVMRuntimeLimits::new(
+            config.air_size_limit,
+            config.particle_size_limit,
+            config.call_result_size_limit,
+            config.hard_limit_enabled,
+        );
+        let vm: AVMRunner<WasmtimeWasmBackend> =
+            tokio::runtime::Handle::current().block_on(AVMRunner::new(
+                config.air_interpreter,
+                config.max_heap_size,
+                avm_runtime_limits,
+                i32::MAX,
+                backend,
+            ))?;
+        waker.wake();
+        Ok(vm)
+    }
+
+    fn into_effects(
+        outcome: Result<RawAVMOutcome, Self::Error>,
+        particle_id: String,
+    ) -> ParticleEffects {
+        match parse_outcome(outcome) {
+            Ok((new_data, peers, calls)) if !peers.is_empty() || !calls.is_empty() => {
+                #[rustfmt::skip]
+                tracing::debug!(
+                    target: "execution",
+                    particle_id,
+                    "Particle executed: {} call requests, {} next peers", calls.len(), peers.len()
+                );
+
+                ParticleEffects {
+                    next_peers: peers,
+                    call_requests: calls,
+                    new_data,
+                }
+            }
+            Ok((data, ..)) => {
+                tracing::debug!(
+                    target: "execution",
+                    particle_id,
+                    "Executed particle, next_peer_pks is empty, no call requests. Nothing to do.",
+                );
+
+                if tracing::enabled!(Level::DEBUG) {
+                    let data = String::from_utf8_lossy(data.as_slice());
+                    tracing::debug!(particle_id, "particle next_peer_pks = [], data: {}", data);
+                }
+
+                ParticleEffects::empty()
+            }
+            Err(ExecutionError::AquamarineError(err)) => {
+                tracing::warn!(target: "execution", particle_id, "Error executing particle: {}", err);
+                ParticleEffects::empty()
+            }
+            Err(err @ ExecutionError::InvalidResultField { .. }) => {
+                tracing::warn!(target: "execution", particle_id, "Error parsing outcome for particle: {}", err);
+                ParticleEffects::empty()
+            }
+        }
+    }
+
+    #[inline]
+    async fn call(
+        &mut self,
+        air: impl Into<String> + Send,
+        prev_data: impl Into<Vec<u8>> + Send,
+        current_data: impl Into<Vec<u8>> + Send,
+        particle_params: ParticleParameters<'_>,
+        call_results: CallResults,
+        key_pair: &KeyPair,
+    ) -> Result<RawAVMOutcome, Self::Error> {
+        AVMRunner::call(
+            self,
+            air,
+            prev_data,
+            current_data,
+            particle_params.init_peer_id,
+            particle_params.timestamp,
+            particle_params.ttl,
+            particle_params.current_peer_id,
+            call_results,
+            key_pair,
+            particle_params.particle_id.to_string(),
+        )
+        .await
+    }
+
+    fn memory_stats(&self) -> AVMMemoryStats {
+        self.memory_stats()
+    }
+}
+
+pub fn parse_outcome(
+    outcome: Result<RawAVMOutcome, RunnerError>,
+) -> Result<(Vec<u8>, Vec<PeerId>, CallRequests), ExecutionError> {
+    let outcome = outcome.map_err(ExecutionError::AquamarineError)?;
+
+    let peer_ids = outcome
+        .next_peer_pks
+        .into_iter()
+        .map(|id| {
+            parse_peer_id(id.as_str()).map_err(|error| ExecutionError::InvalidResultField {
+                field: "next_peer_pks[..]",
+                error,
+            })
+        })
+        .collect::<Result<_, ExecutionError>>()?;
+
+    Ok((outcome.data, peer_ids, outcome.call_requests))
+}
+
+fn parse_peer_id(s: &str) -> Result<PeerId, FieldError> {
+    PeerId::from_str(s).map_err(|err| FieldError::InvalidPeerId {
+        peer_id: s.to_string(),
+        err: err.to_string(),
+    })
+}
+
\ No newline at end of file diff --git a/src/aquamarine/aquamarine.rs.html b/src/aquamarine/aquamarine.rs.html new file mode 100644 index 0000000000..081f22310a --- /dev/null +++ b/src/aquamarine/aquamarine.rs.html @@ -0,0 +1,549 @@ +aquamarine.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+use std::collections::HashMap;
+use std::future::Future;
+use std::sync::Arc;
+use std::task::Poll;
+use std::time::Duration;
+
+use futures::StreamExt;
+use marine_wasmtime_backend::WasmtimeWasmBackend;
+use tokio::sync::mpsc;
+use tokio::task::JoinHandle;
+use tracing::{instrument, Instrument};
+
+use health::HealthCheckRegistry;
+use particle_execution::{ParticleFunctionStatic, ServiceFunction};
+use particle_protocol::ExtendedParticle;
+use particle_services::{PeerScope, WasmBackendConfig};
+use peer_metrics::{ParticleExecutorMetrics, VmPoolMetrics};
+use workers::{Event, KeyStorage, PeerScopes, Receiver, Workers};
+
+use crate::command::Command;
+use crate::command::Command::{AddService, Ingest, RemoveService};
+use crate::error::AquamarineApiError;
+use crate::vm_pool::VmPool;
+use crate::{
+    AquaRuntime, DataStoreConfig, ParticleDataStore, Plumber, RemoteRoutingEffects, VmPoolConfig,
+};
+
+pub type EffectsChannel = mpsc::Sender<Result<RemoteRoutingEffects, AquamarineApiError>>;
+
+pub struct AquamarineBackend<RT: AquaRuntime, F> {
+    inlet: mpsc::Receiver<Command>,
+    worker_events: Receiver<Event>,
+    plumber: Plumber<RT, F>,
+    out: EffectsChannel,
+    data_store: Arc<ParticleDataStore>,
+}
+
+impl<RT: AquaRuntime, F: ParticleFunctionStatic> AquamarineBackend<RT, F> {
+    #[allow(clippy::too_many_arguments)]
+    pub fn new(
+        config: VmPoolConfig,
+        vm_config: RT::Config,
+        avm_wasm_backend_config: WasmBackendConfig,
+        data_store_config: DataStoreConfig,
+        builtins: F,
+        out: EffectsChannel,
+        plumber_metrics: Option<ParticleExecutorMetrics>,
+        vm_pool_metrics: Option<VmPoolMetrics>,
+        health_registry: Option<&mut HealthCheckRegistry>,
+        workers: Arc<Workers>,
+        key_storage: Arc<KeyStorage>,
+        scopes: PeerScopes,
+        worker_events: Receiver<Event>,
+    ) -> eyre::Result<(Self, AquamarineApi)> {
+        // TODO: make `100` configurable
+        let (outlet, inlet) = mpsc::channel(100);
+        let sender = AquamarineApi::new(outlet, config.execution_timeout);
+
+        let data_store = ParticleDataStore::new(
+            data_store_config.particles_dir,
+            data_store_config.particles_vault_dir,
+            data_store_config.particles_anomaly_dir,
+        );
+        let data_store: Arc<ParticleDataStore> = Arc::new(data_store);
+        let avm_wasm_backend = WasmtimeWasmBackend::new(avm_wasm_backend_config.into())?;
+
+        let vm_pool = VmPool::new(
+            config.pool_size,
+            vm_config.clone(),
+            vm_pool_metrics,
+            health_registry,
+            avm_wasm_backend.clone(),
+        );
+        let plumber = Plumber::new(
+            vm_config,
+            vm_pool,
+            data_store.clone(),
+            builtins,
+            plumber_metrics,
+            workers,
+            key_storage,
+            scopes,
+            avm_wasm_backend,
+        );
+        let this = Self {
+            inlet,
+            worker_events,
+            plumber,
+            out,
+            data_store,
+        };
+
+        Ok((this, sender))
+    }
+
+    pub fn poll(&mut self, cx: &mut std::task::Context<'_>) -> Poll<()> {
+        let mut wake = self.process_worker_events();
+
+        // check if there are new particles
+        loop {
+            match self.inlet.poll_recv(cx) {
+                Poll::Ready(Some(Ingest { particle, function })) => {
+                    wake = true;
+                    let span = tracing::info_span!(parent: particle.span.as_ref(), "Aquamarine::poll::ingest");
+                    let _guard = span.entered();
+                    // set new particle to be executed
+                    // every particle that comes from the connection pool first executed on the host peer id
+                    self.plumber.ingest(particle, function, PeerScope::Host);
+                }
+                Poll::Ready(Some(AddService {
+                    service,
+                    functions,
+                    fallback,
+                })) => self.plumber.add_service(service, functions, fallback),
+
+                Poll::Ready(Some(RemoveService { service })) => {
+                    self.plumber.remove_service(service)
+                }
+
+                Poll::Pending | Poll::Ready(None) => break,
+            }
+        }
+
+        // check if there are executed particles
+        while let Poll::Ready(effects) = self.plumber.poll(cx) {
+            wake = true;
+            // send results back
+            let sent = self.out.try_send(effects);
+            if let Err(err) = sent {
+                log::error!("Aquamarine effects outlet has died: {}", err);
+            }
+        }
+
+        if wake {
+            Poll::Ready(())
+        } else {
+            Poll::Pending
+        }
+    }
+
+    fn process_worker_events(&mut self) -> bool {
+        let mut wake = false;
+        loop {
+            let res = self.worker_events.try_recv();
+            match res {
+                Ok(event) => match event {
+                    Event::WorkerCreated {
+                        worker_id,
+                        thread_count,
+                    } => {
+                        wake = true;
+                        self.plumber.create_worker_pool(worker_id, thread_count);
+                    }
+                    Event::WorkerRemoved { worker_id } => {
+                        self.plumber.remove_worker_pool(worker_id);
+                    }
+                },
+                Err(_) => {
+                    break;
+                }
+            }
+        }
+        wake
+    }
+
+    pub fn start(mut self) -> JoinHandle<()> {
+        let data_store = self.data_store.clone();
+        let mut stream = futures::stream::poll_fn(move |cx| self.poll(cx).map(|_| Some(()))).fuse();
+        let result = tokio::task::Builder::new()
+            .name("Aquamarine")
+            .spawn(
+                async move {
+                    data_store
+                        .initialize()
+                        .await
+                        .expect("Could not initialize data store");
+                    loop {
+                        stream.next().await;
+                    }
+                }
+                .in_current_span(),
+            )
+            .expect("Could not spawn task");
+
+        result
+    }
+}
+
+#[derive(Clone)]
+pub struct AquamarineApi {
+    outlet: mpsc::Sender<Command>,
+    #[allow(dead_code)]
+    execution_timeout: Duration,
+}
+
+impl AquamarineApi {
+    pub fn new(outlet: mpsc::Sender<Command>, execution_timeout: Duration) -> Self {
+        Self {
+            outlet,
+            execution_timeout,
+        }
+    }
+
+    /// Send particle to the interpreters pool
+    #[instrument(level = tracing::Level::INFO, skip_all)]
+    pub fn execute(
+        self,
+        particle: ExtendedParticle,
+        function: Option<ServiceFunction>,
+    ) -> impl Future<Output = Result<(), AquamarineApiError>> {
+        let particle_id = particle.particle.id.clone();
+        self.send_command(Ingest { particle, function }, Some(particle_id))
+    }
+
+    pub fn add_service(
+        self,
+        service: String,
+        functions: HashMap<String, ServiceFunction>,
+    ) -> impl Future<Output = Result<(), AquamarineApiError>> {
+        self.send_command(
+            AddService {
+                service,
+                functions,
+                fallback: None,
+            },
+            None,
+        )
+    }
+
+    pub fn remove_service(
+        self,
+        service: String,
+    ) -> impl Future<Output = Result<(), AquamarineApiError>> {
+        self.send_command(RemoveService { service }, None)
+    }
+
+    fn send_command(
+        self,
+        command: Command,
+        particle_id: Option<String>,
+    ) -> impl Future<Output = Result<(), AquamarineApiError>> {
+        use AquamarineApiError::*;
+
+        let interpreters = self.outlet;
+
+        async move {
+            let sent = interpreters.send(command).await;
+
+            sent.map_err(|_err| {
+                log::error!("Aquamarine outlet died!");
+                AquamarineDied { particle_id }
+            })
+        }
+        .in_current_span()
+    }
+}
+
\ No newline at end of file diff --git a/src/aquamarine/command.rs.html b/src/aquamarine/command.rs.html new file mode 100644 index 0000000000..88ca02b81a --- /dev/null +++ b/src/aquamarine/command.rs.html @@ -0,0 +1,77 @@ +command.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use std::collections::HashMap;
+
+use particle_execution::ServiceFunction;
+use particle_protocol::ExtendedParticle;
+
+pub enum Command {
+    Ingest {
+        particle: ExtendedParticle,
+        function: Option<ServiceFunction>,
+    },
+    AddService {
+        service: String,
+        functions: HashMap<String, ServiceFunction>,
+        fallback: Option<ServiceFunction>,
+    },
+    RemoveService {
+        service: String,
+    },
+}
+
\ No newline at end of file diff --git a/src/aquamarine/config.rs.html b/src/aquamarine/config.rs.html new file mode 100644 index 0000000000..7a937653b9 --- /dev/null +++ b/src/aquamarine/config.rs.html @@ -0,0 +1,205 @@ +config.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use fs_utils::to_abs_path;
+use libp2p::PeerId;
+use std::path::PathBuf;
+use std::time::Duration;
+
+#[derive(Debug, Clone)]
+pub struct VmConfig {
+    pub current_peer_id: PeerId,
+    /// Path to AIR interpreter .wasm file (aquamarine.wasm)
+    pub air_interpreter: PathBuf,
+    /// Maximum heap size in bytes available for the interpreter.
+    pub max_heap_size: Option<u64>,
+    /// Maximum AIR script size in bytes.
+    pub air_size_limit: Option<u64>,
+    /// Maximum particle size in bytes.
+    pub particle_size_limit: Option<u64>,
+    /// Maximum call result size in bytes.
+    pub call_result_size_limit: Option<u64>,
+    /// A knob to enable/disable hard limits behavior in AquaVM.
+    pub hard_limit_enabled: bool,
+}
+
+#[derive(Debug, Clone)]
+pub struct VmPoolConfig {
+    /// Number of VMs to create
+    pub pool_size: usize,
+    /// Timeout of a particle execution
+    pub execution_timeout: Duration,
+}
+
+impl VmConfig {
+    pub fn new(
+        current_peer_id: PeerId,
+        air_interpreter: PathBuf,
+        max_heap_size: Option<u64>,
+        air_size_limit: Option<u64>,
+        particle_size_limit: Option<u64>,
+        call_result_size_limit: Option<u64>,
+        hard_limit_enabled: bool,
+    ) -> Self {
+        Self {
+            current_peer_id,
+            air_interpreter,
+            max_heap_size,
+            air_size_limit,
+            particle_size_limit,
+            call_result_size_limit,
+            hard_limit_enabled,
+        }
+    }
+}
+
+impl VmPoolConfig {
+    pub fn new(pool_size: usize, execution_timeout: Duration) -> Self {
+        Self {
+            pool_size,
+            execution_timeout,
+        }
+    }
+}
+
+#[derive(Debug, Clone)]
+pub struct DataStoreConfig {
+    /// Dir for the interpreter to persist particle data
+    /// to merge it between particles of the same particle_id
+    pub particles_dir: PathBuf,
+    /// Dir to store directories shared between services
+    /// in the span of a single particle execution
+    pub particles_vault_dir: PathBuf,
+    /// Dir to store particles data of AquaVM performance anomalies
+    pub particles_anomaly_dir: PathBuf,
+}
+
+impl DataStoreConfig {
+    pub fn new(base_dir: PathBuf) -> Self {
+        let base_dir = to_abs_path(base_dir);
+        Self {
+            particles_dir: config_utils::particles_dir(&base_dir),
+            particles_vault_dir: config_utils::particles_vault_dir(&base_dir),
+            particles_anomaly_dir: config_utils::particles_anomaly_dir(&base_dir),
+        }
+    }
+}
+
\ No newline at end of file diff --git a/src/aquamarine/deadline.rs.html b/src/aquamarine/deadline.rs.html new file mode 100644 index 0000000000..e4417c4565 --- /dev/null +++ b/src/aquamarine/deadline.rs.html @@ -0,0 +1,99 @@ +deadline.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use particle_protocol::Particle;
+
+#[derive(Debug, Clone)]
+pub struct Deadline {
+    // Unix timestamp in milliseconds
+    timestamp: u64,
+    // TTL in milliseconds
+    ttl: u32,
+}
+
+impl Deadline {
+    pub fn from(particle: &Particle) -> Self {
+        Self {
+            timestamp: particle.timestamp,
+            ttl: particle.ttl,
+        }
+    }
+
+    pub fn is_expired(&self, now_ms: u64) -> bool {
+        self.timestamp
+            .checked_add(self.ttl as u64)
+            // Whether ts is in the past
+            .map(|ts| ts < now_ms)
+            // If timestamp + ttl gives overflow, consider particle expired
+            .unwrap_or_else(|| {
+                log::warn!("timestamp {} + ttl {} overflowed", self.timestamp, self.ttl);
+                true
+            })
+    }
+}
+
\ No newline at end of file diff --git a/src/aquamarine/error.rs.html b/src/aquamarine/error.rs.html new file mode 100644 index 0000000000..55d1c9d799 --- /dev/null +++ b/src/aquamarine/error.rs.html @@ -0,0 +1,257 @@ +error.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use avm_server::RunnerError;
+use humantime::FormattedDuration;
+use std::error::Error;
+use std::fmt::{Display, Formatter};
+use thiserror::Error;
+
+use particle_protocol::ParticleError;
+
+#[derive(Debug, Error)]
+pub enum AquamarineApiError {
+    #[error("AquamarineApiError::ParticleExpired: particle_id = {particle_id}")]
+    ParticleExpired { particle_id: String },
+    #[error(
+        r#"AquamarineApiError::OneshotCancelled: particle_id = {particle_id}.
+        Aquamarine dropped particle processing before sending effects back.
+        This is unexpected and shouldn't happen"#
+    )]
+    OneshotCancelled { particle_id: String },
+    #[error(
+        r#"AquamarineApiError::AquamarineDied: particle_id = {particle_id:?}.
+        Aquamarine couldn't be reached from the NetworkApi.
+        This is unexpected and shouldn't happen."#
+    )]
+    AquamarineDied { particle_id: Option<String> },
+    #[error(
+        "AquamarineApiError::ExecutionTimedOut: particle_id = {particle_id}, timeout = {timeout}"
+    )]
+    ExecutionTimedOut {
+        particle_id: String,
+        timeout: FormattedDuration,
+    },
+    #[error("AquamarineApiError::AquamarineQueueFull: can't send particle {particle_id:?} to Aquamarine")]
+    AquamarineQueueFull { particle_id: Option<String> },
+    #[error("AquamarineApiError::SignatureVerificationFailed: particle_id = {particle_id}, error = {err}")]
+    SignatureVerificationFailed {
+        particle_id: String,
+        err: ParticleError,
+    },
+    #[error("AquamarineApiError::WorkerIsNotActive: worker_id = {worker_id}, particle_id = {particle_id}")]
+    WorkerIsNotActive {
+        worker_id: String,
+        particle_id: String,
+    },
+}
+
+impl AquamarineApiError {
+    pub fn into_particle_id(self) -> Option<String> {
+        match self {
+            AquamarineApiError::ParticleExpired { particle_id } => Some(particle_id),
+            AquamarineApiError::OneshotCancelled { particle_id } => Some(particle_id),
+            AquamarineApiError::ExecutionTimedOut { particle_id, .. } => Some(particle_id),
+            AquamarineApiError::WorkerIsNotActive { particle_id, .. } => Some(particle_id),
+            // Should it be `None`  considering usage of signature as particle id?
+            // It can compromise valid particles into thinking they are invalid.
+            // But still there can be a case when signature was generated wrong
+            // and client will never know about it.
+            AquamarineApiError::SignatureVerificationFailed { .. } => None,
+            AquamarineApiError::AquamarineDied { particle_id } => particle_id,
+            AquamarineApiError::AquamarineQueueFull { particle_id, .. } => particle_id,
+        }
+    }
+}
+
+impl std::error::Error for ExecutionError {
+    fn source(&self) -> Option<&(dyn Error + 'static)> {
+        match &self {
+            ExecutionError::InvalidResultField { error, .. } => Some(error),
+            ExecutionError::AquamarineError(err) => Some(err),
+        }
+    }
+}
+
+impl Display for ExecutionError {
+    fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
+        match self {
+            ExecutionError::InvalidResultField { field, error } => {
+                write!(f, "Execution error: invalid result field {field}: {error}")
+            }
+            ExecutionError::AquamarineError(err) => {
+                write!(f, "Execution error: aquamarine error: {err}")
+            }
+        }
+    }
+}
+
+#[derive(Debug)]
+pub enum FieldError {
+    InvalidPeerId { peer_id: String, err: String },
+}
+
+impl std::error::Error for FieldError {}
+impl Display for FieldError {
+    fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
+        match self {
+            FieldError::InvalidPeerId { peer_id, err } => {
+                write!(f, "invalid PeerId '{peer_id}': {err}")
+            }
+        }
+    }
+}
+
+#[derive(Debug)]
+pub enum ExecutionError {
+    InvalidResultField {
+        field: &'static str,
+        error: FieldError,
+    },
+    AquamarineError(RunnerError),
+}
+
\ No newline at end of file diff --git a/src/aquamarine/health.rs.html b/src/aquamarine/health.rs.html new file mode 100644 index 0000000000..994005345c --- /dev/null +++ b/src/aquamarine/health.rs.html @@ -0,0 +1,235 @@ +health.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use health::HealthCheck;
+use std::sync::atomic::{AtomicUsize, Ordering};
+use std::sync::Arc;
+
+#[derive(Clone)]
+pub struct VMPoolHealth {
+    expected_count: usize,
+    current_count: Arc<AtomicUsize>,
+}
+
+impl VMPoolHealth {
+    pub fn new(expected_count: usize) -> Self {
+        Self {
+            expected_count,
+            current_count: Arc::new(AtomicUsize::new(0)),
+        }
+    }
+
+    pub fn increment_count(&self) {
+        self.current_count.fetch_add(1, Ordering::Release);
+    }
+}
+
+impl HealthCheck for VMPoolHealth {
+    fn status(&self) -> eyre::Result<()> {
+        let current = self.current_count.load(Ordering::Acquire);
+        if self.expected_count != current {
+            return Err(eyre::eyre!(
+                "VM pool isn't full. Current: {}, Expected: {}",
+                current,
+                self.expected_count
+            ));
+        }
+
+        Ok(())
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+    use crate::health::VMPoolHealth;
+    use std::thread;
+
+    #[test]
+    fn test_vm_pool_health_empty() {
+        let pool_health = VMPoolHealth::new(0);
+        let status = pool_health.status();
+        assert!(status.is_ok());
+    }
+
+    #[test]
+    fn test_vm_pool_health_partial() {
+        let pool_health = VMPoolHealth::new(5);
+        pool_health.increment_count();
+        pool_health.increment_count();
+        pool_health.increment_count();
+
+        let status = pool_health.status();
+        assert!(status.is_err());
+    }
+
+    #[test]
+    fn test_vm_pool_health_full() {
+        let pool_health = VMPoolHealth::new(3);
+        pool_health.increment_count();
+        pool_health.increment_count();
+        pool_health.increment_count();
+
+        let status = pool_health.status();
+        assert!(status.is_ok());
+    }
+
+    #[test]
+    fn test_vm_pool_health_concurrent_access() {
+        let pool_health = VMPoolHealth::new(100);
+        let mut handles = vec![];
+
+        // Simulate concurrent access by spawning multiple threads.
+        for _ in 0..50 {
+            let pool_health_clone = pool_health.clone();
+            let handle = thread::spawn(move || {
+                for _ in 0..2 {
+                    pool_health_clone.increment_count();
+                }
+            });
+            handles.push(handle);
+        }
+
+        // Wait for all threads to finish.
+        for handle in handles {
+            handle.join().unwrap();
+        }
+
+        let status = pool_health.status();
+        assert!(status.is_ok());
+    }
+}
+
\ No newline at end of file diff --git a/src/aquamarine/lib.rs.html b/src/aquamarine/lib.rs.html new file mode 100644 index 0000000000..ce2fe22e94 --- /dev/null +++ b/src/aquamarine/lib.rs.html @@ -0,0 +1,123 @@ +lib.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+#![recursion_limit = "512"]
+#![warn(rust_2018_idioms)]
+#![deny(
+    dead_code,
+    nonstandard_style,
+    unused_imports,
+    unused_mut,
+    unused_variables,
+    unused_unsafe,
+    unreachable_patterns
+)]
+
+mod actor;
+mod aquamarine;
+mod command;
+mod config;
+mod deadline;
+mod error;
+mod log;
+mod particle_data_store;
+mod particle_executor;
+mod particle_functions;
+mod plumber;
+mod spawner;
+
+mod aqua_runtime;
+
+mod particle_effects;
+
+mod health;
+mod vm_pool;
+
+pub use crate::aqua_runtime::AquaRuntime;
+pub use crate::aquamarine::{AquamarineApi, AquamarineBackend};
+pub use crate::config::{DataStoreConfig, VmConfig, VmPoolConfig};
+pub use crate::particle_effects::{InterpretationStats, ParticleEffects, RemoteRoutingEffects};
+pub type AVMRunner = avm_server::avm_runner::AVMRunner<WasmtimeWasmBackend>;
+pub use error::AquamarineApiError;
+pub use marine_wasmtime_backend::WasmtimeWasmBackend;
+pub use particle_data_store::{DataStoreError, ParticleDataStore};
+pub use particle_services::WasmBackendConfig;
+pub use plumber::Plumber;
+
\ No newline at end of file diff --git a/src/aquamarine/log.rs.html b/src/aquamarine/log.rs.html new file mode 100644 index 0000000000..1ae145f5eb --- /dev/null +++ b/src/aquamarine/log.rs.html @@ -0,0 +1,117 @@ +log.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use humantime::FormattedDuration;
+
+/// Truncate string to be at max 500 graphemes
+fn truncate(s: &str) -> &str {
+    match s.char_indices().nth(500) {
+        None => s,
+        Some((idx, _)) => &s[..idx],
+    }
+}
+
+/// Function that logs for different builtin namespaces
+pub fn builtin_log_fn(service: &str, args: &str, elapsed: FormattedDuration, particle_id: String) {
+    let args = truncate(args);
+    match service {
+        "array" | "cmp" | "debug" | "math" | "op" | "getDataSrv" | "run-console" | "json" => {
+            tracing::event!(
+                tracing::Level::TRACE,
+                "Executed host call {} ({}) [{}]",
+                args,
+                elapsed,
+                particle_id
+            )
+        }
+        "peer" | "stat" | "sig" | "srv" | "dist" | "kad" => tracing::event!(
+            tracing::Level::DEBUG,
+            "Executed host call {} ({}) [{}]",
+            args,
+            elapsed,
+            particle_id
+        ),
+        _ => tracing::event!(
+            tracing::Level::DEBUG,
+            "Executed host call {} ({}) [{}]",
+            args,
+            elapsed,
+            particle_id
+        ),
+    }
+}
+
\ No newline at end of file diff --git a/src/aquamarine/particle_data_store.rs.html b/src/aquamarine/particle_data_store.rs.html new file mode 100644 index 0000000000..00cebf1bf4 --- /dev/null +++ b/src/aquamarine/particle_data_store.rs.html @@ -0,0 +1,1033 @@ +particle_data_store.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use std::borrow::Cow;
+use std::io::ErrorKind;
+use std::path::{Path, PathBuf};
+use std::time::Duration;
+
+use avm_server::avm_runner::RawAVMOutcome;
+use avm_server::{AnomalyData, CallResults, ParticleParameters};
+use fluence_libp2p::PeerId;
+use futures::stream::FuturesUnordered;
+use futures::StreamExt;
+use thiserror::Error;
+use tracing::instrument;
+
+use now_millis::now_ms;
+use particle_execution::{ParticleVault, VaultError};
+
+type Result<T> = std::result::Result<T, DataStoreError>;
+
+#[derive(Debug, Clone)]
+pub struct ParticleDataStore {
+    pub particle_data_store: PathBuf,
+    pub vault: ParticleVault,
+    pub anomaly_data_store: PathBuf,
+}
+
+impl ParticleDataStore {
+    pub fn new(
+        particle_data_store: PathBuf,
+        vault_dir: PathBuf,
+        anomaly_data_store: PathBuf,
+    ) -> Self {
+        Self {
+            particle_data_store,
+            vault: ParticleVault::new(vault_dir),
+            anomaly_data_store,
+        }
+    }
+
+    pub fn data_file(&self, particle_id: &str, current_peer_id: &str, signature: &[u8]) -> PathBuf {
+        let key = store_key_from_components(particle_id, current_peer_id, signature);
+        self.particle_data_store.join(key)
+    }
+
+    /// Returns $ANOMALY_DATA_STORE/$particle_id/$timestamp
+    pub fn anomaly_dir(
+        &self,
+        particle_id: &str,
+        current_peer_id: &str,
+        signature: &[u8],
+    ) -> PathBuf {
+        let key = store_key_from_components(particle_id, current_peer_id, signature);
+        [
+            self.anomaly_data_store.as_path(),
+            Path::new(&key),
+            Path::new(&now_ms().to_string()),
+        ]
+        .iter()
+        .collect()
+    }
+}
+
+const EXECUTION_TIME_THRESHOLD: Duration = Duration::from_millis(500);
+const MEMORY_DELTA_BYTES_THRESHOLD: usize = 10 * bytesize::MB as usize;
+
+impl ParticleDataStore {
+    pub async fn initialize(&self) -> Result<()> {
+        tokio::fs::create_dir_all(&self.particle_data_store)
+            .await
+            .map_err(DataStoreError::CreateDataStore)?;
+
+        self.vault.initialize().await?;
+
+        Ok(())
+    }
+
+    #[instrument(level = tracing::Level::INFO, skip_all)]
+    pub async fn store_data(
+        &self,
+        data: &[u8],
+        particle_id: &str,
+        current_peer_id: &str,
+        signature: &[u8],
+    ) -> Result<()> {
+        tracing::trace!(target: "particle_reap", particle_id = particle_id, "Storing data for particle");
+        let data_path = self.data_file(particle_id, current_peer_id, signature);
+        tokio::fs::write(&data_path, data)
+            .await
+            .map_err(|err| DataStoreError::StoreData(err, data_path))?;
+
+        Ok(())
+    }
+
+    #[instrument(level = tracing::Level::INFO)]
+    pub async fn read_data(
+        &self,
+        particle_id: &str,
+        current_peer_id: &str,
+        signature: &[u8],
+    ) -> Result<Vec<u8>> {
+        let data_path = self.data_file(particle_id, current_peer_id, signature);
+        let data = tokio::fs::read(&data_path).await.unwrap_or_default();
+        Ok(data)
+    }
+
+    pub async fn batch_cleanup_data(&self, cleanup_keys: Vec<(String, PeerId, Vec<u8>, String)>) {
+        let futures: FuturesUnordered<_> = cleanup_keys
+            .into_iter()
+            .map(
+                |(particle_id, peer_id, signature, particle_token)| async move {
+                    tracing::debug!(
+                        target: "particle_reap",
+                        particle_id = particle_id, worker_id = peer_id.to_base58(),
+                        "Reaping particle's actor"
+                    );
+
+                    if let Err(err) = self
+                        .cleanup_data(
+                            particle_id.as_str(),
+                            peer_id,
+                            &signature,
+                            particle_token.as_str(),
+                        )
+                        .await
+                    {
+                        tracing::warn!(
+                            particle_id = particle_id,
+                            "Error cleaning up after particle {:?}",
+                            err
+                        );
+                    }
+                },
+            )
+            .collect();
+        let _results: Vec<_> = futures.collect().await;
+    }
+
+    async fn cleanup_data(
+        &self,
+        particle_id: &str,
+        current_peer_id: PeerId,
+        signature: &[u8],
+        particle_token: &str,
+    ) -> Result<()> {
+        tracing::debug!(target: "particle_reap", particle_id = particle_id, "Cleaning up particle data for particle");
+        let path = self.data_file(particle_id, &current_peer_id.to_base58(), signature);
+        match tokio::fs::remove_file(&path).await {
+            Ok(_) => Ok(()),
+            // ignore NotFound
+            Err(err) if err.kind() == ErrorKind::NotFound => Ok(()),
+            Err(err) => Err(DataStoreError::CleanupData(err)),
+        }?;
+
+        self.vault
+            .cleanup(current_peer_id, particle_id, particle_token)
+            .await?;
+
+        Ok(())
+    }
+
+    fn detect_mem_limits_anomaly(&self, memory_delta: usize, outcome: &RawAVMOutcome) -> bool {
+        memory_delta > MEMORY_DELTA_BYTES_THRESHOLD
+            || outcome.soft_limits_triggering.are_limits_exceeded()
+    }
+
+    pub fn detect_anomaly(
+        &self,
+        execution_time: Duration,
+        memory_delta: usize,
+        outcome: &RawAVMOutcome,
+    ) -> bool {
+        execution_time > EXECUTION_TIME_THRESHOLD
+            || outcome.ret_code != 0
+            || self.detect_mem_limits_anomaly(memory_delta, outcome)
+    }
+
+    #[allow(clippy::too_many_arguments)]
+    #[instrument(level = tracing::Level::INFO, skip_all)]
+    pub async fn save_anomaly_data(
+        &self,
+        air_script: &str,
+        current_data: &[u8],
+        call_results: &CallResults,
+        particle_parameters: &ParticleParameters<'_>,
+        particle_signature: &[u8],
+        outcome: &RawAVMOutcome,
+        execution_time: Duration,
+        memory_delta: usize,
+    ) -> std::result::Result<(), DataStoreError> {
+        let prev_data = self
+            .read_data(
+                &particle_parameters.particle_id,
+                &particle_parameters.current_peer_id,
+                particle_signature,
+            )
+            .await?;
+
+        let ser_particle =
+            serde_json::to_vec(particle_parameters).map_err(DataStoreError::SerializeAnomaly)?;
+        let ser_call_results =
+            serde_json::to_vec(call_results).map_err(DataStoreError::SerializeAnomaly)?;
+        let ser_avm_outcome =
+            serde_json::to_vec(outcome).map_err(DataStoreError::SerializeAnomaly)?;
+
+        let anomaly_data = AnomalyData {
+            air_script: Cow::Borrowed(air_script),
+            particle: Cow::Owned(ser_particle),
+            prev_data: Cow::Owned(prev_data),
+            current_data: Cow::Borrowed(current_data),
+            call_results: Cow::Owned(ser_call_results),
+            avm_outcome: Cow::Owned(ser_avm_outcome),
+            execution_time,
+            memory_delta,
+        };
+        self.collect_anomaly_data(
+            &particle_parameters.particle_id,
+            &particle_parameters.current_peer_id,
+            particle_signature,
+            anomaly_data,
+        )
+        .await?;
+        Ok(())
+    }
+
+    async fn collect_anomaly_data(
+        &self,
+        particle_id: &str,
+        current_peer_id: &str,
+        signature: &[u8],
+        anomaly_data: AnomalyData<'_>,
+    ) -> std::result::Result<(), DataStoreError> {
+        let path = self.anomaly_dir(particle_id, current_peer_id, signature);
+        tokio::fs::create_dir_all(&path)
+            .await
+            .map_err(DataStoreError::CreateAnomalyDir)?;
+
+        let file = path.join("data");
+        let data = serde_json::to_vec(&anomaly_data).map_err(DataStoreError::SerializeAnomaly)?;
+        tokio::fs::write(&file, data)
+            .await
+            .map_err(|err| DataStoreError::WriteAnomaly(err, file))?;
+
+        Ok(())
+    }
+}
+
+#[derive(Debug, Error)]
+pub enum DataStoreError {
+    #[error("error creating particle_data_store")]
+    CreateDataStore(#[source] std::io::Error),
+    #[error(transparent)]
+    VaultError(#[from] VaultError),
+    #[error("error writing data to {1:?}")]
+    StoreData(#[source] std::io::Error, PathBuf),
+    #[error("error cleaning up data")]
+    CleanupData(#[source] std::io::Error),
+    #[error("error creating anomaly dir")]
+    CreateAnomalyDir(#[source] std::io::Error),
+    #[error("error writing anomaly data to {1:?}")]
+    WriteAnomaly(#[source] std::io::Error, PathBuf),
+    #[error("error serializing anomaly data")]
+    SerializeAnomaly(#[source] serde_json::error::Error),
+    #[error("error reading data from {1:?}")]
+    ReadData(#[source] std::io::Error, PathBuf),
+}
+
+fn store_key_from_components(particle_id: &str, current_peer_id: &str, signature: &[u8]) -> String {
+    format!(
+        "particle_{particle_id}-peer_{current_peer_id}-sig_{}",
+        format_signature(signature)
+    )
+}
+
+fn format_signature(signature: &[u8]) -> String {
+    bs58::encode(signature).into_string()
+}
+
+#[cfg(test)]
+mod tests {
+    use crate::ParticleDataStore;
+    use avm_server::avm_runner::RawAVMOutcome;
+    use avm_server::{CallRequests, SoftLimitsTriggering};
+    use fluence_libp2p::PeerId;
+    use std::path::PathBuf;
+    use std::time::Duration;
+
+    #[tokio::test]
+    async fn test_initialize() {
+        let temp_dir = tempfile::tempdir().expect("Failed to create temp dir");
+        let particle_data_store = temp_dir.path().join("particle_data_store");
+        let vault_dir = temp_dir.path().join("vault");
+        let anomaly_data_store = temp_dir.path().join("anomaly_data_store");
+        let particle_data_store_clone = particle_data_store.clone();
+
+        let particle_data_store =
+            ParticleDataStore::new(particle_data_store, vault_dir, anomaly_data_store);
+
+        let result = particle_data_store.initialize().await;
+
+        assert!(result.is_ok());
+        assert!(particle_data_store_clone.exists());
+    }
+
+    #[tokio::test]
+    async fn test_store_and_read_data() {
+        let temp_dir = tempfile::tempdir().expect("Failed to create temp dir");
+        let particle_data_store = temp_dir.path().join("particle_data_store");
+        let vault_dir = temp_dir.path().join("vault");
+        let anomaly_data_store = temp_dir.path().join("anomaly_data_store");
+
+        let particle_data_store =
+            ParticleDataStore::new(particle_data_store, vault_dir, anomaly_data_store);
+        particle_data_store
+            .initialize()
+            .await
+            .expect("Failed to initialize");
+
+        let particle_id = "test_particle";
+        let current_peer_id = "test_peer";
+        let signature: &[u8] = &[0];
+        let data = b"test_data";
+
+        particle_data_store
+            .store_data(data, particle_id, current_peer_id, signature)
+            .await
+            .expect("Failed to store data");
+        let read_result = particle_data_store
+            .read_data(particle_id, current_peer_id, signature)
+            .await;
+
+        assert!(read_result.is_ok());
+        assert_eq!(read_result.unwrap(), data);
+    }
+
+    #[tokio::test]
+    async fn test_detect_anomaly() {
+        let particle_data_store = ParticleDataStore::new(
+            PathBuf::from("dummy"),
+            PathBuf::from("dummy"),
+            PathBuf::from("dummy"),
+        );
+
+        let execution_time_below_threshold = Duration::from_millis(400);
+        let execution_time_above_threshold = Duration::from_millis(600);
+        let memory_delta_below_threshold = 5 * bytesize::MB as usize;
+        let memory_delta_above_threshold = 15 * bytesize::MB as usize;
+        let soft_limits_triggering = <_>::default();
+        let outcome_success = RawAVMOutcome {
+            ret_code: 0,
+            error_message: "".to_string(),
+            data: vec![],
+            call_requests: CallRequests::new(),
+            next_peer_pks: vec![],
+            soft_limits_triggering,
+        };
+        let outcome_failure = RawAVMOutcome {
+            ret_code: 1,
+            error_message: "".to_string(),
+            data: vec![],
+            call_requests: CallRequests::new(),
+            next_peer_pks: vec![],
+            soft_limits_triggering,
+        };
+
+        let anomaly_below_threshold = particle_data_store.detect_anomaly(
+            execution_time_below_threshold,
+            memory_delta_below_threshold,
+            &outcome_success,
+        );
+
+        assert!(!anomaly_below_threshold);
+
+        let anomaly_above_threshold = particle_data_store.detect_anomaly(
+            execution_time_above_threshold,
+            memory_delta_above_threshold,
+            &outcome_failure,
+        );
+
+        assert!(anomaly_above_threshold);
+
+        let anomaly_below_air_size_limit = particle_data_store.detect_anomaly(
+            execution_time_below_threshold,
+            memory_delta_below_threshold,
+            &outcome_success,
+        );
+
+        assert!(!anomaly_below_air_size_limit);
+
+        let soft_limits_triggering = SoftLimitsTriggering::new(true, false, false);
+        let outcome = RawAVMOutcome {
+            ret_code: 0,
+            error_message: "".to_string(),
+            data: vec![],
+            call_requests: CallRequests::new(),
+            next_peer_pks: vec![],
+            soft_limits_triggering,
+        };
+        let anomaly_above_air_size_limit = particle_data_store.detect_anomaly(
+            execution_time_below_threshold,
+            memory_delta_below_threshold,
+            &outcome,
+        );
+
+        assert!(anomaly_above_air_size_limit);
+
+        let anomaly_below_particle_size_limit = particle_data_store.detect_anomaly(
+            execution_time_below_threshold,
+            memory_delta_below_threshold,
+            &outcome_success,
+        );
+
+        assert!(!anomaly_below_particle_size_limit);
+
+        let soft_limits_triggering = SoftLimitsTriggering::new(false, true, false);
+        let outcome = RawAVMOutcome {
+            ret_code: 0,
+            error_message: "".to_string(),
+            data: vec![],
+            call_requests: CallRequests::new(),
+            next_peer_pks: vec![],
+            soft_limits_triggering,
+        };
+        let anomaly_above_particle_size_limit = particle_data_store.detect_anomaly(
+            execution_time_below_threshold,
+            memory_delta_below_threshold,
+            &outcome,
+        );
+
+        assert!(anomaly_above_particle_size_limit);
+
+        let soft_limits_triggering = SoftLimitsTriggering::new(false, false, true);
+        let outcome = RawAVMOutcome {
+            ret_code: 0,
+            error_message: "".to_string(),
+            data: vec![],
+            call_requests: CallRequests::new(),
+            next_peer_pks: vec![],
+            soft_limits_triggering,
+        };
+        let anomaly_below_call_result_size_limit = particle_data_store.detect_anomaly(
+            execution_time_below_threshold,
+            memory_delta_below_threshold,
+            &outcome,
+        );
+
+        assert!(anomaly_below_call_result_size_limit);
+
+        // let anomaly_call_result_size =
+    }
+
+    #[tokio::test]
+    async fn test_cleanup_data() {
+        let temp_dir = tempfile::tempdir().expect("Failed to create temp dir");
+        let temp_dir_path = temp_dir.path();
+        let particle_data_store = ParticleDataStore::new(
+            temp_dir_path.join("particle_data_store"),
+            temp_dir_path.join("vault"),
+            temp_dir_path.join("anomaly_data_store"),
+        );
+        particle_data_store
+            .initialize()
+            .await
+            .expect("Failed to initialize");
+
+        let particle_id = "test_particle";
+        let particle_token = "test_token";
+        let current_peer_id = PeerId::random();
+        let current_peer_id_str = current_peer_id.to_base58();
+        let signature: &[u8] = &[];
+        let data = b"test_data";
+
+        particle_data_store
+            .store_data(data, particle_id, &current_peer_id_str, signature)
+            .await
+            .expect("Failed to store data");
+
+        let data_file_path =
+            particle_data_store.data_file(particle_id, &current_peer_id_str, signature);
+        let vault_path = particle_data_store.vault.real_particle_vault(
+            current_peer_id,
+            particle_id,
+            particle_token,
+        );
+        tokio::fs::create_dir_all(&vault_path)
+            .await
+            .expect("Failed to create vault dir");
+        assert!(data_file_path.exists());
+        assert!(vault_path.exists());
+
+        let cleanup_result = particle_data_store
+            .cleanup_data(particle_id, current_peer_id, signature, particle_token)
+            .await;
+
+        assert!(cleanup_result.is_ok());
+        assert!(!data_file_path.exists());
+        assert!(!vault_path.exists())
+    }
+}
+
\ No newline at end of file diff --git a/src/aquamarine/particle_effects.rs.html b/src/aquamarine/particle_effects.rs.html new file mode 100644 index 0000000000..ac656e657b --- /dev/null +++ b/src/aquamarine/particle_effects.rs.html @@ -0,0 +1,175 @@ +particle_effects.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use std::time::Duration;
+
+use libp2p::PeerId;
+
+use avm_server::CallRequests;
+use particle_protocol::ExtendedParticle;
+use types::peer_scope::PeerScope;
+
+#[derive(Clone, Debug)]
+/// Effects produced by particle execution. Currently the only effect is that of sending particles.
+pub struct ParticleEffects {
+    /// New particle data
+    pub new_data: Vec<u8>,
+    /// Instruction to send particle to these peers
+    pub next_peers: Vec<PeerId>,
+    /// Instruction to execute host calls
+    pub call_requests: CallRequests,
+}
+
+impl ParticleEffects {
+    pub fn empty() -> Self {
+        Self {
+            new_data: vec![],
+            next_peers: vec![],
+            call_requests: <_>::default(),
+        }
+    }
+}
+
+#[derive(Clone, Debug)]
+/// Performance stats about particle's interpretation
+pub struct InterpretationStats {
+    pub interpretation_time: Duration,
+    pub memory_delta: usize,
+    pub new_data_len: Option<usize>,
+    pub success: bool,
+}
+
+impl InterpretationStats {
+    pub fn failed() -> Self {
+        Self {
+            interpretation_time: Duration::default(),
+            memory_delta: 0,
+            new_data_len: None,
+            success: false,
+        }
+    }
+}
+
+/// Routing part of the [[ParticleEffects].
+/// Instruct to send particle to either virtual or remote peers.
+#[derive(Clone, Debug)]
+pub struct RawRoutingEffects {
+    pub particle: ExtendedParticle,
+    pub next_peers: Vec<PeerId>,
+}
+
+#[derive(Clone, Debug)]
+pub struct RemoteRoutingEffects {
+    pub particle: ExtendedParticle,
+    pub next_peers: Vec<PeerId>,
+}
+
+#[derive(Clone, Debug)]
+pub struct LocalRoutingEffects {
+    pub particle: ExtendedParticle,
+    pub next_peers: Vec<PeerScope>,
+}
+
\ No newline at end of file diff --git a/src/aquamarine/particle_executor.rs.html b/src/aquamarine/particle_executor.rs.html new file mode 100644 index 0000000000..46a867c2bc --- /dev/null +++ b/src/aquamarine/particle_executor.rs.html @@ -0,0 +1,611 @@ +particle_executor.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use async_trait::async_trait;
+use std::borrow::Cow;
+use std::sync::Arc;
+use std::time::Instant;
+
+use avm_server::avm_runner::RawAVMOutcome;
+use avm_server::{CallResults, ParticleParameters};
+use fluence_keypair::KeyPair;
+use tokio::task::JoinError;
+use tracing::instrument;
+
+use fluence_libp2p::PeerId;
+use particle_protocol::Particle;
+
+use crate::spawner::SpawnFunctions;
+use crate::spawner::Spawner;
+use crate::{AquaRuntime, InterpretationStats, ParticleDataStore, ParticleEffects};
+
+pub(super) type AVMRes<RT> = FutResult<Option<RT>, ParticleEffects, InterpretationStats>;
+
+#[async_trait]
+pub trait ParticleExecutor {
+    type Output;
+    type Particle;
+    async fn execute(
+        mut self,
+        spawner: Spawner,
+        data_store: Arc<ParticleDataStore>,
+        p: Self::Particle,
+        current_peer_id: PeerId,
+        key_pair: KeyPair,
+    ) -> Self::Output;
+}
+
+/// Result of a particle execution along a VM that has just executed the particle
+pub struct FutResult<RT, Eff, Stats> {
+    /// Return back AVM that just executed a particle and other reusable entities needed for execution
+    pub runtime: RT,
+    /// Outcome produced by particle execution
+    pub effects: Eff,
+    /// Performance stats
+    pub stats: Stats,
+}
+
+struct AVMCallResult<'a, RT: AquaRuntime> {
+    particle: Particle,
+    call_results: CallResults,
+    particle_params: ParticleParameters<'a>,
+    avm_outcome: Result<RawAVMOutcome, RT::Error>,
+    stats: InterpretationStats,
+    vm: RT,
+}
+
+#[async_trait]
+impl<RT: AquaRuntime> ParticleExecutor for RT {
+    type Output = AVMRes<RT>;
+    type Particle = (Particle, CallResults);
+
+    #[instrument(level = tracing::Level::INFO, skip_all)]
+    async fn execute(
+        mut self,
+        spawner: Spawner,
+        data_store: Arc<ParticleDataStore>,
+        p: Self::Particle,
+        current_peer_id: PeerId,
+        key_pair: KeyPair,
+    ) -> Self::Output {
+        let (particle, call_results) = p;
+        let particle_id = particle.id.clone();
+        tracing::trace!(target: "execution", particle_id = particle_id, "Executing particle");
+
+        let prev_data = data_store
+            .clone()
+            .read_data(
+                particle_id.as_str(),
+                current_peer_id.to_base58().as_str(),
+                &particle.signature,
+            )
+            .await;
+
+        if let Ok(prev_data) = prev_data {
+            execute_with_prev_data(
+                self,
+                spawner,
+                data_store,
+                current_peer_id,
+                key_pair,
+                particle,
+                call_results,
+                prev_data,
+            )
+            .await
+        } else {
+            FutResult {
+                runtime: Some(self),
+                effects: ParticleEffects::empty(),
+                stats: InterpretationStats::failed(),
+            }
+        }
+    }
+}
+
+#[instrument(level = tracing::Level::INFO, skip_all)]
+async fn execute_with_prev_data<RT: AquaRuntime>(
+    vm: RT,
+    spawner: Spawner,
+    data_store: Arc<ParticleDataStore>,
+    current_peer_id: PeerId,
+    key_pair: KeyPair,
+    particle: Particle,
+    call_results: CallResults,
+    prev_data: Vec<u8>,
+) -> AVMRes<RT> {
+    let particle_id = particle.id.clone();
+    let prev_data_len = prev_data.len();
+
+    let avm_result = avm_call(
+        spawner,
+        vm,
+        current_peer_id,
+        key_pair,
+        particle,
+        call_results,
+        prev_data,
+    )
+    .await;
+
+    match avm_result {
+        Ok(avm_result) => {
+            process_avm_result(data_store, current_peer_id, prev_data_len, avm_result).await
+        }
+        Err(err) => {
+            if err.is_cancelled() {
+                tracing::warn!(particle_id, "Particle task was cancelled");
+            } else {
+                tracing::error!(particle_id, "Particle task panic");
+            }
+            let stats = InterpretationStats::failed();
+            let effects = ParticleEffects::empty();
+            FutResult {
+                // We loose an AVM instance here
+                // But it will be recreated via VmPool
+                runtime: None,
+                effects,
+                stats,
+            }
+        }
+    }
+}
+
+#[instrument(level = tracing::Level::INFO, skip_all)]
+async fn process_avm_result<RT>(
+    data_store: Arc<ParticleDataStore>,
+    current_peer_id: PeerId,
+    prev_data_len: usize,
+    avm_result: AVMCallResult<'_, RT>,
+) -> AVMRes<RT>
+where
+    RT: AquaRuntime,
+{
+    let particle_id = avm_result.particle.id;
+    let stats = avm_result.stats;
+    match &avm_result.avm_outcome {
+        Ok(outcome) => {
+            let len = outcome.data.len();
+            tracing::trace!(
+                target: "execution", particle_id = particle_id,
+                "Particle interpreted in {} [{} bytes => {} bytes]",
+                humantime::format_duration(stats.interpretation_time), prev_data_len, len
+            );
+
+            if data_store.detect_anomaly(stats.interpretation_time, stats.memory_delta, outcome) {
+                let anomaly_result = data_store
+                    .save_anomaly_data(
+                        avm_result.particle.script.as_str(),
+                        &avm_result.particle.data,
+                        &avm_result.call_results,
+                        &avm_result.particle_params,
+                        &avm_result.particle.signature,
+                        outcome,
+                        stats.interpretation_time,
+                        stats.memory_delta,
+                    )
+                    .await;
+                if let Err(err) = anomaly_result {
+                    tracing::warn!(
+                        particle_id = particle_id,
+                        "Could not save anomaly result: {}",
+                        err
+                    )
+                }
+            }
+
+            let store_result = data_store
+                .store_data(
+                    &outcome.data,
+                    particle_id.as_str(),
+                    current_peer_id.to_base58().as_str(),
+                    &avm_result.particle.signature,
+                )
+                .await;
+            if let Err(err) = store_result {
+                tracing::warn!(
+                    particle_id = particle_id,
+                    "Could not save particle result: {}",
+                    err
+                );
+                return FutResult {
+                    runtime: Some(avm_result.vm),
+                    effects: ParticleEffects::empty(),
+                    stats: InterpretationStats::failed(),
+                };
+            }
+        }
+        Err(err) => {
+            tracing::warn!(
+                particle_id = particle_id,
+                "Error executing particle: {}",
+                err
+            )
+        }
+    }
+    let effects = RT::into_effects(avm_result.avm_outcome, particle_id);
+
+    FutResult {
+        runtime: Some(avm_result.vm),
+        effects,
+        stats,
+    }
+}
+
+#[instrument(level = tracing::Level::INFO, skip_all)]
+async fn avm_call<'a, RT: AquaRuntime>(
+    spawner: Spawner,
+    mut vm: RT,
+    current_peer_id: PeerId,
+    key_pair: KeyPair,
+    particle: Particle,
+    call_results: CallResults,
+    prev_data: Vec<u8>,
+) -> Result<AVMCallResult<'a, RT>, JoinError> {
+    spawner
+        .spawn_avm_call(async move {
+            let particle_id = particle.id.clone();
+            let now = Instant::now();
+            let memory_size_before = vm.memory_stats().memory_size;
+            let particle_params = ParticleParameters {
+                current_peer_id: Cow::Owned(current_peer_id.to_string()),
+                init_peer_id: Cow::Owned(particle.init_peer_id.to_string()),
+                particle_id: Cow::Owned(particle_id),
+                timestamp: particle.timestamp,
+                ttl: particle.ttl,
+            };
+            let current_data = &particle.data[..];
+            let avm_outcome = vm
+                .call(
+                    &particle.script,
+                    prev_data,
+                    current_data,
+                    particle_params.clone(),
+                    call_results.clone(),
+                    &key_pair,
+                )
+                .await;
+            let memory_size_after = vm.memory_stats().memory_size;
+
+            let interpretation_time = now.elapsed();
+            let new_data_len = avm_outcome.as_ref().map(|e| e.data.len()).ok();
+            let memory_delta = memory_size_after - memory_size_before;
+            let stats = InterpretationStats {
+                memory_delta,
+                interpretation_time,
+                new_data_len,
+                success: avm_outcome.is_ok(),
+            };
+            AVMCallResult {
+                avm_outcome,
+                stats,
+                particle,
+                call_results,
+                particle_params,
+                vm,
+            }
+        })
+        .await
+}
+
\ No newline at end of file diff --git a/src/aquamarine/particle_functions.rs.html b/src/aquamarine/particle_functions.rs.html new file mode 100644 index 0000000000..51a787e661 --- /dev/null +++ b/src/aquamarine/particle_functions.rs.html @@ -0,0 +1,581 @@ +particle_functions.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use std::convert::TryFrom;
+use std::sync::Arc;
+use std::task::{Context, Poll, Waker};
+use std::time::{Duration, Instant};
+
+use avm_server::{CallRequestParams, CallRequests, CallResults, CallServiceResult};
+use futures::future::BoxFuture;
+use futures::stream::FuturesUnordered;
+use futures::{FutureExt, StreamExt};
+use humantime::format_duration as pretty;
+use serde_json::json;
+use serde_json::Value as JValue;
+use tracing::{instrument, Instrument, Span};
+
+use particle_args::{Args, JError};
+use particle_execution::{
+    FunctionOutcome, ParticleFunctionStatic, ParticleParams, ServiceFunction,
+};
+use peer_metrics::FunctionKind;
+
+use crate::log::builtin_log_fn;
+use crate::spawner::{SpawnFunctions, Spawner};
+
+#[derive(Clone, Debug)]
+/// Performance statistics about executed function call
+pub struct SingleCallStat {
+    /// If execution happened, then how much time it took to execute the call
+    pub call_time: Option<Duration>,
+    /// If execution happened, then how much time call waited to be scheduled on blocking pool
+    pub wait_time: Option<Duration>,
+    pub success: bool,
+    /// Whether function call was to builtin functions (like op noop) or to services
+    pub kind: FunctionKind,
+}
+
+#[derive(Clone, Debug)]
+pub struct SingleCallResult {
+    /// `call_id` comes from AVM's CallRequest
+    call_id: u32,
+    result: CallServiceResult,
+    stat: SingleCallStat,
+    span: Arc<Span>,
+}
+
+pub struct Functions<F> {
+    particle: ParticleParams,
+    builtins: F,
+    function_calls: FuturesUnordered<BoxFuture<'static, SingleCallResult>>,
+    call_results: CallResults,
+    call_stats: Vec<SingleCallStat>,
+    call_spans: Vec<Arc<Span>>,
+    particle_function: Option<Arc<tokio::sync::Mutex<ServiceFunction>>>,
+}
+
+impl<F: ParticleFunctionStatic> Functions<F> {
+    pub fn new(particle: ParticleParams, builtins: F) -> Self {
+        Self {
+            particle,
+            builtins,
+            function_calls: <_>::default(),
+            call_results: <_>::default(),
+            call_stats: <_>::default(),
+            call_spans: <_>::default(),
+            particle_function: None,
+        }
+    }
+
+    /// Advance call requests execution
+    pub fn poll(&mut self, cx: &mut Context<'_>) {
+        while let Poll::Ready(Some(r)) = self.function_calls.poll_next_unpin(cx) {
+            let overwritten = self.call_results.insert(r.call_id, r.result);
+            self.call_stats.push(r.stat);
+            self.call_spans.push(r.span);
+
+            debug_assert!(
+                overwritten.is_none(),
+                "unreachable: function call result {} was overwritten",
+                r.call_id
+            );
+        }
+    }
+
+    /// Add a bunch of call requests to execution
+    #[instrument(level = tracing::Level::INFO, skip_all)]
+    pub fn execute(
+        &mut self,
+        spawner: Spawner,
+        particle_id: String,
+        requests: CallRequests,
+        waker: Waker,
+        span: Arc<Span>,
+    ) {
+        let futs: Vec<_> = requests
+            .into_iter()
+            .map(|(id, call)| {
+                self.call(
+                    spawner.clone(),
+                    particle_id.clone(),
+                    id,
+                    call,
+                    waker.clone(),
+                    span.clone(),
+                )
+            })
+            .collect();
+        self.function_calls.extend(futs);
+    }
+
+    /// Retrieve all existing call results
+    pub fn drain(&mut self) -> (CallResults, Vec<SingleCallStat>, Vec<Arc<Span>>) {
+        let call_results = std::mem::take(&mut self.call_results);
+        let stats = std::mem::take(&mut self.call_stats);
+        let call_spans = std::mem::take(&mut self.call_spans);
+
+        (call_results, stats, call_spans)
+    }
+
+    pub fn set_function(&mut self, function: ServiceFunction) {
+        self.particle_function = Some(Arc::new(tokio::sync::Mutex::new(function)));
+    }
+
+    // TODO: currently AFAIK there's no cooperation between tasks/executors because all futures
+    //       are executed inside `block_on`.
+    //       i.e., if one future yields, it blocks the whole thread (does it? I'm not sure)
+    //       Probably, the situation can be improved by somehow executing all futures in a cooperative manner.
+    //       I see the main obstacle to cooperation in streaming results to `self.call_results`.
+    //       Streaming can be done through an MPSC channel, but it seems like an overkill. Though
+    //       maybe it's a good option.
+    #[instrument(level = tracing::Level::INFO, skip_all)]
+    fn call(
+        &self,
+        spawner: Spawner,
+        particle_id: String,
+        call_id: u32,
+        call: CallRequestParams,
+        waker: Waker,
+        span: Arc<Span>,
+    ) -> BoxFuture<'static, SingleCallResult> {
+        let async_span =
+            tracing::info_span!(parent: span.as_ref(), "ParticleFunctions::call::async");
+        // Deserialize params
+        let args = match Args::try_from(call) {
+            Ok(args) => args,
+            Err(err) => {
+                return async move {
+                    let result = CallServiceResult {
+                        ret_code: 1,
+                        result: json!(format!(
+                            "Failed to deserialize CallRequestParams to Args: {err}"
+                        )),
+                    };
+                    SingleCallResult {
+                        call_id,
+                        result,
+                        stat: SingleCallStat {
+                            call_time: None,
+                            wait_time: None,
+                            success: false,
+                            kind: FunctionKind::NotHappened,
+                        },
+                        span,
+                    }
+                }
+                .instrument(async_span)
+                .boxed();
+            }
+        };
+
+        let log_args = format!(
+            "{:?} {:?} {}",
+            args.service_id,
+            args.function_name,
+            json!(&args.function_args)
+        );
+        let service_id = args.service_id.clone();
+
+        let params = self.particle.clone();
+        let builtins = self.builtins.clone();
+        let particle_function = self.particle_function.clone();
+        let schedule_wait_start = Instant::now();
+
+        let function_identity = format!("{}:{}", &args.service_id, &args.function_name);
+
+        let fut = async move {
+            // How much time it took to start execution on blocking pool
+            let schedule_wait_time = schedule_wait_start.elapsed();
+            let outcome = builtins.call(args, params).await;
+            // record whether call was handled by builtin or not. needed for stats.
+            let mut call_kind = FunctionKind::Service;
+            let outcome = match outcome {
+                // If particle_function isn't set, just return what we have
+                outcome if particle_function.is_none() => outcome,
+                // If builtins weren't defined over these args, try particle_function
+                FunctionOutcome::NotDefined { args, params } => {
+                    let func = particle_function.unwrap();
+                    // TODO: Actors would allow to get rid of Mutex
+                    //       i.e., wrap each callback with a queue & channel
+                    let func = func.lock().await;
+                    let outcome = func.call(args, params).await;
+                    call_kind = FunctionKind::ParticleFunction;
+                    outcome
+                }
+                // Builtins were called, return their outcome
+                outcome => outcome,
+            };
+            // How much time it took to execute the call
+            // TODO: Time for ParticleFunction includes lock time, which is not good. Low priority cuz ParticleFunctions are barely used.
+            let call_time = schedule_wait_start.elapsed() - schedule_wait_time;
+            (outcome, call_kind, call_time, schedule_wait_time)
+        };
+
+        let spawned_future = spawner.spawn_function_call(function_identity, fut);
+
+        async move {
+            let (result, call_kind, call_time, wait_time) = spawned_future
+                .await
+                .expect("Could not 'Call function' join");
+
+            let result = match result {
+                FunctionOutcome::NotDefined { args, .. } => Err(JError::new(format!(
+                    "Service with id '{}' not found (function {})",
+                    args.service_id, args.function_name
+                ))),
+                FunctionOutcome::Empty => Ok(JValue::String(String::new())),
+                FunctionOutcome::Ok(v) => Ok(v),
+                FunctionOutcome::Err(err) => Err(err),
+            };
+
+            if let Err(err) = &result {
+                tracing::warn!(
+                    particle_id = particle_id,
+                    "Failed host call {} ({}): {}",
+                    log_args,
+                    pretty(call_time),
+                    err
+                )
+            } else {
+                builtin_log_fn(&service_id, &log_args, pretty(call_time), particle_id);
+            };
+
+            let stats = SingleCallStat {
+                call_time: Some(call_time),
+                wait_time: Some(wait_time),
+                success: result.is_ok(),
+                kind: call_kind,
+            };
+
+            let result = match result {
+                Ok(result) => CallServiceResult {
+                    ret_code: 0,
+                    result,
+                },
+                Err(err) => CallServiceResult {
+                    ret_code: 1,
+                    result: JValue::from(err),
+                },
+            };
+
+            waker.wake();
+
+            SingleCallResult {
+                call_id,
+                result,
+                stat: stats,
+                span,
+            }
+        }
+        .in_current_span()
+        .boxed()
+    }
+}
+
\ No newline at end of file diff --git a/src/aquamarine/plumber.rs.html b/src/aquamarine/plumber.rs.html new file mode 100644 index 0000000000..10a0b63c91 --- /dev/null +++ b/src/aquamarine/plumber.rs.html @@ -0,0 +1,1875 @@ +plumber.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+762
+763
+764
+765
+766
+767
+768
+769
+770
+771
+772
+773
+774
+775
+776
+777
+778
+779
+780
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+794
+795
+796
+797
+798
+799
+800
+801
+802
+803
+804
+805
+806
+807
+808
+809
+810
+811
+812
+813
+814
+815
+816
+817
+818
+819
+820
+821
+822
+823
+824
+825
+826
+827
+828
+829
+830
+831
+832
+833
+834
+835
+836
+837
+838
+839
+840
+841
+842
+843
+844
+845
+846
+847
+848
+849
+850
+851
+852
+853
+854
+855
+856
+857
+858
+859
+860
+861
+862
+863
+864
+865
+866
+867
+868
+869
+870
+871
+872
+873
+874
+875
+876
+877
+878
+879
+880
+881
+882
+883
+884
+885
+886
+887
+888
+889
+890
+891
+892
+893
+894
+895
+896
+897
+898
+899
+900
+901
+902
+903
+904
+905
+906
+907
+908
+909
+910
+911
+912
+913
+914
+915
+916
+917
+918
+919
+920
+921
+922
+923
+924
+925
+926
+927
+928
+929
+930
+931
+932
+933
+934
+935
+936
+937
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use eyre::eyre;
+use fluence_keypair::KeyPair;
+use futures::future::BoxFuture;
+use futures::FutureExt;
+use std::collections::hash_map::Entry;
+use std::sync::Arc;
+use std::task::Poll::Ready;
+use std::{
+    collections::{HashMap, VecDeque},
+    task::{Context, Poll},
+};
+
+use futures::task::Waker;
+use marine_wasmtime_backend::WasmtimeWasmBackend;
+use tokio::runtime::Handle;
+use tokio::task;
+use tracing::instrument;
+
+use fluence_libp2p::PeerId;
+/// For tests, mocked time is used
+#[cfg(test)]
+use mock_time::now_ms;
+use particle_execution::{ParticleFunctionStatic, ParticleParams, ServiceFunction};
+use particle_protocol::ExtendedParticle;
+use particle_services::PeerScope;
+use peer_metrics::{ParticleExecutorMetrics, WorkerLabel, WorkerType};
+/// Get current time from OS
+#[cfg(not(test))]
+use real_time::now_ms;
+use types::DealId;
+use workers::{KeyStorage, PeerScopes, Workers};
+
+use crate::actor::{Actor, ActorPoll};
+use crate::deadline::Deadline;
+use crate::error::AquamarineApiError;
+use crate::particle_effects::LocalRoutingEffects;
+use crate::particle_functions::{Functions, SingleCallStat};
+use crate::spawner::{RootSpawner, Spawner, WorkerSpawner};
+use crate::vm_pool::VmPool;
+use crate::{AquaRuntime, ParticleDataStore, RemoteRoutingEffects};
+use types::peer_scope::WorkerId;
+
+#[derive(PartialEq, Hash, Eq)]
+struct ActorKey {
+    signature: Vec<u8>,
+}
+
+const MAX_CLEANUP_KEYS_SIZE: usize = 1024;
+
+pub struct Plumber<RT: AquaRuntime, F> {
+    config: RT::Config,
+    events: VecDeque<Result<RemoteRoutingEffects, AquamarineApiError>>,
+    host_actors: HashMap<ActorKey, Actor<RT, F>>,
+    host_vm_pool: VmPool<RT>,
+    worker_actors: HashMap<WorkerId, HashMap<ActorKey, Actor<RT, F>>>,
+    worker_vm_pools: HashMap<WorkerId, VmPool<RT>>,
+    workers: Arc<Workers>,
+    data_store: Arc<ParticleDataStore>,
+    builtins: F,
+    waker: Option<Waker>,
+    metrics: Option<ParticleExecutorMetrics>,
+    key_storage: Arc<KeyStorage>,
+    scopes: PeerScopes,
+    cleanup_future: Option<BoxFuture<'static, ()>>,
+    root_runtime_handle: Handle,
+    avm_wasm_backend: WasmtimeWasmBackend,
+}
+
+impl<RT: AquaRuntime, F: ParticleFunctionStatic> Plumber<RT, F> {
+    pub fn new(
+        config: RT::Config,
+        host_vm_pool: VmPool<RT>,
+        data_store: Arc<ParticleDataStore>,
+        builtins: F,
+        metrics: Option<ParticleExecutorMetrics>,
+        workers: Arc<Workers>,
+        key_storage: Arc<KeyStorage>,
+        scope: PeerScopes,
+        avm_wasm_backend: WasmtimeWasmBackend,
+    ) -> Self {
+        Self {
+            config,
+            host_vm_pool,
+            data_store,
+            builtins,
+            events: <_>::default(),
+            host_actors: <_>::default(),
+            worker_actors: <_>::default(),
+            worker_vm_pools: <_>::default(),
+            waker: <_>::default(),
+            metrics,
+            workers,
+            key_storage,
+            scopes: scope,
+            cleanup_future: None,
+            root_runtime_handle: Handle::current(),
+            avm_wasm_backend,
+        }
+    }
+
+    /// Receives and ingests incoming particle: creates a new actor or forwards to the existing mailbox
+    #[instrument(level = tracing::Level::INFO, skip_all)]
+    pub fn ingest(
+        &mut self,
+        particle: ExtendedParticle,
+        function: Option<ServiceFunction>,
+        peer_scope: PeerScope,
+    ) {
+        let deadline = Deadline::from(particle.as_ref());
+        if deadline.is_expired(now_ms()) {
+            tracing::info!(target: "expired", particle_id = particle.particle.id, "Particle is expired");
+            self.events
+                .push_back(Err(AquamarineApiError::ParticleExpired {
+                    particle_id: particle.particle.id,
+                }));
+            return;
+        }
+
+        if let Err(err) = particle.particle.verify() {
+            tracing::warn!(target: "signature", particle_id = particle.particle.id, "Particle signature verification failed: {err:?}");
+            self.events
+                .push_back(Err(AquamarineApiError::SignatureVerificationFailed {
+                    particle_id: particle.particle.id,
+                    err,
+                }));
+            return;
+        }
+
+        if let PeerScope::WorkerId(worker_id) = peer_scope {
+            let is_active = self.workers.is_worker_active(worker_id);
+            let is_manager = self.scopes.is_management(particle.particle.init_peer_id);
+            let is_host = self.scopes.is_host(particle.particle.init_peer_id);
+
+            // Only a manager or the host itself is allowed to access deactivated workers
+            if !is_active && !is_manager && !is_host {
+                tracing::trace!(target: "worker_inactive", particle_id = particle.particle.id, worker_id = worker_id.to_string(), "Worker is not active");
+                return;
+            }
+        };
+
+        let key = ActorKey {
+            signature: particle.particle.signature.clone(),
+        };
+
+        let actor = self.get_or_create_actor(peer_scope, key, &particle);
+
+        debug_assert!(actor.is_ok(), "no such worker: {:#?}", actor.err());
+
+        match actor {
+            Ok(actor) => {
+                actor.ingest(particle);
+                if let Some(function) = function {
+                    actor.set_function(function);
+                }
+            }
+            Err(err) => tracing::warn!(
+                "No such worker {:?}, rejected particle {particle_id}: {:?}",
+                peer_scope,
+                err,
+                particle_id = particle.particle.id,
+            ),
+        }
+        self.wake();
+    }
+
+    pub fn create_worker_pool(&mut self, worker_id: WorkerId, thread_count: usize) {
+        let vm_pool = VmPool::new(
+            thread_count,
+            self.config.clone(),
+            None,
+            None,
+            self.avm_wasm_backend.clone(),
+        ); // TODO: add metrics
+        self.worker_vm_pools.insert(worker_id, vm_pool);
+    }
+
+    pub fn remove_worker_pool(&mut self, worker_id: WorkerId) {
+        self.worker_vm_pools.remove(&worker_id);
+    }
+
+    fn get_or_create_actor(
+        &mut self,
+        peer_scope: PeerScope,
+        key: ActorKey,
+        particle: &ExtendedParticle,
+    ) -> eyre::Result<&mut Actor<RT, F>> {
+        let plumber_params = PlumberParams {
+            builtins: &self.builtins,
+            key_storage: self.key_storage.as_ref(),
+            data_store: self.data_store.clone(),
+        };
+        match peer_scope {
+            PeerScope::Host => {
+                let current_peer_id = self.scopes.get_host_peer_id();
+                let spawner = Spawner::Root(RootSpawner::new(self.root_runtime_handle.clone()));
+                let actor_params = ActorParams {
+                    key,
+                    particle,
+                    peer_scope,
+                    current_peer_id,
+                    deal_id: None,
+                    spawner,
+                };
+                Self::create_actor(&mut self.host_actors, plumber_params, actor_params)
+            }
+            PeerScope::WorkerId(worker_id) => {
+                let worker_actors = match self.worker_actors.entry(worker_id) {
+                    Entry::Occupied(o) => o.into_mut(),
+                    Entry::Vacant(v) => v.insert(HashMap::default()),
+                };
+                let current_peer_id: PeerId = worker_id.into();
+                let deal_id = self
+                    .workers
+                    .get_deal_id(worker_id)
+                    .map_err(|err| eyre!("Not found deal for {:?} : {}", worker_id, err))?;
+                let runtime_handle = self
+                    .workers
+                    .get_runtime_handle(worker_id)
+                    .ok_or(eyre!("Not found runtime handle for {:?}", worker_id))?;
+                let spawner = Spawner::Worker(WorkerSpawner::new(runtime_handle, worker_id));
+
+                let actor_params = ActorParams {
+                    key,
+                    particle,
+                    peer_scope,
+                    current_peer_id,
+                    deal_id: Some(deal_id),
+                    spawner,
+                };
+
+                Self::create_actor(worker_actors, plumber_params, actor_params)
+            }
+        }
+    }
+
+    fn create_actor<'p>(
+        actors: &'p mut HashMap<ActorKey, Actor<RT, F>>,
+        plumber_params: PlumberParams<'p, F>,
+        actor_params: ActorParams<'_>,
+    ) -> eyre::Result<&'p mut Actor<RT, F>> {
+        let entry = actors.entry(actor_params.key);
+        let actor = match entry {
+            Entry::Occupied(actor) => actor.into_mut(),
+            Entry::Vacant(entry) => {
+                let builtins = plumber_params.builtins;
+                let key_pair = plumber_params
+                    .key_storage
+                    .get_keypair(actor_params.peer_scope)
+                    .ok_or(eyre!(
+                        "Cannot create actor, no key pair for {:?}",
+                        actor_params.peer_scope
+                    ))?;
+                let data_store = plumber_params.data_store.clone();
+
+                let particle_token = get_particle_token(
+                    &plumber_params.key_storage.root_key_pair,
+                    &actor_params.particle.particle.signature,
+                )?;
+                let params = ParticleParams::clone_from(
+                    &actor_params.particle.particle,
+                    actor_params.peer_scope,
+                    particle_token.clone(),
+                );
+                let functions = Functions::new(params, builtins.clone());
+
+                let actor = Actor::new(
+                    &actor_params.particle.particle,
+                    functions,
+                    actor_params.current_peer_id,
+                    particle_token,
+                    key_pair,
+                    data_store,
+                    actor_params.deal_id,
+                    actor_params.spawner,
+                );
+                entry.insert(actor)
+            }
+        };
+        Ok(actor)
+    }
+
+    pub fn add_service(
+        &self,
+        service: String,
+        functions: HashMap<String, ServiceFunction>,
+        fallback: Option<ServiceFunction>,
+    ) {
+        let builtins = self.builtins.clone();
+        let task = async move {
+            builtins.extend(service, functions, fallback).await;
+        };
+        task::Builder::new()
+            .name("Add service")
+            .spawn(task)
+            .expect("Could not spawn add service task");
+    }
+
+    pub fn remove_service(&self, service: String) {
+        let builtins = self.builtins.clone();
+        let task = async move {
+            builtins.remove(&service).await;
+        };
+        task::Builder::new()
+            .name("Remove service")
+            .spawn(task)
+            .expect("Could not spawn remove service task");
+    }
+
+    pub fn poll(
+        &mut self,
+        cx: &mut Context<'_>,
+    ) -> Poll<Result<RemoteRoutingEffects, AquamarineApiError>> {
+        self.waker = Some(cx.waker().clone());
+
+        self.poll_pools(cx);
+
+        if let Some(event) = self.events.pop_front() {
+            return Poll::Ready(event);
+        }
+
+        let mut remote_effects: Vec<RemoteRoutingEffects> = vec![];
+        let mut local_effects: Vec<LocalRoutingEffects> = vec![];
+        // Gather effects and put VMs back
+        self.poll_host_actors(cx, &mut remote_effects, &mut local_effects);
+        self.poll_workers_actors(cx, &mut remote_effects, &mut local_effects);
+
+        self.cleanup(cx);
+
+        // Execute next messages
+        let host_call_stats = self.poll_next_host_messages(cx);
+        let workers_call_stats = self.poll_next_worker_messages(cx);
+
+        // TODO: separate workers and root metrics
+        self.meter(|m| {
+            for stat in &host_call_stats {
+                m.service_call(stat.success, stat.kind, stat.call_time)
+            }
+            for stat in &workers_call_stats {
+                m.service_call(stat.success, stat.kind, stat.call_time)
+            }
+        });
+
+        for effect in local_effects {
+            for local_peer in effect.next_peers {
+                let span = tracing::info_span!(parent: effect.particle.span.as_ref(), "Plumber: routing effect ingest");
+                let _guard = span.enter();
+                self.ingest(effect.particle.clone(), None, local_peer);
+            }
+        }
+
+        // Turn effects into events, and buffer them
+        self.events.extend(remote_effects.into_iter().map(Ok));
+
+        Poll::Pending
+    }
+
+    fn poll_pools(&mut self, cx: &mut Context<'_>) {
+        self.host_vm_pool.poll(cx);
+        for (_, vm_pool) in self.worker_vm_pools.iter_mut() {
+            vm_pool.poll(cx);
+        }
+    }
+
+    fn poll_host_actors(
+        &mut self,
+        cx: &mut Context<'_>,
+        remote_effects: &mut Vec<RemoteRoutingEffects>,
+        local_effects: &mut Vec<LocalRoutingEffects>,
+    ) {
+        let host_label =
+            WorkerLabel::new(WorkerType::Host, self.scopes.get_host_peer_id().to_string());
+        Self::poll_actors(
+            &mut self.host_actors,
+            &mut self.host_vm_pool,
+            &self.scopes,
+            self.metrics.as_ref(),
+            cx,
+            host_label,
+            remote_effects,
+            local_effects,
+        );
+    }
+
+    fn poll_workers_actors(
+        &mut self,
+        cx: &mut Context<'_>,
+        remote_effects: &mut Vec<RemoteRoutingEffects>,
+        local_effects: &mut Vec<LocalRoutingEffects>,
+    ) {
+        for (worker_id, actors) in self.worker_actors.iter_mut() {
+            if let Some(pool) = self.worker_vm_pools.get_mut(worker_id) {
+                let peer_id: PeerId = (*worker_id).into();
+                let host_label = WorkerLabel::new(WorkerType::Worker, peer_id.to_string());
+                Self::poll_actors(
+                    actors,
+                    pool,
+                    &self.scopes,
+                    self.metrics.as_ref(),
+                    cx,
+                    host_label,
+                    remote_effects,
+                    local_effects,
+                );
+            }
+        }
+    }
+
+    #[allow(clippy::too_many_arguments)]
+    fn poll_actors(
+        actors: &mut HashMap<ActorKey, Actor<RT, F>>,
+        vm_pool: &mut VmPool<RT>,
+        scopes: &PeerScopes,
+        metrics: Option<&ParticleExecutorMetrics>,
+        cx: &mut Context<'_>,
+        label: WorkerLabel,
+        remote_effects: &mut Vec<RemoteRoutingEffects>,
+        local_effects: &mut Vec<LocalRoutingEffects>,
+    ) {
+        let mut mailbox_size = 0;
+        let mut interpretation_stats = vec![];
+
+        for actor in actors.values_mut() {
+            if let Poll::Ready(result) = actor.poll_completed(cx) {
+                interpretation_stats.push(result.stats);
+
+                let mut remote_peers = vec![];
+                let mut local_peers = vec![];
+                for next_peer in result.effects.next_peers {
+                    let scope = scopes.scope(next_peer);
+                    match scope {
+                        Err(_) => {
+                            remote_peers.push(next_peer);
+                        }
+                        Ok(scope) => {
+                            local_peers.push(scope);
+                        }
+                    }
+                }
+
+                if !remote_peers.is_empty() {
+                    remote_effects.push(RemoteRoutingEffects {
+                        particle: result.effects.particle.clone(),
+                        next_peers: remote_peers,
+                    });
+                }
+
+                if !local_peers.is_empty() {
+                    local_effects.push(LocalRoutingEffects {
+                        particle: result.effects.particle.clone(),
+                        next_peers: local_peers,
+                    });
+                }
+
+                let (vm_id, vm) = result.runtime;
+                if let Some(vm) = vm {
+                    vm_pool.put_vm(vm_id, vm);
+                } else {
+                    // if `result.vm` is None, then an AVM instance was lost due to
+                    // panic or cancellation, and we must ask VmPool to recreate that AVM
+                    // TODO: add a Count metric to count how often we call `recreate_avm`
+                    vm_pool.recreate_avm(vm_id, cx);
+                }
+            }
+            mailbox_size += actor.mailbox_size();
+        }
+
+        if let Some(m) = metrics {
+            for stat in &interpretation_stats {
+                // count particle interpretations
+                if stat.success {
+                    m.interpretation_successes.get_or_create(&label).inc();
+                } else {
+                    m.interpretation_failures.get_or_create(&label).inc();
+                }
+
+                let interpretation_time = stat.interpretation_time.as_secs_f64();
+                m.interpretation_time_sec
+                    .get_or_create(&label)
+                    .observe(interpretation_time);
+            }
+            m.total_actors_mailbox
+                .get_or_create(&label)
+                .set(mailbox_size as i64);
+            m.alive_actors
+                .get_or_create(&label)
+                .set(actors.len() as i64);
+        }
+    }
+
+    fn cleanup(&mut self, cx: &mut Context<'_>) {
+        // do not schedule task if another in progress
+        if let Some(Ready(())) = self.cleanup_future.as_mut().map(|f| f.poll_unpin(cx)) {
+            // we remove clean up future if it is ready
+            self.cleanup_future.take();
+        }
+        if self.cleanup_future.is_none() {
+            // Remove expired actors
+            let mut cleanup_keys: Vec<(String, PeerId, Vec<u8>, String)> =
+                Vec::with_capacity(MAX_CLEANUP_KEYS_SIZE);
+            let now = now_ms();
+            self.cleanup_host_actors(&mut cleanup_keys, now);
+            self.cleanup_worker_actors(&mut cleanup_keys, now);
+
+            if !cleanup_keys.is_empty() {
+                let data_store = self.data_store.clone();
+                self.cleanup_future =
+                    Some(async move { data_store.batch_cleanup_data(cleanup_keys).await }.boxed())
+            }
+        }
+    }
+
+    fn cleanup_host_actors(
+        &mut self,
+        cleanup_keys: &mut Vec<(String, PeerId, Vec<u8>, String)>,
+        now_ms: u64,
+    ) {
+        Self::cleanup_actors(&mut self.host_actors, cleanup_keys, now_ms)
+    }
+
+    fn cleanup_worker_actors(
+        &mut self,
+        cleanup_keys: &mut Vec<(String, PeerId, Vec<u8>, String)>,
+        now_ms: u64,
+    ) {
+        if cleanup_keys.len() >= MAX_CLEANUP_KEYS_SIZE {
+            return;
+        }
+        self.worker_actors.retain(|worker_id, actors| {
+            Self::cleanup_actors(actors, cleanup_keys, now_ms);
+
+            !actors.is_empty() || self.worker_vm_pools.contains_key(worker_id)
+        });
+    }
+
+    fn cleanup_actors(
+        map: &mut HashMap<ActorKey, Actor<RT, F>>,
+        cleanup_keys: &mut Vec<(String, PeerId, Vec<u8>, String)>,
+        now_ms: u64,
+    ) {
+        map.retain(|_, actor| {
+            if cleanup_keys.len() >= MAX_CLEANUP_KEYS_SIZE {
+                return true;
+            }
+            // if actor hasn't yet expired or is still executing, keep it
+            if !actor.is_expired(now_ms) || actor.is_executing() {
+                return true; // keep actor
+            }
+            cleanup_keys.push(actor.cleanup_key());
+            false // remove actor
+        });
+    }
+
+    fn poll_next_host_messages(&mut self, cx: &mut Context<'_>) -> Vec<SingleCallStat> {
+        let mut stats = vec![];
+        for actor in self.host_actors.values_mut() {
+            if let Some((vm_id, vm)) = self.host_vm_pool.get_vm() {
+                match actor.poll_next(vm_id, vm, cx) {
+                    ActorPoll::Vm(vm_id, vm) => self.host_vm_pool.put_vm(vm_id, vm),
+                    ActorPoll::Executing(mut s) => stats.append(&mut s),
+                }
+            } else {
+                break;
+            }
+        }
+        stats
+    }
+
+    fn poll_next_worker_messages(&mut self, cx: &mut Context<'_>) -> Vec<SingleCallStat> {
+        let mut stats = vec![];
+
+        for (worker_id, actors) in self.worker_actors.iter_mut() {
+            if let Some(pool) = self.worker_vm_pools.get_mut(worker_id) {
+                for actor in actors.values_mut() {
+                    if let Some((vm_id, vm)) = pool.get_vm() {
+                        match actor.poll_next(vm_id, vm, cx) {
+                            ActorPoll::Vm(vm_id, vm) => pool.put_vm(vm_id, vm),
+                            ActorPoll::Executing(mut s) => stats.append(&mut s),
+                        }
+                    } else {
+                        break;
+                    }
+                }
+            }
+        }
+        stats
+    }
+
+    fn wake(&self) {
+        if let Some(waker) = &self.waker {
+            waker.wake_by_ref();
+        }
+    }
+
+    fn meter<U, FF: Fn(&ParticleExecutorMetrics) -> U>(&self, f: FF) {
+        self.metrics.as_ref().map(f);
+    }
+}
+
+fn get_particle_token(key_pair: &KeyPair, signature: &Vec<u8>) -> eyre::Result<String> {
+    let particle_token = key_pair.sign(signature.as_slice()).map_err(|err| {
+        eyre!(
+            "Could not produce particle token by signing the particle signature: {}",
+            err
+        )
+    })?;
+    Ok(bs58::encode(particle_token.to_vec()).into_string())
+}
+
+/// Implements `now` by taking number of non-leap seconds from `Utc::now()`
+mod real_time {
+    #[allow(dead_code)]
+    pub fn now_ms() -> u64 {
+        (chrono::Utc::now().timestamp() * 1000) as u64
+    }
+}
+
+struct ActorParams<'a> {
+    key: ActorKey,
+    particle: &'a ExtendedParticle,
+    peer_scope: PeerScope,
+    current_peer_id: PeerId,
+    deal_id: Option<DealId>,
+    spawner: Spawner,
+}
+
+struct PlumberParams<'p, F>
+where
+    F: Clone,
+{
+    builtins: &'p F,
+    key_storage: &'p KeyStorage,
+    data_store: Arc<ParticleDataStore>,
+}
+
+#[cfg(test)]
+mod tests {
+    use std::collections::HashMap;
+    use std::convert::Infallible;
+    use std::path::{Path, PathBuf};
+    use std::task::Waker;
+    use std::{sync::Arc, task::Context};
+
+    use avm_server::{AVMMemoryStats, CallResults, ParticleParameters};
+    use fluence_keypair::KeyPair;
+    use fluence_libp2p::RandomPeerId;
+    use futures::task::noop_waker_ref;
+    use workers::{KeyStorage, PeerScopes, Workers, WorkersConfig};
+
+    use particle_args::Args;
+    use particle_execution::{FunctionOutcome, ParticleFunction, ParticleParams, ServiceFunction};
+    use particle_protocol::{ExtendedParticle, Particle};
+
+    use crate::deadline::Deadline;
+    use crate::plumber::mock_time::set_mock_time;
+    use crate::plumber::{now_ms, real_time};
+    use crate::vm_pool::VmPool;
+    use crate::AquamarineApiError::ParticleExpired;
+    use crate::{AquaRuntime, ParticleDataStore, ParticleEffects, Plumber};
+    use async_trait::async_trait;
+    use avm_server::avm_runner::RawAVMOutcome;
+    use core_distributor::dummy::DummyCoreDistibutor;
+    use fs_utils::create_dirs;
+    use marine_wasmtime_backend::{WasmtimeConfig, WasmtimeWasmBackend};
+    use particle_services::{PeerScope, WasmBackendConfig};
+    use tracing::Span;
+
+    struct MockF;
+
+    #[async_trait]
+    impl ParticleFunction for MockF {
+        async fn call(&self, _args: Args, _particle: ParticleParams) -> FunctionOutcome {
+            panic!("no builtins in plumber tests!")
+        }
+
+        async fn extend(
+            &self,
+            _service: String,
+            _functions: HashMap<String, ServiceFunction>,
+            _fallback: Option<ServiceFunction>,
+        ) {
+            todo!()
+        }
+
+        async fn remove(&self, _service: &str) {
+            todo!()
+        }
+    }
+
+    struct VMMock;
+
+    #[async_trait]
+    impl AquaRuntime for VMMock {
+        type Config = ();
+        type Error = Infallible;
+
+        fn create_runtime(
+            _config: Self::Config,
+            _backend: WasmtimeWasmBackend,
+            _waker: Waker,
+        ) -> Result<Self, Self::Error> {
+            Ok(VMMock)
+        }
+
+        fn into_effects(
+            _outcome: Result<RawAVMOutcome, Self::Error>,
+            _particle_id: String,
+        ) -> ParticleEffects {
+            ParticleEffects {
+                new_data: vec![],
+                next_peers: vec![],
+                call_requests: Default::default(),
+            }
+        }
+
+        async fn call(
+            &mut self,
+            _air: impl Into<String> + Send,
+            _prev_data: impl Into<Vec<u8>> + Send,
+            _current_data: impl Into<Vec<u8>> + Send,
+            _particle_params: ParticleParameters<'_>,
+            _call_results: CallResults,
+            _key_pair: &KeyPair,
+        ) -> Result<RawAVMOutcome, Self::Error> {
+            let soft_limits_triggering = <_>::default();
+            Ok(RawAVMOutcome {
+                ret_code: 0,
+                error_message: "".to_string(),
+                data: vec![],
+                call_requests: Default::default(),
+                next_peer_pks: vec![],
+                soft_limits_triggering,
+            })
+        }
+
+        fn memory_stats(&self) -> AVMMemoryStats {
+            AVMMemoryStats {
+                memory_size: 0,
+                total_memory_limit: None,
+                allocation_rejects: None,
+            }
+        }
+    }
+
+    async fn plumber(dir: &Path) -> Plumber<VMMock, Arc<MockF>> {
+        let avm_wasm_config: WasmtimeConfig = WasmBackendConfig::default().into();
+        let avm_wasm_backend =
+            WasmtimeWasmBackend::new(avm_wasm_config).expect("Could not create wasm backend");
+        // Pool is of size 1 so it's easier to control tests
+        let vm_pool = VmPool::new(1, (), None, None, avm_wasm_backend.clone());
+        let builtin_mock = Arc::new(MockF);
+
+        let root_key_pair: KeyPair = KeyPair::generate_ed25519();
+        let key_pair_path: PathBuf = dir.join("keypair");
+        let workers_path: PathBuf = dir.join("workers");
+
+        create_dirs(&[&key_pair_path, &workers_path]).unwrap();
+
+        let key_storage = KeyStorage::from_path(key_pair_path.clone(), root_key_pair.clone())
+            .await
+            .expect("Could not load key storage");
+
+        let key_storage = Arc::new(key_storage);
+
+        let core_distributor = Arc::new(DummyCoreDistibutor::new());
+        let thread_pinner = Arc::new(test_utils::pinning::DUMMY);
+
+        let scope = PeerScopes::new(
+            root_key_pair.get_peer_id(),
+            RandomPeerId::random(),
+            RandomPeerId::random(),
+            key_storage.clone(),
+        );
+
+        let workers_config = WorkersConfig::new(32, None);
+
+        let (workers, _receiver) = Workers::from_path(
+            workers_config,
+            workers_path.clone(),
+            key_storage.clone(),
+            core_distributor,
+            thread_pinner,
+        )
+        .await
+        .expect("Could not load worker registry");
+
+        let workers = Arc::new(workers);
+
+        let data_store = ParticleDataStore::new(
+            dir.join("particles"),
+            dir.join("vault"),
+            dir.join("anomaly"),
+        );
+        data_store
+            .initialize()
+            .await
+            .expect("Could not initialize datastore");
+        let data_store = Arc::new(data_store);
+
+        Plumber::new(
+            (),
+            vm_pool,
+            data_store,
+            builtin_mock,
+            None,
+            workers.clone(),
+            key_storage.clone(),
+            scope.clone(),
+            avm_wasm_backend,
+        )
+    }
+
+    fn particle(ts: u64, ttl: u32) -> Particle {
+        let mut particle = Particle::default();
+        particle.timestamp = ts;
+        particle.ttl = ttl;
+        particle
+    }
+
+    fn context() -> Context<'static> {
+        Context::from_waker(noop_waker_ref())
+    }
+
+    /// Checks that expired actor will be removed
+    #[ignore]
+    #[tokio::test]
+    async fn remove_expired() {
+        let tmp_dir = tempfile::tempdir().expect("Could not create temp dir");
+        set_mock_time(real_time::now_ms());
+
+        let mut plumber = plumber(tmp_dir.path()).await;
+
+        let particle = particle(now_ms(), 1);
+        let deadline = Deadline::from(&particle);
+        assert!(!deadline.is_expired(now_ms()));
+
+        plumber.ingest(
+            ExtendedParticle::new(particle, Span::none()),
+            None,
+            PeerScope::Host,
+        );
+
+        assert_eq!(plumber.host_actors.len(), 1);
+        let mut cx = context();
+        assert!(plumber.poll(&mut cx).is_pending());
+        assert_eq!(plumber.host_actors.len(), 1);
+
+        assert_eq!(plumber.host_vm_pool.free_vms(), 0);
+        // pool is single VM, wait until VM is free
+        loop {
+            if plumber.host_vm_pool.free_vms() == 1 {
+                break;
+            };
+            // 'is_pending' is used to suppress "must use" warning
+            plumber.poll(&mut cx).is_pending();
+        }
+
+        set_mock_time(now_ms() + 2);
+        assert!(plumber.poll(&mut cx).is_pending());
+        assert_eq!(plumber.host_actors.len(), 0);
+    }
+
+    /// Checks that expired particle won't create an actor
+    #[tokio::test]
+    async fn ignore_expired() {
+        let tmp_dir = tempfile::tempdir().expect("Could not create temp dir");
+        set_mock_time(real_time::now_ms());
+        // set_mock_time(1000);
+
+        let mut plumber = plumber(tmp_dir.path()).await;
+        let particle = particle(now_ms() - 100, 99);
+        let deadline = Deadline::from(&particle);
+        assert!(deadline.is_expired(now_ms()));
+
+        plumber.ingest(
+            ExtendedParticle::new(particle.clone(), Span::none()),
+            None,
+            PeerScope::Host,
+        );
+
+        assert_eq!(plumber.host_actors.len(), 0);
+
+        // Check actor doesn't appear after poll somehow
+        set_mock_time(now_ms() + 1000);
+        let poll = plumber.poll(&mut context());
+        assert!(poll.is_ready());
+        match poll {
+            std::task::Poll::Ready(Err(ParticleExpired { particle_id })) => {
+                assert_eq!(particle_id, particle.id)
+            }
+            unexpected => panic!(
+                "Expected Poll::Ready(Err(AquamarineApiError::ParticleExpired)), got {:?}",
+                unexpected
+            ),
+        }
+        assert_eq!(plumber.host_actors.len(), 0);
+    }
+}
+
+/// Code taken from https://blog.iany.me/2019/03/how-to-mock-time-in-rust-tests-and-cargo-gotchas-we-met/
+/// And then modified to use u64 instead of `SystemTime`
+#[cfg(test)]
+pub mod mock_time {
+    #![allow(dead_code)]
+
+    use std::cell::RefCell;
+
+    thread_local! {
+        static MOCK_TIME: RefCell<u64> = RefCell::new(0);
+    }
+
+    pub fn now_ms() -> u64 {
+        MOCK_TIME.with(|cell| *cell.borrow())
+    }
+
+    pub fn set_mock_time(time: u64) {
+        MOCK_TIME.with(|cell| *cell.borrow_mut() = time);
+    }
+}
+
\ No newline at end of file diff --git a/src/aquamarine/spawner.rs.html b/src/aquamarine/spawner.rs.html new file mode 100644 index 0000000000..d6b8c4b884 --- /dev/null +++ b/src/aquamarine/spawner.rs.html @@ -0,0 +1,433 @@ +spawner.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use std::future::Future;
+
+use enum_dispatch::enum_dispatch;
+use tokio::runtime::Handle;
+use tokio::task::JoinHandle;
+use tokio_util::context::TokioContext;
+use workers::WorkerId;
+
+/// The `SpawnFunctions` trait defines methods for spawning asynchronous tasks with different configurations.
+///
+/// It provides three methods:
+/// - `spawn_function_call`: Spawns a task representing a function call.
+/// - `spawn_avm_call`: Spawns a task representing an AVM call.
+/// - `spawn_io`: Spawns a task for asynchronous I/O operations.
+///
+/// Implementations should handle the specifics of spawning tasks based on the provided context.
+#[enum_dispatch]
+pub(crate) trait SpawnFunctions {
+    /// Spawns a task representing a function call.
+    ///
+    /// # Parameters
+    ///
+    /// - `function_identity`: A string identifier for the function.
+    /// - `fut`: The future representing the asynchronous function call.
+    ///
+    /// # Returns
+    ///
+    /// A `JoinHandle` representing the handle to the spawned task.
+    ///
+    /// # Type Parameters
+    ///
+    /// - `F`: The type of the future representing the asynchronous function call.
+    fn spawn_function_call<F>(&self, function_identity: String, fut: F) -> JoinHandle<F::Output>
+    where
+        F: Future + Send + 'static,
+        F::Output: Send + 'static;
+
+    /// Spawns a task representing an AVM call.
+    ///
+    /// # Parameters
+    ///
+    /// - `func`: The closure returning a result of type `R` when executed asynchronously.
+    ///
+    /// # Returns
+    ///
+    /// A `JoinHandle` representing the handle to the spawned task.
+    ///
+    /// # Type Parameters
+    ///
+    /// - `F`: The type of the closure.
+    /// - `R`: The type of the result returned by the closure.
+    fn spawn_avm_call<F>(&self, fut: F) -> JoinHandle<F::Output>
+    where
+        F: Future + Send + 'static,
+        F::Output: Send + 'static;
+
+    /// Shift execution to the specific pool
+    ///
+    /// # Parameters
+    ///
+    /// - `fut`: The future representing the asynchronous I/O task.
+    ///
+    /// # Returns
+    ///
+    /// A `TokioContext` wrapping the future and associated with a specific runtime handle.
+    ///
+    /// # Type Parameters
+    ///
+    /// - `F`: The type of the future representing the asynchronous task.
+    fn wrap<F>(&self, fut: F) -> TokioContext<F>
+    where
+        F: Future + Send + 'static,
+        F::Output: Send + 'static;
+}
+
+/// The `Spawner` enum represents a spawner that can be either a `RootSpawner` or a `WorkerSpawner`.
+///
+/// It uses the `SpawnFunctions` trait to provide a common interface for spawning asynchronous tasks
+/// with different configurations, such as spawning on the root runtime or worker runtime.
+#[derive(Clone)]
+#[enum_dispatch(SpawnFunctions)]
+pub enum Spawner {
+    /// Represents a spawner for the root runtime.
+    Root(RootSpawner),
+
+    /// Represents a spawner for a worker runtime associated with a specific worker ID.
+    Worker(WorkerSpawner),
+}
+
+/// The `RootSpawner` struct represents a spawner for the root runtime.
+///
+/// It implements the `SpawnFunctions` trait to provide methods for spawning asynchronous tasks
+/// on the root runtime with specific configurations.
+#[derive(Clone)]
+pub struct RootSpawner {
+    runtime_handle: Handle,
+}
+
+impl RootSpawner {
+    /// Creates a new `RootSpawner` instance with the given runtime handle.
+    pub(crate) fn new(runtime_handle: Handle) -> Self {
+        Self { runtime_handle }
+    }
+}
+
+impl SpawnFunctions for RootSpawner {
+    fn spawn_function_call<F: Future>(
+        &self,
+        function_identity: String,
+        fut: F,
+    ) -> JoinHandle<F::Output>
+    where
+        F: Future + Send + 'static,
+        F::Output: Send + 'static,
+    {
+        let task_name = format!("Call function root:{}", &function_identity);
+        let builder = tokio::task::Builder::new().name(task_name.as_str());
+
+        let handle = self.runtime_handle.clone();
+        builder
+            .spawn_blocking_on(move || handle.block_on(fut), &self.runtime_handle)
+            .expect("Failed to spawn a task")
+    }
+
+    fn spawn_avm_call<F>(&self, fut: F) -> JoinHandle<F::Output>
+    where
+        F: Future + Send + 'static,
+        F::Output: Send + 'static,
+    {
+        self.runtime_handle
+            .spawn_blocking(|| Handle::current().block_on(fut))
+    }
+
+    fn wrap<F>(&self, fut: F) -> TokioContext<F>
+    where
+        F: Future + Send + 'static,
+        F::Output: Send + 'static,
+    {
+        TokioContext::new(fut, self.runtime_handle.clone())
+    }
+}
+
+/// The `WorkerSpawner` struct represents a spawner for a worker runtime associated with a specific worker ID.
+///
+/// It implements the `SpawnFunctions` trait to provide methods for spawning asynchronous tasks
+/// on the worker runtime with specific configurations.
+#[derive(Clone)]
+pub struct WorkerSpawner {
+    worker_id: WorkerId,
+    runtime_handle: Handle,
+}
+
+impl WorkerSpawner {
+    /// Creates a new `WorkerSpawner` instance with the given runtime handle and worker ID.
+    pub(crate) fn new(runtime_handle: Handle, worker_id: WorkerId) -> Self {
+        Self {
+            runtime_handle,
+            worker_id,
+        }
+    }
+}
+
+impl SpawnFunctions for WorkerSpawner {
+    fn spawn_function_call<F: Future>(
+        &self,
+        function_identity: String,
+        fut: F,
+    ) -> JoinHandle<F::Output>
+    where
+        F: Future + Send + 'static,
+        F::Output: Send + 'static,
+    {
+        let task_name = format!("Call function {}:{}", self.worker_id, &function_identity);
+
+        let builder = tokio::task::Builder::new().name(task_name.as_str());
+
+        builder
+            .spawn_on(fut, &self.runtime_handle)
+            .expect("Failed to spawn a task")
+    }
+
+    fn spawn_avm_call<F>(&self, fut: F) -> JoinHandle<F::Output>
+    where
+        F: Future + Send + 'static,
+        F::Output: Send + 'static,
+    {
+        self.runtime_handle.spawn(fut)
+    }
+
+    fn wrap<F>(&self, fut: F) -> TokioContext<F>
+    where
+        F: Future + Send + 'static,
+        F::Output: Send + 'static,
+    {
+        TokioContext::new(fut, self.runtime_handle.clone())
+    }
+}
+
\ No newline at end of file diff --git a/src/aquamarine/vm_pool.rs.html b/src/aquamarine/vm_pool.rs.html new file mode 100644 index 0000000000..639d26bb5c --- /dev/null +++ b/src/aquamarine/vm_pool.rs.html @@ -0,0 +1,445 @@ +vm_pool.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use std::error::Error;
+use std::fmt::Debug;
+use std::task::{Context, Poll};
+
+use futures::future::BoxFuture;
+use futures::FutureExt;
+use marine_wasmtime_backend::WasmtimeWasmBackend;
+use tokio::task::JoinError;
+
+use health::HealthCheckRegistry;
+use peer_metrics::VmPoolMetrics;
+
+use crate::health::VMPoolHealth;
+use crate::AquaRuntime;
+
+type RuntimeF<RT> = BoxFuture<'static, Result<RT, CreateAVMError>>;
+
+#[derive(Debug)]
+enum CreateAVMError {
+    AVMError(Box<dyn Error + Send + Sync + 'static>),
+    JoinError(JoinError),
+}
+
+/// Pool that owns and manages aquamarine stepper VMs
+/// VMs are created asynchronously after `VmPool` creation
+/// Futures representing background VM creation are stored in `VmPool::creating_runtimes`
+/// Created vms are moved to `VmPool::runtimes`
+///
+/// Main API consists of `VmPool::get_vm` and `VmPool::put_vm`.
+/// API allows taking VM for execution (via `get_vm`), and then it is expected that VM is
+/// returned back via `put_vm`.
+/// It is also expected that `VmPool::poll` is called periodically.
+pub struct VmPool<RT: AquaRuntime> {
+    runtimes: Vec<Option<RT>>,
+    creating_runtimes: Option<Vec<(usize, RuntimeF<RT>)>>,
+    runtime_config: RT::Config,
+    pool_size: usize,
+    metrics: Option<VmPoolMetrics>,
+    health: Option<VMPoolHealth>,
+    wasm_backend: WasmtimeWasmBackend,
+}
+
+impl<RT: AquaRuntime> VmPool<RT> {
+    /// Creates `VmPool` and starts background tasks creating `config.pool_size` number of VMs
+    pub fn new(
+        pool_size: usize,
+        runtime_config: RT::Config,
+        metrics: Option<VmPoolMetrics>,
+        health_registry: Option<&mut HealthCheckRegistry>,
+        wasm_backend: WasmtimeWasmBackend,
+    ) -> Self {
+        let health = health_registry.map(|registry| {
+            let health = VMPoolHealth::new(pool_size);
+            registry.register("vm_pool", health.clone());
+            health
+        });
+
+        let mut this = Self {
+            runtimes: (0..pool_size).map(|_| None).collect(),
+            creating_runtimes: None,
+            runtime_config,
+            pool_size,
+            metrics,
+            health,
+            wasm_backend,
+        };
+
+        this.meter(|m| m.set_pool_size(pool_size));
+
+        this
+    }
+
+    fn meter<U, FF: Fn(&mut VmPoolMetrics) -> U>(&mut self, f: FF) {
+        self.metrics.as_mut().map(f);
+    }
+
+    /// Number of currently unused vms
+    pub fn free_vms(&self) -> usize {
+        self.runtimes.len()
+    }
+
+    /// Takes VM from pool
+    pub fn get_vm(&mut self) -> Option<(usize, RT)> {
+        let runtimes = self.runtimes.iter_mut();
+        let vm = runtimes
+            .enumerate()
+            .find_map(|(idx, vm)| vm.take().map(|vm| (idx, vm)));
+
+        let free_vms_count = self.runtimes.iter().filter(|vm| vm.is_some()).count();
+        self.meter(|m| {
+            m.get_vm.inc();
+
+            if vm.is_none() {
+                m.no_free_vm.inc();
+            }
+            m.free_vms.set(free_vms_count as i64);
+        });
+
+        vm
+    }
+
+    /// Puts VM back to the pool
+    pub fn put_vm(&mut self, id: usize, vm: RT) {
+        debug_assert!(
+            self.runtimes[id].is_none(),
+            "put_vm must never happen before get_vm"
+        );
+        let memory_stats = vm.memory_stats();
+        self.runtimes[id] = Some(vm);
+
+        let free_vms_count = self.runtimes.iter().filter(|vm| vm.is_some()).count();
+        self.meter(|m| {
+            m.put_vm.inc();
+            m.free_vms.set(free_vms_count as i64);
+            m.measure_memory(id, memory_stats.memory_size as u64);
+            // TODO: measure max memory
+        });
+    }
+
+    pub fn recreate_avm(&mut self, id: usize, cx: &Context<'_>) {
+        if self.creating_runtimes.is_none() {
+            tracing::error!(
+                "Attempt to recreate an AVM before initialization (self.creating_runtimes is None), ignoring"
+            );
+            return;
+        }
+
+        let avm_f = self.create_avm(cx);
+        if let Some(creating_vms) = self.creating_runtimes.as_mut() {
+            creating_vms.push((id, avm_f))
+        }
+    }
+
+    fn create_avm(&self, cx: &Context<'_>) -> RuntimeF<RT> {
+        let config = self.runtime_config.clone();
+        let wasm_backend = self.wasm_backend.clone();
+        let waker = cx.waker().clone();
+
+        async {
+            let task_result =
+                tokio::task::spawn_blocking(|| RT::create_runtime(config, wasm_backend, waker))
+                    .await; // TODO: move waker outside create runtime
+            match task_result {
+                Ok(joined_res) => joined_res.map_err(|e| CreateAVMError::AVMError(Box::new(e))),
+                Err(e) => Err(CreateAVMError::JoinError(e)),
+            }
+        }
+        .boxed()
+    }
+
+    /// Moves created VMs from `creating_vms` to `vms`
+    pub fn poll(&mut self, cx: &mut Context<'_>) {
+        let creating_vms = match &mut self.creating_runtimes {
+            None => {
+                tracing::debug!("Starting creation {} AVMs", self.pool_size);
+                self.creating_runtimes = Some(
+                    (0..self.pool_size)
+                        .map(|id| (id, self.create_avm(cx)))
+                        .collect(),
+                );
+                self.creating_runtimes.as_mut().unwrap()
+            }
+            Some(ref mut vms) => vms,
+        };
+
+        let mut wake = false;
+
+        let mut fut_index = 0;
+        while fut_index < creating_vms.len() {
+            let vms = &mut self.runtimes;
+            let idx_fut = &mut creating_vms[fut_index];
+            let id = idx_fut.0;
+            let fut = &mut idx_fut.1;
+            if let Poll::Ready(vm) = fut.poll_unpin(cx) {
+                // Remove completed future
+                let _ = creating_vms.remove(fut_index);
+                if creating_vms.is_empty() {
+                    tracing::info!("All {} AquaVMs created.", self.pool_size)
+                }
+
+                // Put created vm to self.vms
+                match vm {
+                    Ok(vm) => {
+                        vms[id] = Some(vm);
+                        if let Some(h) = self.health.as_ref() {
+                            h.increment_count()
+                        }
+                    }
+                    Err(err) => {
+                        tracing::error!("Failed to create vm: {:?}", err)
+                    } // TODO: don't panic
+                }
+
+                wake = true;
+            }
+            fut_index += 1;
+        }
+
+        if wake {
+            cx.waker().wake_by_ref()
+        }
+    }
+}
+
\ No newline at end of file diff --git a/src/async_unlock/lib.rs.html b/src/async_unlock/lib.rs.html new file mode 100644 index 0000000000..49d53c6da0 --- /dev/null +++ b/src/async_unlock/lib.rs.html @@ -0,0 +1,79 @@ +lib.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+//! This crate describes functions to work with async_std's Mutex in a manner that guarantees
+//! shortest possible lock time by dropping MutexGuard ASAP.
+
+use std::future::Future;
+use std::ops::DerefMut;
+use tokio::sync::Mutex;
+
+/// Performs async computation on a value inside Mutex
+/// This function guarantees that Mutex will be unlocked before awaiting computation described by `f`
+pub async fn unlock_f<T, R, F: Future<Output = R>>(m: &Mutex<T>, f: impl FnOnce(&mut T) -> F) -> R {
+    unlock(m, f).await.await
+}
+
+/// Performs computation on a value inside Mutex, unlocking Mutex immediately after `f` is computed
+pub async fn unlock<T, R>(m: &Mutex<T>, f: impl FnOnce(&mut T) -> R) -> R {
+    let mut guard = m.lock().await;
+    let result = f(guard.deref_mut());
+    drop(guard);
+    result
+}
+
\ No newline at end of file diff --git a/src/chain_connector/builtins.rs.html b/src/chain_connector/builtins.rs.html new file mode 100644 index 0000000000..88bc629ebf --- /dev/null +++ b/src/chain_connector/builtins.rs.html @@ -0,0 +1,395 @@ +builtins.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+use crate::types::{SubnetResolveResult, TxReceiptResult, TxStatus, Worker};
+use crate::{ChainConnector, HttpChainConnector};
+use ccp_shared::types::CUID;
+use futures::FutureExt;
+use particle_args::{Args, JError};
+use particle_builtins::{wrap, CustomService};
+use particle_execution::{ParticleParams, ServiceFunction};
+use serde_json::json;
+use serde_json::Value as JValue;
+use std::collections::HashMap;
+use std::sync::Arc;
+use types::peer_scope::WorkerId;
+use types::DealId;
+
+// macro to generate a closure for a builtin function
+macro_rules! make_builtin_closure {
+    ($connector:expr, $function:ident) => {{
+        let connector = $connector.clone();
+        ServiceFunction::Immut(Box::new(move |args, params| {
+            let connector = connector.clone();
+            async move { wrap($function(connector, args, params).await) }.boxed()
+        }))
+    }};
+}
+
+pub(crate) fn make_connector_builtins(
+    connector: Arc<HttpChainConnector>,
+) -> HashMap<String, CustomService> {
+    let mut builtins = HashMap::new();
+    builtins.insert(
+        "connector".to_string(),
+        CustomService::new(
+            vec![
+                (
+                    "get_deals",
+                    make_builtin_closure!(connector, get_deals_builtin),
+                ),
+                (
+                    "register_worker",
+                    make_builtin_closure!(connector, register_worker_builtin),
+                ),
+                (
+                    "get_tx_receipts",
+                    make_builtin_closure!(connector, get_tx_receipts_builtin),
+                ),
+            ],
+            None,
+        ),
+    );
+    // Legacy service name; Can be deprecated and moved to connector in the future
+    builtins.insert(
+        "subnet".to_string(),
+        CustomService::new(
+            vec![(
+                "resolve",
+                make_builtin_closure!(connector, resolve_subnet_builtin),
+            )],
+            None,
+        ),
+    );
+    builtins
+}
+
+async fn get_deals_builtin(
+    connector: Arc<HttpChainConnector>,
+    _args: Args,
+    params: ParticleParams,
+) -> Result<JValue, JError> {
+    if params.init_peer_id != connector.host_id {
+        return Err(JError::new(
+            "Only the root worker can call connector.get_deals",
+        ));
+    }
+
+    let deals = connector
+        .get_deals()
+        .await
+        .map_err(|err| JError::new(format!("Failed to get deals: {err}")))?;
+    Ok(json!(deals))
+}
+
+async fn register_worker_builtin(
+    connector: Arc<HttpChainConnector>,
+    args: Args,
+    params: ParticleParams,
+) -> Result<JValue, JError> {
+    if params.init_peer_id != connector.host_id {
+        return Err(JError::new(
+            "Only the root worker can call connector.register_worker",
+        ));
+    }
+
+    let mut args = args.function_args.into_iter();
+    let deal_id: DealId = Args::next("deal_id", &mut args)?;
+    let worker_id: WorkerId = Args::next("worker_id", &mut args)?;
+    let cu_ids: Vec<CUID> = Args::next("cu_id", &mut args)?;
+
+    if cu_ids.len() != 1 {
+        return Err(JError::new("Only one cu_id is allowed"));
+    }
+
+    let tx_hash = connector
+        .register_worker(&deal_id, worker_id, cu_ids[0])
+        .await
+        .map_err(|err| JError::new(format!("Failed to register worker: {err}")))?;
+    Ok(json!(tx_hash))
+}
+
+async fn get_tx_receipts_builtin(
+    connector: Arc<HttpChainConnector>,
+    args: Args,
+    params: ParticleParams,
+) -> Result<JValue, JError> {
+    if params.init_peer_id != connector.host_id {
+        return Err(JError::new(
+            "Only the root worker can call connector.get_tx_receipt",
+        ));
+    }
+
+    let mut args = args.function_args.into_iter();
+
+    let tx_hashes: Vec<String> = Args::next("tx_hashes", &mut args)?;
+
+    let receipts = connector
+        .get_tx_receipts(tx_hashes)
+        .await
+        .map_err(|err| JError::new(format!("Failed to get tx receipts: {err}")))?
+        .into_iter()
+        .map(|tx_receipt| match tx_receipt {
+            Ok(receipt) => match receipt {
+                TxStatus::Pending => TxReceiptResult::pending(),
+                TxStatus::Processed(receipt) => TxReceiptResult::processed(receipt),
+            },
+            Err(err) => TxReceiptResult::error(err.to_string()),
+        })
+        .collect::<Vec<_>>();
+
+    Ok(json!(receipts))
+}
+
+async fn resolve_subnet_builtin(
+    connector: Arc<HttpChainConnector>,
+    args: Args,
+    _params: ParticleParams,
+) -> Result<JValue, JError> {
+    let deal_id: String = Args::next("deal_id", &mut args.function_args.into_iter())?;
+    let deal_id = DealId::from(deal_id);
+
+    let workers: eyre::Result<Vec<Worker>> = try {
+        if !deal_id.is_valid() {
+            Err(eyre::eyre!(
+                "Invalid deal id '{}': invalid length",
+                deal_id.as_str()
+            ))?;
+        }
+
+        let units = connector.get_deal_compute_units(&deal_id).await?;
+        let workers: Result<Vec<Worker>, _> = units
+            .into_iter()
+            .map(|unit| Worker::try_from(unit))
+            .collect();
+        workers?
+    };
+
+    let result = match workers {
+        Ok(workers) => SubnetResolveResult {
+            success: true,
+            workers,
+            error: vec![],
+        },
+        Err(err) => SubnetResolveResult {
+            success: false,
+            workers: vec![],
+            error: vec![format!("{}", err)],
+        },
+    };
+
+    Ok(json!(result))
+}
+
\ No newline at end of file diff --git a/src/chain_connector/connector.rs.html b/src/chain_connector/connector.rs.html new file mode 100644 index 0000000000..b3eddda7e4 --- /dev/null +++ b/src/chain_connector/connector.rs.html @@ -0,0 +1,2773 @@ +connector.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+762
+763
+764
+765
+766
+767
+768
+769
+770
+771
+772
+773
+774
+775
+776
+777
+778
+779
+780
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+794
+795
+796
+797
+798
+799
+800
+801
+802
+803
+804
+805
+806
+807
+808
+809
+810
+811
+812
+813
+814
+815
+816
+817
+818
+819
+820
+821
+822
+823
+824
+825
+826
+827
+828
+829
+830
+831
+832
+833
+834
+835
+836
+837
+838
+839
+840
+841
+842
+843
+844
+845
+846
+847
+848
+849
+850
+851
+852
+853
+854
+855
+856
+857
+858
+859
+860
+861
+862
+863
+864
+865
+866
+867
+868
+869
+870
+871
+872
+873
+874
+875
+876
+877
+878
+879
+880
+881
+882
+883
+884
+885
+886
+887
+888
+889
+890
+891
+892
+893
+894
+895
+896
+897
+898
+899
+900
+901
+902
+903
+904
+905
+906
+907
+908
+909
+910
+911
+912
+913
+914
+915
+916
+917
+918
+919
+920
+921
+922
+923
+924
+925
+926
+927
+928
+929
+930
+931
+932
+933
+934
+935
+936
+937
+938
+939
+940
+941
+942
+943
+944
+945
+946
+947
+948
+949
+950
+951
+952
+953
+954
+955
+956
+957
+958
+959
+960
+961
+962
+963
+964
+965
+966
+967
+968
+969
+970
+971
+972
+973
+974
+975
+976
+977
+978
+979
+980
+981
+982
+983
+984
+985
+986
+987
+988
+989
+990
+991
+992
+993
+994
+995
+996
+997
+998
+999
+1000
+1001
+1002
+1003
+1004
+1005
+1006
+1007
+1008
+1009
+1010
+1011
+1012
+1013
+1014
+1015
+1016
+1017
+1018
+1019
+1020
+1021
+1022
+1023
+1024
+1025
+1026
+1027
+1028
+1029
+1030
+1031
+1032
+1033
+1034
+1035
+1036
+1037
+1038
+1039
+1040
+1041
+1042
+1043
+1044
+1045
+1046
+1047
+1048
+1049
+1050
+1051
+1052
+1053
+1054
+1055
+1056
+1057
+1058
+1059
+1060
+1061
+1062
+1063
+1064
+1065
+1066
+1067
+1068
+1069
+1070
+1071
+1072
+1073
+1074
+1075
+1076
+1077
+1078
+1079
+1080
+1081
+1082
+1083
+1084
+1085
+1086
+1087
+1088
+1089
+1090
+1091
+1092
+1093
+1094
+1095
+1096
+1097
+1098
+1099
+1100
+1101
+1102
+1103
+1104
+1105
+1106
+1107
+1108
+1109
+1110
+1111
+1112
+1113
+1114
+1115
+1116
+1117
+1118
+1119
+1120
+1121
+1122
+1123
+1124
+1125
+1126
+1127
+1128
+1129
+1130
+1131
+1132
+1133
+1134
+1135
+1136
+1137
+1138
+1139
+1140
+1141
+1142
+1143
+1144
+1145
+1146
+1147
+1148
+1149
+1150
+1151
+1152
+1153
+1154
+1155
+1156
+1157
+1158
+1159
+1160
+1161
+1162
+1163
+1164
+1165
+1166
+1167
+1168
+1169
+1170
+1171
+1172
+1173
+1174
+1175
+1176
+1177
+1178
+1179
+1180
+1181
+1182
+1183
+1184
+1185
+1186
+1187
+1188
+1189
+1190
+1191
+1192
+1193
+1194
+1195
+1196
+1197
+1198
+1199
+1200
+1201
+1202
+1203
+1204
+1205
+1206
+1207
+1208
+1209
+1210
+1211
+1212
+1213
+1214
+1215
+1216
+1217
+1218
+1219
+1220
+1221
+1222
+1223
+1224
+1225
+1226
+1227
+1228
+1229
+1230
+1231
+1232
+1233
+1234
+1235
+1236
+1237
+1238
+1239
+1240
+1241
+1242
+1243
+1244
+1245
+1246
+1247
+1248
+1249
+1250
+1251
+1252
+1253
+1254
+1255
+1256
+1257
+1258
+1259
+1260
+1261
+1262
+1263
+1264
+1265
+1266
+1267
+1268
+1269
+1270
+1271
+1272
+1273
+1274
+1275
+1276
+1277
+1278
+1279
+1280
+1281
+1282
+1283
+1284
+1285
+1286
+1287
+1288
+1289
+1290
+1291
+1292
+1293
+1294
+1295
+1296
+1297
+1298
+1299
+1300
+1301
+1302
+1303
+1304
+1305
+1306
+1307
+1308
+1309
+1310
+1311
+1312
+1313
+1314
+1315
+1316
+1317
+1318
+1319
+1320
+1321
+1322
+1323
+1324
+1325
+1326
+1327
+1328
+1329
+1330
+1331
+1332
+1333
+1334
+1335
+1336
+1337
+1338
+1339
+1340
+1341
+1342
+1343
+1344
+1345
+1346
+1347
+1348
+1349
+1350
+1351
+1352
+1353
+1354
+1355
+1356
+1357
+1358
+1359
+1360
+1361
+1362
+1363
+1364
+1365
+1366
+1367
+1368
+1369
+1370
+1371
+1372
+1373
+1374
+1375
+1376
+1377
+1378
+1379
+1380
+1381
+1382
+1383
+1384
+1385
+1386
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use alloy_primitives::{FixedBytes, Uint, U256};
+use alloy_sol_types::sol_data::Array;
+use alloy_sol_types::{SolCall, SolType};
+use std::collections::{BTreeMap, HashMap};
+use std::str::FromStr;
+use std::sync::Arc;
+
+use ccp_shared::types::{Difficulty, GlobalNonce, LocalNonce, ResultHash, CUID};
+use clarity::{Transaction, Uint256};
+use eyre::eyre;
+use jsonrpsee::core::async_trait;
+use jsonrpsee::core::client::{BatchResponse, ClientT};
+use jsonrpsee::core::params::{ArrayParams, BatchRequestBuilder};
+use jsonrpsee::http_client::HttpClientBuilder;
+use jsonrpsee::rpc_params;
+use serde_json::{json, Value};
+use tokio::sync::Mutex;
+
+use crate::builtins::make_connector_builtins;
+use crate::error::process_response;
+use crate::eth_call::EthCall;
+use crate::types::*;
+use crate::ConnectorError::{FieldNotFound, InvalidU256, ResponseParseError};
+use crate::Deal::CIDV1;
+use crate::Offer::{ComputePeer, ComputeUnit};
+use crate::{CCStatus, Capacity, CommitmentId, Core, Deal, Offer};
+use chain_data::{peer_id_to_bytes, BlockHeader};
+use fluence_libp2p::PeerId;
+use hex_utils::{decode_hex, encode_hex_0x};
+use particle_builtins::CustomService;
+use server_config::ChainConfig;
+use types::peer_scope::WorkerId;
+use types::DealId;
+
+#[async_trait]
+pub trait ChainConnector: Send + Sync {
+    async fn get_current_commitment_id(&self) -> Result<Option<CommitmentId>>;
+
+    async fn get_cc_init_params(&self) -> eyre::Result<CCInitParams>; //TODO: make error type
+
+    async fn get_compute_units(&self) -> Result<Vec<ComputeUnit>>;
+
+    async fn get_commitment_status(&self, commitment_id: CommitmentId) -> Result<CCStatus>;
+
+    async fn get_global_nonce(&self) -> Result<GlobalNonce>;
+
+    async fn submit_proofs(
+        &self,
+        unit_ids: Vec<CUID>,
+        local_nonces: Vec<LocalNonce>,
+        result_hashes: Vec<ResultHash>,
+    ) -> Result<String>;
+
+    async fn get_deal_statuses(&self, deal_ids: Vec<DealId>) -> Result<Vec<Result<Deal::Status>>>;
+
+    async fn exit_deal(&self, cu_id: &CUID) -> Result<String>;
+
+    async fn get_tx_statuses(&self, tx_hashes: Vec<String>) -> Result<Vec<Result<Option<bool>>>>;
+
+    async fn get_tx_receipts(&self, tx_hashes: Vec<String>) -> Result<Vec<Result<TxStatus>>>;
+}
+
+pub struct HttpChainConnector {
+    client: Arc<jsonrpsee::http_client::HttpClient>,
+    config: ChainConfig,
+    tx_nonce_mutex: Arc<Mutex<Option<U256>>>,
+    pub(crate) host_id: PeerId,
+}
+
+impl HttpChainConnector {
+    pub fn new(
+        config: ChainConfig,
+        host_id: PeerId,
+    ) -> eyre::Result<(Arc<Self>, HashMap<String, CustomService>)> {
+        tracing::info!(target: "chain-connector","Connecting to chain via {}", config.http_endpoint);
+
+        let connector = Arc::new(Self {
+            client: Arc::new(HttpClientBuilder::default().build(&config.http_endpoint)?),
+            config,
+            tx_nonce_mutex: Arc::new(Mutex::new(None)),
+            host_id,
+        });
+
+        let builtins = make_connector_builtins(connector.clone());
+        Ok((connector, builtins))
+    }
+
+    async fn get_base_fee_per_gas(&self) -> Result<U256> {
+        if let Some(fee) = self.config.default_base_fee {
+            return Ok(Uint::from(fee));
+        }
+
+        let block: Value = process_response(
+            self.client
+                .request("eth_getBlockByNumber", rpc_params!["pending", false])
+                .await,
+        )?;
+
+        let fee = block
+            .as_object()
+            .and_then(|o| o.get("baseFeePerGas"))
+            .and_then(Value::as_str)
+            .ok_or(ResponseParseError(block.to_string()))?
+            .to_string();
+
+        let base_fee_per_gas =
+            U256::from_str(&fee).map_err(|err| InvalidU256(fee, err.to_string()))?;
+
+        Ok(base_fee_per_gas)
+    }
+
+    pub async fn get_app_cid(&self, deals: impl Iterator<Item = &DealId>) -> Result<Vec<String>> {
+        let data = Deal::appCIDCall {}.abi_encode();
+        let mut batch = BatchRequestBuilder::new();
+        for deal in deals {
+            batch.insert(
+                "eth_call",
+                rpc_params![EthCall::to(&data, &deal.to_address()), "latest"],
+            )?;
+        }
+        let resp: BatchResponse<String> = self.client.batch_request(batch).await?;
+        let mut cids = vec![];
+        for result in resp.into_iter() {
+            let cid = CIDV1::from_hex(&result?)?;
+            let app_cid = cid.to_ipld()?;
+            cids.push(app_cid.to_string());
+        }
+
+        Ok(cids)
+    }
+
+    pub(crate) async fn get_deals(&self) -> eyre::Result<Vec<DealResult>> {
+        let units = self.get_compute_units().await?;
+        tracing::debug!(target: "chain-connector", "get_deals: Got {} compute units", units.len());
+        let mut deals: BTreeMap<DealId, Vec<CUID>> = BTreeMap::new();
+
+        units
+            .iter()
+            .filter(|unit| !unit.deal.is_zero())
+            .for_each(|unit| {
+                deals
+                    .entry(unit.deal.to_string().into())
+                    .or_default()
+                    .push(CUID::new(unit.id.into()));
+            });
+
+        if deals.is_empty() {
+            return Ok(Vec::new());
+        }
+        tracing::debug!(target: "chain-connector", "get_deals: Got {} deals: {:?}", deals.len(), deals);
+        let infos = self.get_deal_infos(deals.keys()).await?;
+        tracing::debug!(target: "chain-connector", "get_deals: Got {} deals infos: {:?}", infos.len(), infos);
+        let deals = infos
+            .into_iter()
+            .zip(deals)
+            .map(|(details, (deal_id, unit_ids))| match details {
+                Ok((status, app_cid)) => DealResult::new(
+                    deal_id,
+                    DealInfo {
+                        unit_ids,
+                        status,
+                        app_cid,
+                    },
+                ),
+                Err(err) => DealResult::with_error(deal_id, err.to_string()),
+            })
+            .collect::<_>();
+        tracing::debug!(target: "chain-connector", "get_deals: Return deals: {:?}", deals);
+        Ok(deals)
+    }
+
+    async fn get_deal_infos<'a, I>(
+        &self,
+        deal_ids: I,
+    ) -> Result<Vec<Result<(Deal::Status, String)>>>
+    where
+        I: IntoIterator<Item = &'a DealId> + ExactSizeIterator,
+    {
+        let mut batch = BatchRequestBuilder::new();
+        let deal_count = deal_ids.len();
+        for deal_id in deal_ids {
+            let status_data = Deal::getStatusCall {}.abi_encode();
+            batch.insert(
+                "eth_call",
+                rpc_params![EthCall::to(&status_data, &deal_id.to_address()), "latest"],
+            )?;
+            let app_cid_data = Deal::appCIDCall {}.abi_encode();
+            batch.insert(
+                "eth_call",
+                rpc_params![EthCall::to(&app_cid_data, &deal_id.to_address()), "latest"],
+            )?;
+        }
+        tracing::debug!(target: "chain-connector", "Batched get_deal_info request: {batch:?}");
+        let resp: BatchResponse<String> = self.client.batch_request(batch).await?;
+        tracing::debug!(target: "chain-connector", "Batched get_deal_info response: {resp:?}");
+
+        debug_assert_eq!(
+            resp.len(),
+            deal_count * 2,
+            "JSON RPC Response contains not enough replies for the request, reposne = {resp:?}"
+        );
+
+        // Here we unite two responses with status and app cid for one deal.
+        //
+        // Since we put in the batch request requests in order [deal status, deal app_cid, ..]
+        // we must get a reply in the same order.
+        //
+        // Note that JSON RPC specification says that it's a SHOULD not a MUST that the reply for
+        // an ID will come at all, so this code can break if RPC malfunctions.
+        let deal_info = resp
+            .into_iter()
+            .array_chunks::<2>()
+            .map(|[status_resp, app_cid_resp]| try {
+                let status = Deal::Status::from_hex(&status_resp?)?;
+                let app_cid = CIDV1::from_hex(&app_cid_resp?)?.to_ipld()?;
+                (status, app_cid)
+            })
+            .collect::<_>();
+        Ok(deal_info)
+    }
+
+    async fn get_tx_nonce(&self) -> Result<U256> {
+        let address = self.config.wallet_key.to_address().to_string();
+        let resp: String = process_response(
+            self.client
+                .request("eth_getTransactionCount", rpc_params![address, "pending"])
+                .await,
+        )?;
+
+        let nonce = U256::from_str(&resp).map_err(|err| InvalidU256(resp, err.to_string()))?;
+        Ok(nonce)
+    }
+
+    async fn max_priority_fee_per_gas(&self) -> Result<U256> {
+        if let Some(fee) = self.config.default_priority_fee {
+            return Ok(Uint::from(fee));
+        }
+
+        let resp: String = process_response(
+            self.client
+                .request("eth_maxPriorityFeePerGas", rpc_params![])
+                .await,
+        )?;
+        let max_priority_fee_per_gas =
+            U256::from_str(&resp).map_err(|err| InvalidU256(resp, err.to_string()))?;
+        Ok(max_priority_fee_per_gas)
+    }
+
+    async fn estimate_gas_limit(&self, data: &[u8], to: &str) -> Result<U256> {
+        let resp: String = process_response(
+            self.client
+                .request(
+                    "eth_estimateGas",
+                    rpc_params![json!({
+                        "from": self.config.wallet_key.to_address().to_string(),
+                        "to": to,
+                        "data": encode_hex_0x(data),
+                    })],
+                )
+                .await,
+        )?;
+        let limit = U256::from_str(&resp).map_err(|err| InvalidU256(resp, err.to_string()))?;
+        Ok(limit)
+    }
+
+    pub async fn send_tx(&self, data: Vec<u8>, to: &str) -> Result<String> {
+        let base_fee = self.get_base_fee_per_gas().await?;
+        tracing::info!(target: "chain-connector", "Estimating gas for tx from {} to {} data {}", self.config.wallet_key.to_address(), to, encode_hex_0x(&data));
+        let gas_limit = self.estimate_gas_limit(&data, to).await?;
+        let max_priority_fee_per_gas = self.max_priority_fee_per_gas().await?;
+        // (base fee + priority fee).
+        let max_fee_per_gas = base_fee + max_priority_fee_per_gas;
+
+        // We use this lock no ensure that we don't send two transactions with the same nonce
+        let mut nonce_guard = self.tx_nonce_mutex.lock().await;
+        let nonce = match *nonce_guard {
+            None => self.get_tx_nonce().await?,
+            Some(n) => n,
+        };
+
+        tracing::info!(target: "chain-connector",
+            "Sending tx to {to} from {} data {}",
+            self.config.wallet_key.to_address(), encode_hex_0x(&data)
+        );
+
+        // Create a new transaction
+        let tx = Transaction::Eip1559 {
+            chain_id: self.config.network_id.into(),
+            nonce: Uint256::from_le_bytes(&nonce.to_le_bytes_vec()),
+            max_priority_fee_per_gas: Uint256::from_le_bytes(
+                &max_priority_fee_per_gas.to_le_bytes_vec(),
+            ),
+            gas_limit: Uint256::from_le_bytes(&gas_limit.to_le_bytes_vec()),
+            to: to.parse()?,
+            value: 0u32.into(),
+            data,
+            signature: None, // Not signed. Yet.
+            max_fee_per_gas: Uint256::from_le_bytes(&max_fee_per_gas.to_le_bytes_vec()),
+            access_list: vec![],
+        };
+
+        let signed_tx = tx
+            .sign(&self.config.wallet_key, Some(self.config.network_id))
+            .to_bytes();
+        let signed_tx = encode_hex_0x(signed_tx);
+
+        let result: Result<String> = process_response(
+            self.client
+                .request("eth_sendRawTransaction", rpc_params![signed_tx])
+                .await,
+        );
+
+        match result {
+            Ok(resp) => {
+                let new_nonce = nonce + Uint::from(1);
+                *nonce_guard = Some(new_nonce);
+                tracing::debug!(target: "chain-connector", "Incrementing nonce. New nonce {new_nonce}");
+                Ok(resp)
+            }
+            Err(err) => {
+                tracing::warn!(target: "chain-connector", "Failed to send tx: {err}, resetting nonce");
+                *nonce_guard = None;
+                Err(err)
+            }
+        }
+    }
+
+    pub async fn register_worker(
+        &self,
+        deal_id: &DealId,
+        worker_id: WorkerId,
+        cu_id: CUID,
+    ) -> Result<String> {
+        let data = Deal::setWorkerCall {
+            computeUnitId: cu_id.as_ref().into(),
+            workerId: peer_id_to_bytes(worker_id.into()).into(),
+        }
+        .abi_encode();
+        tracing::debug!(target: "chain-connector", "Registering worker {worker_id} for deal {deal_id} with cu_id {cu_id}");
+        self.send_tx(data, &deal_id.to_address()).await
+    }
+
+    fn difficulty_params(&self) -> ArrayParams {
+        let data = Core::difficultyCall {}.abi_encode();
+
+        self.make_latest_diamond_rpc_params(data)
+    }
+
+    pub async fn get_deal_compute_units(&self, deal_id: &DealId) -> Result<Vec<Deal::ComputeUnit>> {
+        let data = Deal::getComputeUnitsCall {}.abi_encode();
+        let resp: String = process_response(
+            self.client
+                .request(
+                    "eth_call",
+                    rpc_params![EthCall::to(&data, &deal_id.to_address()), "latest"],
+                )
+                .await,
+        )?;
+        let bytes = decode_hex(&resp)?;
+        let compute_units = <Array<Deal::ComputeUnit> as SolType>::abi_decode(&bytes, true)?;
+
+        Ok(compute_units)
+    }
+
+    fn init_timestamp_params(&self) -> ArrayParams {
+        let data = Core::initTimestampCall {}.abi_encode();
+        self.make_latest_diamond_rpc_params(data)
+    }
+    fn global_nonce_params(&self) -> ArrayParams {
+        let data = Capacity::getGlobalNonceCall {}.abi_encode();
+        self.make_latest_diamond_rpc_params(data)
+    }
+    fn current_epoch_params(&self) -> ArrayParams {
+        let data = Core::currentEpochCall {}.abi_encode();
+        self.make_latest_diamond_rpc_params(data)
+    }
+    fn epoch_duration_params(&self) -> ArrayParams {
+        let data = Core::epochDurationCall {}.abi_encode();
+        self.make_latest_diamond_rpc_params(data)
+    }
+
+    fn min_proofs_per_epoch_params(&self) -> ArrayParams {
+        let data = Core::minProofsPerEpochCall {}.abi_encode();
+        self.make_latest_diamond_rpc_params(data)
+    }
+
+    fn max_proofs_per_epoch_params(&self) -> ArrayParams {
+        let data = Core::maxProofsPerEpochCall {}.abi_encode();
+        self.make_latest_diamond_rpc_params(data)
+    }
+
+    fn make_latest_diamond_rpc_params(&self, data: Vec<u8>) -> ArrayParams {
+        rpc_params![
+            EthCall::to(&data, &self.config.diamond_contract_address),
+            "latest"
+        ]
+    }
+}
+
+#[async_trait]
+impl ChainConnector for HttpChainConnector {
+    async fn get_current_commitment_id(&self) -> Result<Option<CommitmentId>> {
+        let peer_id = peer_id_to_bytes(self.host_id);
+        let data = Offer::getComputePeerCall {
+            peerId: peer_id.into(),
+        }
+        .abi_encode();
+        let resp: String = process_response(
+            self.client
+                .request("eth_call", self.make_latest_diamond_rpc_params(data))
+                .await,
+        )?;
+        let compute_peer = <ComputePeer as SolType>::abi_decode(&decode_hex(&resp)?, true)?;
+        Ok(CommitmentId::new(compute_peer.commitmentId.0))
+    }
+
+    async fn get_cc_init_params(&self) -> eyre::Result<CCInitParams> {
+        let mut batch = BatchRequestBuilder::new();
+
+        batch.insert("eth_call", self.difficulty_params())?;
+        batch.insert("eth_call", self.init_timestamp_params())?;
+        batch.insert("eth_call", self.global_nonce_params())?;
+        batch.insert("eth_call", self.current_epoch_params())?;
+        batch.insert("eth_call", self.epoch_duration_params())?;
+        batch.insert("eth_call", self.min_proofs_per_epoch_params())?;
+        batch.insert("eth_call", self.max_proofs_per_epoch_params())?;
+        batch.insert("eth_getBlockByNumber", rpc_params!["latest", false])?;
+
+        let resp: BatchResponse<Value> = self.client.batch_request(batch).await?;
+        tracing::debug!(target: "chain-connector", "Got cc init params response: {resp:?}");
+
+        let mut results = resp
+            .into_ok()
+            .map_err(|err| eyre!("Some request failed in a batch {err:?}"))?;
+
+        // TODO: check with 0x and write test
+        let difficulty: FixedBytes<32> =
+            FixedBytes::from_str(&parse_str_field(results.next(), "difficulty")?)?;
+
+        let init_timestamp = U256::from_str(&parse_str_field(results.next(), "init_timestamp")?)?;
+
+        let global_nonce = FixedBytes::from_str(&parse_str_field(results.next(), "global_nonce")?)?;
+
+        let current_epoch = U256::from_str(&parse_str_field(results.next(), "current_epoch")?)?;
+
+        let epoch_duration = U256::from_str(&parse_str_field(results.next(), "epoch_duration")?)?;
+
+        let min_proofs_per_epoch =
+            U256::from_str(&parse_str_field(results.next(), "min_proofs_per_epoch")?)?;
+
+        let max_proofs_per_epoch =
+            U256::from_str(&parse_str_field(results.next(), "max_proofs_per_epoch")?)?;
+
+        let header = BlockHeader::from_json(
+            results
+                .next()
+                .ok_or_else(|| eyre!("Block header not found in response"))?,
+        )?;
+
+        Ok(CCInitParams {
+            difficulty: Difficulty::new(difficulty.0),
+            init_timestamp,
+            current_timestamp: header.timestamp,
+            global_nonce: GlobalNonce::new(global_nonce.0),
+            current_epoch,
+            epoch_duration,
+            min_proofs_per_epoch,
+            max_proofs_per_epoch,
+        })
+    }
+
+    async fn get_compute_units(&self) -> Result<Vec<ComputeUnit>> {
+        let data = Offer::getComputeUnitsCall {
+            peerId: peer_id_to_bytes(self.host_id).into(),
+        }
+        .abi_encode();
+
+        let resp: String = process_response(
+            self.client
+                .request("eth_call", self.make_latest_diamond_rpc_params(data))
+                .await,
+        )?;
+        let bytes = decode_hex(&resp)?;
+        let compute_units = <Array<ComputeUnit> as SolType>::abi_decode(&bytes, true)?;
+
+        Ok(compute_units)
+    }
+
+    async fn get_commitment_status(&self, commitment_id: CommitmentId) -> Result<CCStatus> {
+        let data = Capacity::getStatusCall {
+            commitmentId: commitment_id.0.into(),
+        }
+        .abi_encode();
+
+        let resp: String = process_response(
+            self.client
+                .request("eth_call", self.make_latest_diamond_rpc_params(data))
+                .await,
+        )?;
+        Ok(<CCStatus as SolType>::abi_decode(
+            &decode_hex(&resp)?,
+            true,
+        )?)
+    }
+
+    async fn get_global_nonce(&self) -> Result<GlobalNonce> {
+        let resp: String = process_response(
+            self.client
+                .request("eth_call", self.global_nonce_params())
+                .await,
+        )?;
+
+        let bytes: FixedBytes<32> = FixedBytes::from_str(&resp)?;
+        Ok(GlobalNonce::new(bytes.0))
+    }
+
+    async fn submit_proofs(
+        &self,
+        unit_ids: Vec<CUID>,
+        local_nonces: Vec<LocalNonce>,
+        result_hashes: Vec<ResultHash>,
+    ) -> Result<String> {
+        let data = Capacity::submitProofsCall {
+            unitIds: unit_ids.into_iter().map(|id| id.as_ref().into()).collect(),
+            localUnitNonces: local_nonces
+                .into_iter()
+                .map(|n| n.as_ref().into())
+                .collect(),
+
+            resultHashes: result_hashes
+                .into_iter()
+                .map(|hash| hash.as_ref().into())
+                .collect(),
+        }
+        .abi_encode();
+
+        self.send_tx(data, &self.config.diamond_contract_address)
+            .await
+    }
+
+    async fn get_deal_statuses(&self, deal_ids: Vec<DealId>) -> Result<Vec<Result<Deal::Status>>> {
+        let mut batch = BatchRequestBuilder::new();
+        for deal_id in deal_ids {
+            let data = Deal::getStatusCall {}.abi_encode();
+            batch.insert(
+                "eth_call",
+                rpc_params![EthCall::to(&data, &deal_id.to_address()), "latest"],
+            )?;
+        }
+
+        let resp: BatchResponse<String> = self.client.batch_request(batch).await?;
+        let statuses = resp
+            .into_iter()
+            .map(|status_resp| {
+                status_resp
+                    .map(|status| Deal::Status::from_hex(&status))
+                    .map_err(Into::into)
+                    .flatten()
+            })
+            .collect::<_>();
+
+        Ok(statuses)
+    }
+    async fn exit_deal(&self, cu_id: &CUID) -> Result<String> {
+        let data = Offer::returnComputeUnitFromDealCall {
+            unitId: cu_id.as_ref().into(),
+        }
+        .abi_encode();
+
+        self.send_tx(data, &self.config.diamond_contract_address)
+            .await
+    }
+
+    async fn get_tx_statuses(&self, tx_hashes: Vec<String>) -> Result<Vec<Result<Option<bool>>>> {
+        let receipts = self.get_tx_receipts(tx_hashes).await?;
+
+        let statuses = receipts
+            .into_iter()
+            .map(|receipt| match receipt {
+                Ok(TxStatus::Pending) => Ok(None),
+                Ok(TxStatus::Processed(receipt)) => Ok(Some(receipt.is_ok)),
+                Err(err) => Err(err),
+            })
+            .collect();
+
+        Ok(statuses)
+    }
+
+    async fn get_tx_receipts(&self, tx_hashes: Vec<String>) -> Result<Vec<Result<TxStatus>>> {
+        let mut batch = BatchRequestBuilder::new();
+        for tx_hash in tx_hashes {
+            batch.insert("eth_getTransactionReceipt", rpc_params![tx_hash])?;
+        }
+        let resp: BatchResponse<Value> = self.client.batch_request(batch).await?;
+
+        let receipts = resp
+            .into_iter()
+            .map(|receipt| try {
+                match serde_json::from_value::<Option<RawTxReceipt>>(receipt?)? {
+                    // When there's no receipt yet, the transaction is considered pending
+                    None => TxStatus::Pending,
+                    Some(raw_receipt) => TxStatus::Processed(raw_receipt.to_tx_receipt()),
+                }
+            })
+            .collect();
+
+        Ok(receipts)
+    }
+}
+
+fn parse_str_field(value: Option<Value>, field: &'static str) -> Result<String> {
+    value
+        .ok_or_else(|| FieldNotFound(field))?
+        .as_str()
+        .ok_or_else(|| ResponseParseError(format!("Field {} is not a string", field)))
+        .map(|s| s.to_string())
+}
+
+#[cfg(test)]
+mod tests {
+
+    use alloy_primitives::uint;
+    use alloy_primitives::U256;
+    use std::assert_matches::assert_matches;
+    use std::str::FromStr;
+    use std::sync::Arc;
+
+    use ccp_shared::types::{Difficulty, GlobalNonce, LocalNonce, ResultHash, CUID};
+    use clarity::PrivateKey;
+    use hex::FromHex;
+    use mockito::Matcher;
+    use serde::Deserialize;
+    use serde_json::json;
+
+    use chain_data::peer_id_from_hex;
+    use fluence_libp2p::RandomPeerId;
+    use hex_utils::decode_hex;
+    use log_utils::{enable_logs_for, LogSpec};
+
+    use crate::connector::TxStatus;
+    use crate::Deal::Status::ACTIVE;
+    use crate::{
+        is_commitment_not_active, CCStatus, ChainConnector, CommitmentId, ConnectorError,
+        HttpChainConnector,
+    };
+
+    fn get_connector(url: &str) -> Arc<HttpChainConnector> {
+        let (connector, _) = HttpChainConnector::new(
+            server_config::ChainConfig {
+                http_endpoint: url.to_string(),
+                diamond_contract_address: "0x2f5224b7Cb8bd98d9Ef61c247F4741758E8E873d".to_string(),
+                network_id: 3525067388221321,
+                wallet_key: PrivateKey::from_str(
+                    "0x97a2456e78c4894c62eef6031972d1ca296ed40bf311ab54c231f13db59fc428",
+                )
+                .unwrap(),
+                default_base_fee: None,
+                default_priority_fee: None,
+            },
+            peer_id_from_hex("0x6497db93b32e4cdd979ada46a23249f444da1efb186cd74b9666bd03f710028b")
+                .unwrap(),
+        )
+        .unwrap();
+
+        connector
+    }
+
+    #[tokio::test]
+    async fn test_get_compute_units() {
+        let expected_data = "0x000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000025d204dcc21f59c2a2098a277e48879207f614583e066654ad6736d36815ebb9e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000450e2f2a5bdb528895e9005f67e70fe213b9b822122e96fd85d2238cae55b6f900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000";
+        let expected_response =
+            format!("{{\"jsonrpc\":\"2.0\",\"result\":\"{expected_data}\",\"id\":0}}");
+
+        let mut server = mockito::Server::new_async().await;
+        let url = server.url();
+        let mock = server
+            .mock("POST", "/")
+            // expect exactly 1 POST request
+            .expect(1)
+            .with_status(200)
+            .with_header("content-type", "application/json")
+            .with_body(expected_response)
+            .create();
+
+        let units = get_connector(&url).get_compute_units().await.unwrap();
+
+        mock.assert();
+        assert_eq!(units.len(), 2);
+        assert_eq!(units[0].startEpoch, U256::from(0));
+        assert!(units[0].deal.is_zero());
+        assert_eq!(units[1].startEpoch, U256::from(0));
+        assert!(units[1].deal.is_zero());
+    }
+
+    #[tokio::test]
+    async fn test_get_current_commitment_id_none() {
+        let expected_data = "0xaa3046a12a1aac6e840625e6329d70b427328fec36dc8d273e5e6454b85633d5000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000005b73c5498c1e3b4dba84de0f1833c4a029d90519";
+        let expected_response =
+            format!("{{\"jsonrpc\":\"2.0\",\"result\":\"{expected_data}\",\"id\":0}}");
+
+        let mut server = mockito::Server::new_async().await;
+        let url = server.url();
+        let mock = server
+            .mock("POST", "/")
+            // expect exactly 1 POST request
+            .expect(1)
+            .with_status(200)
+            .with_header("content-type", "application/json")
+            .with_body(expected_response)
+            .create();
+        let commitment_id = get_connector(&url)
+            .get_current_commitment_id()
+            .await
+            .unwrap();
+
+        mock.assert();
+        assert!(commitment_id.is_none());
+    }
+
+    #[tokio::test]
+    async fn test_get_current_commitment_id_some() {
+        let expected_data = "0xaa3046a12a1aac6e840625e6329d70b427328fec36dc8d273e5e6454b85633d5aa3046a12a1aac6e840625e6329d70b427328feceedc8d273e5e6454b85633b5000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000005b73c5498c1e3b4dba84de0f1833c4a029d90519";
+        let expected_response =
+            format!("{{\"jsonrpc\":\"2.0\",\"result\":\"{expected_data}\",\"id\":0}}");
+
+        let mut server = mockito::Server::new_async().await;
+        let url = server.url();
+        let mock = server
+            .mock("POST", "/")
+            // expect exactly 1 POST request
+            .expect(1)
+            .with_status(200)
+            .with_header("content-type", "application/json")
+            .with_body(expected_response)
+            .create();
+        let commitment_id = get_connector(&url)
+            .get_current_commitment_id()
+            .await
+            .unwrap();
+
+        mock.assert();
+        assert!(commitment_id.is_some());
+        assert_eq!(
+            hex::encode(commitment_id.unwrap().0),
+            "aa3046a12a1aac6e840625e6329d70b427328feceedc8d273e5e6454b85633b5"
+        );
+    }
+
+    #[tokio::test]
+    async fn get_commitment_status() {
+        let commitment_id = "0xa98dc43600773b162bcdb8175eadc037412cd7ad83555fafa507702011a53992";
+
+        let expected_data = "0x0000000000000000000000000000000000000000000000000000000000000001";
+        let expected_response =
+            format!("{{\"jsonrpc\":\"2.0\",\"result\":\"{expected_data}\",\"id\":0}}");
+        let mut server = mockito::Server::new_async().await;
+        let url = server.url();
+        let mock = server
+            .mock("POST", "/")
+            // expect exactly 1 POST request
+            .expect(1)
+            .with_status(200)
+            .with_header("content-type", "application/json")
+            .match_body(Matcher::PartialJson(json!({
+                "method": "eth_call",
+            })))
+            .with_body(expected_response)
+            .create();
+        let commitment_id = CommitmentId(decode_hex(commitment_id).unwrap().try_into().unwrap());
+        let status = get_connector(&url)
+            .get_commitment_status(commitment_id)
+            .await
+            .unwrap();
+
+        mock.assert();
+        assert_eq!(status, CCStatus::Active);
+    }
+
+    #[tokio::test]
+    async fn test_batch_init_request() {
+        use hex::FromHex;
+        let expected_response = r#"[
+          {
+            "jsonrpc": "2.0",
+            "result": "0x76889c92f61b9c5df216e048df56eb8f4eb02f172ab0d5b04edb9190ab9c9eec",
+            "id": 0
+          },
+          {
+            "jsonrpc": "2.0",
+            "result": "0x0000000000000000000000000000000000000000000000000000000065ca5a01",
+            "id": 1
+          },
+          {
+            "jsonrpc": "2.0",
+            "result": "0x0000000000000000000000000000000000000000000000000000000000000005",
+            "id": 2
+          },
+          {
+            "jsonrpc": "2.0",
+            "result": "0x00000000000000000000000000000000000000000000000000000000000016be",
+            "id": 3
+          },
+          {
+            "jsonrpc": "2.0",
+            "result": "0x000000000000000000000000000000000000000000000000000000000000000f",
+            "id": 4
+          },
+          {
+            "jsonrpc": "2.0",
+            "result": "0x5",
+            "id": 5
+          },
+          {
+            "jsonrpc": "2.0",
+            "result": "0x8",
+            "id": 6
+          },
+          {
+              "jsonrpc": "2.0",
+              "result": {
+                "hash": "0x402c63844e7797c56468e5c9ca241d7f99b102c6e683fd371c1558fc87ff0963",
+                "parentHash": "0x4904bfa81f0c577da1caa89826c3cf05a952e51dd39226709ed643c0f3847992",
+                "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
+                "miner": "0x5d159e79d541c35d68d1c8a5da02637fff779da0",
+                "stateRoot": "0x5f928ec52b4c7d259e0cc744f2be0e17952a94e721b732d03b91142ab23bd497",
+                "transactionsRoot": "0xc6d90adaa66f9e4e53d27c59c946f8f1b6aa9d1092a414c2290c05a4e081a8e5",
+                "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
+                "number": "0x8b287",
+                "gasUsed": "0x8af3a5a",
+                "gasLimit": "0xadb3bb8",
+                "extraData": "0x",
+                "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
+                "timestamp": "0x666c79b1",
+                "difficulty": "0x0",
+                "totalDifficulty": "0x0",
+                "sealFields": [],
+                "uncles": [],
+                "transactions": [
+                  {
+                    "accessList": [],
+                    "blockHash": "0x402c63844e7797c56468e5c9ca241d7f99b102c6e683fd371c1558fc87ff0963",
+                    "blockNumber": "0x8b287",
+                    "chainId": "0x8613d62c79827",
+                    "from": "0xb3b172cc702e3ae32ce0c73a050037a7750e41a6",
+                    "gas": "0xadb3bb8",
+                    "gasPrice": "0x64",
+                    "hash": "0xdd5a4b397f222a9432b3d592ecca96171860953c5d2630f5f1f9f3614fdd8cd5",
+                    "input": "0x4ece5685649cea1e34fec8ae2f5f8195124ec9c9e268b333f51d38dd12c9c89b026dd66ea6f4997b286ae1873a26c2f8cac3980af7ac51b185c9754d3a116d8a3c3a02fc0001286ad1ddc35083d1773e4f451e27047b3cdb5a1ebc592fd521de7780eb4c",
+                    "maxFeePerGas": "0x64",
+                    "maxPriorityFeePerGas": "0x0",
+                    "nonce": "0x34d6",
+                    "r": "0xfceb7aaceb1dc56f1e0b33584361c17ba1d8d79a5ec378c81d789c83e5eb7016",
+                    "s": "0x13ba30819306a8cb71c60261824a77e29a0571514ffbb3f08f8503303caec56d",
+                    "to": "0x066d0e888b62b7c2571cf867d2b26d6afefac720",
+                    "transactionIndex": "0x0",
+                    "type": "0x2",
+                    "v": "0x1",
+                    "value": "0x0"
+                  }
+                ],
+                "size": "0xf7",
+                "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
+                "nonce": "0x0000000000000000",
+                "baseFeePerGas": "0x64"
+              },
+              "id": 7
+            }
+        ]"#;
+
+        let mut server = mockito::Server::new_async().await;
+        let url = server.url();
+        let mock = server
+            .mock("POST", "/")
+            // expect exactly 1 POST request
+            .expect(1)
+            .with_status(200)
+            .with_header("content-type", "application/json")
+            .with_body(expected_response)
+            .create();
+
+        let init_params = get_connector(&url).get_cc_init_params().await.unwrap();
+
+        mock.assert();
+        assert_eq!(
+            init_params.difficulty,
+            <Difficulty>::from_hex(
+                "76889c92f61b9c5df216e048df56eb8f4eb02f172ab0d5b04edb9190ab9c9eec"
+            )
+            .unwrap()
+        );
+        assert_eq!(init_params.init_timestamp, uint!(1707760129_U256));
+        assert_eq!(
+            init_params.global_nonce,
+            <GlobalNonce>::from_hex(
+                "0000000000000000000000000000000000000000000000000000000000000005"
+            )
+            .unwrap()
+        );
+        assert_eq!(
+            init_params.current_epoch,
+            U256::from(0x00000000000000000000000000000000000000000000000000000000000016be)
+        );
+        assert_eq!(
+            init_params.epoch_duration,
+            U256::from(0x000000000000000000000000000000000000000000000000000000000000000f)
+        );
+        assert_eq!(init_params.min_proofs_per_epoch, U256::from(5));
+        assert_eq!(init_params.max_proofs_per_epoch, U256::from(8));
+    }
+
+    #[tokio::test]
+    async fn submit_proof_not_active() {
+        let get_block_by_number = r#"{"jsonrpc":"2.0","id":0,"result":{"hash":"0xcbe8d90665392babc8098738ec78009193c99d3cc872a6657e306cfe8824bef9","parentHash":"0x15e767118a3e2d7545fee290b545faccd4a9eff849ac1057ce82cab7100c0c52","sha3Uncles":"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347","miner":"0x0000000000000000000000000000000000000000","stateRoot":"0x0000000000000000000000000000000000000000000000000000000000000000","transactionsRoot":"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421","receiptsRoot":"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421","logsBloom":"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","difficulty":"0x0","number":"0xa2","gasLimit":"0x1c9c380","gasUsed":"0x0","timestamp":"0x65d88f76","extraData":"0x","mixHash":"0x0000000000000000000000000000000000000000000000000000000000000000","nonce":"0x0000000000000000","baseFeePerGas":"0x7","totalDifficulty":"0x0","uncles":[],"transactions":[],"size":"0x220"}}"#;
+        let estimate_gas = r#"
+        {
+            "jsonrpc": "2.0",
+            "id": 1,
+            "error": {
+                "code": 3,
+                "message": "execution reverted: ",
+                "data": "0x0852c7200000000000000000000000000000000000000000000000000000000000000000"
+            }
+        }
+        "#;
+
+        let mut server = mockito::Server::new_async().await;
+        let url = server.url();
+        server
+            .mock("POST", "/")
+            // expect exactly 4 POST request
+            .expect(1)
+            .with_status(200)
+            .with_header("content-type", "application/json")
+            .with_body_from_request(move |req| {
+                let body = req.body().expect("mock: get request body");
+                let body: serde_json::Value =
+                    serde_json::from_slice(body).expect("mock: parse request body");
+                let method = body.get("method").expect("get method");
+                let method = method.as_str().expect("as str").trim_matches(|c| c == '\"');
+
+                match method {
+                    "eth_getBlockByNumber" => get_block_by_number.into(),
+                    "eth_estimateGas" => estimate_gas.into(),
+                    method => format!("'{}' not supported", method).into(),
+                }
+            })
+            .create();
+
+        let cu_ids = vec![CUID::new([0u8; 32])];
+        let local_nonces = vec![LocalNonce::new([0u8; 32])];
+        let result_hashes = vec![ResultHash::from_slice([0u8; 32])];
+
+        let result = get_connector(&url)
+            .submit_proofs(cu_ids, local_nonces, result_hashes)
+            .await;
+
+        assert!(result.is_err());
+
+        assert_matches!(
+            result.unwrap_err(),
+            ConnectorError::RpcCallError {
+                code: _,
+                message: _,
+                data,
+            } if is_commitment_not_active(&data)
+        );
+    }
+
+    #[tokio::test]
+    async fn submit_proof() {
+        let get_block_by_number = r#"{"jsonrpc":"2.0","id":0,"result":{"hash":"0xcbe8d90665392babc8098738ec78009193c99d3cc872a6657e306cfe8824bef9","parentHash":"0x15e767118a3e2d7545fee290b545faccd4a9eff849ac1057ce82cab7100c0c52","sha3Uncles":"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347","miner":"0x0000000000000000000000000000000000000000","stateRoot":"0x0000000000000000000000000000000000000000000000000000000000000000","transactionsRoot":"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421","receiptsRoot":"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421","logsBloom":"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","difficulty":"0x0","number":"0xa2","gasLimit":"0x1c9c380","gasUsed":"0x0","timestamp":"0x65d88f76","extraData":"0x","mixHash":"0x0000000000000000000000000000000000000000000000000000000000000000","nonce":"0x0000000000000000","baseFeePerGas":"0x7","totalDifficulty":"0x0","uncles":[],"transactions":[],"size":"0x220"}}"#;
+        let estimate_gas = r#"{"jsonrpc":"2.0","id": 1,"result": "0x5208"}"#;
+        let max_priority_fee = r#"{"jsonrpc":"2.0","id": 2,"result": "0x5208"}"#;
+        let nonce = r#"{"jsonrpc":"2.0","id":3,"result":"0x20"}"#;
+        let send_tx_response = r#"
+            {
+                "jsonrpc": "2.0",
+                "id": 4,
+                "result": "0x55bfec4a4400ca0b09e075e2b517041cd78b10021c51726cb73bcba52213fa05"
+            }
+            "#;
+        let mut server = mockito::Server::new_async().await;
+        let url = server.url();
+        server
+            .mock("POST", "/")
+            // expect exactly 4 POST request
+            .expect(1)
+            .with_status(200)
+            .with_header("content-type", "application/json")
+            .with_body_from_request(move |req| {
+                let body = req.body().expect("mock: get request body");
+                let body: serde_json::Value =
+                    serde_json::from_slice(body).expect("mock: parse request body");
+                let method = body.get("method").expect("get method");
+                let method = method.as_str().expect("as str").trim_matches(|c| c == '\"');
+
+                match method {
+                    "eth_getBlockByNumber" => get_block_by_number.into(),
+                    "eth_estimateGas" => estimate_gas.into(),
+                    "eth_maxPriorityFeePerGas" => max_priority_fee.into(),
+                    "eth_getTransactionCount" => nonce.into(),
+                    "eth_sendRawTransaction" => send_tx_response.into(),
+                    method => format!("'{}' not supported", method).into(),
+                }
+            })
+            .create();
+
+        let cu_ids = vec![CUID::new([0u8; 32])];
+        let local_nonces = vec![LocalNonce::new([0u8; 32])];
+        let result_hashes = vec![ResultHash::from_slice([0u8; 32])];
+
+        let result = get_connector(&url)
+            .submit_proofs(cu_ids, local_nonces, result_hashes)
+            .await
+            .unwrap();
+
+        assert_eq!(
+            result,
+            "0x55bfec4a4400ca0b09e075e2b517041cd78b10021c51726cb73bcba52213fa05"
+        );
+    }
+
+    #[derive(Debug, Deserialize)]
+    // for parsing
+    #[allow(dead_code)]
+    struct RpcRequest<P> {
+        jsonrpc: String,
+        id: u64,
+        method: String,
+        params: P,
+    }
+
+    #[derive(Debug, Deserialize)]
+    // for parsing
+    #[allow(dead_code)]
+    struct EthCall {
+        data: String,
+        to: String,
+    }
+
+    #[tokio::test]
+    async fn test_get_app_cid_empty() {
+        // This response causes the `buffer overrun while deserializing` error
+        let app_cid_response = r#"[{"jsonrpc":"2.0", "id":0, "result": "0x"}]"#;
+
+        let mut server = mockito::Server::new_async().await;
+        let url = server.url();
+        let mock = server
+            .mock("POST", "/")
+            .expect(1)
+            .with_status(200)
+            .with_header("content-type", "application/json")
+            .with_body(app_cid_response)
+            .create();
+
+        let deals = vec![types::DealId::from(
+            "0x0000000000000000000000000000000000000000",
+        )];
+        let result = get_connector(&url).get_app_cid(deals.iter()).await;
+        assert_matches!(result, Err(ConnectorError::EmptyData(_)));
+
+        mock.assert();
+    }
+
+    #[tokio::test]
+    async fn test_get_deals() {
+        enable_logs_for(LogSpec::new(vec!["chain-connector=debug".parse().unwrap()]));
+        let expected_deal_id_1 = "5e3d0fde6f793b3115a9e7f5ebc195bbeed35d6c";
+        let expected_cuid_1 = "aa3046a12a1aac6e840625e6329d70b427328fec36dc8d273e5e6454b85633d5";
+
+        let expected_deal_id_2 = "0x6e3d0fde6f793b3115a9e7f5ebc195bbeed35d6d";
+        let expected_cuid_2 = "ba3046a12a1aac6e840625e6329d70b427328fec36dc8d273e5e6454b85633d1";
+
+        let compute_units_response = "00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000002aa3046a12a1aac6e840625e6329d70b427328fec36dc8d273e5e6454b85633d50000000000000000000000005e3d0fde6f793b3115a9e7f5ebc195bbeed35d6c00000000000000000000000000000000000000000000000000000000000fffbcba3046a12a1aac6e840625e6329d70b427328fec36dc8d273e5e6454b85633d10000000000000000000000006e3d0fde6f793b3115a9e7f5ebc195bbeed35d6d00000000000000000000000000000000000000000000000000000000000fffba";
+        let compute_units_response = json!({
+            "jsonrpc": "2.0",
+            "id": 0,
+            "result": compute_units_response,
+        });
+
+        let expected_app_cid = "bafkreiekvwp2w7t7vw4jzjq4s4n4wc323c6dnexmy4axh6c7tiza5wxzm4";
+        let deal_status_response =
+            "0x0000000000000000000000000000000000000000000000000000000000000001";
+        let app_cid_response = "0x01551220000000000000000000000000000000000000000000000000000000008aad9fab7e7fadb89ca61c971bcb0b7ad8bc3692ecc70173f85f9a320edaf967";
+        let deal_info_response = json!([
+            {
+                "jsonrpc": "2.0",
+                "id": 1,
+                "result": deal_status_response,
+            },
+            {
+                "jsonrpc": "2.0",
+                "id": 2,
+                "result": app_cid_response
+            },
+            {
+                "jsonrpc": "2.0",
+                "id": 3,
+                "result": deal_status_response,
+            },
+            {
+                "jsonrpc": "2.0",
+                "id": 4,
+                "result": app_cid_response
+            }
+
+        ]);
+
+        let mut server = mockito::Server::new_async().await;
+        let url = server.url();
+        let mock = server
+            .mock("POST", "/")
+            .expect(2)
+            .with_status(200)
+            .with_header("content-type", "application/json")
+            .with_body_from_request(move |req| {
+                let body = req.body().expect("mock: get request body");
+                let body: serde_json::Value =
+                    serde_json::from_slice(body).expect("mock: parse request body");
+                match body {
+                    serde_json::Value::Object(_) => {
+                        compute_units_response.clone().to_string().into()
+                    }
+                    serde_json::Value::Array(_) => deal_info_response.to_string().into(),
+                    x => {
+                        panic!("unexpected body: {x:?}");
+                    }
+                }
+            })
+            .create();
+
+        let deals = get_connector(&url).get_deals().await.unwrap();
+
+        assert_eq!(deals.len(), 2, "there should be only two deals: {deals:?}");
+        assert!(deals[0].success, "failed to get a deal: {deals:?}");
+        assert_eq!(deals[0].deal_id, expected_deal_id_1);
+
+        let deal_info = &deals[0].deal_info[0];
+        assert_eq!(deal_info.status, ACTIVE);
+        assert_eq!(
+            deal_info.unit_ids.len(),
+            1,
+            "there should be only one unit id: {deals:?}"
+        );
+        assert_eq!(deal_info.unit_ids[0].to_string(), expected_cuid_1);
+        assert_eq!(deal_info.app_cid, expected_app_cid);
+
+        // Second deal
+        assert!(deals[1].success, "failed to get a deal: {deals:?}");
+        assert_eq!(deals[1].deal_id, expected_deal_id_2);
+
+        let deal_info = &deals[1].deal_info[0];
+        assert_eq!(deal_info.status, ACTIVE);
+        assert_eq!(
+            deal_info.unit_ids.len(),
+            1,
+            "there should be only one unit id: {deals:?}"
+        );
+        assert_eq!(deal_info.unit_ids[0].to_string(), expected_cuid_2);
+        assert_eq!(deal_info.app_cid, expected_app_cid);
+
+        mock.assert();
+    }
+
+    #[tokio::test]
+    async fn test_get_deals_no_deals() {
+        let compute_units_response = "0x0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002097ab88db9d8e48a1d55cd0205bd74721eb2ba70897d255f350062dec8fec7bb4000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002988e97756c550265b7a570b41bb4d8dbf056a1ca0435265ad175c5ecced2ef600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000d4af56c3a07423c4b976f6d1a43a96f4843bdc5479b01bf3bd73f69c1062738e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e9ab8214c37d615708ef89559407e1a015a0f7fbdaf3cd23a1f4c5ed2ae1c8cd00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a717255e798920c9a9bbaae45492ff9020cdc8db3d8a44099015fbe950927368000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000df891a54a5479aa7ee3c019615ac55a18534aa81dcf3b2fbf7577d54cadf0c300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000fbbd2b72d216685d97c09c56ca6ba16e7d2e35ff72bb69c72584ad8d9365610200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ccff78d7a0c365cd3ba8842707a2f96f26ac7ea4dbd7aac04ae2f0958ef2252400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000db5fba69f5d2b2d04a5bf63b7abe1a2781470e77101e3afe6ec66794aec80c0a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005b96d1d71cf1b77421645ae4031558195d9df60abd73ea716c3df67d3e7832da00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e5cf187d01e552b0bd38ea89b9013e7b98915891cafb44fc7cf6937223290bcf00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000fe00f5915737e75aa5c7799dcf326020ab499a65c9d10e1e4951be8371aee6f2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c073f4fe89ebe1a354f052de5e371dc39e8d2b8f9ccbf0fc9e26e107217fe40000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008510f943f7080e58846bc5044afa0c91480dbeca0ff5dcbef7c522a43531cffc000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007d3ea3803085980a5b4e3bd93c32d8dae3b8060db9aab800e0922b7b18d865fc000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002be7bd75150701c7ef8521d322fbcbb228cf907224d80e433550a3034bbcbb8b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e1469c97990a40da4465cb4e749faa2905adfc4b1109f7dc8b66ef8b1ed0a0c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008d20e7f50737ea4236c6d92b150e569aa2fc482699cc0165722210b4bcffdc4c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000eae742035300aed3774579cab0c75416002438809f3cb3f62fb3c34dd0ab16790000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000029e9cc0f707e8e02578285b8e1d50c207fab5ec11b0b1e6f97834e1154abbe4b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005be58fc7ae8eb4e577b1be2a911a11fd17b90c8b6754aa71859ad6285bcc3b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008f7ba4e1f4bccd2aaf1f8791df5b73a6727b0720aba8fcf0afb6e1f07303c1cc0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000053f668a26f5978f4f252145d68d2f0a627116c197a342a2e42aa269f46dcccf000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000db7ddcd38d772f1b043572bab7d890ea65723cf4805ee963f46b7a9f81a454f20000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000018fa36dd54f48c4c4ae40ceefca274460d4c83026f48fdcc4e201a1a0423561400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0b6e3c818a1ecb540a289c81d0835dc41755f091ba70f02e5134203c195b80900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e77ef1585872eabfa78c01915cf0d43c3bd3bd63ae40565c62254a95bba901530000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000059810dcb510b17ca28693caa6d6164b6db28925290f345d8ef0ac8ef5751014f0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000d6b992345e2ed6287ff2df0943d10f972ae7f63789d11df22f3fd9a4199f5c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005e58c2b5ba2b1a7d861de440a962fe0ffdcef1e240e3e50690f6f1f527bf7d66000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ca0be7865c187df9331bce42cd6ea3498d858a3d8b37fec18e9654ef320daa7000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003938f3a12b19ed989431771df29f64ef011eec4da79e2ec30d86f28dae35f10a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000";
+        let compute_units_response =
+            format!("{{\"jsonrpc\":\"2.0\",\"result\":\"{compute_units_response}\",\"id\":0}}");
+        let mut server = mockito::Server::new_async().await;
+        let url = server.url();
+        let mock = server
+            .mock("POST", "/")
+            .expect(1)
+            .with_status(200)
+            .with_header("content-type", "application/json")
+            .with_body(compute_units_response)
+            .create();
+
+        let deals = get_connector(&url).get_deals().await;
+        assert!(
+            deals.is_ok(),
+            "must not fail when no deals in compute units"
+        );
+        assert!(
+            deals.unwrap().is_empty(),
+            "no deals must be found in the compute units"
+        );
+
+        mock.assert();
+    }
+
+    #[tokio::test]
+    async fn test_register_worker() {
+        let get_block_by_number_response = r#"{"jsonrpc":"2.0","id":0,"result":{"hash":"0xcbe8d90665392babc8098738ec78009193c99d3cc872a6657e306cfe8824bef9","parentHash":"0x15e767118a3e2d7545fee290b545faccd4a9eff849ac1057ce82cab7100c0c52","sha3Uncles":"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347","miner":"0x0000000000000000000000000000000000000000","stateRoot":"0x0000000000000000000000000000000000000000000000000000000000000000","transactionsRoot":"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421","receiptsRoot":"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421","logsBloom":"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","difficulty":"0x0","number":"0xa2","gasLimit":"0x1c9c380","gasUsed":"0x0","timestamp":"0x65d88f76","extraData":"0x","mixHash":"0x0000000000000000000000000000000000000000000000000000000000000000","nonce":"0x0000000000000000","baseFeePerGas":"0x7","totalDifficulty":"0x0","uncles":[],"transactions":[],"size":"0x220"}}"#;
+        let estimate_gas_response = r#"{"jsonrpc":"2.0","id": 1,"result": "0x5208"}"#;
+        let max_priority_fee_response = r#"{"jsonrpc":"2.0","id": 2,"result": "0x5208"}"#;
+        let nonce_response = r#"{"jsonrpc":"2.0","id":3,"result":"0x20"}"#;
+        let expected_tx_hash = "0x55bfec4a4400ca0b09e075e2b517041cd78b10021c51726cb73bcba52213fa05";
+        let send_tx_response = r#"
+            {
+                "jsonrpc": "2.0",
+                "id": 4,
+                "result": "0x55bfec4a4400ca0b09e075e2b517041cd78b10021c51726cb73bcba52213fa05"
+            }
+            "#;
+
+        let deal_id = "5e3d0fde6f793b3115a9e7f5ebc195bbeed35d6c";
+        let deal_id = types::DealId::from(deal_id);
+        let worker_id = types::peer_scope::WorkerId::from(RandomPeerId::random());
+        let cuid =
+            CUID::from_hex("aa3046a12a1aac6e840625e6329d70b427328fec36dc8d273e5e6454b85633d5")
+                .unwrap();
+
+        let mut server = mockito::Server::new_async().await;
+        let url = server.url();
+        let mock = server
+            .mock("POST", "/")
+            .expect(5)
+            .with_status(200)
+            .with_header("content-type", "application/json")
+            .with_body_from_request(move |req| {
+                let body = req.body().expect("mock: get request body");
+                let body: RpcRequest<Option<serde_json::Value>> =
+                    serde_json::from_slice(body).expect("mock: parse request body");
+                match body.method.as_ref() {
+                    "eth_getBlockByNumber" => get_block_by_number_response.into(),
+                    "eth_estimateGas" => estimate_gas_response.into(),
+                    "eth_maxPriorityFeePerGas" => max_priority_fee_response.into(),
+                    "eth_getTransactionCount" => nonce_response.into(),
+                    "eth_sendRawTransaction" => send_tx_response.into(),
+                    x => {
+                        panic!("unknown method: {x}. Request {body:?}");
+                    }
+                }
+            })
+            .create();
+
+        let result = get_connector(&url)
+            .register_worker(&deal_id, worker_id, cuid)
+            .await
+            .unwrap();
+        assert_eq!(result, expected_tx_hash);
+
+        mock.assert();
+    }
+
+    #[tokio::test]
+    async fn test_get_receipts_several() {
+        let tx_hash =
+            "0x55bfec4a4400ca0b09e075e2b517041cd78b10021c51726cb73bcba52213fa05".to_string();
+        let receipt_response = r#"
+            [{
+                "id": 0,
+                "jsonrpc": "2.0",
+                "result": null
+            },
+            {
+                "id": 1,
+                "jsonrpc": "2.0",
+                "result": {
+                    "blockNumber": "0x123",
+                    "status": "0x1",
+                    "transactionHash": "0x55bfec4a4400ca0b09e075e2b517041cd78b10021c51726cb73bcba52213fa05"
+                }
+            },
+            {
+                "id": 2,
+                "jsonrpc": "2.0",
+                "error": {
+                    "code": -32000,
+                    "message": "some error"
+                }
+            }]
+        "#;
+        let mut server = mockito::Server::new_async().await;
+        let url = server.url();
+        let mock = server
+            .mock("POST", "/")
+            // expect exactly 1 POST request
+            .expect(1)
+            .with_status(200)
+            .with_header("content-type", "application/json")
+            .with_body_from_request(move |req| {
+                let body = req.body().expect("mock: get request body");
+                let body: Vec<RpcRequest<serde_json::Value>> =
+                    serde_json::from_slice(body).expect("mock: parse request body");
+                match body[0].method.as_ref() {
+                    "eth_getTransactionReceipt" => receipt_response.into(),
+                    x => {
+                        panic!("unknown method: {x}. Request {body:?}");
+                    }
+                }
+            })
+            .create();
+
+        let mut result = get_connector(&url)
+            .get_tx_receipts(vec![tx_hash.clone()])
+            .await
+            .unwrap();
+        assert_eq!(result.len(), 3);
+
+        let pending = result.remove(0);
+        assert!(pending.is_ok(), "should get pending status: {:?}", pending);
+        assert_matches!(pending.unwrap(), TxStatus::Pending);
+
+        let ok = result.remove(0);
+        assert!(ok.is_ok(), "should get a receipt: {:?}", ok);
+        assert_matches!(ok.unwrap(), TxStatus::Processed(_));
+
+        assert!(result[0].is_err(), "should be error: {:?}", result[0]);
+
+        mock.assert();
+    }
+
+    #[tokio::test]
+    async fn test_get_receipts() {
+        let tx_hash =
+            "0x55bfec4a4400ca0b09e075e2b517041cd78b10021c51726cb73bcba52213fa05".to_string();
+        let receipt_response = r#"
+            [{
+                "id": 0,
+                "jsonrpc": "2.0",
+                "result": {
+                    "blockNumber": "0x123",
+                    "status": "0x1",
+                    "transactionHash": "0x55bfec4a4400ca0b09e075e2b517041cd78b10021c51726cb73bcba52213fa05"
+                }
+            }]
+        "#;
+        let mut server = mockito::Server::new_async().await;
+        let url = server.url();
+        let mock = server
+            .mock("POST", "/")
+            // expect exactly 1 POST request
+            .expect(1)
+            .with_status(200)
+            .with_header("content-type", "application/json")
+            .with_body_from_request(move |req| {
+                let body = req.body().expect("mock: get request body");
+                let body: Vec<RpcRequest<serde_json::Value>> =
+                    serde_json::from_slice(body).expect("mock: parse request body");
+                match body[0].method.as_ref() {
+                    "eth_getTransactionReceipt" => receipt_response.into(),
+                    x => {
+                        panic!("unknown method: {x}. Request {body:?}");
+                    }
+                }
+            })
+            .create();
+
+        let mut result = get_connector(&url)
+            .get_tx_receipts(vec![tx_hash.clone()])
+            .await
+            .unwrap();
+        assert_eq!(result.len(), 1);
+        assert!(result[0].is_ok(), "can't get receipt: {:?}", result[0]);
+
+        let result = result.remove(0).unwrap();
+        assert_matches!(result, TxStatus::Processed(_));
+        if let TxStatus::Processed(receipt) = result {
+            assert_eq!(receipt.transaction_hash, tx_hash);
+        }
+
+        mock.assert();
+    }
+}
+
\ No newline at end of file diff --git a/src/chain_connector/error.rs.html b/src/chain_connector/error.rs.html new file mode 100644 index 0000000000..02a63c9387 --- /dev/null +++ b/src/chain_connector/error.rs.html @@ -0,0 +1,199 @@ +error.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use std::string::FromUtf8Error;
+
+use jsonrpsee::core::client::{Error as RPCError, Error};
+use jsonrpsee::types::ErrorObjectOwned;
+use thiserror::Error;
+
+use chain_data::ChainDataError;
+use hex_utils::FromHexError;
+
+#[derive(Debug, Error)]
+pub enum ConnectorError {
+    #[error("IPC internal network error: {0}")]
+    IpcInternalNetworkError(#[source] ErrorObjectOwned),
+    #[error("RPC error: {0}")]
+    RpcError(#[from] RPCError),
+    #[error("RPC call error: code: {code}, message: {message}, data: {data}")]
+    RpcCallError {
+        /// Code
+        code: i32,
+        /// Message
+        message: String,
+        /// Optional data
+        data: String,
+    },
+    #[error("Failed to parse chain data: {0}")]
+    ParseChainDataFailed(#[from] ChainDataError),
+    #[error("Failed to parse chain data: {0}")]
+    ParseChainDataFailedAlloy(#[from] alloy_sol_types::Error),
+    #[error("Failed to parse chain data: {0}")]
+    RpcChainData(#[from] ErrorObjectOwned),
+    #[error("Failed to convert CID to string: {0}")]
+    ConvertCid(#[from] libipld::cid::Error),
+    #[error("Failed to parse address: {0}")]
+    AddressParseError(#[from] clarity::Error),
+    #[error("data is not a valid hex: '{0}'")]
+    DecodeHex(#[from] FromHexError),
+    #[error("empty data is not a valid hex: '{0}'")]
+    EmptyData(String),
+    #[error(transparent)]
+    DecodeConstHex(#[from] const_hex::FromHexError),
+    #[error("data is not a valid string: '{0}'")]
+    DecodeData(#[from] FromUtf8Error),
+    #[error("Failed to parse u256, got: {0}, error: {1}")]
+    InvalidU256(String, String),
+    #[error("Failed to parse response: {0}")]
+    ResponseParseError(String),
+    #[error("Failed to parse response, field {0} not found")]
+    FieldNotFound(&'static str),
+    #[error("Parse error: {0}")]
+    ParseError(#[from] serde_json::Error),
+}
+
+pub fn process_response<T>(response: Result<T, RPCError>) -> Result<T, ConnectorError> {
+    match response {
+        Ok(data) => Ok(data),
+        Err(err) => match err {
+            Error::Call(e) => {
+                let code = e.code();
+                let message = e.message().to_string();
+                let data = match e.data() {
+                    Some(data) => serde_json::from_str(data.get())?,
+                    None => "".to_string(),
+                };
+
+                if message.to_lowercase().contains("tendermint rpc error")
+                    || message.to_lowercase().contains("connection reset by peer")
+                {
+                    return Err(ConnectorError::IpcInternalNetworkError(e));
+                }
+
+                Err(ConnectorError::RpcCallError {
+                    code,
+                    message,
+                    data,
+                })
+            }
+            _ => Err(ConnectorError::RpcError(err)),
+        },
+    }
+}
+
\ No newline at end of file diff --git a/src/chain_connector/eth_call.rs.html b/src/chain_connector/eth_call.rs.html new file mode 100644 index 0000000000..fc4b0734ef --- /dev/null +++ b/src/chain_connector/eth_call.rs.html @@ -0,0 +1,161 @@ +eth_call.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+use hex_utils::encode_hex_0x;
+use serde::ser::SerializeStruct;
+use serde::{Serialize, Serializer};
+
+#[derive(Debug)]
+pub struct EthCall<'a, 'b, 'c> {
+    data: &'c [u8],
+    to: &'a str,
+    from: Option<&'b str>,
+}
+
+impl<'a, 'b, 'c> EthCall<'a, 'b, 'c> {
+    pub fn to(data: &'c [u8], to: &'a str) -> Self {
+        Self {
+            data,
+            to,
+            from: None,
+        }
+    }
+
+    #[allow(unused)]
+    pub fn from(data: &'c [u8], to: &'a str, from: &'b str) -> Self {
+        Self {
+            data,
+            to,
+            from: Some(from),
+        }
+    }
+}
+
+impl<'a, 'b, 'c> Serialize for EthCall<'a, 'b, 'c> {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        let fields = if self.from.is_some() { 3 } else { 2 };
+        let mut eth_call = serializer.serialize_struct("EthCall", fields)?;
+        eth_call.serialize_field("data", &encode_hex_0x(&self.data))?;
+        eth_call.serialize_field("to", self.to)?;
+        if let Some(from) = &self.from {
+            eth_call.serialize_field("from", from)?;
+        }
+
+        eth_call.end()
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use super::EthCall;
+
+    #[test]
+    fn serialize_eth_call() {
+        let eth_call = EthCall::to(&[0, 1, 2], "0xabc");
+        let j = serde_json::json!(eth_call).to_string();
+        assert_eq!(j, r#"{"data":"0x000102","to":"0xabc"}"#);
+
+        let eth_call = EthCall::from(&[0, 1, 2], "0xabc", "0xcba");
+        let j = serde_json::json!(eth_call).to_string();
+        assert_eq!(j, r#"{"data":"0x000102","to":"0xabc","from":"0xcba"}"#);
+    }
+}
+
\ No newline at end of file diff --git a/src/chain_connector/function/capacity.rs.html b/src/chain_connector/function/capacity.rs.html new file mode 100644 index 0000000000..43bd73ff54 --- /dev/null +++ b/src/chain_connector/function/capacity.rs.html @@ -0,0 +1,247 @@ +capacity.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use alloy_sol_types::{sol, SolError};
+use hex_utils::{encode_hex_0x, encode_hex_no_prefix};
+use serde::{Deserialize, Serialize};
+use std::fmt::{Display, Formatter};
+
+sol! {
+    #[derive(PartialEq, Debug)]
+    enum CCStatus {
+        Inactive,
+        Active,
+        // WaitDelegation - before collateral is deposited.
+        WaitDelegation,
+        // Status is WaitStart - means collateral deposited, and epoch should be proceed before Active.
+        WaitStart,
+        Failed,
+        Removed
+    }
+
+
+    contract Capacity {
+
+        /// @dev Throws if peer sent too many proofs for the commitment by unit per epoch
+        error TooManyProofs();
+
+        /// @dev Capacity commitment is not active
+        error CapacityCommitmentIsNotActive(CCStatus status);
+
+        function getGlobalNonce() external view returns (bytes32);
+
+
+        /// @dev Returns the commitment status
+        /// @param commitmentId Commitment id
+        /// @return status commitment status
+        function getStatus(bytes32 commitmentId) external view returns (CCStatus);
+
+       /// @dev Submits a proof for the commitment
+       /// @param unitId Compute unit id which provied the proof
+       /// @param localUnitNonce The local nonce of the unit for calculating the target hash. It's the proof
+       /// @param resultHash The target hash of this proof
+        function submitProof(bytes32 unitId, bytes32 localUnitNonce, bytes32 resultHash) external;
+
+        /// @dev Submits proofs for the commitment
+        /// @param unitIds Compute unit ids which provide the proof
+        /// @param localUnitNonces Local nonces of the units for calculating the target hashes. It's the proof
+        /// @param resultHashes Target hashes of this proof
+        function submitProofs(
+            bytes32[] memory unitIds,
+            bytes32[] memory localUnitNonces,
+            bytes32[] memory resultHashes
+        ) external;
+    }
+}
+
+pub fn is_too_many_proofs(data: &str) -> bool {
+    data.contains(&encode_hex_no_prefix(Capacity::TooManyProofs::SELECTOR))
+}
+
+pub fn is_commitment_not_active(data: &str) -> bool {
+    data.contains(&encode_hex_no_prefix(
+        Capacity::CapacityCommitmentIsNotActive::SELECTOR,
+    ))
+}
+
+#[derive(Clone, Debug, Serialize, Deserialize, Hash, PartialEq, Eq)]
+pub struct CommitmentId(pub [u8; 32]);
+
+impl CommitmentId {
+    pub fn new(data: [u8; 32]) -> Option<Self> {
+        if data.iter().all(|&x| x == 0) {
+            None
+        } else {
+            Some(Self(data))
+        }
+    }
+}
+
+impl Display for CommitmentId {
+    fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
+        write!(f, "{}", encode_hex_0x(&self.0))
+    }
+}
+#[cfg(test)]
+mod tests {
+
+    use crate::function::capacity::CCStatus;
+    use alloy_sol_types::SolType;
+
+    #[tokio::test]
+    async fn decode_commitment_status() {
+        let data = "0000000000000000000000000000000000000000000000000000000000000001";
+        let status: CCStatus = CCStatus::abi_decode(&hex::decode(data).unwrap(), true).unwrap();
+
+        assert_eq!(format!("{:?}", status), "Active");
+        assert_eq!(status, CCStatus::Active);
+    }
+
+    #[tokio::test]
+    async fn decode_commitment_status_removed() {
+        let data = "0000000000000000000000000000000000000000000000000000000000000005";
+        let status = CCStatus::abi_decode(&hex::decode(data).unwrap(), true).unwrap();
+
+        assert_eq!(status, super::CCStatus::Removed);
+    }
+}
+
\ No newline at end of file diff --git a/src/chain_connector/function/core.rs.html b/src/chain_connector/function/core.rs.html new file mode 100644 index 0000000000..e467aca53b --- /dev/null +++ b/src/chain_connector/function/core.rs.html @@ -0,0 +1,99 @@ +core.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use alloy_sol_types::sol;
+sol! {
+    contract Core {
+        function capacity() external view returns (address);
+
+        function market() external view returns (address);
+
+        /// @dev Returns current epoch
+        /// @return current epoch number
+        function currentEpoch() external view returns (uint256);
+
+        /// @dev Returns epoch duration
+        /// @return epochDuration in seconds
+        function epochDuration() external view returns (uint256);
+
+        /// @dev Returns epoch init timestamp
+        /// @return initTimestamp in seconds
+        function initTimestamp() external view returns (uint256);
+
+        /// @dev Returns the difficulty for CCP
+        function difficulty() external view returns (bytes32);
+
+        /// @dev Returns the min required randomX proofs per epoch for the 1 CU.
+        /// @dev  If lower than this - CU is failed and CC slashed.
+        function minProofsPerEpoch() external view returns (uint256);
+
+        /// @dev Returns the max randomX proofs per epoch
+        function maxProofsPerEpoch() external view returns (uint256);
+    }
+}
+
\ No newline at end of file diff --git a/src/chain_connector/function/deal.rs.html b/src/chain_connector/function/deal.rs.html new file mode 100644 index 0000000000..ced25bc9ae --- /dev/null +++ b/src/chain_connector/function/deal.rs.html @@ -0,0 +1,187 @@ +deal.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use alloy_sol_types::{sol, SolType};
+use hex_utils::decode_hex;
+use serde::{Deserialize, Serialize};
+
+use crate::ConnectorError;
+use crate::Deal::{Status, CIDV1};
+
+sol! {
+    contract Deal {
+        struct CIDV1 {
+            bytes4 prefixes;
+            bytes32 hash;
+        }
+
+        #[derive(Debug, PartialEq, Eq, Serialize, Deserialize)]
+        enum Status {
+            // the deal does have enough funds to pay for the workers
+            INSUFFICIENT_FUNDS,
+            ACTIVE,
+            // the deal is stopped
+            ENDED,
+            // the deal has a balance and waiting for workers
+            NOT_ENOUGH_WORKERS,
+            // the deal has balance less than the minimal balance. Min balance: 2 * targetWorkers * pricePerWorkerEpoch
+            SMALL_BALANCE
+        }
+
+        struct ComputeUnit {
+            bytes32 id;
+            bytes32 workerId;
+            bytes32 peerId;
+            address provider;
+            uint256 joinedEpoch;
+        }
+
+        /// @dev Returns the status of the deal
+        function getStatus() external view returns (Status);
+
+        /// @dev Returns the app CID
+        function appCID() external view returns (CIDV1 memory);
+
+        /// @dev Set worker ID for a compute unit. Compute unit can have only one worker ID
+        function setWorker(bytes32 computeUnitId, bytes32 workerId) external;
+
+        /// @dev Returns the compute units info by provider
+        function getComputeUnits() public view returns (ComputeUnit[] memory);
+    }
+}
+
+impl CIDV1 {
+    pub fn from_hex(hex: &str) -> Result<Self, ConnectorError> {
+        let bytes = decode_hex(hex)?;
+        if bytes.is_empty() {
+            return Err(ConnectorError::EmptyData(hex.to_string()));
+        }
+        Ok(CIDV1::abi_decode(&bytes, true)?)
+    }
+
+    pub fn to_ipld(self) -> Result<String, ConnectorError> {
+        let cid_bytes = [self.prefixes.to_vec(), self.hash.to_vec()].concat();
+        Ok(libipld::Cid::read_bytes(cid_bytes.as_slice())?.to_string())
+    }
+}
+
+impl Status {
+    pub fn from_hex(hex: &str) -> Result<Self, ConnectorError> {
+        let bytes = decode_hex(hex)?;
+        if bytes.is_empty() {
+            return Err(ConnectorError::EmptyData(hex.to_string()));
+        }
+
+        Ok(Status::abi_decode(&bytes, true)?)
+    }
+}
+
\ No newline at end of file diff --git a/src/chain_connector/function/mod.rs.html b/src/chain_connector/function/mod.rs.html new file mode 100644 index 0000000000..d402bfa3da --- /dev/null +++ b/src/chain_connector/function/mod.rs.html @@ -0,0 +1,57 @@ +mod.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+mod capacity;
+mod core;
+mod deal;
+mod offer;
+
+pub use capacity::*;
+pub use core::*;
+pub use deal::*;
+pub use offer::*;
+
\ No newline at end of file diff --git a/src/chain_connector/function/offer.rs.html b/src/chain_connector/function/offer.rs.html new file mode 100644 index 0000000000..b8cfa4e533 --- /dev/null +++ b/src/chain_connector/function/offer.rs.html @@ -0,0 +1,307 @@ +offer.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use crate::Offer::ComputeUnit;
+use alloy_primitives::U256;
+use alloy_sol_types::sol;
+use ccp_shared::types::CUID;
+
+sol! {
+    contract Offer {
+        struct ComputePeer {
+            bytes32 offerId;
+            bytes32 commitmentId;
+            uint256 unitCount;
+            address owner;
+        }
+
+        #[derive(Debug)]
+        struct ComputeUnit {
+            bytes32 id;
+            address deal;
+            uint256 startEpoch;
+        }
+
+        /// @dev Returns the compute peer info
+        function getComputePeer(bytes32 peerId) external view returns (ComputePeer memory);
+        /// @dev Returns the compute units info of a peer
+        function getComputeUnits(bytes32 peerId) external view returns (ComputeUnit[] memory);
+
+        /// @dev Return the compute unit from a deal
+        function returnComputeUnitFromDeal(bytes32 unitId) external;
+    }
+}
+
+/// "Peer doesn't exists" in Market.sol
+pub const PEER_NOT_EXISTS: &str = "08c379a0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000125065657220646f65736e27742065786973740000000000000000000000000000";
+
+#[derive(Debug, PartialEq, Eq, Hash, Ord, PartialOrd)]
+pub struct PendingUnit {
+    pub id: CUID,
+    pub start_epoch: U256,
+}
+
+impl PendingUnit {
+    pub fn new(id: CUID, start_epoch: U256) -> Self {
+        Self { id, start_epoch }
+    }
+}
+impl From<ComputeUnit> for PendingUnit {
+    fn from(unit: ComputeUnit) -> Self {
+        Self {
+            id: CUID::new(unit.id.0),
+            start_epoch: unit.startEpoch,
+        }
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use crate::Offer::ComputePeer;
+    use alloy_primitives::{hex, U256};
+    use alloy_sol_types::SolType;
+    use hex_utils::decode_hex;
+
+    #[tokio::test]
+    async fn decode_compute_unit() {
+        let data = "aa3046a12a1aac6e840625e6329d70b427328fec36dc8d273e5e6454b85633d50000000000000000000000005e3d0fde6f793b3115a9e7f5ebc195bbeed35d6c00000000000000000000000000000000000000000000000000000000000003e8";
+        let compute_unit = super::ComputeUnit::abi_decode(&decode_hex(data).unwrap(), true);
+        assert!(compute_unit.is_ok());
+        let compute_unit = compute_unit.unwrap();
+
+        assert_eq!(
+            compute_unit.id,
+            hex!("aa3046a12a1aac6e840625e6329d70b427328fec36dc8d273e5e6454b85633d5")
+        );
+        assert!(!compute_unit.deal.is_zero());
+        assert_eq!(
+            compute_unit.deal.to_string().to_lowercase(),
+            "0x5e3d0fde6f793b3115a9e7f5ebc195bbeed35d6c"
+        );
+        assert_eq!(compute_unit.startEpoch, U256::from(1000));
+    }
+
+    #[tokio::test]
+    async fn decode_compute_unit_no_deal() {
+        let data = "aa3046a12a1aac6e840625e6329d70b427328fec36dc8d273e5e6454b85633d5000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003e8";
+        let compute_unit = super::ComputeUnit::abi_decode(&decode_hex(data).unwrap(), true);
+        assert!(compute_unit.is_ok());
+        let compute_unit = compute_unit.unwrap();
+        assert_eq!(
+            compute_unit.id,
+            hex!("aa3046a12a1aac6e840625e6329d70b427328fec36dc8d273e5e6454b85633d5")
+        );
+        assert!(compute_unit.deal.is_zero());
+        assert_eq!(compute_unit.startEpoch, U256::from(1000));
+    }
+
+    #[tokio::test]
+    async fn decode_compute_peer_no_commitment() {
+        let data = "0xaa3046a12a1aac6e840625e6329d70b427328fec36dc8d273e5e6454b85633d5000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000005b73c5498c1e3b4dba84de0f1833c4a029d90519";
+        let compute_peer = ComputePeer::abi_decode(&decode_hex(data).unwrap(), true);
+        assert!(compute_peer.is_ok());
+        let compute_peer = compute_peer.unwrap();
+        assert_eq!(
+            hex::encode(compute_peer.offerId),
+            "aa3046a12a1aac6e840625e6329d70b427328fec36dc8d273e5e6454b85633d5"
+        );
+        assert!(compute_peer.commitmentId.is_zero());
+        assert_eq!(compute_peer.unitCount, U256::from(2));
+        assert_eq!(
+            compute_peer.owner.to_string().to_lowercase(),
+            "0x5b73c5498c1e3b4dba84de0f1833c4a029d90519"
+        );
+    }
+
+    #[tokio::test]
+    async fn decode_compute_peer() {
+        let data = "0xaa3046a12a1aac6e840625e6329d70b427328fec36dc8d273e5e6454b85633d5aa3046a12a1aac6e840625e6329d70b427328feceedc8d273e5e6454b85633b5000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000005b73c5498c1e3b4dba84de0f1833c4a029d90519";
+        let compute_peer = ComputePeer::abi_decode(&decode_hex(data).unwrap(), true);
+        assert!(compute_peer.is_ok());
+        let compute_peer = compute_peer.unwrap();
+        assert_eq!(
+            hex::encode(compute_peer.offerId),
+            "aa3046a12a1aac6e840625e6329d70b427328fec36dc8d273e5e6454b85633d5"
+        );
+        assert!(!compute_peer.commitmentId.is_zero());
+        assert_eq!(
+            hex::encode(compute_peer.commitmentId.0),
+            "aa3046a12a1aac6e840625e6329d70b427328feceedc8d273e5e6454b85633b5"
+        );
+        assert_eq!(compute_peer.unitCount, U256::from(10));
+        assert_eq!(
+            compute_peer.owner.to_string().to_lowercase(),
+            "0x5b73c5498c1e3b4dba84de0f1833c4a029d90519"
+        );
+    }
+}
+
\ No newline at end of file diff --git a/src/chain_connector/lib.rs.html b/src/chain_connector/lib.rs.html new file mode 100644 index 0000000000..a9e396b056 --- /dev/null +++ b/src/chain_connector/lib.rs.html @@ -0,0 +1,77 @@ +lib.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+#![feature(assert_matches)]
+#![feature(result_flattening)]
+#![feature(try_blocks)]
+#![feature(iter_array_chunks)]
+
+mod connector;
+mod error;
+mod function;
+
+mod builtins;
+mod eth_call;
+mod types;
+
+pub use self::types::CCInitParams;
+pub use connector::ChainConnector;
+pub use connector::HttpChainConnector;
+pub use error::ConnectorError;
+pub use function::*;
+pub use types::SubnetResolveResult;
+
\ No newline at end of file diff --git a/src/chain_connector/types.rs.html b/src/chain_connector/types.rs.html new file mode 100644 index 0000000000..6a76987e90 --- /dev/null +++ b/src/chain_connector/types.rs.html @@ -0,0 +1,379 @@ +types.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+use crate::error::ConnectorError;
+use crate::function::Deal;
+use crate::Deal::ComputeUnit;
+use alloy_primitives::U256;
+use ccp_shared::types::{Difficulty, GlobalNonce, CUID};
+use chain_data::parse_peer_id;
+use eyre::{eyre, Report};
+use serde::{Deserialize, Serialize};
+use types::DealId;
+
+pub type Result<T> = std::result::Result<T, ConnectorError>;
+
+#[derive(Debug, Serialize, Deserialize)]
+pub struct DealResult {
+    pub success: bool,
+    pub error: Vec<String>,
+    pub deal_id: DealId,
+    pub deal_info: Vec<DealInfo>,
+}
+
+impl DealResult {
+    pub fn with_error(deal_id: DealId, err: String) -> Self {
+        Self {
+            success: false,
+            error: vec![err],
+            deal_id,
+            deal_info: vec![],
+        }
+    }
+
+    pub fn new(deal_id: DealId, info: DealInfo) -> Self {
+        Self {
+            success: true,
+            error: vec![],
+            deal_id,
+            deal_info: vec![info],
+        }
+    }
+}
+
+#[derive(Debug, Serialize, Deserialize)]
+pub struct DealInfo {
+    pub status: Deal::Status,
+    pub unit_ids: Vec<CUID>,
+    pub app_cid: String,
+}
+
+#[derive(Debug, Serialize, Deserialize)]
+pub struct TxReceiptResult {
+    pub success: bool,
+    pub error: Vec<String>,
+    pub status: String,
+    pub receipt: Vec<TxReceiptInfo>,
+}
+
+#[derive(Debug, Serialize, Deserialize)]
+pub struct TxReceiptInfo {
+    pub block_number: String,
+    pub tx_hash: String,
+}
+
+impl TxReceiptResult {
+    pub fn pending() -> Self {
+        Self {
+            success: true,
+            error: vec![],
+            status: "pending".to_string(),
+            receipt: vec![],
+        }
+    }
+
+    pub fn processed(receipt: TxReceipt) -> Self {
+        Self {
+            success: true,
+            error: vec![],
+            status: if receipt.is_ok { "ok" } else { "failed" }.to_string(),
+            receipt: vec![TxReceiptInfo {
+                block_number: receipt.block_number,
+                tx_hash: receipt.transaction_hash,
+            }],
+        }
+    }
+
+    pub fn error(msg: String) -> Self {
+        Self {
+            success: false,
+            error: vec![msg],
+            status: "".to_string(),
+            receipt: vec![],
+        }
+    }
+}
+
+#[derive(Debug)]
+pub struct TxReceipt {
+    pub is_ok: bool,
+    pub transaction_hash: String,
+    pub block_number: String,
+}
+
+#[derive(Debug)]
+pub enum TxStatus {
+    Pending,
+    Processed(TxReceipt),
+}
+
+#[derive(Debug, Deserialize)]
+#[serde(rename_all = "camelCase")]
+pub struct RawTxReceipt {
+    status: String,
+    transaction_hash: String,
+    block_number: String,
+}
+
+impl RawTxReceipt {
+    pub fn to_tx_receipt(self) -> TxReceipt {
+        TxReceipt {
+            // if status is "0x1" transaction was successful
+            is_ok: self.status == "0x1",
+            transaction_hash: self.transaction_hash,
+            block_number: self.block_number,
+        }
+    }
+}
+
+#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
+pub struct Worker {
+    pub cu_ids: Vec<String>,
+    pub host_id: String,
+    pub worker_id: Vec<String>,
+}
+
+impl TryFrom<ComputeUnit> for Worker {
+    type Error = Report;
+    fn try_from(unit: ComputeUnit) -> eyre::Result<Self> {
+        let mut worker_id = vec![];
+        if !unit.workerId.is_zero() {
+            let w_id = parse_peer_id(&unit.workerId.0)
+                .map_err(|err| eyre!("Failed to parse unit.workerId: {err}"))?
+                .to_base58();
+            worker_id.push(w_id)
+        }
+        let cu_id = unit.id.to_string();
+        let peer_id = parse_peer_id(&unit.peerId.0)
+            .map_err(|err| eyre!("Failed to parse unit.peerId: {err}"))?;
+
+        Ok(Self {
+            cu_ids: vec![cu_id],
+            host_id: peer_id.to_base58(),
+            worker_id,
+        })
+    }
+}
+
+#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
+pub struct SubnetResolveResult {
+    pub success: bool,
+    pub workers: Vec<Worker>,
+    pub error: Vec<String>,
+}
+
+pub struct CCInitParams {
+    pub difficulty: Difficulty,
+    pub init_timestamp: U256,
+    pub current_timestamp: U256,
+    pub global_nonce: GlobalNonce,
+    pub current_epoch: U256,
+    pub epoch_duration: U256,
+    pub min_proofs_per_epoch: U256,
+    pub max_proofs_per_epoch: U256,
+}
+
\ No newline at end of file diff --git a/src/chain_data/block_header.rs.html b/src/chain_data/block_header.rs.html new file mode 100644 index 0000000000..36bd66077c --- /dev/null +++ b/src/chain_data/block_header.rs.html @@ -0,0 +1,129 @@ +block_header.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use alloy_primitives::{U256, U64};
+use alloy_serde_macro::{U256_from_String, U64_from_String};
+use serde::Deserialize;
+use serde_json::Value;
+use serde_with::serde_as;
+
+#[serde_as]
+#[derive(Debug, Deserialize)]
+pub struct BlockHeader {
+    #[serde(deserialize_with = "U64_from_String")]
+    pub number: U64,
+    #[serde(deserialize_with = "U256_from_String")]
+    pub timestamp: U256,
+}
+
+impl BlockHeader {
+    pub fn from_json(json: Value) -> eyre::Result<Self> {
+        serde_json::from_value(json.clone())
+            .map_err(|err| eyre::eyre!("failed to parse header {err}; got {json}"))
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+    use serde_json::json;
+
+    #[test]
+    fn test_block_header_from_json() {
+        let json = json!({"number":"0x11","timestamp":"0x11"});
+        let header = BlockHeader::from_json(json).unwrap();
+        assert_eq!(header.number, U64::from(17));
+        assert_eq!(header.timestamp, U256::from(17));
+
+        let json = json!({"number":"11","timestamp":"11"});
+        let header = BlockHeader::from_json(json).unwrap();
+        assert_eq!(header.number, U64::from(11));
+        assert_eq!(header.timestamp, U256::from(11));
+
+        let json = json!({"number":"0xa1","timestamp":"0xa1"});
+        let header = BlockHeader::from_json(json).unwrap();
+        assert_eq!(header.number, U64::from(161));
+        assert_eq!(header.timestamp, U256::from(161));
+    }
+}
+
\ No newline at end of file diff --git a/src/chain_data/chain_data.rs.html b/src/chain_data/chain_data.rs.html new file mode 100644 index 0000000000..0f197998c3 --- /dev/null +++ b/src/chain_data/chain_data.rs.html @@ -0,0 +1,141 @@ +chain_data.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use crate::error::ChainDataError;
+use ethabi::{ParamType, Token};
+use hex_utils::decode_hex;
+
+#[derive(Debug, Clone, PartialEq)]
+/// Kind of the field in Chain Event
+pub enum EventField {
+    /// If field is indexed, it's passed among topics
+    Indexed(ParamType),
+    /// If field is not indexed, it's passed in log.data
+    NotIndexed(ParamType),
+}
+
+impl EventField {
+    pub fn param_type(self) -> ParamType {
+        match self {
+            EventField::Indexed(t) => t,
+            EventField::NotIndexed(t) => t,
+        }
+    }
+}
+
+pub trait ChainData {
+    fn event_name() -> &'static str;
+    fn signature() -> Vec<EventField>;
+    fn parse(data_tokens: &mut impl Iterator<Item = Token>) -> Result<Self, ChainDataError>
+    where
+        Self: Sized;
+
+    fn topic() -> String {
+        let sig: Vec<_> = Self::signature()
+            .into_iter()
+            .map(|t| t.param_type())
+            .collect();
+        let hash = ethabi::long_signature(Self::event_name(), &sig);
+        hex_utils::encode_hex_0x(hash)
+    }
+}
+
+pub trait ChainEvent<ChainData> {
+    fn new(block_number: String, data: ChainData) -> Self;
+}
+
+/// Parse data from chain. Accepts data with and without "0x" prefix.
+pub fn parse_chain_data(data: &str, signature: &[ParamType]) -> Result<Vec<Token>, ChainDataError> {
+    if data.is_empty() {
+        return Err(ChainDataError::Empty);
+    }
+    let data = decode_hex(data).map_err(ChainDataError::DecodeHex)?;
+    Ok(ethabi::decode(signature, &data)?)
+}
+
\ No newline at end of file diff --git a/src/chain_data/data_tokens.rs.html b/src/chain_data/data_tokens.rs.html new file mode 100644 index 0000000000..2a9ba78ee4 --- /dev/null +++ b/src/chain_data/data_tokens.rs.html @@ -0,0 +1,87 @@ +data_tokens.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use crate::ChainDataError;
+use crate::ChainDataError::{InvalidParsedToken, MissingParsedToken};
+use ethabi::Token;
+
+// Take next token and parse it with `f`
+pub fn next_opt<T>(
+    data_tokens: &mut impl Iterator<Item = Token>,
+    name: &'static str,
+    f: impl Fn(Token) -> Option<T>,
+) -> Result<T, ChainDataError> {
+    let next = data_tokens.next().ok_or(MissingParsedToken(name))?;
+    let parsed = f(next).ok_or(InvalidParsedToken(name))?;
+
+    Ok(parsed)
+}
+
+// Take next token and parse it with `f`
+pub fn next<T>(
+    data_tokens: &mut impl Iterator<Item = Token>,
+    name: &'static str,
+    f: impl Fn(Token) -> T,
+) -> Result<T, ChainDataError> {
+    next_opt(data_tokens, name, |t| Some(f(t)))
+}
+
\ No newline at end of file diff --git a/src/chain_data/error.rs.html b/src/chain_data/error.rs.html new file mode 100644 index 0000000000..9dd3a88e00 --- /dev/null +++ b/src/chain_data/error.rs.html @@ -0,0 +1,81 @@ +error.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use thiserror::Error;
+
+use hex_utils::FromHexError;
+
+#[derive(Debug, Error)]
+pub enum ChainDataError {
+    #[error("empty data, nothing to parse")]
+    Empty,
+    #[error("missing token for field '{0}'")]
+    MissingParsedToken(&'static str),
+    #[error("invalid token for field '{0}'")]
+    InvalidParsedToken(&'static str),
+    #[error("invalid compute peer id: '{0}'")]
+    InvalidComputePeerId(#[from] libp2p_identity::ParseError),
+    #[error("data is not a valid hex: '{0}'")]
+    DecodeHex(#[source] FromHexError),
+    #[error(transparent)]
+    EthError(#[from] ethabi::Error),
+    #[error("Invalid token size")]
+    InvalidTokenSize,
+}
+
\ No newline at end of file diff --git a/src/chain_data/lib.rs.html b/src/chain_data/lib.rs.html new file mode 100644 index 0000000000..a0c495db4a --- /dev/null +++ b/src/chain_data/lib.rs.html @@ -0,0 +1,71 @@ +lib.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+#![feature(try_blocks)]
+#![feature(slice_as_chunks)]
+
+mod block_header;
+mod chain_data;
+mod data_tokens;
+mod error;
+mod log;
+mod utils;
+
+pub use block_header::BlockHeader;
+pub use chain_data::{parse_chain_data, ChainData, ChainEvent, EventField};
+pub use data_tokens::{next, next_opt};
+pub use error::ChainDataError;
+pub use log::{parse_log, Log, LogParseError};
+pub use utils::{parse_peer_id, peer_id_from_hex, peer_id_to_bytes, peer_id_to_hex};
+
\ No newline at end of file diff --git a/src/chain_data/log.rs.html b/src/chain_data/log.rs.html new file mode 100644 index 0000000000..9b924c8ccf --- /dev/null +++ b/src/chain_data/log.rs.html @@ -0,0 +1,169 @@ +log.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use std::str::FromStr;
+
+use alloy_sol_types::{SolEvent, Word};
+use libp2p_identity::ParseError;
+use serde::{Deserialize, Serialize};
+use thiserror::Error;
+
+use hex_utils::{decode_hex, FromHexError};
+
+use crate::chain_data::EventField;
+use crate::error::ChainDataError;
+use crate::LogParseError::EthError;
+
+#[derive(Debug, Serialize, Deserialize, Clone)]
+#[serde(rename_all = "camelCase")]
+pub struct Log {
+    // Log arguments
+    pub data: String,
+    // The block number in hex (with 0x prefix) that contains this log
+    pub block_number: String,
+    // true when the log was removed, due to a chain reorganization. false if its a valid log.
+    #[serde(default)]
+    pub removed: bool,
+    pub topics: Vec<String>,
+}
+
+#[derive(Debug, Error)]
+pub enum LogParseError {
+    #[error(transparent)]
+    EthError(#[from] alloy_sol_types::Error),
+    #[error(transparent)]
+    DecodeHex(#[from] FromHexError),
+    #[error(transparent)]
+    DecodeConstHex(#[from] const_hex::FromHexError),
+    #[error(
+        "incorrect log signature: not found token for field #{position} of type ${event_field:?}"
+    )]
+    MissingToken {
+        position: usize,
+        event_field: EventField,
+    },
+    #[error("incorrect log signature: not found topic for indexed field #{position} of type ${event_field:?}")]
+    MissingTopic {
+        position: usize,
+        event_field: EventField,
+    },
+    #[error("missing token for field '{0}'")]
+    MissingParsedToken(&'static str),
+    #[error("invalid token for field '{0}'")]
+    InvalidParsedToken(&'static str),
+    #[error("invalid compute peer id: '{0}'")]
+    InvalidComputePeerId(#[from] ParseError),
+    #[error(transparent)]
+    ChainData(#[from] ChainDataError),
+    #[error("no tokens after deserialization")]
+    NoTokens,
+}
+
+pub fn parse_log<T: SolEvent>(log: Log) -> Result<T, LogParseError> {
+    let mut topics = vec![];
+    for t in log.topics {
+        topics.push(Word::from_str(&t)?);
+    }
+    SolEvent::decode_raw_log(topics.iter(), &decode_hex(&log.data)?, true).map_err(EthError)
+}
+
\ No newline at end of file diff --git a/src/chain_data/utils.rs.html b/src/chain_data/utils.rs.html new file mode 100644 index 0000000000..fb416de995 --- /dev/null +++ b/src/chain_data/utils.rs.html @@ -0,0 +1,125 @@ +utils.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use hex_utils::decode_hex;
+use libp2p_identity::{ParseError, PeerId};
+
+/// Static prefix of the PeerId. Protobuf encoding + multihash::identity + length and so on.
+pub(crate) const PEER_ID_PREFIX: &[u8] = &[0, 36, 8, 1, 18, 32];
+
+pub fn parse_peer_id(bytes: &[u8]) -> Result<PeerId, ParseError> {
+    let peer_id = [PEER_ID_PREFIX, bytes].concat();
+
+    PeerId::from_bytes(&peer_id)
+}
+
+/// This code works only for PeerId generated from ed25519 public key, the size assumptions is wrong
+pub fn peer_id_to_bytes(peer_id: PeerId) -> [u8; 32] {
+    let peer_id = peer_id.to_bytes();
+    // peer_id is 38 bytes but we need 32 for chain
+    let res = peer_id[PEER_ID_PREFIX.len()..].as_chunks::<32>();
+    res.0[0]
+}
+pub fn peer_id_to_hex(peer_id: PeerId) -> String {
+    hex_utils::encode_hex_0x_zero_pad(peer_id_to_bytes(peer_id), 64)
+}
+
+pub fn peer_id_from_hex(hex: &str) -> eyre::Result<PeerId> {
+    Ok(parse_peer_id(&decode_hex(hex)?)?)
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+    use std::str::FromStr;
+    #[test]
+    fn peer_id_test() {
+        let hex = "0x246cd65bc58db104674f76c9b1340eb16881d9ef90e33d4b1086ebd334f4002d".to_string();
+        let peer_id =
+            PeerId::from_str("12D3KooWCGZ6t8by5ag5YMQW4k3HoPLaKdN5rB9DhAmDUeG8dj1N").unwrap();
+        assert_eq!(
+            peer_id,
+            parse_peer_id(&decode_hex(&hex[2..]).unwrap()).unwrap()
+        );
+        assert_eq!(hex, peer_id_to_hex(peer_id));
+    }
+}
+
\ No newline at end of file diff --git a/src/chain_listener/event/cc_activated.rs.html b/src/chain_listener/event/cc_activated.rs.html new file mode 100644 index 0000000000..0e3d4603bc --- /dev/null +++ b/src/chain_listener/event/cc_activated.rs.html @@ -0,0 +1,179 @@ +cc_activated.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use alloy_sol_types::sol;
+sol! {
+    /// @dev Emitted when a commitment is activated. Commitment can be activated only if delegator deposited collateral.
+    /// @param peerId Peer id which linked to the commitment
+    /// @param commitmentId Commitment id which activated
+    /// @param startEpoch The start epoch of the commitment
+    /// @param endEpoch The end epoch of the commitment
+    /// @param unitIds Compute unit ids which linked to the commitment
+    #[derive(Debug)]
+    event CommitmentActivated(
+        bytes32 indexed peerId,
+        bytes32 indexed commitmentId,
+        uint256 startEpoch,
+        uint256 endEpoch,
+        bytes32[] unitIds
+    );
+}
+
+#[cfg(test)]
+mod test {
+    use super::CommitmentActivated;
+    use alloy_primitives::Uint;
+    use alloy_sol_types::{SolEvent, Word};
+    use chain_data::parse_peer_id;
+    use hex_utils::decode_hex;
+    use std::str::FromStr;
+
+    #[tokio::test]
+    async fn test_cc_activated_topic() {
+        assert_eq!(
+            CommitmentActivated::SIGNATURE_HASH.to_string(),
+            "0x0b0a4688a90d1b24732d05ddf4925af69f02cd7d9a921b1cdcd4a7c2b6d57d68"
+        );
+    }
+
+    #[tokio::test]
+    async fn test_chain_parsing_ok() {
+        let data = "0x000000000000000000000000000000000000000000000000000000000000007b00000000000000000000000000000000000000000000000000000000000001c800000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001c04d94f1e85788b245471c87490f42149b09503fe3af46733e4b5adf94583105".to_string();
+        let topics = vec![
+            CommitmentActivated::SIGNATURE_HASH.to_string(),
+            "0xc586dcbfc973643dc5f885bf1a38e054d2675b03fe283a5b7337d70dda9f7171".to_string(),
+            "0x27e42c090aa007a4f2545547425aaa8ea3566e1f18560803ac48f8e98cb3b0c9".to_string(),
+        ];
+        let result = CommitmentActivated::decode_raw_log(
+            topics.into_iter().map(|t| Word::from_str(&t).unwrap()),
+            &decode_hex(&data).unwrap(),
+            true,
+        );
+
+        assert!(result.is_ok(), "can't parse data: {:?}", result);
+        let result = result.unwrap();
+        assert_eq!(
+            parse_peer_id(result.peerId.as_slice()).unwrap().to_string(),
+            "12D3KooWP7RkvkBhbe7ATd451zxTifzF6Gm1uzCDadqQueET7EMe" // it's also the second topic
+        );
+
+        assert_eq!(
+            result.commitmentId.to_string(),
+            "0x27e42c090aa007a4f2545547425aaa8ea3566e1f18560803ac48f8e98cb3b0c9" // it's the third topic
+        );
+        assert_eq!(result.startEpoch, Uint::from(123));
+        assert_eq!(result.endEpoch, Uint::from(456));
+
+        assert_eq!(result.unitIds.len(), 1);
+        assert_eq!(
+            result.unitIds[0].to_string(),
+            "0xc04d94f1e85788b245471c87490f42149b09503fe3af46733e4b5adf94583105"
+        )
+    }
+}
+
\ No newline at end of file diff --git a/src/chain_listener/event/compute_unit_matched.rs.html b/src/chain_listener/event/compute_unit_matched.rs.html new file mode 100644 index 0000000000..121bc908a9 --- /dev/null +++ b/src/chain_listener/event/compute_unit_matched.rs.html @@ -0,0 +1,289 @@ +compute_unit_matched.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use alloy_sol_types::sol;
+
+sol! {
+    struct CIDV1 {
+        bytes4 prefixes;
+        bytes32 hash;
+    }
+
+    event ComputeUnitMatched(
+        bytes32 indexed peerId,
+        address deal,
+        bytes32 unitId,
+        uint256 dealCreationBlock,
+        CIDV1 appCID
+    );
+}
+
+#[cfg(test)]
+mod tests {
+    use crate::event::compute_unit_matched::ComputeUnitMatched;
+    use alloy_primitives::Uint;
+    use alloy_sol_types::SolEvent;
+    use chain_data::{parse_log, parse_peer_id, Log};
+    use hex_utils::decode_hex;
+
+    #[test]
+    fn topic() {
+        assert_eq!(
+            ComputeUnitMatched::SIGNATURE_HASH.to_string(),
+            String::from("0xb1c5a9179c3104a43de668491f14c45778f00ec34d5deee023af204820483bdb")
+        );
+    }
+
+    #[test]
+    fn peer_id() {
+        let bytes = [
+            88, 198, 255, 218, 126, 170, 188, 84, 84, 39, 255, 137, 18, 55, 7, 139, 121, 207, 149,
+            42, 196, 115, 102, 160, 4, 47, 227, 62, 7, 53, 189, 15,
+        ];
+        let peer_id = parse_peer_id(&bytes).expect("parse peer_id from Token");
+        assert_eq!(
+            peer_id.to_string(),
+            String::from("12D3KooWFnv3Qc25eKpTDCNBoW1jXHMHHHSzcJoPkHai1b2dHNra")
+        );
+
+        let hex = "0x7a82a5feefcaad4a89c689412031e5f87c02b29e3fced583be5f05c7077354b7";
+        let bytes = decode_hex(hex).expect("parse peer_id from hex");
+        let peer_id = parse_peer_id(&bytes).expect("parse peer_id from Token");
+        assert_eq!(
+            peer_id.to_string(),
+            String::from("12D3KooWJ4bTHirdTFNZpCS72TAzwtdmavTBkkEXtzo6wHL25CtE")
+        );
+    }
+
+    #[test]
+    fn parse() {
+        let data1 = "000000000000000000000000ffa0611a099ab68ad7c3c67b4ca5bbbee7a58b9900000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000500155122000000000000000000000000000000000000000000000000000000000a146af49df31c99c79a30ec4ae2abb2445d8c5d202ea58fa9ea9cbff45d4152e".to_string();
+        let data2 = "00000000000000000000000067b2ad3866429282e16e55b715d12a77f85b7ce800000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000560155122000000000000000000000000000000000000000000000000000000000a146af49df31c99c79a30ec4ae2abb2445d8c5d202ea58fa9ea9cbff45d4152e".to_string();
+        let log1 = Log {
+            data: data1,
+            block_number: "0x0".to_string(),
+            removed: false,
+            topics: vec![
+                ComputeUnitMatched::SIGNATURE_HASH.to_string(),
+                "0x7a82a5feefcaad4a89c689412031e5f87c02b29e3fced583be5f05c7077354b7".to_string(),
+            ],
+        };
+        let log2 = Log {
+            data: data2,
+            block_number: "0x1".to_string(),
+            removed: false,
+            topics: vec![
+                ComputeUnitMatched::SIGNATURE_HASH.to_string(),
+                "0x7a82a5feefcaad4a89c689412031e5f87c02b29e3fced583be5f05c7077354b7".to_string(),
+            ],
+        };
+
+        let m = parse_log::<ComputeUnitMatched>(log1).expect("error parsing Match from log");
+        assert_eq!(
+            parse_peer_id(m.peerId.as_slice()).unwrap().to_string(),
+            "12D3KooWJ4bTHirdTFNZpCS72TAzwtdmavTBkkEXtzo6wHL25CtE"
+        );
+        assert_eq!(
+            m.deal.to_string(),
+            "0xFfA0611a099AB68AD7C3C67B4cA5bbBEE7a58B99"
+        );
+        assert_eq!(
+            m.unitId.to_string(),
+            "0x00000000000000000000000000000000000000000000000000000000000000a0"
+        );
+        assert_eq!(m.dealCreationBlock, Uint::from(80));
+
+        let cid_bytes = [m.appCID.prefixes.to_vec(), m.appCID.hash.to_vec()].concat();
+        let app_cid = libipld::Cid::read_bytes(cid_bytes.as_slice())
+            .unwrap()
+            .to_string();
+        assert_eq!(
+            app_cid,
+            "bafkreifbi2xutxzrzgohtiyoysxcvozeixmmluqc5jmpvhvjzp7ulvavfy"
+        );
+
+        let m = parse_log::<ComputeUnitMatched>(log2).expect("error parsing Match from log");
+        assert_eq!(
+            parse_peer_id(m.peerId.as_slice()).unwrap().to_string(),
+            "12D3KooWJ4bTHirdTFNZpCS72TAzwtdmavTBkkEXtzo6wHL25CtE"
+        );
+        assert_eq!(
+            m.deal.to_string(),
+            "0x67b2AD3866429282e16e55B715d12A77F85B7CE8"
+        );
+        assert_eq!(
+            m.unitId.to_string(),
+            "0x00000000000000000000000000000000000000000000000000000000000000a0"
+        );
+        assert_eq!(m.dealCreationBlock, Uint::from(86));
+        let cid_bytes = [m.appCID.prefixes.to_vec(), m.appCID.hash.to_vec()].concat();
+        let app_cid = libipld::Cid::read_bytes(cid_bytes.as_slice())
+            .unwrap()
+            .to_string();
+        assert_eq!(
+            app_cid,
+            "bafkreifbi2xutxzrzgohtiyoysxcvozeixmmluqc5jmpvhvjzp7ulvavfy"
+        );
+    }
+}
+
\ No newline at end of file diff --git a/src/chain_listener/event/mod.rs.html b/src/chain_listener/event/mod.rs.html new file mode 100644 index 0000000000..103838020d --- /dev/null +++ b/src/chain_listener/event/mod.rs.html @@ -0,0 +1,57 @@ +mod.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+mod cc_activated;
+mod compute_unit_matched;
+mod unit_activated;
+mod unit_deactivated;
+
+pub use cc_activated::CommitmentActivated;
+pub use compute_unit_matched::{ComputeUnitMatched, CIDV1};
+pub use unit_activated::UnitActivated;
+pub use unit_deactivated::UnitDeactivated;
+
\ No newline at end of file diff --git a/src/chain_listener/event/unit_activated.rs.html b/src/chain_listener/event/unit_activated.rs.html new file mode 100644 index 0000000000..73f311819d --- /dev/null +++ b/src/chain_listener/event/unit_activated.rs.html @@ -0,0 +1,183 @@ +unit_activated.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use alloy_sol_types::sol;
+use chain_connector::PendingUnit;
+
+use core_distributor::CUID;
+
+sol! {
+    /// @dev Emitted when a unit activated.
+    /// Unit is activated when it returned from deal
+    /// @param commitmentId Commitment id
+    /// @param unitId Compute unit id which activated
+    #[derive(Debug)]
+    event UnitActivated(
+        bytes32 indexed commitmentId,
+        bytes32 indexed unitId,
+        uint256 startEpoch
+    );
+}
+
+impl From<UnitActivated> for PendingUnit {
+    fn from(data: UnitActivated) -> Self {
+        PendingUnit {
+            id: CUID::new(data.unitId.0),
+            start_epoch: data.startEpoch,
+        }
+    }
+}
+#[cfg(test)]
+mod test {
+    use super::UnitActivated;
+    use alloy_primitives::Uint;
+    use alloy_sol_types::{SolEvent, Word};
+    use std::str::FromStr;
+
+    use hex_utils::decode_hex;
+
+    #[tokio::test]
+    async fn test_unit_activated_topic() {
+        assert_eq!(
+            UnitActivated::SIGNATURE_HASH.to_string(),
+            "0x8e4b27eeb3194deef0b3140997e6b82f53eb7350daceb9355268009b92f70add"
+        );
+    }
+
+    #[tokio::test]
+    async fn test_chain_parsing_ok() {
+        let data = "0x000000000000000000000000000000000000000000000000000000000000007b".to_string();
+        let topics = vec![
+            UnitActivated::SIGNATURE_HASH.to_string(),
+            "0x431688393bc518ef01e11420af290b92f3668dca24fc171eeb11dd15bcefad72".to_string(),
+            "0xd33bc101f018e42351fbe2adc8682770d164e27e2e4c6454e0faaf5b8b63b90e".to_string(),
+        ];
+
+        let result = UnitActivated::decode_raw_log(
+            topics.into_iter().map(|t| Word::from_str(&t).unwrap()),
+            &decode_hex(&data).unwrap(),
+            true,
+        );
+
+        assert!(result.is_ok(), "can't parse data: {:?}", result);
+        let result = result.unwrap();
+        assert_eq!(
+            result.commitmentId.to_string(),
+            "0x431688393bc518ef01e11420af290b92f3668dca24fc171eeb11dd15bcefad72" // it's the second topic
+        );
+        assert_eq!(
+            result.unitId.to_string(),
+            "0xd33bc101f018e42351fbe2adc8682770d164e27e2e4c6454e0faaf5b8b63b90e" // it's also the third topic
+        );
+
+        assert_eq!(result.startEpoch, Uint::from(123));
+    }
+}
+
\ No newline at end of file diff --git a/src/chain_listener/event/unit_deactivated.rs.html b/src/chain_listener/event/unit_deactivated.rs.html new file mode 100644 index 0000000000..19fcdee379 --- /dev/null +++ b/src/chain_listener/event/unit_deactivated.rs.html @@ -0,0 +1,151 @@ +unit_deactivated.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use alloy_sol_types::sol;
+
+sol! {
+    /// @dev Emitted when a unit deactivated. Unit is deactivated when it moved to deal
+    /// @param commitmentId Commitment id
+    /// @param unitId Compute unit id which deactivated
+    #[derive(Debug)]
+    event UnitDeactivated(
+        bytes32 indexed commitmentId,
+        bytes32 indexed unitId
+    );
+}
+
+#[cfg(test)]
+mod test {
+    use crate::event::unit_deactivated::UnitDeactivated;
+    use alloy_sol_types::SolEvent;
+
+    use chain_data::{parse_log, Log};
+
+    #[tokio::test]
+    async fn test_unit_activated_topic() {
+        assert_eq!(
+            UnitDeactivated::SIGNATURE_HASH.to_string(),
+            "0xbd9cde1bbc961036d34368ae328c38917036a98eacfb025a1ff6d2c6235d0a14"
+        );
+    }
+
+    #[tokio::test]
+    async fn test_chain_parsing_ok() {
+        let data = "0x".to_string();
+
+        let topics = vec![
+            UnitDeactivated::SIGNATURE_HASH.to_string(),
+            "0x91cfcc4a139573b08646960be31b278152ef3480710ab15d9b39262be37038a1".to_string(),
+            "0xf3660ca1eaf461cbbb5e1d06ade6ba4a9a503c0d680ba825e09cddd3f9b45fc6".to_string(),
+        ];
+        let result = parse_log::<UnitDeactivated>(Log {
+            data,
+            block_number: "".to_string(),
+            removed: false,
+            topics,
+        });
+
+        assert!(result.is_ok(), "can't parse data: {:?}", result);
+        let result = result.unwrap();
+        assert_eq!(
+            result.commitmentId.to_string(),
+            "0x91cfcc4a139573b08646960be31b278152ef3480710ab15d9b39262be37038a1" // it's the second topic
+        );
+        assert_eq!(
+            result.unitId.to_string(),
+            "0xf3660ca1eaf461cbbb5e1d06ade6ba4a9a503c0d680ba825e09cddd3f9b45fc6" // it's also the third topic
+        );
+    }
+}
+
\ No newline at end of file diff --git a/src/chain_listener/lib.rs.html b/src/chain_listener/lib.rs.html new file mode 100644 index 0000000000..b9e8021b04 --- /dev/null +++ b/src/chain_listener/lib.rs.html @@ -0,0 +1,79 @@ +lib.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+#![feature(assert_matches)]
+#![feature(try_blocks)]
+#![feature(extract_if)]
+#![feature(btree_extract_if)]
+#![feature(result_option_inspect)]
+extern crate core;
+
+pub use event::CommitmentActivated;
+pub use event::ComputeUnitMatched;
+pub use event::UnitActivated;
+pub use event::UnitDeactivated;
+pub use event::CIDV1;
+pub use listener::ChainListener;
+
+mod event;
+mod listener;
+
+mod persistence;
+mod proof_tracker;
+mod types;
+
\ No newline at end of file diff --git a/src/chain_listener/listener.rs.html b/src/chain_listener/listener.rs.html new file mode 100644 index 0000000000..7ecc7ab447 --- /dev/null +++ b/src/chain_listener/listener.rs.html @@ -0,0 +1,2849 @@ +listener.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+762
+763
+764
+765
+766
+767
+768
+769
+770
+771
+772
+773
+774
+775
+776
+777
+778
+779
+780
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+794
+795
+796
+797
+798
+799
+800
+801
+802
+803
+804
+805
+806
+807
+808
+809
+810
+811
+812
+813
+814
+815
+816
+817
+818
+819
+820
+821
+822
+823
+824
+825
+826
+827
+828
+829
+830
+831
+832
+833
+834
+835
+836
+837
+838
+839
+840
+841
+842
+843
+844
+845
+846
+847
+848
+849
+850
+851
+852
+853
+854
+855
+856
+857
+858
+859
+860
+861
+862
+863
+864
+865
+866
+867
+868
+869
+870
+871
+872
+873
+874
+875
+876
+877
+878
+879
+880
+881
+882
+883
+884
+885
+886
+887
+888
+889
+890
+891
+892
+893
+894
+895
+896
+897
+898
+899
+900
+901
+902
+903
+904
+905
+906
+907
+908
+909
+910
+911
+912
+913
+914
+915
+916
+917
+918
+919
+920
+921
+922
+923
+924
+925
+926
+927
+928
+929
+930
+931
+932
+933
+934
+935
+936
+937
+938
+939
+940
+941
+942
+943
+944
+945
+946
+947
+948
+949
+950
+951
+952
+953
+954
+955
+956
+957
+958
+959
+960
+961
+962
+963
+964
+965
+966
+967
+968
+969
+970
+971
+972
+973
+974
+975
+976
+977
+978
+979
+980
+981
+982
+983
+984
+985
+986
+987
+988
+989
+990
+991
+992
+993
+994
+995
+996
+997
+998
+999
+1000
+1001
+1002
+1003
+1004
+1005
+1006
+1007
+1008
+1009
+1010
+1011
+1012
+1013
+1014
+1015
+1016
+1017
+1018
+1019
+1020
+1021
+1022
+1023
+1024
+1025
+1026
+1027
+1028
+1029
+1030
+1031
+1032
+1033
+1034
+1035
+1036
+1037
+1038
+1039
+1040
+1041
+1042
+1043
+1044
+1045
+1046
+1047
+1048
+1049
+1050
+1051
+1052
+1053
+1054
+1055
+1056
+1057
+1058
+1059
+1060
+1061
+1062
+1063
+1064
+1065
+1066
+1067
+1068
+1069
+1070
+1071
+1072
+1073
+1074
+1075
+1076
+1077
+1078
+1079
+1080
+1081
+1082
+1083
+1084
+1085
+1086
+1087
+1088
+1089
+1090
+1091
+1092
+1093
+1094
+1095
+1096
+1097
+1098
+1099
+1100
+1101
+1102
+1103
+1104
+1105
+1106
+1107
+1108
+1109
+1110
+1111
+1112
+1113
+1114
+1115
+1116
+1117
+1118
+1119
+1120
+1121
+1122
+1123
+1124
+1125
+1126
+1127
+1128
+1129
+1130
+1131
+1132
+1133
+1134
+1135
+1136
+1137
+1138
+1139
+1140
+1141
+1142
+1143
+1144
+1145
+1146
+1147
+1148
+1149
+1150
+1151
+1152
+1153
+1154
+1155
+1156
+1157
+1158
+1159
+1160
+1161
+1162
+1163
+1164
+1165
+1166
+1167
+1168
+1169
+1170
+1171
+1172
+1173
+1174
+1175
+1176
+1177
+1178
+1179
+1180
+1181
+1182
+1183
+1184
+1185
+1186
+1187
+1188
+1189
+1190
+1191
+1192
+1193
+1194
+1195
+1196
+1197
+1198
+1199
+1200
+1201
+1202
+1203
+1204
+1205
+1206
+1207
+1208
+1209
+1210
+1211
+1212
+1213
+1214
+1215
+1216
+1217
+1218
+1219
+1220
+1221
+1222
+1223
+1224
+1225
+1226
+1227
+1228
+1229
+1230
+1231
+1232
+1233
+1234
+1235
+1236
+1237
+1238
+1239
+1240
+1241
+1242
+1243
+1244
+1245
+1246
+1247
+1248
+1249
+1250
+1251
+1252
+1253
+1254
+1255
+1256
+1257
+1258
+1259
+1260
+1261
+1262
+1263
+1264
+1265
+1266
+1267
+1268
+1269
+1270
+1271
+1272
+1273
+1274
+1275
+1276
+1277
+1278
+1279
+1280
+1281
+1282
+1283
+1284
+1285
+1286
+1287
+1288
+1289
+1290
+1291
+1292
+1293
+1294
+1295
+1296
+1297
+1298
+1299
+1300
+1301
+1302
+1303
+1304
+1305
+1306
+1307
+1308
+1309
+1310
+1311
+1312
+1313
+1314
+1315
+1316
+1317
+1318
+1319
+1320
+1321
+1322
+1323
+1324
+1325
+1326
+1327
+1328
+1329
+1330
+1331
+1332
+1333
+1334
+1335
+1336
+1337
+1338
+1339
+1340
+1341
+1342
+1343
+1344
+1345
+1346
+1347
+1348
+1349
+1350
+1351
+1352
+1353
+1354
+1355
+1356
+1357
+1358
+1359
+1360
+1361
+1362
+1363
+1364
+1365
+1366
+1367
+1368
+1369
+1370
+1371
+1372
+1373
+1374
+1375
+1376
+1377
+1378
+1379
+1380
+1381
+1382
+1383
+1384
+1385
+1386
+1387
+1388
+1389
+1390
+1391
+1392
+1393
+1394
+1395
+1396
+1397
+1398
+1399
+1400
+1401
+1402
+1403
+1404
+1405
+1406
+1407
+1408
+1409
+1410
+1411
+1412
+1413
+1414
+1415
+1416
+1417
+1418
+1419
+1420
+1421
+1422
+1423
+1424
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use alloy_primitives::{Address, FixedBytes, Uint, U256, U64};
+use alloy_sol_types::SolEvent;
+use backoff::Error::Permanent;
+use std::cmp::min;
+use std::collections::{BTreeMap, BTreeSet, HashMap};
+use std::future::{pending, Future};
+use std::path::PathBuf;
+use std::process::exit;
+use std::sync::Arc;
+use std::time::Duration;
+
+use backoff::future::retry;
+use backoff::ExponentialBackoff;
+use ccp_rpc_client::CCPRpcHttpClient;
+use ccp_shared::proof::BatchRequest;
+use ccp_shared::types::{Difficulty, GlobalNonce, LocalNonce, ResultHash};
+use cpu_utils::PhysicalCoreId;
+use hex_utils::encode_hex_0x;
+
+use eyre::{eyre, Report};
+use jsonrpsee::core::client::{Client as WsClient, Subscription, SubscriptionClientT};
+use jsonrpsee::core::params::ArrayParams;
+use jsonrpsee::core::{client, JsonValue};
+use jsonrpsee::rpc_params;
+use jsonrpsee::ws_client::WsClientBuilder;
+use libp2p_identity::PeerId;
+use serde::de::DeserializeOwned;
+use serde_json::{json, Value};
+use tokio::task::JoinHandle;
+use tokio::time::{interval, Instant};
+use tokio_stream::wrappers::IntervalStream;
+use tokio_stream::StreamExt;
+use tracing::Instrument;
+
+use chain_connector::Offer::ComputeUnit;
+use chain_connector::{
+    is_commitment_not_active, is_too_many_proofs, CCStatus, ChainConnector, CommitmentId,
+    ConnectorError, Deal, PEER_NOT_EXISTS,
+};
+use chain_data::{parse_log, peer_id_to_hex, BlockHeader, Log};
+use core_distributor::errors::AcquireError;
+use core_distributor::types::{AcquireRequest, Assignment, WorkType};
+use core_distributor::{CoreDistributor, CUID};
+use peer_metrics::ChainListenerMetrics;
+use server_config::{ChainConfig, ChainListenerConfig};
+use types::DealId;
+
+use crate::event::CommitmentActivated;
+use crate::event::{ComputeUnitMatched, UnitActivated, UnitDeactivated};
+use crate::proof_tracker::ProofTracker;
+use crate::types::{CUGroups, PhysicalCoreGroups};
+
+const PROOF_POLL_LIMIT: usize = 50;
+
+pub struct ChainListener {
+    config: ChainConfig,
+    listener_config: ChainListenerConfig,
+
+    chain_connector: Arc<dyn ChainConnector>,
+    // To subscribe to chain events
+    ws_client: WsClient,
+
+    ccp_client: Option<CCPRpcHttpClient>,
+
+    core_distributor: Arc<dyn CoreDistributor>,
+
+    host_id: PeerId,
+
+    // These settings aren't changed
+    // We refresh them on some errors, but it's enough to get them only on start without refreshing
+    difficulty: Difficulty,
+    // The time when the first epoch starts (aka the contract was deployed)
+    init_timestamp: U256,
+    epoch_duration: U256,
+    min_proofs_per_epoch: U256,
+    max_proofs_per_epoch: U256,
+    // These settings are changed each epoch
+    global_nonce: GlobalNonce,
+    current_epoch: U256,
+    last_observed_block_timestamp: U256,
+
+    current_commitment: Option<CommitmentId>,
+
+    // the compute units that are in the commitment and not in deals
+    cc_compute_units: BTreeMap<CUID, ComputeUnit>,
+    // the compute units that are in deals and not in commitment
+    active_deals: BTreeMap<DealId, CUID>,
+
+    proof_tracker: ProofTracker,
+    pending_proof_txs: Vec<(String, Vec<CUID>)>,
+
+    // TODO: move out to a separate struct, get rid of Option
+    // Subscriptions that are polled when we have commitment
+    unit_activated: Option<Subscription<JsonValue>>,
+    unit_deactivated: Option<Subscription<JsonValue>>,
+    // Subscriptions that are polled always
+    heads: Option<Subscription<JsonValue>>,
+    commitment_activated: Option<Subscription<JsonValue>>,
+    unit_matched: Option<Subscription<JsonValue>>,
+
+    metrics: Option<ChainListenerMetrics>,
+}
+
+async fn poll_subscription<T>(
+    s: &mut Option<Subscription<T>>,
+) -> Option<Result<T, serde_json::Error>>
+where
+    T: DeserializeOwned + Send,
+{
+    match s {
+        Some(ref mut s) => s.next().await,
+        None => pending().await,
+    }
+}
+
+impl ChainListener {
+    pub fn new(
+        chain_config: ChainConfig,
+        ws_client: WsClient,
+        listener_config: ChainListenerConfig,
+        host_id: PeerId,
+        chain_connector: Arc<dyn ChainConnector>,
+        core_distributor: Arc<dyn CoreDistributor>,
+        ccp_client: Option<CCPRpcHttpClient>,
+        persisted_proof_id_dir: PathBuf,
+        metrics: Option<ChainListenerMetrics>,
+    ) -> Self {
+        if ccp_client.is_none() {
+            tracing::warn!(target: "chain-listener", "CCP client is not set, will submit mocked proofs");
+        }
+
+        Self {
+            chain_connector,
+            ws_client,
+            listener_config,
+            config: chain_config,
+            host_id,
+            difficulty: Difficulty::default(),
+            init_timestamp: U256::ZERO,
+            global_nonce: GlobalNonce::new([0; 32]),
+            current_epoch: U256::ZERO,
+            epoch_duration: U256::ZERO,
+            min_proofs_per_epoch: U256::ZERO,
+            max_proofs_per_epoch: U256::ZERO,
+            current_commitment: None,
+            cc_compute_units: BTreeMap::new(),
+            core_distributor,
+            ccp_client,
+            pending_proof_txs: vec![],
+            unit_activated: None,
+            unit_deactivated: None,
+            heads: None,
+            commitment_activated: None,
+            unit_matched: None,
+            active_deals: BTreeMap::new(),
+            metrics,
+            proof_tracker: ProofTracker::new(persisted_proof_id_dir),
+            last_observed_block_timestamp: U256::ZERO,
+        }
+    }
+
+    async fn handle_subscription_error(&mut self, event: &str, err: Report) {
+        tracing::warn!(target: "chain-listener", "{event} event processing error: {err}");
+
+        let result: eyre::Result<()> = try {
+            self.refresh_state().await?;
+            self.refresh_subscriptions().await?;
+        };
+
+        if let Err(err) = result {
+            tracing::error!(target: "chain-listener", "Failed to resubscribe: {err}; Stopping...");
+            exit(1);
+        }
+    }
+
+    pub fn start(mut self) -> JoinHandle<()> {
+        let result = tokio::task::Builder::new()
+            .name("ChainListener")
+            .spawn(async move {
+
+                if let Err(err) = self.set_utility_core().await {
+                    tracing::error!(target: "chain-listener", "Failed to set utility core: {err}; Stopping...");
+                    exit(1);
+                }
+
+                tracing::info!(target: "chain-listener", "Subscribing to chain events");
+                if let Err(err) = self.refresh_subscriptions().await {
+                    tracing::error!(target: "chain-listener", "Failed to subscribe to chain events: {err}; Stopping...");
+                    exit(1);
+                }
+                tracing::info!(target: "chain-listener", "Subscribed successfully");
+
+                // Proof id should be loaded once on start, there is no reason to update it on refresh
+
+                if let Err(err) = self.proof_tracker.load_state().await {
+                    tracing::error!(target: "chain-listener", "Failed to load persisted proof tracker state: {err}; Stopping...");
+                    exit(1);
+                }
+
+                if let Err(err) = self.refresh_state().await {
+                    tracing::error!(target: "chain-listener", "Failed to refresh state: {err}; Stopping...");
+                    exit(1);
+                }
+
+                tracing::info!(target: "chain-listener", "State successfully refreshed, starting main loop");
+                let mut timer = IntervalStream::new(interval(self.listener_config.proof_poll_period));
+
+                loop {
+                    tokio::select! {
+                        event = poll_subscription(&mut self.heads) => {
+                            if let Err(err) = self.process_new_header(event).await {
+                                self.handle_subscription_error("newHeads", err).await;
+                            }
+                        },
+                        event = poll_subscription(&mut self.commitment_activated) => {
+                            if let Err(err) = self.process_commitment_activated(event).await {
+                                self.handle_subscription_error("CommitmentActivated", err).await;
+                            }
+                        },
+                        event = poll_subscription(&mut self.unit_activated) => {
+                            if self.unit_activated.is_some() {
+                                if let Err(err) = self.process_unit_activated(event).await {
+                                    self.handle_subscription_error("UnitActivated", err).await;
+                                }
+                            }
+                        },
+                        event = poll_subscription(&mut self.unit_deactivated) => {
+                            if self.unit_deactivated.is_some() {
+                                 if let Err(err) = self.process_unit_deactivated(event).await {
+                                    self.handle_subscription_error("UnitDeactivated", err).await;
+                                }
+                            }
+                        },
+                        event = poll_subscription(&mut self.unit_matched) => {
+                            if let Err(err) = self.process_unit_matched(event) {
+                                self.handle_subscription_error("ComputeUnitMatched", err).await;
+                            }
+                        },
+                        _ = timer.next() => {
+                            if self.ccp_client.is_some() {
+                                if let Err(err) = self.poll_proofs().await {
+                                    tracing::warn!(target: "chain-listener", "Failed to poll/submit proofs: {err}");
+                                }
+                            } else if let Err(err) = self.submit_mocked_proofs().await {
+                                tracing::warn!(target: "chain-listener", "Failed to submit mocked proofs: {err}");
+                            }
+
+
+                            if let Err(err) = self.poll_deal_statuses().await {
+                                tracing::warn!(target: "chain-listener", "Failed to poll deal statuses: {err}");
+                            }
+
+                            if let Err(err) = self.poll_pending_proof_txs().await {
+                                tracing::warn!(target: "chain-listener", "Failed to poll pending proof txs: {err}");
+                            }
+
+                            // NOTE: we need to update global nonce by timer because sometimes it's stale
+                            // at the beginning of the epoch. It's caused by inconsistency between eth-rpc and subscription to newHeads
+                            if let Err(err) = self.update_global_nonce().await  {
+                                tracing::warn!(target: "chain-listener", "Failed to update global nonce: {err}");
+                            }
+                        }
+                    }
+                }
+            }
+                .in_current_span()
+            )
+            .expect("Could not spawn task");
+
+        result
+    }
+
+    async fn refresh_current_commitment_id(&mut self) -> eyre::Result<()> {
+        match self.chain_connector.get_current_commitment_id().await {
+            Ok(id) => {
+                self.current_commitment = id;
+                Ok(())
+            }
+            Err(err) => match err {
+                ConnectorError::RpcCallError { ref data, .. } => {
+                    if data.contains(PEER_NOT_EXISTS) {
+                        tracing::info!("Peer doesn't exist on chain. Waiting for market offer");
+                        Ok(())
+                    } else {
+                        tracing::error!(target: "chain-listener", "Failed to get current commitment id: {err}");
+                        Err(err.into())
+                    }
+                }
+                _ => {
+                    tracing::error!(target: "chain-listener", "Failed to get current commitment id: {err}");
+                    Err(err.into())
+                }
+            },
+        }
+    }
+
+    async fn refresh_commitment_params(&mut self) -> eyre::Result<()> {
+        let init_params =
+            self.chain_connector
+                .get_cc_init_params()
+                .await
+                .map_err(|err| {
+                    tracing::info!(target: "chain-listener", "Error getting Commitment initial params: {err}");
+                    err
+                })?;
+
+        tracing::info!(target: "chain-listener","Commitment initial params: difficulty {}, global nonce {}, init_timestamp {}, epoch_duration {}, current_epoch {}, min_proofs_per_epoch {}, max_proofs_per_epoch {}",  init_params.difficulty, init_params.global_nonce, init_params.init_timestamp, init_params.epoch_duration, init_params.current_epoch, init_params.min_proofs_per_epoch, init_params.max_proofs_per_epoch);
+
+        self.difficulty = init_params.difficulty;
+        self.init_timestamp = init_params.init_timestamp;
+
+        self.epoch_duration = init_params.epoch_duration;
+        self.min_proofs_per_epoch = init_params.min_proofs_per_epoch;
+        self.max_proofs_per_epoch = init_params.max_proofs_per_epoch;
+
+        self.set_current_epoch(init_params.current_epoch).await;
+        self.set_global_nonce(init_params.global_nonce).await;
+
+        Ok(())
+    }
+
+    async fn refresh_state(&mut self) -> eyre::Result<()> {
+        loop {
+            let result: eyre::Result<()> = try {
+                // TODO: can do it once, on start
+                self.refresh_commitment_params().await?;
+                // but others we need to refresh on each error
+                self.refresh_compute_units().await?;
+                self.refresh_current_commitment_id().await?;
+
+                if let Some(c) = self.current_commitment.clone() {
+                    tracing::info!(target: "chain-listener", "Current commitment id: {}", c);
+                    tracing::info!(target: "chain-listener", "Subscribing to unit events");
+
+                    if let Err(err) = self.subscribe_unit_events(&c).await {
+                        tracing::warn!(target: "chain-listener", "Failed to subscribe to unit events: {err}");
+                        self.refresh_subscriptions().await?;
+                    }
+
+                    tracing::info!(target: "chain-listener", "Successfully subscribed to unit events");
+                } else {
+                    tracing::info!(target: "chain-listener", "Compute peer has no commitment");
+                    self.reset_commitment().await?
+                }
+
+                if let Some(status) = self.get_commitment_status().await? {
+                    tracing::info!(target: "chain-listener", "Current commitment status: {status:?}");
+
+                    match status {
+                        CCStatus::Active => {
+                            self.refresh_commitment().await?;
+                        }
+
+                        CCStatus::Inactive | CCStatus::Failed | CCStatus::Removed => {
+                            self.reset_commitment().await?;
+                        }
+                        CCStatus::WaitDelegation | CCStatus::WaitStart => {
+                            tracing::info!(target: "chain-listener", "Waiting for commitment to be activated; Stopping current one");
+                            self.stop_commitment().await?
+                        }
+                        _ => {}
+                    }
+                }
+            };
+
+            if let Err(e) = result {
+                tracing::warn!(target: "chain-listener", "Failed to refresh state: {e}");
+                tracing::info!(target: "chain-listener", "Retrying in 5 seconds");
+                tokio::time::sleep(Duration::from_secs(5)).await;
+            } else {
+                break;
+            }
+        }
+
+        Ok(())
+    }
+
+    // Allocate one CPU core for utility use
+    async fn set_utility_core(&mut self) -> eyre::Result<()> {
+        if let Some(ccp_client) = self.ccp_client.as_ref() {
+            // We will use the first logical core for utility tasks
+            let utility_core = self
+                .core_distributor
+                .get_system_cpu_assignment()
+                .logical_core_ids
+                .first()
+                .cloned()
+                .ok_or(eyre::eyre!("No utility core id"))?;
+            measured_request(&self.metrics,
+                retry(ExponentialBackoff::default(), || async {
+                    ccp_client
+                        .realloc_utility_cores(vec![utility_core])
+                        .await
+                        .map_err(|err| {
+                            tracing::warn!(target: "chain-listener", "Error reallocating utility core {utility_core} to CCP, error: {err}. Retrying...");
+                            eyre::eyre!("Error reallocating utility core {utility_core} to CCP, error: {err}")
+                        })?;
+                    Ok(())
+                })
+            ).await?;
+
+            tracing::info!("Utility core {utility_core} successfully reallocated");
+        }
+        Ok(())
+    }
+
+    async fn get_commitment_status(&self) -> eyre::Result<Option<CCStatus>> {
+        if let Some(commitment_id) = self.current_commitment.clone() {
+            let status = self
+                .chain_connector
+                .get_commitment_status(commitment_id)
+                .await?;
+            Ok(Some(status))
+        } else {
+            Ok(None)
+        }
+    }
+
+    pub async fn create_ws_client(ws_endpoint: &str) -> Result<WsClient, client::Error> {
+        let ws_client = retry(ExponentialBackoff::default(), || async {
+            let client = WsClientBuilder::default()
+                .build(ws_endpoint)
+                .await
+                .map_err(|err| {
+                    tracing::warn!(
+                        target: "chain-listener",
+                        "Error connecting to websocket endpoint {}, error: {}; Retrying...",
+                        ws_endpoint,
+                        err
+                    );
+                    err
+                })?;
+
+            Ok(client)
+        })
+        .await?;
+
+        tracing::info!(
+            target: "chain-listener",
+            "Successfully connected to websocket endpoint: {}",
+            ws_endpoint
+        );
+
+        Ok(ws_client)
+    }
+
+    async fn subscribe_unit_events(
+        &mut self,
+        commitment_id: &CommitmentId,
+    ) -> Result<(), client::Error> {
+        self.unit_activated = Some(
+            self.subscribe("logs", self.unit_activated_params(commitment_id))
+                .await?,
+        );
+        self.unit_deactivated = Some(
+            self.subscribe("logs", self.unit_deactivated_params(commitment_id))
+                .await?,
+        );
+
+        Ok(())
+    }
+
+    async fn refresh_subscriptions(&mut self) -> Result<(), client::Error> {
+        if !self.ws_client.is_connected() {
+            self.ws_client =
+                ChainListener::create_ws_client(&self.listener_config.ws_endpoint).await?;
+        }
+
+        // loop because subscriptions can fail and require reconnection, we can't proceed without them
+        loop {
+            let result: Result<(), client::Error> = try {
+                self.heads = Some(self.subscribe("newHeads", rpc_params!["newHeads"]).await?);
+                self.commitment_activated =
+                    Some(self.subscribe("logs", self.cc_activated_params()).await?);
+                self.unit_matched = Some(self.subscribe("logs", self.unit_matched_params()).await?);
+                if let Some(commitment_id) = self.current_commitment.clone() {
+                    self.subscribe_unit_events(&commitment_id).await?;
+                }
+            };
+
+            match result {
+                Ok(_) => {
+                    tracing::info!(target: "chain-listener", "Subscriptions refreshed successfully");
+                    break;
+                }
+                Err(err) => match err {
+                    client::Error::RestartNeeded(_) => {
+                        tracing::warn!(target: "chain-listener", "Failed to refresh subscriptions: {err}; Restart client...");
+                        self.ws_client =
+                            ChainListener::create_ws_client(&self.listener_config.ws_endpoint)
+                                .await?;
+                    }
+                    _ => {
+                        tracing::error!(target: "chain-listener", "Failed to refresh subscriptions: {err}; Retrying...");
+                        tokio::time::sleep(Duration::from_secs(1)).await;
+                    }
+                },
+            }
+        }
+        Ok(())
+    }
+
+    /// Updates active and pending compute units
+    async fn refresh_compute_units(&mut self) -> eyre::Result<()> {
+        let mut units = self.chain_connector.get_compute_units().await?;
+
+        let in_deal: Vec<_> = units.extract_if(|cu| !cu.deal.is_zero()).collect();
+
+        self.cc_compute_units = units
+            .into_iter()
+            .map(|unit| (CUID::new(unit.id.0), unit))
+            .collect();
+
+        let active = self
+            .cc_compute_units
+            .values()
+            .filter(|unit| unit.startEpoch <= self.current_epoch);
+
+        let pending = self
+            .cc_compute_units
+            .values()
+            .filter(|unit| unit.startEpoch > self.current_epoch);
+
+        for cu in &in_deal {
+            let cu_id = CUID::new(cu.id.0);
+            // TODO: in the future it should be BTreeMap<DealId, Vec<CUID>>, because deal will be able
+            // to use multiple CUs from one peer
+            self.active_deals.insert(cu.deal.to_string().into(), cu_id);
+        }
+
+        tracing::info!(target: "chain-listener",
+            "Compute units mapping: in cc {}/[{} pending], in deal {}",
+            self.cc_compute_units.len(),
+            pending.clone().count(),
+            in_deal.len()
+        );
+
+        tracing::info!(target: "chain-listener",
+            "Active compute units: {:?}",
+            active.map(|cu| cu.id.to_string()).collect::<Vec<_>>()
+        );
+        tracing::info!(target: "chain-listener",
+            "Pending compute units: {:?}",
+            pending
+                .map(|cu| cu.id.to_string())
+                .collect::<Vec<_>>()
+        );
+        tracing::info!(target: "chain-listener",
+            "In deal compute units: {:?}",
+            self.active_deals.values()
+                .map(CUID::to_string)
+                .collect::<Vec<_>>()
+        );
+
+        // NOTE: cores are released after all the logs to simplify debug on failure
+        for cu_id in self.active_deals.values() {
+            self.core_distributor.release_worker_cores(&[*cu_id]);
+            self.acquire_core_for_deal(*cu_id)?;
+        }
+
+        Ok(())
+    }
+
+    async fn subscribe(
+        &self,
+        method: &str,
+        params: ArrayParams,
+    ) -> Result<Subscription<JsonValue>, client::Error> {
+        let sub = retry(ExponentialBackoff::default(), || async {
+             self
+                .ws_client
+                .subscribe("eth_subscribe", params.clone(), "eth_unsubscribe")
+                .await.map_err(|err|  {
+                if let client::Error::RestartNeeded(_) = err {
+                    tracing::error!(target: "chain-listener", "Failed to subscribe to {method}: {err};");
+                    Permanent(err)
+                } else {
+                    tracing::warn!(target: "chain-listener", "Failed to subscribe to {method}: {err}; Retrying...");
+                    backoff::Error::transient(err)
+                }})
+        }).await?;
+
+        Ok(sub)
+    }
+
+    fn cc_activated_params(&self) -> ArrayParams {
+        let topic = CommitmentActivated::SIGNATURE_HASH.to_string();
+        let topics = vec![topic, peer_id_to_hex(self.host_id)];
+        rpc_params![
+            "logs",
+            json!({"address": self.config.diamond_contract_address, "topics": topics})
+        ]
+    }
+
+    fn unit_activated_params(&self, commitment_id: &CommitmentId) -> ArrayParams {
+        let topic = UnitActivated::SIGNATURE_HASH.to_string();
+        rpc_params![
+            "logs",
+            json!({"address": self.config.diamond_contract_address, "topics": vec![topic, encode_hex_0x(commitment_id.0)]})
+        ]
+    }
+
+    fn unit_deactivated_params(&self, commitment_id: &CommitmentId) -> ArrayParams {
+        let topic = UnitDeactivated::SIGNATURE_HASH.to_string();
+        rpc_params![
+            "logs",
+            json!({"address": self.config.diamond_contract_address, "topics": vec![topic, encode_hex_0x(commitment_id.0)]})
+        ]
+    }
+
+    fn unit_matched_params(&self) -> ArrayParams {
+        let topics = vec![
+            ComputeUnitMatched::SIGNATURE_HASH.to_string(),
+            peer_id_to_hex(self.host_id),
+        ];
+        rpc_params![
+            "logs",
+            json!({"address": self.config.diamond_contract_address, "topics": topics})
+        ]
+    }
+
+    async fn process_new_header(
+        &mut self,
+        event: Option<Result<Value, serde_json::Error>>,
+    ) -> eyre::Result<()> {
+        let header = event.ok_or(eyre!("Failed to process newHeads event: got None"))?;
+
+        let header = BlockHeader::from_json(header?)?;
+        let block_number = header.number.as_limbs()[0];
+        let block_timestamp = header.timestamp;
+
+        self.last_observed_block_timestamp = block_timestamp;
+        self.observe(|m| m.observe_new_block(block_number));
+
+        // `epoch_number = 1 + (block_timestamp - init_timestamp) / epoch_duration`
+        let epoch_number = U256::from(1)
+            + (Uint::from(block_timestamp) - self.init_timestamp) / self.epoch_duration;
+        let epoch_changed = epoch_number > self.current_epoch;
+
+        if epoch_changed {
+            // TODO: add epoch_number to metrics
+
+            self.set_current_epoch(epoch_number).await;
+
+            let nonce_updated = self
+                .set_global_nonce(self.chain_connector.get_global_nonce().await?)
+                .await;
+
+            if !nonce_updated {
+                tracing::warn!(target: "chain-listener", "Epoch changed but global nonce hasn't changed. Don't worry, it'll catch up soon");
+            }
+
+            tracing::info!(target: "chain-listener", "Global nonce: {}", self.global_nonce);
+
+            if let Some(status) = self.get_commitment_status().await? {
+                tracing::info!(target: "chain-listener", "Current commitment status: {status:?}");
+
+                match status {
+                    CCStatus::Active => {
+                        self.refresh_commitment().await?;
+                    }
+                    CCStatus::Inactive | CCStatus::Failed | CCStatus::Removed => {
+                        self.reset_commitment().await?;
+                    }
+                    _ => {}
+                }
+            }
+        }
+        self.observe(|m| m.observe_processed_block(block_number));
+        Ok(())
+    }
+
+    async fn process_commitment_activated(
+        &mut self,
+        event: Option<Result<JsonValue, serde_json::Error>>,
+    ) -> eyre::Result<()> {
+        let event = event.ok_or(eyre!(
+            "Failed to process CommitmentActivated event: got None"
+        ))??;
+        let log = serde_json::from_value::<Log>(event.clone()).map_err(|err| {
+            tracing::error!(target: "chain-listener", "Failed to parse CommitmentActivated event: {err}, data: {event}");
+            err
+        })?;
+
+        let cc_event = parse_log::<CommitmentActivated>(log)?;
+        let unit_ids = cc_event.unitIds;
+        tracing::info!(target: "chain-listener",
+            "Received CommitmentActivated event for commitment: {}, startEpoch: {}, unitIds: {:?}",
+            cc_event.commitmentId.to_string(),
+            cc_event.startEpoch,
+            unit_ids
+                .iter()
+                .map(FixedBytes::to_string)
+                .collect::<Vec<_>>()
+        );
+
+        let commitment_id = CommitmentId(cc_event.commitmentId.0);
+        self.current_commitment = Some(commitment_id.clone());
+        if let Err(err) = self.subscribe_unit_events(&commitment_id).await {
+            tracing::warn!(target: "chain-listener", "Failed to subscribe to unit events: {err}");
+            self.refresh_subscriptions().await?;
+        }
+
+        self.cc_compute_units = unit_ids
+            .into_iter()
+            .map(|id| {
+                (
+                    CUID::new(id.0),
+                    ComputeUnit {
+                        id,
+                        deal: Address::ZERO,
+                        startEpoch: cc_event.startEpoch,
+                    },
+                )
+            })
+            .collect();
+
+        self.refresh_commitment().await?;
+
+        Ok(())
+    }
+
+    async fn process_unit_activated(
+        &mut self,
+        event: Option<Result<JsonValue, serde_json::Error>>,
+    ) -> eyre::Result<()> {
+        let event = event.ok_or(eyre!("Failed to process UnitActivated event: got None"))??;
+
+        let log = serde_json::from_value::<Log>(event.clone()).map_err(|err| {
+            tracing::error!(target: "chain-listener", "Failed to parse UnitActivated event: {err}, data: {event}");
+            err
+        })?;
+
+        let unit_event = parse_log::<UnitActivated>(log)?;
+        tracing::info!(target: "chain-listener",
+            "Received UnitActivated event for unit: {}, startEpoch: {}",
+            unit_event.unitId,
+            unit_event.startEpoch
+        );
+
+        self.cc_compute_units.insert(
+            CUID::new(unit_event.unitId.0),
+            ComputeUnit {
+                id: unit_event.unitId,
+                deal: Address::ZERO,
+                startEpoch: unit_event.startEpoch,
+            },
+        );
+
+        self.refresh_commitment().await?;
+        Ok(())
+    }
+
+    /// Unit goes to Deal
+    async fn process_unit_deactivated(
+        &mut self,
+        event: Option<Result<JsonValue, serde_json::Error>>,
+    ) -> eyre::Result<()> {
+        let event = event.ok_or(eyre!("Failed to process UnitDeactivated event: got None"))??;
+        let log = serde_json::from_value::<Log>(event.clone()).map_err(|err| {
+            tracing::error!(target: "chain-listener", "Failed to parse UnitDeactivated event: {err}, data: {event}");
+            err
+        })?;
+        let unit_event = parse_log::<UnitDeactivated>(log)?;
+        let unit_id = CUID::new(unit_event.unitId.0);
+        tracing::info!(target: "chain-listener",
+            "Received UnitDeactivated event for unit: {}",
+            unit_event.unitId.to_string()
+        );
+        self.cc_compute_units.remove(&unit_id);
+        self.refresh_commitment().await?;
+        self.acquire_core_for_deal(unit_id)?;
+        Ok(())
+    }
+
+    fn process_unit_matched(
+        &mut self,
+        event: Option<Result<JsonValue, serde_json::Error>>,
+    ) -> eyre::Result<()> {
+        let event = event.ok_or(eyre!("Failed to process DealMatched event: got None"))??;
+        let log = serde_json::from_value::<Log>(event.clone()).map_err(|err| {
+            tracing::error!(target: "chain-listener", "Failed to parse DealMatched event: {err}, data: {event}");
+            err
+        })?;
+        let deal_event = parse_log::<ComputeUnitMatched>(log)?;
+        tracing::info!(target: "chain-listener",
+            "Received DealMatched event for deal: {}",
+            deal_event.deal
+        );
+
+        self.active_deals.insert(
+            deal_event.deal.to_string().into(),
+            CUID::new(deal_event.unitId.0),
+        );
+        Ok(())
+    }
+
+    fn get_cu_groups(&self) -> CUGroups {
+        let mut priority_units: Vec<CUID> = Vec::new();
+        let mut non_priority_units: Vec<CUID> = Vec::new();
+        let mut pending_units: Vec<CUID> = Vec::new();
+        let mut finished_units: Vec<CUID> = Vec::new();
+        for (cuid, cu) in &self.cc_compute_units {
+            if cu.startEpoch <= self.current_epoch {
+                let count = self.proof_tracker.get_proof_counter(&cuid);
+                if count < self.min_proofs_per_epoch {
+                    priority_units.push(*cuid)
+                } else if count >= self.max_proofs_per_epoch {
+                    finished_units.push(*cuid)
+                } else {
+                    non_priority_units.push(*cuid)
+                }
+            } else {
+                pending_units.push(*cuid);
+            }
+        }
+        CUGroups {
+            priority_units,
+            non_priority_units,
+            pending_units,
+            finished_units,
+        }
+    }
+
+    /// Send GlobalNonce, Difficulty and Core<>CUID mapping (full commitment info) to CCP
+    async fn refresh_commitment(&self) -> eyre::Result<()> {
+        if self.cc_compute_units.is_empty() || self.current_commitment.is_none() {
+            self.stop_commitment().await?;
+            return Ok(());
+        }
+
+        if self.active_units_count() == 0 {
+            tracing::info!(target: "chain-listener", "No active units found in this epoch {}", self.current_epoch);
+            self.stop_commitment().await?;
+            return Ok(());
+        }
+
+        tracing::info!(target: "chain-listener",
+            "Refreshing commitment, active compute units: {}",
+            self.cc_compute_units
+                .keys()
+                .map(CUID::to_string)
+                .collect::<Vec<_>>()
+                .join(", ")
+        );
+        tracing::info!(target: "chain-listener", "Global nonce: {}", self.global_nonce);
+        tracing::info!(target: "chain-listener", "Difficulty: {}", self.difficulty);
+
+        let ccp_client = match &self.ccp_client {
+            Some(ccp_client) => ccp_client,
+            None => return Ok(()),
+        };
+
+        let cu_groups = self.get_cu_groups();
+        tracing::trace!(target: "chain-listener", "cu_groups {:?}", cu_groups);
+
+        let cc_cores = self.acquire_cores_for_cc(&cu_groups)?;
+        tracing::trace!(target: "chain-listener", "cc_cores {:?}", cc_cores);
+
+        let mut cu_allocation: HashMap<PhysicalCoreId, CUID> = HashMap::new();
+
+        if cu_groups.all_min_proofs_found() {
+            tracing::info!(target: "chain-listener", "All CUs found minimal number of proofs {} in current epoch {}", self.min_proofs_per_epoch, self.current_epoch);
+            if cu_groups.all_max_proofs_found() {
+                tracing::info!(target: "chain-listener", "All CUs found max number of proofs {} in current epoch {}", self.max_proofs_per_epoch ,self.current_epoch);
+                self.stop_commitment().await?;
+                return Ok(());
+            } else {
+                // All CUs were proven, now let's work on submitting proofs for every CU until MAX_PROOF_COUNT is reached
+                let non_priority_cores_mapping = cc_cores
+                    .non_priority_cores
+                    .iter()
+                    .cloned()
+                    .zip(cu_groups.non_priority_units.iter().cloned());
+                cu_allocation.extend(non_priority_cores_mapping);
+
+                // Assign "pending cores" to help generate proofs for "non priority units"
+                let mut non_priority_units = cu_groups.non_priority_units.iter().cycle();
+                cc_cores.pending_cores.iter().for_each(|core| {
+                    if let Some(non_priority_unit) = non_priority_units.next() {
+                        cu_allocation.insert(*core, *non_priority_unit);
+                    }
+                });
+            }
+        } else {
+            // Use assigned cores to calculate proofs for CUs who haven't reached MIN_PROOF_COUNT yet
+            let priority_cores_mapping = cc_cores
+                .priority_cores
+                .iter()
+                .zip(cu_groups.priority_units.iter());
+            cu_allocation.extend(priority_cores_mapping);
+
+            // Use all spare cores to help CUs to reach MIN_PROOF_COUNT
+            let spare_cores: BTreeSet<_> = cc_cores
+                .non_priority_cores
+                .into_iter()
+                .chain(cc_cores.pending_cores.into_iter())
+                .chain(cc_cores.finished_cores.into_iter())
+                .collect();
+
+            let mut units = cu_groups.priority_units.iter().cycle();
+            spare_cores.iter().for_each(|core| {
+                if let Some(unit) = units.next() {
+                    cu_allocation.insert(*core, *unit);
+                }
+            });
+        }
+
+        tracing::info!(target: "chain-listener",
+            "Sending commitment to CCP: global_nonce: {}, difficulty: {}, cores: {:?}",
+            self.global_nonce,
+            self.difficulty,
+            cu_allocation.iter().map(|(core, unit)| format!("{}: {}", core, unit))
+            .collect::<Vec<_>>()
+        );
+
+        measured_request(
+            &self.metrics,
+            ccp_client.on_active_commitment(self.global_nonce, self.difficulty, cu_allocation),
+        )
+        .await
+        .map_err(|err| {
+            tracing::error!(target: "chain-listener", "Failed to send commitment to CCP: {err}");
+            eyre::eyre!("Failed to send commitment to CCP: {err}")
+        })?;
+
+        Ok(())
+    }
+
+    fn acquire_cores_for_cc(&self, cu_groups: &CUGroups) -> eyre::Result<PhysicalCoreGroups> {
+        let mut units = vec![];
+        units.extend(&cu_groups.priority_units);
+        units.extend(&cu_groups.non_priority_units);
+        units.extend(&cu_groups.pending_units);
+        units.extend(&cu_groups.finished_units);
+
+        // Release all ccp units to allow the core distributor to assign them again
+        // without that action availability count will be wrong
+        self.core_distributor.release_worker_cores(&units);
+
+        let cores = self
+            .core_distributor
+            .acquire_worker_cores(AcquireRequest::new(
+                units.to_vec(),
+                WorkType::CapacityCommitment,
+            ));
+
+        fn filter(units: &[CUID], assignment: &Assignment) -> Vec<PhysicalCoreId> {
+            units
+                .iter()
+                .filter_map(|cuid| {
+                    assignment
+                        .cuid_cores
+                        .get(cuid)
+                        .map(|data| data.physical_core_id)
+                })
+                .collect()
+        }
+
+        match cores {
+            Ok(assignment) => {
+                let priority_units = filter(&cu_groups.priority_units, &assignment);
+                let non_priority_units = filter(&cu_groups.non_priority_units, &assignment);
+                let pending_units = filter(&cu_groups.pending_units, &assignment);
+                let finished_units = filter(&cu_groups.finished_units, &assignment);
+
+                Ok(PhysicalCoreGroups {
+                    priority_cores: priority_units,
+                    non_priority_cores: non_priority_units,
+                    pending_cores: pending_units,
+                    finished_cores: finished_units,
+                })
+            }
+            Err(AcquireError::NotFoundAvailableCores {
+                required,
+                available,
+                ..
+            }) => {
+                tracing::warn!(target: "chain-listener", "Found {required} CUs in the Capacity Commitment, but Nox has only {available} Cores available for CC");
+                let assign_units = units.iter().take(available).cloned().collect();
+                let assignment =
+                    self.core_distributor
+                        .acquire_worker_cores(AcquireRequest::new(
+                            assign_units,
+                            WorkType::CapacityCommitment,
+                        ))?;
+                let priority_cores = filter(&cu_groups.priority_units, &assignment);
+                let non_priority_cores = filter(&cu_groups.non_priority_units, &assignment);
+                let pending_cores = filter(&cu_groups.pending_units, &assignment);
+                let finished_cores = filter(&cu_groups.finished_units, &assignment);
+
+                Ok(PhysicalCoreGroups {
+                    priority_cores,
+                    non_priority_cores,
+                    pending_cores,
+                    finished_cores,
+                })
+            }
+        }
+    }
+
+    fn acquire_core_for_deal(&self, unit_id: CUID) -> eyre::Result<()> {
+        self.core_distributor
+            .acquire_worker_cores(AcquireRequest::new(vec![unit_id], WorkType::Deal))?;
+        Ok(())
+    }
+
+    /// Should be called only if Commitment is Inactive, Failed, Removed or not exists
+    async fn reset_commitment(&mut self) -> eyre::Result<()> {
+        self.cc_compute_units.clear();
+        self.active_deals.clear();
+        self.current_commitment = None;
+        self.stop_commitment().await?;
+        Ok(())
+    }
+
+    async fn stop_commitment(&self) -> eyre::Result<()> {
+        tracing::info!(target: "chain-listener", "Stopping current commitment");
+        if let Some(ref ccp_client) = self.ccp_client {
+            measured_request(&self.metrics,
+                ccp_client.on_no_active_commitment()
+            ).await.map_err(|err| {
+                tracing::error!(target: "chain-listener", "Failed to send no active commitment to CCP: {err}");
+                eyre::eyre!("Failed to send no active commitment to CCP: {err}")
+            })?;
+        }
+        Ok(())
+    }
+
+    /// Submit Mocked Proofs for all active compute units.
+    /// Mocked Proof has result_hash == difficulty and random local_nonce
+    async fn submit_mocked_proofs(&mut self) -> eyre::Result<()> {
+        if self.current_commitment.is_none() {
+            return Ok(());
+        }
+
+        let all_compute_units = self.cc_compute_units.keys().cloned().collect::<Vec<_>>();
+        let mut units = vec![];
+        let mut local_nonces = vec![];
+        let mut result_hashes = vec![];
+        for cuid in all_compute_units.into_iter() {
+            let proof_sent = self.proof_tracker.get_proof_counter(&cuid);
+            if proof_sent < self.max_proofs_per_epoch {
+                units.push(cuid);
+                local_nonces.push(LocalNonce::random());
+                result_hashes.push(ResultHash::from_slice(*self.difficulty.as_ref()));
+            }
+        }
+
+        self.submit_proofs(units, local_nonces, result_hashes)
+            .await?;
+        Ok(())
+    }
+
+    async fn update_global_nonce(&mut self) -> eyre::Result<()> {
+        let nonce = self.chain_connector.get_global_nonce().await?;
+        let nonce_changed = self.set_global_nonce(nonce).await;
+        if nonce_changed {
+            self.refresh_commitment().await?;
+        }
+        Ok(())
+    }
+
+    fn is_epoch_ending(&self) -> bool {
+        let window = Uint::from(self.listener_config.epoch_end_window.as_secs());
+        let next_epoch_start =
+            self.init_timestamp + self.epoch_duration * (self.current_epoch + Uint::from(1));
+        next_epoch_start - self.last_observed_block_timestamp < window
+    }
+
+    async fn poll_proofs(&mut self) -> eyre::Result<()> {
+        if self.current_commitment.is_none() || self.cc_compute_units.is_empty() {
+            return Ok(());
+        }
+
+        if let Some(ref ccp_client) = self.ccp_client {
+            let batch_requests = self.get_batch_request();
+
+            let proof_batches = if self.is_epoch_ending() {
+                let last_known_proofs = batch_requests
+                    .into_iter()
+                    .map(|(cu_id, req)| (cu_id, req.last_seen_proof_idx))
+                    .collect();
+
+                tracing::debug!(target: "chain-listener", "Polling proofs after {:?}", last_known_proofs);
+                measured_request(
+                    &self.metrics,
+                    ccp_client.get_proofs_after(last_known_proofs, PROOF_POLL_LIMIT),
+                )
+                .await
+                .map_err(|err| eyre::eyre!("Failed to poll proofs from ccp: {err}"))?
+            } else {
+                tracing::debug!(target: "chain-listener", "Polling proofs after {:?}, min batch count: {}, max batch count: {}", batch_requests, self.listener_config.min_batch_count, self.listener_config.max_batch_count);
+                measured_request(
+                    &self.metrics,
+                    ccp_client.get_batch_proofs_after(
+                        batch_requests,
+                        self.listener_config.min_batch_count,
+                        self.listener_config.max_batch_count,
+                    ),
+                )
+                .await
+                .map_err(|err| eyre::eyre!("Failed to poll batched proofs from ccp: {err}"))?
+            };
+
+            // TODO: maybe filter out proofs that are not related to current epoch
+            // // Filter proofs related to current epoch only
+            // let proof_batches: Vec<BatchResponse> = proofs
+            //     .into_iter()
+            //     .for_each(move |p| {
+            //         p.proof_batches
+            //             .into_iter()
+            //             .filter(|p| p.id.global_nonce == self.global_nonce)
+            //             .collect()
+            //     })
+            //     .collect();
+
+            if !proof_batches.is_empty() {
+                let total_proofs = proof_batches
+                    .iter()
+                    .map(|p| p.proof_batches.len())
+                    .sum::<usize>();
+                tracing::info!(target: "chain-listener", "Found {} proofs in {} batches from polling", total_proofs, proof_batches.len());
+
+                let mut unit_ids = Vec::new();
+                let mut local_nonces = Vec::new();
+                let mut result_hashes = Vec::new();
+                for batch in proof_batches.into_iter() {
+                    for proof in batch.proof_batches.into_iter() {
+                        unit_ids.push(proof.cu_id);
+                        local_nonces.push(proof.local_nonce);
+                        result_hashes.push(proof.result_hash);
+                        self.proof_tracker
+                            .observe_proof(proof.cu_id, proof.id.idx)
+                            .await;
+                    }
+                }
+
+                self.submit_proofs(unit_ids, local_nonces, result_hashes)
+                    .await?;
+            } else {
+                tracing::debug!(target: "chain-listener", "No proofs found from polling");
+            }
+        }
+        Ok(())
+    }
+
+    async fn submit_proofs(
+        &mut self,
+        unit_ids: Vec<CUID>,
+        local_nonces: Vec<LocalNonce>,
+        result_hashes: Vec<ResultHash>,
+    ) -> eyre::Result<()> {
+        let submit = retry(ExponentialBackoff::default(), || async {
+            self.chain_connector.submit_proofs(unit_ids.clone(), local_nonces.clone(), result_hashes.clone()).await.map_err(|err| {
+                match err {
+                    ConnectorError::RpcCallError { .. } => { Permanent(err) }
+                   _ => {
+                        tracing::warn!(target: "chain-listener", "Failed to submit proof: {err}. Retrying..");
+                        backoff::Error::transient(err)
+                    }
+                }
+            })
+        })
+        .await;
+
+        match submit {
+            Err(err) => {
+                match err {
+                    ConnectorError::RpcCallError { ref data, .. } => {
+                        // TODO: track proofs count per epoch and stop at maxProofsPerEpoch
+                        if is_too_many_proofs(data) {
+                            tracing::info!(target: "chain-listener", "Too many proofs found for some compute unit" );
+
+                            // NOTE: it should be removed from contracts
+
+                            Ok(())
+                        } else if is_commitment_not_active(data) {
+                            tracing::info!(target: "chain-listener", "Submit proof returned commitment is not active error");
+                            let status = self.get_commitment_status().await?;
+                            if let Some(status) = status {
+                                tracing::info!(target: "chain-listener", "Current commitment status: {status:?}");
+                            }
+
+                            self.reset_commitment().await?;
+                            Ok(())
+                        } else {
+                            // TODO: catch more contract asserts like "Proof is not valid" and "Proof is bigger than difficulty"
+                            tracing::error!(target: "chain-listener", "Failed to submit proofs {}", err.to_string().replace("\n", " "));
+                            tracing::error!(target: "chain-listener", "Units {:?} nonces {:?} result hashes {:?}", unit_ids, local_nonces, result_hashes);
+                            // In case of contract errors we just skip these proofs and continue
+                            Ok(())
+                        }
+                    }
+                    _ => {
+                        tracing::error!(target: "chain-listener", "Failed to submit proof: {err}");
+                        tracing::error!(target: "chain-listener", "Units {:?} nonces {:?} result hashes {:?}", unit_ids, local_nonces, result_hashes);
+                        self.observe(|m| m.observe_proof_failed());
+                        Err(err.into())
+                    }
+                }
+            }
+            Ok(tx_id) => {
+                tracing::info!(target: "chain-listener", "Successfully submitted {} proofs, txHash: {tx_id}", unit_ids.len());
+                self.pending_proof_txs.push((tx_id, unit_ids));
+                self.observe(|m| m.observe_proof_submitted());
+
+                Ok(())
+            }
+        }
+    }
+
+    async fn poll_deal_statuses(&mut self) -> eyre::Result<()> {
+        if self.active_deals.is_empty() {
+            return Ok(());
+        }
+
+        let statuses = retry(ExponentialBackoff::default(), || async {
+            let s = self.chain_connector.get_deal_statuses(self.active_deals.keys().cloned().collect()).await.map_err(|err| {
+                tracing::warn!(target: "chain-listener", "Failed to poll deal statuses: {err}; Retrying...");
+                eyre!("Failed to poll deal statuses: {err}; Retrying...")
+            })?;
+
+            Ok(s)
+        })
+        .await?;
+
+        for (status, (deal_id, cu_id)) in statuses
+            .into_iter()
+            .zip(self.active_deals.clone().into_iter())
+        {
+            match status {
+                Ok(status) => match status {
+                    Deal::Status::INSUFFICIENT_FUNDS | Deal::Status::ENDED => {
+                        tracing::info!(target: "chain-listener", "Deal {deal_id} status: {status:?}; Exiting...");
+                        self.exit_deal(&deal_id, cu_id).await?;
+                        tracing::info!(target: "chain-listener", "Exited deal {deal_id} successfully");
+                    }
+                    _ => {}
+                },
+                Err(err) => {
+                    tracing::error!(target: "chain-listener", "Failed to get deal status for {deal_id}: {err}");
+                }
+            }
+        }
+
+        Ok(())
+    }
+
+    async fn exit_deal(&mut self, deal_id: &DealId, cu_id: CUID) -> eyre::Result<()> {
+        let backoff = ExponentialBackoff {
+            max_elapsed_time: Some(Duration::from_secs(3)),
+            ..ExponentialBackoff::default()
+        };
+
+        retry(backoff, || async {
+            self.chain_connector.exit_deal(&cu_id).await.map_err(|err| {
+                tracing::warn!(target: "chain-listener", "Failed to exit deal {deal_id}: {err}");
+                eyre!("Failed to exit deal {deal_id}: {err}; Retrying...")
+            })?;
+            Ok(())
+        })
+        .await?;
+
+        self.active_deals.remove(deal_id);
+        Ok(())
+    }
+
+    async fn poll_pending_proof_txs(&mut self) -> eyre::Result<()> {
+        if self.pending_proof_txs.is_empty() {
+            return Ok(());
+        }
+
+        let statuses = retry(ExponentialBackoff::default(), || async {
+            let txs = self.pending_proof_txs.iter().map(|(tx, _)| tx).cloned().collect();
+            let s = self.chain_connector.get_tx_statuses(txs).await.map_err(|err| {
+                tracing::warn!(target: "chain-listener", "Failed to poll pending proof txs statuses: {err}");
+                eyre!("Failed to poll pending proof txs statuses: {err}; Retrying...")
+            })?;
+
+            Ok(s)
+        })
+            .await?;
+
+        let mut refresh_neeeded = false;
+        let mut stats_updated = false;
+        for (status, (tx_hash, cu_ids)) in statuses
+            .into_iter()
+            .zip(self.pending_proof_txs.clone().into_iter())
+        {
+            match status {
+                Ok(Some(status)) => {
+                    if status {
+                        tracing::info!(target: "chain-listener", "Proof tx {tx_hash} confirmed");
+                        stats_updated = true;
+                        for cu_id in cu_ids {
+                            let counter = self.proof_tracker.confirm_proof(cu_id).await;
+
+                            if counter == self.max_proofs_per_epoch {
+                                tracing::info!(target: "chain-listener", "Compute unit {cu_id} submitted maximum proofs in the current epoch {}", self.current_epoch);
+                                // need to call refresh commitment to make some cores to help others
+                                refresh_neeeded = true;
+                            } else {
+                                if counter >= self.min_proofs_per_epoch {
+                                    tracing::info!(target: "chain-listener", "Compute unit {cu_id} submitted minimum proofs in the current epoch {}", self.current_epoch);
+                                    // need to call refresh commitment to make some cores to help others
+                                    refresh_neeeded = true;
+                                }
+                            }
+                        }
+                        self.observe(|m| m.observe_proof_tx_success());
+                    } else {
+                        tracing::warn!(target: "chain-listener", "Proof tx {tx_hash} not confirmed");
+                        self.observe(|m| m.observe_proof_tx_failed(tx_hash.to_string()));
+                    }
+
+                    self.pending_proof_txs.retain(|(tx, _)| tx != &tx_hash);
+                }
+                Ok(None) => {
+                    tracing::debug!(target: "chain-listener", "Proof tx {tx_hash} is pending");
+                }
+                Err(err) => {
+                    tracing::debug!(target: "chain-listener", "Failed to get tx receipt for {tx_hash}: {err}");
+                }
+            }
+        }
+
+        if refresh_neeeded {
+            self.refresh_commitment().await?;
+        }
+
+        if stats_updated {
+            tracing::debug!(target: "chain-listener", "Confirmed proofs count: {:?}", self.proof_tracker.get_proof_counters().iter().map(|(cu, count)| format!("{}: {}", cu, count)).collect::<Vec<_>>());
+        }
+
+        Ok(())
+    }
+
+    async fn set_current_epoch(&mut self, epoch_number: U256) {
+        self.current_epoch = epoch_number;
+        self.proof_tracker.set_current_epoch(epoch_number).await;
+    }
+
+    /// Returns true if global nonce was updated
+    async fn set_global_nonce(&mut self, global_nonce: GlobalNonce) -> bool {
+        self.global_nonce = global_nonce;
+        self.proof_tracker.set_global_nonce(global_nonce).await
+    }
+
+    fn observe<F>(&self, f: F)
+    where
+        F: FnOnce(&ChainListenerMetrics),
+    {
+        if let Some(metrics) = self.metrics.as_ref() {
+            f(metrics);
+        }
+    }
+
+    fn active_units_count(&self) -> usize {
+        self.cc_compute_units
+            .iter()
+            .filter(|(_, cu)| cu.startEpoch <= self.current_epoch)
+            .count()
+    }
+    fn get_batch_request(&self) -> HashMap<CUID, BatchRequest> {
+        let mut batch_request = HashMap::new();
+        for cu_id in self.cc_compute_units.keys() {
+            let sent_proofs_count = self.proof_tracker.get_proof_counter(cu_id);
+            let proofs_needed = U64::from(
+                self.max_proofs_per_epoch
+                    .checked_add(-sent_proofs_count)
+                    .unwrap_or(Uint::ZERO),
+            )
+            .as_limbs()[0] as usize;
+
+            if proofs_needed > 0 {
+                let request = BatchRequest {
+                    last_seen_proof_idx: self.proof_tracker.get_last_submitted_proof_id(cu_id),
+                    proof_batch_size: min(proofs_needed, self.listener_config.max_proof_batch_size),
+                };
+
+                batch_request.insert(*cu_id, request);
+            }
+        }
+        batch_request
+    }
+}
+
+// measure the request execution time and store it in the metrics
+async fn measured_request<Fut, R, E>(
+    metrics: &Option<ChainListenerMetrics>,
+    fut: Fut,
+) -> Result<R, E>
+where
+    Fut: Future<Output = Result<R, E>> + Sized,
+{
+    metrics.as_ref().inspect(|m| m.observe_ccp_request());
+    let start = Instant::now();
+    let result = fut.await;
+    let elapsed = start.elapsed();
+    metrics
+        .as_ref()
+        .inspect(|m| m.observe_ccp_reply(elapsed.as_millis() as f64));
+    result
+}
+
\ No newline at end of file diff --git a/src/chain_listener/persistence.rs.html b/src/chain_listener/persistence.rs.html new file mode 100644 index 0000000000..836a9e8be6 --- /dev/null +++ b/src/chain_listener/persistence.rs.html @@ -0,0 +1,253 @@ +persistence.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use alloy_primitives::U256;
+use eyre::Context;
+use hex_utils::serde_as::Hex;
+use serde_with::serde_as;
+use serde_with::DisplayFromStr;
+use std::path::Path;
+
+use crate::proof_tracker::ProofTracker;
+use alloy_serde_macro::{U256_as_String, U256_from_String};
+use ccp_shared::proof::ProofIdx;
+use ccp_shared::types::{GlobalNonce, CUID};
+use serde::{Deserialize, Serialize};
+
+#[serde_as]
+#[derive(Serialize, Deserialize)]
+pub struct PersistedProofTracker {
+    #[serde_as(as = "Vec<(Hex,DisplayFromStr)>")]
+    pub proof_ids: Vec<(CUID, ProofIdx)>,
+    #[serde_as(as = "Vec<(Hex,DisplayFromStr)>")]
+    pub proof_counter: Vec<(CUID, U256)>,
+    #[serde_as(as = "Hex")]
+    pub global_nonce: GlobalNonce,
+    #[serde(
+        serialize_with = "U256_as_String",
+        deserialize_with = "U256_from_String"
+    )]
+    pub epoch: U256,
+}
+
+pub(crate) fn proof_tracker_state_filename() -> String {
+    "proof_tracker.toml".to_string()
+}
+
+pub(crate) async fn persist_proof_tracker(
+    proof_id_dir: &Path,
+    proof_tracker: &ProofTracker,
+) -> eyre::Result<()> {
+    let path = proof_id_dir.join(proof_tracker_state_filename());
+    let bytes = toml_edit::ser::to_vec(&PersistedProofTracker::from(proof_tracker))
+        .map_err(|err| eyre::eyre!("Proof tracker serialization failed {err}"))?;
+    tokio::fs::write(&path, bytes)
+        .await
+        .context(format!("error writing proof id to {}", path.display()))
+}
+
+pub(crate) async fn load_persisted_proof_tracker(
+    proof_tracker_dir: &Path,
+) -> eyre::Result<Option<PersistedProofTracker>> {
+    let path = proof_tracker_dir.join(proof_tracker_state_filename());
+    if path.exists() {
+        let bytes = tokio::fs::read(&path).await.context(format!(
+            "error reading proof tracker state from {}",
+            path.display()
+        ))?;
+        let persisted_proof = toml_edit::de::from_slice(&bytes).context(format!(
+            "error deserializing proof tracker state from {}, content {}",
+            path.display(),
+            String::from_utf8_lossy(&bytes)
+        ))?;
+        Ok(Some(persisted_proof))
+    } else {
+        Ok(None)
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+    use std::str::FromStr;
+    use tempfile::tempdir;
+
+    #[tokio::test]
+    async fn proof_tracker_test() {
+        let dir = tempdir().expect("Could not create temp dir");
+        let mut proof_tracker = ProofTracker::new(dir.path().to_path_buf());
+        let cuid =
+            CUID::from_str("7dcee6bb1c39396de3b19424154ad3996cbdef5f3950022325bb4f651e48fbe0")
+                .unwrap();
+
+        let global_nonce = GlobalNonce::new([1; 32]);
+        let epoch = U256::from(100);
+        let proof_id = ProofIdx::from_str("1").unwrap();
+        proof_tracker.set_current_epoch(epoch).await;
+        proof_tracker.set_global_nonce(global_nonce).await;
+
+        proof_tracker.observe_proof(cuid, proof_id).await;
+
+        proof_tracker.confirm_proof(cuid).await;
+        proof_tracker.confirm_proof(cuid).await;
+
+        let persisted_proof_tracker = load_persisted_proof_tracker(dir.path())
+            .await
+            .unwrap()
+            .unwrap();
+
+        assert_eq!(persisted_proof_tracker.proof_ids.len(), 1);
+        assert_eq!(persisted_proof_tracker.proof_ids[0].0, cuid);
+        assert_eq!(persisted_proof_tracker.proof_ids[0].1, proof_id);
+
+        assert_eq!(persisted_proof_tracker.proof_counter.len(), 1);
+        assert_eq!(persisted_proof_tracker.proof_counter[0].0, cuid);
+        assert_eq!(persisted_proof_tracker.proof_counter[0].1, U256::from(2));
+
+        assert_eq!(persisted_proof_tracker.epoch, epoch);
+        assert_eq!(persisted_proof_tracker.global_nonce, global_nonce);
+    }
+}
+
\ No newline at end of file diff --git a/src/chain_listener/proof_tracker.rs.html b/src/chain_listener/proof_tracker.rs.html new file mode 100644 index 0000000000..049b0f74cd --- /dev/null +++ b/src/chain_listener/proof_tracker.rs.html @@ -0,0 +1,303 @@ +proof_tracker.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use crate::persistence;
+use crate::persistence::PersistedProofTracker;
+use alloy_primitives::{Uint, U256};
+use ccp_shared::proof::ProofIdx;
+use ccp_shared::types::{GlobalNonce, CUID};
+use std::cmp::max;
+use std::collections::{BTreeMap, HashMap};
+use std::ops::Add;
+use std::path::PathBuf;
+
+pub struct ProofTracker {
+    persisted_proof_id_dir: PathBuf,
+    current_epoch: U256,
+    global_nonce: GlobalNonce,
+    proof_counter: BTreeMap<CUID, U256>,
+    last_submitted_proof_ids: HashMap<CUID, ProofIdx>,
+}
+
+impl ProofTracker {
+    pub fn new(persisted_proof_id_dir: PathBuf) -> Self {
+        Self {
+            persisted_proof_id_dir,
+            current_epoch: U256::ZERO,
+            global_nonce: GlobalNonce::new([0; 32]),
+            proof_counter: BTreeMap::new(),
+            last_submitted_proof_ids: HashMap::new(),
+        }
+    }
+
+    pub async fn load_state(&mut self) -> eyre::Result<()> {
+        let persisted_proof_tracker =
+            persistence::load_persisted_proof_tracker(&self.persisted_proof_id_dir).await?;
+
+        if let Some(state) = persisted_proof_tracker {
+            tracing::info!(target: "chain-listener", "Loaded proof tracker state");
+            self.proof_counter = state.proof_counter.into_iter().collect();
+            self.last_submitted_proof_ids = state
+                .proof_ids
+                .into_iter()
+                .collect::<HashMap<CUID, ProofIdx>>();
+            self.global_nonce = state.global_nonce;
+            self.current_epoch = state.epoch;
+        } else {
+            tracing::info!(target: "chain-listener", "No persisted proof tracker state found")
+        }
+
+        Ok(())
+    }
+
+    pub async fn observe_proof(&mut self, cu_id: CUID, proof_id: ProofIdx) {
+        self.last_submitted_proof_ids
+            .entry(cu_id)
+            .and_modify(|id| *id = max(*id, proof_id))
+            .or_insert(proof_id);
+
+        tracing::info!(target: "chain-listener", "Persisted proof id {} for {} on epoch {} nonce {}", proof_id, cu_id, self.current_epoch, self.global_nonce);
+
+        self.persist().await;
+    }
+
+    pub fn get_last_submitted_proof_id(&self, cu_id: &CUID) -> ProofIdx {
+        self.last_submitted_proof_ids
+            .get(cu_id)
+            .copied()
+            .unwrap_or(ProofIdx::zero())
+    }
+
+    pub async fn confirm_proof(&mut self, cu_id: CUID) -> U256 {
+        let cu_proof_counter = self.proof_counter.entry(cu_id).or_insert(Uint::ZERO);
+        *cu_proof_counter = cu_proof_counter.add(Uint::from(1));
+
+        let counter = *cu_proof_counter;
+        self.persist().await;
+
+        counter
+    }
+
+    pub fn get_proof_counter(&self, cu_id: &CUID) -> U256 {
+        self.proof_counter.get(cu_id).copied().unwrap_or(Uint::ZERO)
+    }
+
+    pub fn get_proof_counters(&self) -> BTreeMap<CUID, U256> {
+        self.proof_counter.clone()
+    }
+    pub async fn set_current_epoch(&mut self, epoch_number: U256) {
+        if self.current_epoch != epoch_number {
+            tracing::info!(target: "chain-listener", "Epoch changed, was {}, new epoch number is {epoch_number}", self.current_epoch);
+            self.current_epoch = epoch_number;
+            self.proof_counter.clear();
+            self.persist().await;
+        }
+    }
+
+    /// Returns true if the global nonce has changed
+    pub async fn set_global_nonce(&mut self, global_nonce: GlobalNonce) -> bool {
+        if self.global_nonce != global_nonce {
+            tracing::info!(target: "chain-listener", "Global nonce changed, was {}, new global nonce is {global_nonce}", self.global_nonce);
+            self.global_nonce = global_nonce;
+            tracing::info!(target: "chain-listener", "Resetting proof id counter");
+            self.last_submitted_proof_ids.clear();
+            self.persist().await;
+            true
+        } else {
+            false
+        }
+    }
+
+    async fn persist(&self) {
+        let write = persistence::persist_proof_tracker(&self.persisted_proof_id_dir, &self).await;
+
+        if let Err(err) = write {
+            tracing::warn!(target: "chain-listener", "Failed to persist proof tracker state: {err}");
+        } else {
+            tracing::debug!(target: "chain-listener", "Proof tracker state persisted successfully");
+        }
+    }
+}
+
+impl From<&ProofTracker> for PersistedProofTracker {
+    fn from(tracker: &ProofTracker) -> Self {
+        Self {
+            proof_ids: tracker
+                .last_submitted_proof_ids
+                .clone()
+                .into_iter()
+                .collect(),
+            proof_counter: tracker.proof_counter.clone().into_iter().collect(),
+            global_nonce: tracker.global_nonce.clone(),
+            epoch: tracker.current_epoch.clone(),
+        }
+    }
+}
+
\ No newline at end of file diff --git a/src/chain_listener/types.rs.html b/src/chain_listener/types.rs.html new file mode 100644 index 0000000000..729a819470 --- /dev/null +++ b/src/chain_listener/types.rs.html @@ -0,0 +1,101 @@ +types.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+use ccp_shared::types::{PhysicalCoreId, CUID};
+
+#[derive(Debug)]
+pub struct CUGroups {
+    /// Already started units involved in CC and not having less than MIN_PROOFS_PER_EPOCH proofs in the current epoch
+    pub priority_units: Vec<CUID>,
+    /// Already started units involved in CC and found at least MIN_PROOFS_PER_EPOCH proofs,
+    /// but less that MAX_PROOFS_PER_EPOCH proofs in the current epoch
+    pub non_priority_units: Vec<CUID>,
+    /// Units in CC that is not active yet and can't produce proofs in the current epoch
+    pub pending_units: Vec<CUID>,
+    /// Already started units involved in CC and having more than MAX_PROOFS_PER_EPOCH proofs in the current epoch
+    pub finished_units: Vec<CUID>,
+}
+
+impl CUGroups {
+    pub fn all_min_proofs_found(&self) -> bool {
+        self.priority_units.is_empty()
+    }
+
+    pub fn all_max_proofs_found(&self) -> bool {
+        self.non_priority_units.is_empty()
+    }
+}
+
+#[derive(Debug)]
+pub struct PhysicalCoreGroups {
+    pub priority_cores: Vec<PhysicalCoreId>,
+    pub non_priority_cores: Vec<PhysicalCoreId>,
+    pub pending_cores: Vec<PhysicalCoreId>,
+    pub finished_cores: Vec<PhysicalCoreId>,
+}
+
\ No newline at end of file diff --git a/src/cid_utils/hash.rs.html b/src/cid_utils/hash.rs.html new file mode 100644 index 0000000000..6e52c0f691 --- /dev/null +++ b/src/cid_utils/hash.rs.html @@ -0,0 +1,233 @@ +hash.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use std::borrow::{Borrow, Cow};
+use std::fmt::{Display, Formatter};
+use std::str::FromStr;
+
+use bytes::Bytes;
+use libipld::multihash::{Code, MultihashDigest};
+use libipld::pb::{PbLink, PbNode};
+use libipld::IpldCodec::{DagPb, Raw};
+use libipld::{cid, Cid};
+use quick_protobuf::{MessageWrite, Writer};
+use serde::{de, Deserialize, Deserializer, Serialize, Serializer};
+
+use crate::unixfs::mod_Data::DataType;
+use crate::unixfs::Data as UnixFsMetadata;
+
+/// CHUNK_SIZE is the size of the chunks that we use to split the data into before hashing.
+/// 262144 is the default size used by the go-ipfs implementation.
+/// It should be used everywhere in the Fluence stack to produce the same CIDs.
+const CHUNK_SIZE: usize = 262144;
+
+#[derive(Clone, PartialEq, Eq, Hash, Debug)]
+pub struct Hash(pub Cid);
+
+impl Hash {
+    pub fn new(bytes: &[u8]) -> eyre::Result<Self> {
+        let chunks: Vec<&[u8]> = bytes.chunks(CHUNK_SIZE).collect();
+        let mut links = Vec::new();
+        let mut blocksizes = Vec::new();
+        for chunk in chunks {
+            let digest = Code::Sha2_256.digest(chunk);
+            let cid = Cid::new_v1(Raw.into(), digest);
+            links.push(PbLink {
+                cid,
+                // name for links should be empty, with None it produces results different from go-ipfs
+                name: Some("".to_string()),
+                size: Some(chunk.len() as u64),
+            });
+            blocksizes.push(chunk.len() as u64);
+        }
+
+        if links.len() == 1 {
+            return Ok(Hash(links[0].cid));
+        }
+
+        let metadata = UnixFsMetadata {
+            Type: DataType::File,
+            filesize: Some(bytes.len() as u64),
+            blocksizes,
+            ..Default::default()
+        };
+
+        let mut metadata_bytes = vec![];
+        let mut writer = Writer::new(&mut metadata_bytes);
+        UnixFsMetadata::write_message(&metadata, &mut writer)?;
+
+        let pb_node = PbNode {
+            links,
+            data: Some(Bytes::from(metadata_bytes)),
+        };
+        let digest = Code::Sha2_256.digest(pb_node.into_bytes().borrow());
+        Ok(Hash(Cid::new_v1(DagPb.into(), digest)))
+    }
+
+    pub fn as_bytes(&self) -> Vec<u8> {
+        self.0.to_bytes()
+    }
+
+    pub fn from_string(s: &str) -> Result<Self, cid::Error> {
+        let cid = Cid::from_str(s)?;
+        Ok(Self(cid))
+    }
+}
+
+impl<'de> Deserialize<'de> for Hash {
+    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
+    where
+        D: Deserializer<'de>,
+    {
+        let s = <Cow<'de, str>>::deserialize(deserializer)?;
+        Hash::from_string(s.borrow()).map_err(de::Error::custom)
+    }
+}
+
+impl Serialize for Hash {
+    fn serialize<S>(&self, s: S) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
+    where
+        S: Serializer,
+    {
+        self.0.to_string().serialize(s)
+    }
+}
+
+impl Display for Hash {
+    fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
+        self.0.to_string().fmt(f)
+    }
+}
+
\ No newline at end of file diff --git a/src/cid_utils/lib.rs.html b/src/cid_utils/lib.rs.html new file mode 100644 index 0000000000..055cd8443d --- /dev/null +++ b/src/cid_utils/lib.rs.html @@ -0,0 +1,47 @@ +lib.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+mod hash;
+mod unixfs;
+
+pub use hash::Hash;
+
\ No newline at end of file diff --git a/src/cid_utils/unixfs.rs.html b/src/cid_utils/unixfs.rs.html new file mode 100644 index 0000000000..f0340250b8 --- /dev/null +++ b/src/cid_utils/unixfs.rs.html @@ -0,0 +1,387 @@ +unixfs.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+
// Automatically generated rust module for 'unixfs.proto' file
+
+#![allow(non_snake_case)]
+#![allow(non_upper_case_globals)]
+#![allow(non_camel_case_types)]
+#![allow(unused_imports)]
+#![allow(unknown_lints)]
+#![allow(clippy::all)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+
+
+use std::borrow::Cow;
+use quick_protobuf::{MessageInfo, MessageRead, MessageWrite, BytesReader, Writer, WriterBackend, Result};
+use quick_protobuf::sizeofs::*;
+use super::*;
+
+#[allow(clippy::derive_partial_eq_without_eq)]
+#[derive(Debug, Default, PartialEq, Clone)]
+pub struct Data<'a> {
+    pub Type: mod_Data::DataType,
+    pub Data: Option<Cow<'a, [u8]>>,
+    pub filesize: Option<u64>,
+    pub blocksizes: Vec<u64>,
+    pub hashType: Option<u64>,
+    pub fanout: Option<u64>,
+    pub mode: Option<u32>,
+    pub mtime: Option<UnixTime>,
+}
+
+impl<'a> MessageRead<'a> for Data<'a> {
+    fn from_reader(r: &mut BytesReader, bytes: &'a [u8]) -> Result<Self> {
+        let mut msg = Self::default();
+        while !r.is_eof() {
+            match r.next_tag(bytes) {
+                Ok(8) => msg.Type = r.read_enum(bytes)?,
+                Ok(18) => msg.Data = Some(r.read_bytes(bytes).map(Cow::Borrowed)?),
+                Ok(24) => msg.filesize = Some(r.read_uint64(bytes)?),
+                Ok(32) => msg.blocksizes.push(r.read_uint64(bytes)?),
+                Ok(40) => msg.hashType = Some(r.read_uint64(bytes)?),
+                Ok(48) => msg.fanout = Some(r.read_uint64(bytes)?),
+                Ok(56) => msg.mode = Some(r.read_uint32(bytes)?),
+                Ok(66) => msg.mtime = Some(r.read_message::<UnixTime>(bytes)?),
+                Ok(t) => { r.read_unknown(bytes, t)?; }
+                Err(e) => return Err(e),
+            }
+        }
+        Ok(msg)
+    }
+}
+
+impl<'a> MessageWrite for Data<'a> {
+    fn get_size(&self) -> usize {
+        0
+        + 1 + sizeof_varint(*(&self.Type) as u64)
+        + self.Data.as_ref().map_or(0, |m| 1 + sizeof_len((m).len()))
+        + self.filesize.as_ref().map_or(0, |m| 1 + sizeof_varint(*(m) as u64))
+        + self.blocksizes.iter().map(|s| 1 + sizeof_varint(*(s) as u64)).sum::<usize>()
+        + self.hashType.as_ref().map_or(0, |m| 1 + sizeof_varint(*(m) as u64))
+        + self.fanout.as_ref().map_or(0, |m| 1 + sizeof_varint(*(m) as u64))
+        + self.mode.as_ref().map_or(0, |m| 1 + sizeof_varint(*(m) as u64))
+        + self.mtime.as_ref().map_or(0, |m| 1 + sizeof_len((m).get_size()))
+    }
+
+    fn write_message<W: WriterBackend>(&self, w: &mut Writer<W>) -> Result<()> {
+        w.write_with_tag(8, |w| w.write_enum(*&self.Type as i32))?;
+        if let Some(ref s) = self.Data { w.write_with_tag(18, |w| w.write_bytes(&**s))?; }
+        if let Some(ref s) = self.filesize { w.write_with_tag(24, |w| w.write_uint64(*s))?; }
+        for s in &self.blocksizes { w.write_with_tag(32, |w| w.write_uint64(*s))?; }
+        if let Some(ref s) = self.hashType { w.write_with_tag(40, |w| w.write_uint64(*s))?; }
+        if let Some(ref s) = self.fanout { w.write_with_tag(48, |w| w.write_uint64(*s))?; }
+        if let Some(ref s) = self.mode { w.write_with_tag(56, |w| w.write_uint32(*s))?; }
+        if let Some(ref s) = self.mtime { w.write_with_tag(66, |w| w.write_message(s))?; }
+        Ok(())
+    }
+}
+
+pub mod mod_Data {
+
+
+#[derive(Debug, PartialEq, Eq, Clone, Copy)]
+pub enum DataType {
+    Raw = 0,
+    Directory = 1,
+    File = 2,
+    Metadata = 3,
+    Symlink = 4,
+    HAMTShard = 5,
+}
+
+impl Default for DataType {
+    fn default() -> Self {
+        DataType::Raw
+    }
+}
+
+impl From<i32> for DataType {
+    fn from(i: i32) -> Self {
+        match i {
+            0 => DataType::Raw,
+            1 => DataType::Directory,
+            2 => DataType::File,
+            3 => DataType::Metadata,
+            4 => DataType::Symlink,
+            5 => DataType::HAMTShard,
+            _ => Self::default(),
+        }
+    }
+}
+
+impl<'a> From<&'a str> for DataType {
+    fn from(s: &'a str) -> Self {
+        match s {
+            "Raw" => DataType::Raw,
+            "Directory" => DataType::Directory,
+            "File" => DataType::File,
+            "Metadata" => DataType::Metadata,
+            "Symlink" => DataType::Symlink,
+            "HAMTShard" => DataType::HAMTShard,
+            _ => Self::default(),
+        }
+    }
+}
+
+}
+
+#[allow(clippy::derive_partial_eq_without_eq)]
+#[derive(Debug, Default, PartialEq, Clone)]
+pub struct Metadata<'a> {
+    pub MimeType: Option<Cow<'a, str>>,
+}
+
+impl<'a> MessageRead<'a> for Metadata<'a> {
+    fn from_reader(r: &mut BytesReader, bytes: &'a [u8]) -> Result<Self> {
+        let mut msg = Self::default();
+        while !r.is_eof() {
+            match r.next_tag(bytes) {
+                Ok(10) => msg.MimeType = Some(r.read_string(bytes).map(Cow::Borrowed)?),
+                Ok(t) => { r.read_unknown(bytes, t)?; }
+                Err(e) => return Err(e),
+            }
+        }
+        Ok(msg)
+    }
+}
+
+impl<'a> MessageWrite for Metadata<'a> {
+    fn get_size(&self) -> usize {
+        0
+        + self.MimeType.as_ref().map_or(0, |m| 1 + sizeof_len((m).len()))
+    }
+
+    fn write_message<W: WriterBackend>(&self, w: &mut Writer<W>) -> Result<()> {
+        if let Some(ref s) = self.MimeType { w.write_with_tag(10, |w| w.write_string(&**s))?; }
+        Ok(())
+    }
+}
+
+#[allow(clippy::derive_partial_eq_without_eq)]
+#[derive(Debug, Default, PartialEq, Clone)]
+pub struct UnixTime {
+    pub Seconds: i64,
+    pub FractionalNanoseconds: Option<u32>,
+}
+
+impl<'a> MessageRead<'a> for UnixTime {
+    fn from_reader(r: &mut BytesReader, bytes: &'a [u8]) -> Result<Self> {
+        let mut msg = Self::default();
+        while !r.is_eof() {
+            match r.next_tag(bytes) {
+                Ok(8) => msg.Seconds = r.read_int64(bytes)?,
+                Ok(21) => msg.FractionalNanoseconds = Some(r.read_fixed32(bytes)?),
+                Ok(t) => { r.read_unknown(bytes, t)?; }
+                Err(e) => return Err(e),
+            }
+        }
+        Ok(msg)
+    }
+}
+
+impl MessageWrite for UnixTime {
+    fn get_size(&self) -> usize {
+        0
+        + 1 + sizeof_varint(*(&self.Seconds) as u64)
+        + self.FractionalNanoseconds.as_ref().map_or(0, |_| 1 + 4)
+    }
+
+    fn write_message<W: WriterBackend>(&self, w: &mut Writer<W>) -> Result<()> {
+        w.write_with_tag(8, |w| w.write_int64(*&self.Seconds))?;
+        if let Some(ref s) = self.FractionalNanoseconds { w.write_with_tag(21, |w| w.write_fixed32(*s))?; }
+        Ok(())
+    }
+}
+
+
\ No newline at end of file diff --git a/src/config_utils/config.rs.html b/src/config_utils/config.rs.html new file mode 100644 index 0000000000..10822d6ca0 --- /dev/null +++ b/src/config_utils/config.rs.html @@ -0,0 +1,109 @@ +config.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+use libp2p_identity::Keypair;
+use libp2p_identity::PeerId;
+use std::path::{Path, PathBuf};
+
+pub fn workdir(base_dir: &Path) -> PathBuf {
+    base_dir.join("workdir")
+}
+
+pub fn modules_dir(base_dir: &Path) -> PathBuf {
+    base_dir.join("modules")
+}
+
+pub fn services_dir(base_dir: &Path) -> PathBuf {
+    base_dir.join("services")
+}
+
+pub fn particles_dir(base_dir: &Path) -> PathBuf {
+    base_dir.join("particles")
+}
+
+pub fn particles_vault_dir(base_dir: &Path) -> PathBuf {
+    particles_dir(base_dir).join("vault")
+}
+
+pub fn particles_anomaly_dir(base_dir: &Path) -> PathBuf {
+    particles_dir(base_dir).join("anomalies")
+}
+
+pub fn blueprint_dir(base_dir: &Path) -> PathBuf {
+    base_dir.join("blueprint")
+}
+
+// TODO: move to fluence-identity crate
+pub fn to_peer_id(kp: &Keypair) -> PeerId {
+    PeerId::from(kp.public())
+}
+
\ No newline at end of file diff --git a/src/config_utils/lib.rs.html b/src/config_utils/lib.rs.html new file mode 100644 index 0000000000..2d75827249 --- /dev/null +++ b/src/config_utils/lib.rs.html @@ -0,0 +1,81 @@ +lib.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+#![warn(rust_2018_idioms)]
+#![deny(
+    dead_code,
+    nonstandard_style,
+    unused_imports,
+    unused_mut,
+    unused_variables,
+    unused_unsafe,
+    unreachable_patterns
+)]
+
+mod config;
+
+pub use config::blueprint_dir;
+pub use config::modules_dir;
+pub use config::particles_anomaly_dir;
+pub use config::particles_dir;
+pub use config::particles_vault_dir;
+pub use config::services_dir;
+pub use config::to_peer_id;
+pub use config::workdir;
+
\ No newline at end of file diff --git a/src/connected_client/api.rs.html b/src/connected_client/api.rs.html new file mode 100644 index 0000000000..2be79170e3 --- /dev/null +++ b/src/connected_client/api.rs.html @@ -0,0 +1,65 @@ +api.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use crate::behaviour::FluenceClientBehaviour;
+use libp2p::PeerId;
+use particle_protocol::Particle;
+
+pub trait ParticleApi {
+    fn send(&mut self, peer_id: PeerId, particle: Particle);
+}
+
+impl ParticleApi for FluenceClientBehaviour {
+    fn send(&mut self, peer_id: PeerId, particle: Particle) {
+        self.call(peer_id, particle)
+    }
+}
+
\ No newline at end of file diff --git a/src/connected_client/behaviour.rs.html b/src/connected_client/behaviour.rs.html new file mode 100644 index 0000000000..9e28f34c45 --- /dev/null +++ b/src/connected_client/behaviour.rs.html @@ -0,0 +1,571 @@ +behaviour.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use std::collections::VecDeque;
+use std::task::{Context, Poll, Waker};
+use std::time::Duration;
+
+use futures::future::BoxFuture;
+use futures::FutureExt;
+use libp2p::core::Endpoint;
+use libp2p::identity::PublicKey;
+use libp2p::swarm::ToSwarm::GenerateEvent;
+use libp2p::swarm::{
+    ConnectionDenied, ConnectionId, DialError, FromSwarm, THandler, THandlerInEvent,
+    THandlerOutEvent,
+};
+use libp2p::{
+    core::{connection::ConnectedPoint, Multiaddr},
+    identify::{Behaviour as Identify, Config as IdentifyConfig},
+    ping::{Behaviour as Ping, Config as PingConfig},
+    swarm::{NetworkBehaviour, NotifyHandler, OneShotHandler, ToSwarm},
+    PeerId,
+};
+use particle_protocol::{HandlerMessage, Particle, ProtocolConfig, PROTOCOL_NAME};
+
+use crate::ClientEvent;
+
+pub type SwarmEventType = ToSwarm<ClientEvent, THandlerInEvent<ClientBehaviour>>;
+
+#[derive(NetworkBehaviour)]
+pub struct FluenceClientBehaviour {
+    client: ClientBehaviour,
+    ping: Ping,
+    identify: Identify,
+}
+
+impl FluenceClientBehaviour {
+    pub fn new(
+        protocol_config: ProtocolConfig,
+        public_key: PublicKey,
+        reconnect_enabled: bool,
+    ) -> Self {
+        let client = ClientBehaviour::new(protocol_config, reconnect_enabled);
+        let identify = Identify::new(IdentifyConfig::new(PROTOCOL_NAME.into(), public_key));
+        let ping = Ping::new(
+            PingConfig::new()
+                .with_interval(Duration::from_secs(5))
+                .with_timeout(Duration::from_secs(60)),
+        );
+        Self {
+            client,
+            ping,
+            identify,
+        }
+    }
+
+    pub fn call(&mut self, peer_id: PeerId, call: Particle) {
+        self.client.events.push_back(ToSwarm::NotifyHandler {
+            event: HandlerMessage::OutParticle(call, <_>::default()),
+            handler: NotifyHandler::Any,
+            peer_id,
+        });
+
+        self.client.wake();
+    }
+}
+
+pub struct ClientBehaviour {
+    protocol_config: ProtocolConfig,
+    events: VecDeque<SwarmEventType>,
+    reconnect: Option<BoxFuture<'static, Vec<Multiaddr>>>,
+    waker: Option<Waker>,
+    reconnect_enabled: bool,
+}
+
+impl ClientBehaviour {
+    pub fn new(protocol_config: ProtocolConfig, reconnect_enabled: bool) -> Self {
+        Self {
+            protocol_config,
+            events: VecDeque::default(),
+            reconnect: None,
+            waker: None,
+            reconnect_enabled,
+        }
+    }
+
+    fn wake(&self) {
+        if let Some(waker) = &self.waker {
+            waker.wake_by_ref()
+        }
+    }
+
+    fn on_connection_established(&mut self, peer_id: &PeerId, cp: &ConnectedPoint) {
+        let multiaddr = match cp {
+            ConnectedPoint::Dialer { address, .. } => address,
+            ConnectedPoint::Listener {
+                send_back_addr,
+                local_addr,
+            } => {
+                log::warn!(
+                    "Someone connected to the client at {:?}. That's strange. {} @ {:?}",
+                    local_addr,
+                    peer_id,
+                    send_back_addr
+                );
+                send_back_addr
+            }
+        };
+
+        self.events
+            .push_back(ToSwarm::GenerateEvent(ClientEvent::NewConnection {
+                peer_id: *peer_id,
+                multiaddr: multiaddr.clone(),
+            }))
+    }
+
+    fn on_dial_failure(&mut self, peer_id: Option<PeerId>, error: &DialError) {
+        if self.reconnect_enabled {
+            log::warn!(
+                "Failed to connect to {:?}: {:?}, reconnecting",
+                peer_id,
+                error
+            );
+
+            if let DialError::Transport(addresses) = error {
+                let addresses = addresses.iter().map(|(a, _)| a.clone()).collect();
+                self.reconnect = async move {
+                    // TODO: move timeout to config
+                    tokio::time::sleep(Duration::from_secs(1)).await;
+                    addresses
+                }
+                .boxed()
+                .into();
+            }
+        } else {
+            log::error!("Failed to connect to {:?}: {:?}", peer_id, error)
+        }
+    }
+
+    fn on_connection_closed(
+        &mut self,
+        peer_id: &PeerId,
+        cp: &ConnectedPoint,
+        remaining_established: usize,
+    ) {
+        if remaining_established != 0 {
+            // not disconnected, we don't care
+            return;
+        }
+
+        match cp {
+            ConnectedPoint::Dialer { address, .. } => {
+                if self.reconnect_enabled {
+                    let address = address.clone();
+                    log::warn!(
+                        "Disconnected from {} @ {:?}, reconnecting",
+                        peer_id,
+                        address
+                    );
+                    self.events.push_front(SwarmEventType::Dial {
+                        opts: address.into(),
+                    });
+                } else {
+                    log::error!("Disconnected from {} @ {:?}", peer_id, address);
+                }
+            }
+            ConnectedPoint::Listener {
+                send_back_addr,
+                local_addr,
+            } => {
+                log::warn!(
+                    "Peer {} @ {:?} disconnected, was connected to {:?}, won't reconnect",
+                    peer_id,
+                    send_back_addr,
+                    local_addr
+                );
+            }
+        }
+    }
+}
+
+impl NetworkBehaviour for ClientBehaviour {
+    type ConnectionHandler = OneShotHandler<ProtocolConfig, HandlerMessage, HandlerMessage>;
+
+    type ToSwarm = ClientEvent;
+
+    fn handle_established_inbound_connection(
+        &mut self,
+        _connection_id: ConnectionId,
+        _peer_id: PeerId,
+        _local_addr: &Multiaddr,
+        _remote_addr: &Multiaddr,
+    ) -> Result<THandler<Self>, ConnectionDenied> {
+        let oneshot_handler: OneShotHandler<ProtocolConfig, HandlerMessage, HandlerMessage> =
+            self.protocol_config.clone().into();
+
+        Ok(oneshot_handler)
+    }
+
+    fn handle_established_outbound_connection(
+        &mut self,
+        _connection_id: ConnectionId,
+        _peer: PeerId,
+        _addr: &Multiaddr,
+        _role_override: Endpoint,
+    ) -> Result<THandler<Self>, ConnectionDenied> {
+        let oneshot_handler: OneShotHandler<ProtocolConfig, HandlerMessage, HandlerMessage> =
+            self.protocol_config.clone().into();
+        Ok(oneshot_handler)
+    }
+
+    fn on_swarm_event(&mut self, event: FromSwarm<'_>) {
+        match event {
+            FromSwarm::ConnectionEstablished(e) => {
+                self.on_connection_established(&e.peer_id, e.endpoint);
+            }
+            FromSwarm::ConnectionClosed(e) => {
+                self.on_connection_closed(&e.peer_id, e.endpoint, e.remaining_established);
+            }
+            FromSwarm::AddressChange(_) => {}
+            FromSwarm::DialFailure(e) => {
+                self.on_dial_failure(e.peer_id, e.error);
+            }
+            FromSwarm::ListenFailure(_) => {}
+            FromSwarm::NewListener(_) => {}
+            FromSwarm::NewListenAddr(_) => {}
+            FromSwarm::ExpiredListenAddr(_) => {}
+            FromSwarm::ListenerError(_) => {}
+            FromSwarm::ListenerClosed(_) => {}
+            FromSwarm::NewExternalAddrCandidate(_) => {}
+            FromSwarm::ExternalAddrExpired(_) => {}
+            FromSwarm::ExternalAddrConfirmed(_) => {}
+            _ => {}
+        }
+    }
+
+    fn on_connection_handler_event(
+        &mut self,
+        peer_id: PeerId,
+        _cid: ConnectionId,
+        event: THandlerOutEvent<Self>,
+    ) {
+        use ClientEvent::Particle;
+
+        if let Ok(HandlerMessage::InParticle(particle)) = event {
+            self.events.push_back(GenerateEvent(Particle {
+                particle,
+                sender: peer_id,
+            }))
+        }
+    }
+
+    fn poll(&mut self, cx: &mut Context<'_>) -> Poll<SwarmEventType> {
+        self.waker = Some(cx.waker().clone());
+
+        if let Some(Poll::Ready(addresses)) = self.reconnect.as_mut().map(|r| r.poll_unpin(cx)) {
+            self.reconnect = None;
+            for addr in addresses {
+                self.events.push_front(ToSwarm::Dial { opts: addr.into() });
+            }
+        }
+
+        if let Some(event) = self.events.pop_front() {
+            return Poll::Ready(event);
+        }
+
+        Poll::Pending
+    }
+}
+
\ No newline at end of file diff --git a/src/connected_client/client.rs.html b/src/connected_client/client.rs.html new file mode 100644 index 0000000000..d80cc8f82d --- /dev/null +++ b/src/connected_client/client.rs.html @@ -0,0 +1,463 @@ +client.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use std::{error::Error, time::Duration};
+
+use derivative::Derivative;
+use fluence_keypair::{KeyPair, Signature};
+use futures::stream::StreamExt;
+use libp2p::core::Multiaddr;
+use libp2p::swarm::SwarmEvent;
+use libp2p::{PeerId, Swarm, SwarmBuilder};
+use tokio::sync::mpsc::error::SendError;
+use tokio::sync::{mpsc, oneshot};
+use tokio::{select, task, task::JoinHandle};
+
+use fluence_libp2p::{build_transport, Transport};
+use particle_protocol::{Particle, ProtocolConfig};
+
+use crate::api::ParticleApi;
+use crate::behaviour::FluenceClientBehaviourEvent;
+use crate::{behaviour::FluenceClientBehaviour, ClientEvent};
+
+#[derive(Debug)]
+struct Command {
+    node: PeerId,
+    particle: Particle,
+}
+
+#[derive(Derivative)]
+#[derivative(Debug)]
+pub struct Client {
+    #[derivative(Debug = "ignore")]
+    pub key_pair: KeyPair,
+    pub peer_id: PeerId,
+    /// Channel to send commands to node
+    relay_outlet: mpsc::Sender<Command>,
+    /// Stream of messages received from node
+    client_inlet: mpsc::Receiver<ClientEvent>,
+    stop_outlet: oneshot::Sender<()>,
+    pub(crate) fetched: Vec<Particle>,
+}
+
+impl Client {
+    fn new(
+        relay_outlet: mpsc::Sender<Command>,
+        client_inlet: mpsc::Receiver<ClientEvent>,
+        stop_outlet: oneshot::Sender<()>,
+        key_pair: Option<KeyPair>,
+    ) -> Self {
+        let key = key_pair.unwrap_or_else(KeyPair::generate_ed25519);
+        let peer_id = key.get_peer_id();
+
+        Client {
+            key_pair: key,
+            peer_id,
+            relay_outlet,
+            client_inlet,
+            stop_outlet,
+            fetched: vec![],
+        }
+    }
+
+    pub async fn send(&self, particle: Particle, node: PeerId) {
+        if let Err(err) = self.relay_outlet.send(Command { node, particle }).await {
+            let err_msg = format!("{err:?}");
+            let msg = err;
+            log::warn!("Unable to send msg {:?}: {:?}", msg, err_msg)
+        }
+    }
+
+    pub async fn receive_one(&mut self) -> Option<ClientEvent> {
+        self.client_inlet.recv().await
+    }
+
+    pub fn stop(self) {
+        if self.stop_outlet.send(()).is_err() {
+            log::warn!("Unable to send stop, channel closed")
+        }
+    }
+
+    pub fn sign(&self, bytes: &[u8]) -> Signature {
+        self.key_pair.sign(bytes).expect("signing error")
+    }
+
+    fn dial(
+        &self,
+        node: Multiaddr,
+        transport: Transport,
+        transport_timeout: Duration,
+        idle_connection_timeout: Duration,
+        protocol_config: ProtocolConfig,
+        reconnect_enabled: bool,
+    ) -> Result<Swarm<FluenceClientBehaviour>, Box<dyn Error>> {
+        let mut swarm = {
+            let public_key = self.key_pair.public();
+            let behaviour =
+                FluenceClientBehaviour::new(protocol_config, public_key.into(), reconnect_enabled);
+
+            let kp = self.key_pair.clone().into();
+            let transport = build_transport(transport, &kp, transport_timeout);
+            SwarmBuilder::with_existing_identity(kp)
+                .with_tokio()
+                .with_other_transport(|_| transport)?
+                .with_behaviour(|_| behaviour)?
+                .with_swarm_config(|cfg| cfg.with_idle_connection_timeout(idle_connection_timeout))
+                .build()
+        };
+
+        match Swarm::dial(&mut swarm, node.clone()) {
+            Ok(_) => log::info!("{} dialed to {:?}", self.peer_id, node),
+            Err(e) => {
+                log::error!("Dial to {:?} failed with {:?}", node, e);
+                return Err(e.into());
+            }
+        }
+
+        Ok(swarm)
+    }
+
+    pub fn connect(
+        relay: Multiaddr,
+        transport_timeout: Duration,
+        idle_connection_timeout: Duration,
+    ) -> Result<(Client, JoinHandle<()>), Box<dyn Error>> {
+        Self::connect_with(
+            relay,
+            Transport::Network,
+            None,
+            transport_timeout,
+            idle_connection_timeout,
+            true,
+        )
+    }
+
+    pub fn connect_with(
+        relay: Multiaddr,
+        transport: Transport,
+        key_pair: Option<KeyPair>,
+        transport_timeout: Duration,
+        idle_connection_timeout: Duration,
+        reconnect_enabled: bool,
+    ) -> Result<(Client, JoinHandle<()>), Box<dyn Error>> {
+        let (client_outlet, client_inlet) = mpsc::channel(128);
+        let (relay_outlet, mut relay_inlet) = mpsc::channel(128);
+
+        let (stop_outlet, stop_inlet) = oneshot::channel();
+
+        let protocol_config = ProtocolConfig::new(transport_timeout, transport_timeout);
+        let client = Client::new(relay_outlet, client_inlet, stop_outlet, key_pair);
+        let mut swarm = client.dial(
+            relay,
+            transport,
+            transport_timeout,
+            idle_connection_timeout,
+            protocol_config,
+            reconnect_enabled,
+        )?;
+        let mut stop_inlet = Some(stop_inlet);
+
+        let task = task::Builder::new()
+            .name("Client")
+            .spawn(async move {
+                loop {
+                    let stop_inlet = stop_inlet.as_mut().expect("Could not get stop inlet");
+                    select!(
+                        // Messages that were scheduled via client.send() method
+                        to_relay = relay_inlet.recv() => {
+                            if let Some(cmd) = to_relay {
+                                Self::send_to_node(swarm.behaviour_mut(), cmd)
+                            }
+                        },
+
+                        // Messages that were received from relay node
+                        Some(from_relay) = swarm.next() => {
+                            match Self::receive_from_node(from_relay, &client_outlet).await {
+                                Err(err) => {
+                                    let err_msg = format!("{err:?}");
+                                    let msg = err;
+                                    log::warn!("unable to send {:?} to node: {:?}", msg, err_msg);
+                                },
+                                Ok(_v) => {},
+                            }
+                        },
+                        _ = stop_inlet => break,
+                    )
+                }
+            })
+            .expect("Could not spawn task");
+
+        Ok((client, task))
+    }
+
+    fn send_to_node<R: ParticleApi>(swarm: &mut R, cmd: Command) {
+        let Command { node, particle } = cmd;
+        tracing::debug!(
+            particle_id = particle.id,
+            "Sending particle to node {}",
+            node
+        );
+        swarm.send(node, particle)
+    }
+
+    #[allow(clippy::result_large_err)]
+    async fn receive_from_node(
+        msg: SwarmEvent<FluenceClientBehaviourEvent>,
+        client_outlet: &mpsc::Sender<ClientEvent>,
+    ) -> Result<(), SendError<ClientEvent>> {
+        if let SwarmEvent::Behaviour(FluenceClientBehaviourEvent::Client(msg)) = msg {
+            // Message will be available through client.receive_one
+            client_outlet.send(msg).await
+        } else {
+            Ok(())
+        }
+    }
+}
+
\ No newline at end of file diff --git a/src/connected_client/command.rs.html b/src/connected_client/command.rs.html new file mode 100644 index 0000000000..c5156d42d8 --- /dev/null +++ b/src/connected_client/command.rs.html @@ -0,0 +1,73 @@ +command.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use particle_protocol::Particle;
+use serde::{Deserialize, Serialize};
+
+/// Describes commands sent from client to relay node; also see `ToNodeNetworkMsg`
+#[derive(Clone, Debug, Serialize, Deserialize)]
+#[serde(tag = "command")]
+pub enum ClientCommand {
+    Particle { particle: Particle },
+}
+
+impl From<ClientCommand> for Particle {
+    fn from(command: ClientCommand) -> Particle {
+        match command {
+            ClientCommand::Particle { particle } => particle,
+        }
+    }
+}
+
\ No newline at end of file diff --git a/src/connected_client/connected_client.rs.html b/src/connected_client/connected_client.rs.html new file mode 100644 index 0000000000..d470c9eceb --- /dev/null +++ b/src/connected_client/connected_client.rs.html @@ -0,0 +1,835 @@ +connected_client.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use core::ops::Deref;
+use std::sync::Arc;
+use std::{collections::HashMap, ops::DerefMut, time::Duration};
+
+use eyre::Result;
+use eyre::{bail, eyre, WrapErr};
+use fluence_keypair::KeyPair;
+use fluence_libp2p::Transport;
+use libp2p::{core::Multiaddr, PeerId};
+use local_vm::{make_particle, make_vm, read_args, ParticleDataStore};
+use marine_wasmtime_backend::WasmtimeWasmBackend;
+use particle_protocol::Particle;
+use serde_json::{Value as JValue, Value};
+use tempfile::TempDir;
+use test_constants::{
+    IDLE_CONNECTION_TIMEOUT, PARTICLE_TTL, SHORT_TIMEOUT, TIMEOUT, TRANSPORT_TIMEOUT,
+};
+
+use crate::client::Client;
+use crate::event::ClientEvent;
+
+#[allow(clippy::upper_case_acronyms)]
+type AVM = local_vm::AVMRunner<WasmtimeWasmBackend>;
+
+pub struct ConnectedClient {
+    pub client: Client,
+    pub node: PeerId,
+    pub node_address: Multiaddr,
+    pub timeout: Duration,
+    pub short_timeout: Duration,
+    pub local_vm: tokio::sync::OnceCell<tokio::sync::Mutex<AVM>>,
+    pub data_store: Arc<ParticleDataStore>,
+    pub particle_ttl: Duration,
+    pub tmp_dir: TempDir,
+}
+
+impl ConnectedClient {
+    pub fn timeout(&self) -> Duration {
+        self.timeout
+    }
+
+    pub fn short_timeout(&self) -> Duration {
+        self.short_timeout
+    }
+
+    pub fn particle_ttl(&self) -> Duration {
+        self.particle_ttl
+    }
+
+    pub fn set_particle_ttl(&mut self, particle_ttl: Duration) {
+        self.particle_ttl = particle_ttl;
+    }
+}
+
+impl Deref for ConnectedClient {
+    type Target = Client;
+
+    fn deref(&self) -> &Self::Target {
+        &self.client
+    }
+}
+
+impl DerefMut for ConnectedClient {
+    fn deref_mut(&mut self) -> &mut Self::Target {
+        &mut self.client
+    }
+}
+
+impl ConnectedClient {
+    pub async fn connect_to(node_address: Multiaddr) -> Result<Self> {
+        Self::connect_with_keypair(node_address, None).await
+    }
+
+    pub async fn connect_to_with_timeout(
+        node_address: Multiaddr,
+        timeout: Duration,
+        idle_connection_timeout: Duration,
+        particle_ttl: Option<Duration>,
+    ) -> Result<Self> {
+        Self::connect_with_timeout(
+            node_address,
+            None,
+            timeout,
+            idle_connection_timeout,
+            particle_ttl,
+            true,
+        )
+        .await
+    }
+
+    pub async fn connect_with_keypair(
+        node_address: Multiaddr,
+        key_pair: Option<KeyPair>,
+    ) -> Result<Self> {
+        Self::connect_with_timeout(
+            node_address,
+            key_pair,
+            TRANSPORT_TIMEOUT,
+            IDLE_CONNECTION_TIMEOUT,
+            None,
+            true,
+        )
+        .await
+    }
+
+    pub async fn connect_with_timeout(
+        node_address: Multiaddr,
+        key_pair: Option<KeyPair>,
+        timeout: Duration,
+        idle_connection_timeout: Duration,
+        particle_ttl: Option<Duration>,
+        reconnect_enabled: bool,
+    ) -> Result<Self> {
+        use core::result::Result;
+        use std::io::{Error, ErrorKind};
+
+        let transport = Transport::from_maddr(&node_address);
+        let connect = async move {
+            let (mut client, _) = Client::connect_with(
+                node_address.clone(),
+                transport,
+                key_pair.map(Into::into),
+                timeout,
+                idle_connection_timeout,
+                reconnect_enabled,
+            )
+            .expect("sender connected");
+            let result: Result<_, Error> = if let Some(ClientEvent::NewConnection {
+                peer_id, ..
+            }) = client.receive_one().await
+            {
+                Ok(ConnectedClient::new(client, peer_id, node_address, particle_ttl).await)
+            } else {
+                Err(ErrorKind::ConnectionAborted.into())
+            };
+
+            result
+        };
+
+        let result = self::timeout(TIMEOUT, connect).await??;
+
+        Ok(result)
+    }
+
+    pub async fn get_local_vm(&self) -> &tokio::sync::Mutex<AVM> {
+        self.local_vm
+            .get_or_init(|| async {
+                let dir = self.tmp_dir.path();
+                tokio::sync::Mutex::new(make_vm(dir).await)
+            })
+            .await
+    }
+    pub fn get_data_store(&self) -> Arc<ParticleDataStore> {
+        self.data_store.clone()
+    }
+
+    pub async fn new(
+        client: Client,
+        node: PeerId,
+        node_address: Multiaddr,
+        particle_ttl: Option<Duration>,
+    ) -> Self {
+        let local_vm = tokio::sync::OnceCell::const_new();
+        let tmp_dir = tempfile::tempdir().expect("Could not get temp dir");
+
+        let tmp_dir_path = tmp_dir.path();
+
+        let data_store = ParticleDataStore::new(
+            tmp_dir_path.join("particle"),
+            tmp_dir_path.join("vault"),
+            tmp_dir_path.join("anomaly"),
+        );
+
+        data_store
+            .initialize()
+            .await
+            .expect("Could not initialize datastore");
+
+        let data_store = Arc::new(data_store);
+
+        Self {
+            client,
+            node,
+            node_address,
+            timeout: TIMEOUT,
+            short_timeout: SHORT_TIMEOUT,
+            local_vm,
+            data_store,
+            particle_ttl: particle_ttl.unwrap_or(Duration::from_millis(PARTICLE_TTL as u64)),
+            tmp_dir,
+        }
+    }
+
+    pub async fn send(&self, particle: Particle) {
+        tracing::debug!(
+            particle_id = particle.id,
+            "Add a particle to the client send queue"
+        );
+        self.client.send(particle, self.node).await
+    }
+
+    pub async fn send_particle(
+        &mut self,
+        script: impl Into<String>,
+        data: HashMap<&str, JValue>,
+    ) -> String {
+        self.send_particle_ext(script, data, false).await
+    }
+
+    pub async fn execute_particle(
+        &mut self,
+        script: impl Into<String>,
+        data: HashMap<&str, JValue>,
+    ) -> Result<Vec<JValue>> {
+        let particle_id = self.send_particle_ext(script, data, false).await;
+        self.wait_particle_args(particle_id.clone()).await
+    }
+
+    pub async fn send_particle_ext(
+        &mut self,
+        script: impl Into<String>,
+        data: HashMap<&str, JValue>,
+        generated: bool,
+    ) -> String {
+        let data = data
+            .into_iter()
+            .map(|(key, value)| (key.to_string(), value))
+            .collect();
+        let mut guard = self.get_local_vm().await.lock().await;
+        let particle = make_particle(
+            self.peer_id,
+            &data,
+            script.into(),
+            self.node,
+            &mut guard,
+            self.data_store.clone(),
+            generated,
+            self.particle_ttl(),
+            &self.key_pair,
+        )
+        .await;
+        let id = particle.id.clone();
+        self.send(particle).await;
+        id
+    }
+
+    pub async fn maybe_receive(&mut self) -> Option<Particle> {
+        let short_timeout = self.short_timeout();
+        let receive = self.client.receive_one();
+        let particle = timeout(short_timeout, receive).await.ok()??;
+        match particle {
+            ClientEvent::Particle { particle, .. } => Some(particle),
+            _ => None,
+        }
+    }
+
+    pub async fn receive(&mut self) -> Result<Particle> {
+        let head = self.fetched.pop();
+
+        match head {
+            Some(particle) => Ok(particle),
+            None => self.raw_receive().await,
+        }
+    }
+
+    async fn raw_receive(&mut self) -> Result<Particle> {
+        let tout = self.timeout();
+        let result = timeout(tout, async {
+            loop {
+                let result = self.client.receive_one().await;
+                if let Some(ClientEvent::Particle { particle, .. }) = result {
+                    break particle;
+                }
+            }
+        })
+        .await;
+        let result = result.wrap_err("receive particle")?;
+
+        Ok(result)
+    }
+
+    pub async fn receive_args(&mut self) -> Result<Vec<JValue>> {
+        let particle = self.receive().await.wrap_err("receive_args")?;
+        let mut guard = self.get_local_vm().await.lock().await;
+        let result = read_args(
+            particle,
+            self.peer_id,
+            &mut guard,
+            self.data_store.clone(),
+            &self.key_pair,
+        )
+        .await;
+        match result {
+            Some(result) => result.map_err(|args| eyre!("AIR caught an error: {:?}", args)),
+            None => Err(eyre!("Received a particle, but it didn't return anything")),
+        }
+    }
+
+    /// Wait for a particle with specified `particle_id`, and read "op" "return" result from it
+    pub async fn wait_particle_args(
+        &mut self,
+        particle_id: impl AsRef<str>,
+    ) -> Result<Vec<JValue>> {
+        let head = self
+            .fetched
+            .iter()
+            .position(|particle| particle.id == particle_id.as_ref());
+
+        match head {
+            Some(index) => {
+                let particle = self.fetched.remove(index);
+                let mut guard = self.get_local_vm().await.lock().await;
+                let result = read_args(
+                    particle,
+                    self.peer_id,
+                    &mut guard,
+                    self.data_store.clone(),
+                    &self.key_pair,
+                )
+                .await;
+                drop(guard);
+                if let Some(result) = result {
+                    result.map_err(|args| eyre!("AIR caught an error: {:?}", args))
+                } else {
+                    self.raw_wait_particle_args(particle_id).await
+                }
+            }
+            None => self.raw_wait_particle_args(particle_id).await,
+        }
+    }
+
+    async fn raw_wait_particle_args(&mut self, particle_id: impl AsRef<str>) -> Result<Vec<Value>> {
+        let mut max = 100;
+        loop {
+            max -= 1;
+            if max <= 0 {
+                bail!("timed out waiting for particle {}", particle_id.as_ref());
+            }
+            let particle = self.raw_receive().await.ok();
+            if let Some(particle) = particle {
+                if particle.id == particle_id.as_ref() {
+                    let mut guard = self.get_local_vm().await.lock().await;
+                    let result = read_args(
+                        particle,
+                        self.peer_id,
+                        &mut guard,
+                        self.data_store.clone(),
+                        &self.key_pair,
+                    )
+                    .await;
+                    if let Some(result) = result {
+                        break result.map_err(|args| eyre!("AIR caught an error: {:?}", args));
+                    }
+                } else {
+                    self.fetched.push(particle)
+                }
+            }
+        }
+    }
+
+    pub async fn listen_for_n<O: Default, F: Fn(Result<Vec<JValue>, Vec<JValue>>) -> O>(
+        &mut self,
+        mut n: usize,
+        f: F,
+    ) -> O {
+        loop {
+            n -= 1;
+            if n == 0 {
+                return O::default();
+            }
+
+            let particle = self.receive().await.ok();
+            if let Some(particle) = particle {
+                let mut guard = self.get_local_vm().await.lock().await;
+                let args = read_args(
+                    particle,
+                    self.peer_id,
+                    &mut guard,
+                    self.data_store.clone(),
+                    &self.key_pair,
+                )
+                .await;
+                if let Some(args) = args {
+                    return f(args);
+                }
+            }
+        }
+    }
+}
+
+pub async fn timeout<F, T>(dur: Duration, f: F) -> eyre::Result<T>
+where
+    F: std::future::Future<Output = T>,
+{
+    tokio::time::timeout(dur, f)
+        .await
+        .wrap_err(format!("timed out after {dur:?}"))
+}
+
\ No newline at end of file diff --git a/src/connected_client/event.rs.html b/src/connected_client/event.rs.html new file mode 100644 index 0000000000..66623fc417 --- /dev/null +++ b/src/connected_client/event.rs.html @@ -0,0 +1,69 @@ +event.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use libp2p::core::Multiaddr;
+use libp2p::PeerId;
+use particle_protocol::Particle;
+
+#[derive(Debug)]
+pub enum ClientEvent {
+    Particle {
+        sender: PeerId,
+        particle: Particle,
+    },
+    NewConnection {
+        peer_id: PeerId,
+        multiaddr: Multiaddr,
+    },
+}
+
\ No newline at end of file diff --git a/src/connected_client/lib.rs.html b/src/connected_client/lib.rs.html new file mode 100644 index 0000000000..505ce6d821 --- /dev/null +++ b/src/connected_client/lib.rs.html @@ -0,0 +1,85 @@ +lib.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+#![feature(lazy_cell)]
+#![recursion_limit = "512"]
+#![warn(rust_2018_idioms)]
+#![deny(
+    dead_code,
+    nonstandard_style,
+    unused_imports,
+    unused_mut,
+    unused_variables,
+    unused_unsafe,
+    unreachable_patterns
+)]
+
+mod api;
+mod behaviour;
+mod client;
+mod command;
+mod connected_client;
+mod event;
+
+pub use crate::connected_client::ConnectedClient;
+pub use command::ClientCommand;
+pub use event::ClientEvent;
+
\ No newline at end of file diff --git a/src/connection_pool/api.rs.html b/src/connection_pool/api.rs.html new file mode 100644 index 0000000000..536a6595d2 --- /dev/null +++ b/src/connection_pool/api.rs.html @@ -0,0 +1,301 @@ +api.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use std::time::Duration;
+
+use futures::{future::BoxFuture, stream::BoxStream, FutureExt, StreamExt};
+use libp2p::{core::Multiaddr, PeerId};
+use tokio::sync::{mpsc, oneshot};
+use tokio_stream::wrappers::UnboundedReceiverStream;
+
+use particle_protocol::ExtendedParticle;
+use particle_protocol::{Contact, SendStatus};
+
+use crate::connection_pool::LifecycleEvent;
+use crate::ConnectionPoolT;
+
+// marked `pub` to be available in benchmarks
+#[derive(Debug)]
+pub enum Command {
+    Connect {
+        contact: Contact,
+        out: oneshot::Sender<bool>,
+    },
+    Send {
+        to: Contact,
+        particle: ExtendedParticle,
+        out: oneshot::Sender<SendStatus>,
+    },
+    Dial {
+        addr: Multiaddr,
+        out: oneshot::Sender<Option<Contact>>,
+    },
+    Disconnect {
+        peer_id: PeerId,
+        out: oneshot::Sender<bool>,
+    },
+    IsConnected {
+        peer_id: PeerId,
+        out: oneshot::Sender<bool>,
+    },
+    GetContact {
+        peer_id: PeerId,
+        out: oneshot::Sender<Option<Contact>>,
+    },
+
+    CountConnections {
+        out: oneshot::Sender<usize>,
+    },
+    LifecycleEvents {
+        out: mpsc::UnboundedSender<LifecycleEvent>,
+    },
+}
+
+#[derive(Clone, Debug)]
+pub struct ConnectionPoolApi {
+    // TODO: marked as `pub` to be available in benchmarks
+    pub outlet: mpsc::UnboundedSender<Command>,
+    pub send_timeout: Duration,
+}
+
+impl ConnectionPoolApi {
+    fn execute<R, F>(&self, cmd: F) -> BoxFuture<'static, R>
+    where
+        R: Default + Send + Sync + 'static,
+        F: FnOnce(oneshot::Sender<R>) -> Command,
+    {
+        let (out, inlet) = oneshot::channel();
+        if self.outlet.send(cmd(out)).is_err() {
+            return futures::future::ready(R::default()).boxed();
+        }
+        inlet.map(|r| r.unwrap_or_default()).boxed()
+    }
+}
+
+impl ConnectionPoolT for ConnectionPoolApi {
+    fn dial(&self, addr: Multiaddr) -> BoxFuture<'static, Option<Contact>> {
+        // timeout isn't needed because libp2p handles it through inject_dial_failure, etc
+        self.execute(|out| Command::Dial { addr, out })
+    }
+
+    fn connect(&self, contact: Contact) -> BoxFuture<'static, bool> {
+        // timeout isn't needed because libp2p handles it through inject_dial_failure, etc
+        self.execute(|out| Command::Connect { contact, out })
+    }
+
+    fn disconnect(&self, peer_id: PeerId) -> BoxFuture<'static, bool> {
+        // TODO: timeout needed? will be clearer when disconnect is implemented
+        self.execute(|out| Command::Disconnect { peer_id, out })
+    }
+
+    fn is_connected(&self, peer_id: PeerId) -> BoxFuture<'static, bool> {
+        // timeout isn't needed because result is returned immediately
+        self.execute(|out| Command::IsConnected { peer_id, out })
+    }
+
+    fn get_contact(&self, peer_id: PeerId) -> BoxFuture<'static, Option<Contact>> {
+        // timeout isn't needed because result is returned immediately
+        self.execute(|out| Command::GetContact { peer_id, out })
+    }
+
+    fn send(&self, to: Contact, particle: ExtendedParticle) -> BoxFuture<'static, SendStatus> {
+        let fut = self.execute(|out| Command::Send { to, particle, out });
+        // timeout on send is required because libp2p can silently drop outbound events
+        let timeout = self.send_timeout;
+        tokio::time::timeout(self.send_timeout, fut)
+            // convert timeout to false
+            .map(move |r| match r {
+                Ok(status) => status,
+                Err(error) => {
+                    let error = error.into();
+                    SendStatus::TimedOut {
+                        after: timeout,
+                        error,
+                    }
+                }
+            })
+            .boxed()
+    }
+
+    fn count_connections(&self) -> BoxFuture<'static, usize> {
+        // timeout isn't needed because result is returned immediately
+        self.execute(|out| Command::CountConnections { out })
+    }
+
+    fn lifecycle_events(&self) -> BoxStream<'static, LifecycleEvent> {
+        let (out, inlet) = mpsc::unbounded_channel();
+        let cmd = Command::LifecycleEvents { out };
+        if self.outlet.send(cmd).is_err() {
+            return futures::stream::empty().boxed();
+        };
+
+        UnboundedReceiverStream::new(inlet).boxed()
+    }
+}
+
\ No newline at end of file diff --git a/src/connection_pool/behaviour.rs.html b/src/connection_pool/behaviour.rs.html new file mode 100644 index 0000000000..16fda72987 --- /dev/null +++ b/src/connection_pool/behaviour.rs.html @@ -0,0 +1,1415 @@ +behaviour.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use futures::{Sink, StreamExt};
+use libp2p::core::Endpoint;
+use libp2p::swarm::dial_opts::DialOpts;
+use libp2p::swarm::CloseConnection::All;
+use libp2p::swarm::{
+    dial_opts, ConnectionDenied, ConnectionId, DialError, FromSwarm, ListenFailure, THandler,
+    THandlerOutEvent, ToSwarm,
+};
+use libp2p::{
+    core::{ConnectedPoint, Multiaddr},
+    swarm::{NetworkBehaviour, NotifyHandler, OneShotHandler},
+    PeerId,
+};
+use std::pin::Pin;
+use std::{
+    collections::{hash_map::Entry, HashMap, HashSet, VecDeque},
+    task::{Context, Poll, Waker},
+};
+use tokio::sync::{mpsc, oneshot};
+use tokio_stream::wrappers::UnboundedReceiverStream;
+use tokio_util::sync::PollSender;
+
+use crate::connection_pool::LifecycleEvent;
+use crate::{Command, ConnectionPoolApi};
+use fluence_libp2p::remote_multiaddr;
+use particle_protocol::{
+    CompletionChannel, Contact, ExtendedParticle, HandlerMessage, ProtocolConfig, SendStatus,
+};
+use peer_metrics::ConnectionPoolMetrics;
+
+// type SwarmEventType = generate_swarm_event_type!(ConnectionPoolBehaviour);
+
+// TODO: replace with generate_swarm_event_type
+type SwarmEventType = ToSwarm<(), HandlerMessage>;
+
+#[derive(Debug, Default)]
+/// [Peer] is the representation of [Contact] extended with precise connectivity information
+struct Peer {
+    /// Current peer has active connections with that list of addresses
+    connected: HashSet<Multiaddr>,
+    /// Addresses gathered via Identify protocol, but not connected
+    discovered: HashSet<Multiaddr>,
+    /// Dialed but not yet connected addresses
+    dialing: HashSet<Multiaddr>,
+    /// Channels to notify when any dial succeeds or peer is already connected
+    dial_promises: Vec<oneshot::Sender<bool>>,
+    // TODO: this layout of `dialing` and `dial_promises` doesn't allow to check specific addresses for reachability
+    //       if check reachability for specific maddrs is ever required, one would need to maintain the following info:
+    //       reachability_promises: HashMap<Multiaddr, Vec<oneshot::Sender<bool>>
+}
+
+impl Peer {
+    pub fn addresses(&self) -> impl Iterator<Item = &Multiaddr> {
+        self.connected
+            .iter()
+            .chain(&self.discovered)
+            .chain(&self.dialing)
+            .collect::<HashSet<_>>()
+            .into_iter()
+    }
+
+    pub fn connected(addresses: impl IntoIterator<Item = Multiaddr>) -> Self {
+        Peer {
+            connected: addresses.into_iter().collect(),
+            discovered: Default::default(),
+            dialing: Default::default(),
+            dial_promises: vec![],
+        }
+    }
+
+    pub fn dialing(
+        addresses: impl IntoIterator<Item = Multiaddr>,
+        outlet: oneshot::Sender<bool>,
+    ) -> Self {
+        Peer {
+            connected: Default::default(),
+            discovered: Default::default(),
+            dialing: addresses.into_iter().collect(),
+            dial_promises: vec![outlet],
+        }
+    }
+}
+
+pub struct ConnectionPoolBehaviour {
+    peer_id: PeerId,
+
+    commands: UnboundedReceiverStream<Command>,
+
+    outlet: PollSender<ExtendedParticle>,
+    subscribers: Vec<mpsc::UnboundedSender<LifecycleEvent>>,
+
+    queue: VecDeque<ExtendedParticle>,
+    contacts: HashMap<PeerId, Peer>,
+    dialing: HashMap<Multiaddr, Vec<oneshot::Sender<Option<Contact>>>>,
+
+    events: VecDeque<SwarmEventType>,
+    waker: Option<Waker>,
+    pub(super) protocol_config: ProtocolConfig,
+
+    metrics: Option<ConnectionPoolMetrics>,
+}
+
+impl ConnectionPoolBehaviour {
+    fn execute(&mut self, cmd: Command) {
+        match cmd {
+            Command::Dial { addr, out } => self.dial(addr, out),
+            Command::Connect { contact, out } => self.connect(contact, out),
+            Command::Disconnect { peer_id, out } => self.disconnect(peer_id, out),
+            Command::IsConnected { peer_id, out } => self.is_connected(peer_id, out),
+            Command::GetContact { peer_id, out } => self.get_contact(peer_id, out),
+            Command::Send { to, particle, out } => self.send(to, particle, out),
+            Command::CountConnections { out } => self.count_connections(out),
+            Command::LifecycleEvents { out } => self.add_subscriber(out),
+        }
+    }
+
+    /// Dial `address`, and send contact back on success
+    /// `None` means something prevented us from connecting - dial reach failure or something else
+    pub fn dial(&mut self, address: Multiaddr, out: oneshot::Sender<Option<Contact>>) {
+        // TODO: return Contact immediately if that address is already connected
+        self.dialing.entry(address.clone()).or_default().push(out);
+
+        self.push_event(ToSwarm::Dial {
+            opts: DialOpts::unknown_peer_id().address(address).build(),
+        });
+    }
+
+    /// Connect to the contact by all of its known addresses and return whether connection succeeded
+    /// If contact is already being dialed and there are no new addresses in Contact, don't dial
+    /// If contact is already connected, return `true` immediately
+    pub fn connect(&mut self, new_contact: Contact, outlet: oneshot::Sender<bool>) {
+        let addresses = match self.contacts.entry(new_contact.peer_id) {
+            Entry::Occupied(mut entry) => {
+                let known_contact = entry.get_mut();
+
+                // collect previously unknown addresses
+                let mut new_addrs = HashSet::new();
+                // flag if `contact` has any unconnected addresses
+                let mut not_connected = false;
+                for maddr in new_contact.addresses {
+                    if !known_contact.connected.contains(&maddr) {
+                        not_connected = true;
+                    }
+
+                    if !known_contact.dialing.contains(&maddr) {
+                        new_addrs.insert(maddr);
+                    }
+                }
+
+                if not_connected {
+                    // we got either new addresses to dial, or in-progress dialing on some
+                    // addresses in `new_contact`, so remember to notify channel about dial state change
+                    known_contact.dial_promises.push(outlet);
+                } else {
+                    // all addresses in `new_contact` are already connected, so notify about success
+                    outlet.send(true).ok();
+                }
+                new_addrs.into_iter().collect()
+            }
+            Entry::Vacant(slot) => {
+                slot.insert(Peer::dialing(new_contact.addresses.clone(), outlet));
+                new_contact.addresses
+            }
+        };
+
+        if !addresses.is_empty() {
+            self.push_event(ToSwarm::Dial {
+                opts: DialOpts::peer_id(new_contact.peer_id)
+                    .addresses(addresses)
+                    .build(),
+            });
+        }
+    }
+
+    pub fn disconnect(&mut self, peer_id: PeerId, outlet: oneshot::Sender<bool>) {
+        self.push_event(ToSwarm::CloseConnection {
+            peer_id,
+            connection: All,
+        });
+        // TODO: signal disconnect completion only after `peer_removed` was called or Disconnect failed
+        outlet.send(true).ok();
+    }
+
+    /// Returns whether given peer is connected or not
+    pub fn is_connected(&self, peer_id: PeerId, outlet: oneshot::Sender<bool>) {
+        outlet.send(self.contacts.contains_key(&peer_id)).ok();
+    }
+
+    /// Returns contact for a given peer if it is known
+    pub fn get_contact(&self, peer_id: PeerId, outlet: oneshot::Sender<Option<Contact>>) {
+        let contact = self.get_contact_impl(peer_id);
+        outlet.send(contact).ok();
+    }
+
+    /// Sends a particle to a connected contact. Returns whether sending succeeded or not
+    /// Result is sent to channel inside `upgrade_outbound` in ProtocolHandler
+    pub fn send(
+        &mut self,
+        to: Contact,
+        particle: ExtendedParticle,
+        outlet: oneshot::Sender<SendStatus>,
+    ) {
+        let span =
+            tracing::info_span!(parent: particle.span.as_ref(), "ConnectionPool::Behaviour::send");
+        let _guard = span.enter();
+        if to.peer_id == self.peer_id {
+            // If particle is sent to the current node, process it locally
+            self.queue.push_back(particle);
+            outlet.send(SendStatus::Ok).ok();
+            self.wake();
+        } else if self.contacts.contains_key(&to.peer_id) {
+            tracing::debug!(
+                target: "network",
+                particle_id = particle.particle.id ,
+                "{}: Sending particle to {}",
+                self.peer_id,
+                to.peer_id
+            );
+            // Send particle to remote peer
+            self.push_event(ToSwarm::NotifyHandler {
+                peer_id: to.peer_id,
+                handler: NotifyHandler::Any,
+                event: HandlerMessage::OutParticle(
+                    particle.particle,
+                    CompletionChannel::Oneshot(outlet),
+                ),
+            });
+        } else {
+            tracing::warn!(
+                particle_id = particle.particle.id,
+                "Won't send particle to contact {}: not connected",
+                to.peer_id
+            );
+            outlet.send(SendStatus::NotConnected).ok();
+        }
+    }
+
+    /// Returns number of connected contacts
+    pub fn count_connections(&mut self, outlet: oneshot::Sender<usize>) {
+        outlet.send(self.contacts.len()).ok();
+    }
+
+    /// Subscribes given channel for all `LifecycleEvent`s
+    pub fn add_subscriber(&mut self, outlet: mpsc::UnboundedSender<LifecycleEvent>) {
+        self.subscribers.push(outlet);
+    }
+
+    pub fn add_discovered_addresses(&mut self, peer_id: PeerId, addresses: Vec<Multiaddr>) {
+        self.contacts
+            .entry(peer_id)
+            .or_default()
+            .discovered
+            .extend(addresses);
+    }
+
+    fn meter<U, F: Fn(&ConnectionPoolMetrics) -> U>(&self, f: F) {
+        self.metrics.as_ref().map(f);
+    }
+}
+
+impl ConnectionPoolBehaviour {
+    pub fn new(
+        buffer: usize,
+        protocol_config: ProtocolConfig,
+        peer_id: PeerId,
+        metrics: Option<ConnectionPoolMetrics>,
+    ) -> (Self, mpsc::Receiver<ExtendedParticle>, ConnectionPoolApi) {
+        let (outlet, inlet) = mpsc::channel(buffer);
+        let outlet = PollSender::new(outlet);
+        let (command_outlet, command_inlet) = mpsc::unbounded_channel();
+        let api = ConnectionPoolApi {
+            outlet: command_outlet,
+            send_timeout: protocol_config.upgrade_timeout * 2,
+        };
+
+        let this = Self {
+            peer_id,
+            outlet,
+            commands: UnboundedReceiverStream::new(command_inlet),
+            subscribers: <_>::default(),
+            queue: <_>::default(),
+            contacts: <_>::default(),
+            dialing: <_>::default(),
+            events: <_>::default(),
+            waker: None,
+            protocol_config,
+            metrics,
+        };
+
+        (this, inlet, api)
+    }
+
+    fn wake(&self) {
+        if let Some(waker) = &self.waker {
+            waker.wake_by_ref();
+        }
+    }
+
+    fn add_connected_address(&mut self, peer_id: PeerId, maddr: Multiaddr) {
+        // notify these waiting for a peer to be connected
+        match self.contacts.entry(peer_id) {
+            Entry::Occupied(mut entry) => {
+                let peer = entry.get_mut();
+                peer.dialing.remove(&maddr);
+                peer.discovered.remove(&maddr);
+                peer.connected.insert(maddr.clone());
+
+                let dial_promises = std::mem::take(&mut peer.dial_promises);
+
+                for out in dial_promises {
+                    out.send(true).ok();
+                }
+            }
+            Entry::Vacant(e) => {
+                e.insert(Peer::connected(std::iter::once(maddr.clone())));
+            }
+        }
+
+        // notify these waiting for an address to be dialed
+        if let Some(outs) = self.dialing.remove(&maddr) {
+            let contact = self.get_contact_impl(peer_id);
+            debug_assert!(contact.is_some());
+            for out in outs {
+                out.send(contact.clone()).ok();
+            }
+        }
+        self.meter(|m| m.connected_peers.set(self.contacts.len() as i64));
+    }
+
+    fn lifecycle_event(&mut self, event: LifecycleEvent) {
+        self.subscribers.retain(|out| {
+            let ok = out.send(event.clone());
+            ok.is_ok()
+        })
+    }
+
+    fn push_event(&mut self, event: SwarmEventType) {
+        self.events.push_back(event);
+        self.wake();
+    }
+
+    fn remove_contact(&mut self, peer_id: &PeerId, reason: &str) {
+        if let Some(contact) = self.contacts.remove(peer_id) {
+            log::debug!("Contact {} was removed: {}", peer_id, reason);
+            self.lifecycle_event(LifecycleEvent::Disconnected(Contact::new(
+                *peer_id,
+                contact.addresses().cloned().collect(),
+            )));
+
+            for out in contact.dial_promises {
+                // if dial was in progress, notify waiters
+                out.send(false).ok();
+            }
+            self.meter(|m| m.connected_peers.set(self.contacts.len() as i64));
+        }
+    }
+
+    fn get_contact_impl(&self, peer_id: PeerId) -> Option<Contact> {
+        self.contacts.get(&peer_id).map(|c| Contact {
+            peer_id,
+            addresses: c.addresses().cloned().collect(),
+        })
+    }
+
+    fn on_connection_closed(
+        &mut self,
+        peer_id: &PeerId,
+        cp: &ConnectedPoint,
+        remaining_established: usize,
+    ) {
+        let multiaddr = remote_multiaddr(cp);
+        if remaining_established == 0 {
+            self.remove_contact(peer_id, "disconnected");
+            log::debug!(
+                target: "network",
+                "{}: connection lost with {} @ {}",
+                self.peer_id,
+                peer_id,
+                multiaddr
+            );
+        } else {
+            log::debug!(
+                target: "network",
+                "{}: {} connections remaining established with {}. {} has just closed.",
+                self.peer_id,
+                remaining_established,
+                peer_id,
+                multiaddr
+            )
+        }
+
+        self.cleanup_address(Some(peer_id), multiaddr);
+    }
+
+    fn on_dial_failure(&mut self, peer_id: Option<PeerId>, error: &DialError) {
+        use dial_opts::PeerCondition::{Disconnected, NotDialing};
+        if let DialError::DialPeerConditionFalse(Disconnected | NotDialing) = error {
+            // So, if you tell libp2p to dial a peer, there's an option dial_opts::PeerCondition
+            // The default one is Disconnected.
+            // So, if you asked libp2p to connect to a peer, and the peer IS ALREADY CONNECTED,
+            // libp2p will tell you that dial has failed.
+            // We need to ignore this "failure" in case condition is Disconnected or NotDialing.
+            // Because this basically means that peer has already connected while our Dial was processed.
+            // That could happen in several cases:
+            //  1. `dial` was called by multiaddress of an already-connected peer
+            //  2. `connect` was called with new multiaddresses, but target peer is already connected
+            //  3. unknown data race
+            log::info!("Dialing attempt to an already connected peer {:?}", peer_id);
+            return;
+        }
+
+        log::warn!(
+            "Error dialing peer {}: {:?}",
+            peer_id.map_or("unknown".to_string(), |id| id.to_string()),
+            error
+        );
+        match error {
+            DialError::WrongPeerId { endpoint, .. } => {
+                let addr = match endpoint {
+                    ConnectedPoint::Dialer { address, .. } => address,
+                    ConnectedPoint::Listener { send_back_addr, .. } => send_back_addr,
+                };
+                self.cleanup_address(peer_id.as_ref(), addr);
+            }
+            DialError::Transport(addrs) => {
+                for (addr, _) in addrs {
+                    self.cleanup_address(peer_id.as_ref(), addr);
+                }
+            }
+            _ => {}
+        };
+        // remove failed contact
+        if let Some(peer_id) = peer_id {
+            self.remove_contact(&peer_id, format!("dial failure: {error}").as_str())
+        } else {
+            log::warn!("Unknown peer dial failure: {}", error)
+        }
+    }
+
+    fn on_listen_failure(&mut self, event: ListenFailure<'_>) {
+        log::warn!(
+            "Error accepting incoming connection from {} to our local address {}: {:?}",
+            event.send_back_addr,
+            event.local_addr,
+            event.error
+        );
+    }
+
+    fn cleanup_address(&mut self, peer_id: Option<&PeerId>, addr: &Multiaddr) {
+        // Notify those who waits for address dial
+        if let Some(outs) = self.dialing.remove(addr) {
+            for out in outs {
+                out.send(None).ok();
+            }
+        }
+
+        let _: Option<()> = try {
+            let peer_id = peer_id?;
+            let contact = self.contacts.get_mut(peer_id)?;
+
+            contact.connected.remove(addr);
+            contact.discovered.remove(addr);
+            contact.dialing.remove(addr);
+            if contact.dialing.is_empty() {
+                let dial_promises = std::mem::take(&mut contact.dial_promises);
+                for out in dial_promises {
+                    out.send(false).ok();
+                }
+            }
+            if contact.connected.is_empty() && contact.dialing.is_empty() {
+                self.remove_contact(
+                    peer_id,
+                    "no more connected or dialed addresses after 'cleanup_address' call",
+                );
+            }
+        };
+    }
+}
+
+impl NetworkBehaviour for ConnectionPoolBehaviour {
+    type ConnectionHandler = OneShotHandler<ProtocolConfig, HandlerMessage, HandlerMessage>;
+    type ToSwarm = ();
+
+    fn handle_pending_inbound_connection(
+        &mut self,
+        _connection_id: ConnectionId,
+        _local_addr: &Multiaddr,
+        _remote_addr: &Multiaddr,
+    ) -> Result<(), ConnectionDenied> {
+        Ok(())
+    }
+
+    fn handle_established_inbound_connection(
+        &mut self,
+        _connection_id: ConnectionId,
+        peer_id: PeerId,
+        _local_addr: &Multiaddr,
+        remote_addr: &Multiaddr,
+    ) -> Result<THandler<Self>, ConnectionDenied> {
+        log::debug!(
+            target: "network",
+            "{}: inbound connection established with {} @ {}",
+            self.peer_id,
+            peer_id,
+            remote_addr
+        );
+
+        self.add_connected_address(peer_id, remote_addr.clone());
+
+        self.lifecycle_event(LifecycleEvent::Connected(Contact::new(
+            peer_id,
+            vec![remote_addr.clone()],
+        )));
+
+        Ok(self.protocol_config.clone().into())
+    }
+
+    fn handle_pending_outbound_connection(
+        &mut self,
+        _connection_id: ConnectionId,
+        maybe_peer: Option<PeerId>,
+        _addresses: &[Multiaddr],
+        _effective_role: Endpoint,
+    ) -> Result<Vec<Multiaddr>, ConnectionDenied> {
+        let peer_id = match maybe_peer {
+            None => return Ok(vec![]),
+            Some(peer_id) => peer_id,
+        };
+        Ok(self
+            .contacts
+            .get(&peer_id)
+            .into_iter()
+            .flat_map(|p| p.addresses().cloned())
+            .collect())
+    }
+
+    fn handle_established_outbound_connection(
+        &mut self,
+        _connection_id: ConnectionId,
+        peer_id: PeerId,
+        addr: &Multiaddr,
+        _role_override: Endpoint,
+    ) -> Result<THandler<Self>, ConnectionDenied> {
+        log::debug!(
+            target: "network",
+            "{}: outbound connection established with {} @ {}",
+            self.peer_id,
+            peer_id,
+            addr
+        );
+
+        self.add_connected_address(peer_id, addr.clone());
+
+        self.lifecycle_event(LifecycleEvent::Connected(Contact::new(
+            peer_id,
+            vec![addr.clone()],
+        )));
+        Ok(self.protocol_config.clone().into())
+    }
+
+    fn on_swarm_event(&mut self, event: FromSwarm<'_>) {
+        match event {
+            FromSwarm::ConnectionEstablished(event) => {
+                for addr in event.failed_addresses {
+                    log::warn!("failed to connect to {} {}", addr, event.peer_id);
+                    self.cleanup_address(Some(&event.peer_id), addr)
+                }
+            }
+            FromSwarm::ConnectionClosed(event) => {
+                self.on_connection_closed(
+                    &event.peer_id,
+                    event.endpoint,
+                    event.remaining_established,
+                );
+            }
+            FromSwarm::AddressChange(_) => {}
+            FromSwarm::DialFailure(event) => {
+                self.on_dial_failure(event.peer_id, event.error);
+            }
+            FromSwarm::ListenFailure(event) => {
+                self.on_listen_failure(event);
+            }
+            FromSwarm::NewListener(_) => {}
+            FromSwarm::NewListenAddr(_) => {}
+            FromSwarm::ExpiredListenAddr(_) => {}
+            FromSwarm::ListenerError(_) => {}
+            FromSwarm::ListenerClosed(_) => {}
+
+            FromSwarm::NewExternalAddrCandidate(_) => {}
+            FromSwarm::ExternalAddrConfirmed(_) => {}
+            FromSwarm::ExternalAddrExpired(_) => {}
+            e => {
+                tracing::warn!("Unexpected event {:?}", e);
+                #[cfg(test)]
+                panic!("Unexpected event")
+            }
+        }
+    }
+
+    fn on_connection_handler_event(
+        &mut self,
+        from: PeerId,
+        _connection_id: ConnectionId,
+        event: THandlerOutEvent<Self>,
+    ) {
+        match event {
+            Ok(HandlerMessage::InParticle(particle)) => {
+                tracing::info!(target: "network", particle_id = particle.id,"{}: received particle from {}; queue {}", self.peer_id, from, self.queue.len());
+                let root_span = tracing::info_span!("Particle", particle_id = particle.id);
+
+                self.meter(|m| {
+                    m.incoming_particle(
+                        &particle.id,
+                        self.queue.len() as i64 + 1,
+                        particle.data.len() as f64,
+                    )
+                });
+                self.queue
+                    .push_back(ExtendedParticle::new(particle, root_span));
+                self.wake();
+            }
+            Ok(HandlerMessage::Upgrade) => {}
+            Ok(HandlerMessage::OutParticle(..)) => unreachable!("can't receive OutParticle"),
+            Err(err) => log::warn!("Handler error: {:?}", err),
+        }
+    }
+
+    fn poll(&mut self, cx: &mut Context<'_>) -> Poll<SwarmEventType> {
+        self.waker = Some(cx.waker().clone());
+
+        loop {
+            // Check backpressure on the outlet
+            let mut outlet = Pin::new(&mut self.outlet);
+            match outlet.as_mut().poll_ready(cx) {
+                Poll::Ready(Ok(_)) => {
+                    // channel is ready to consume more particles, so send them
+                    if let Some(particle) = self.queue.pop_front() {
+                        let particle_id = particle.particle.id.clone();
+
+                        if let Err(err) = outlet.start_send(particle) {
+                            tracing::error!(
+                                particle_id = particle_id,
+                                "Failed to send particle to outlet: {}",
+                                err
+                            )
+                        } else {
+                            tracing::trace!(
+                                target: "execution",
+                                particle_id = particle_id,
+                                "Sent particle to execution"
+                            );
+                        }
+                    } else {
+                        break;
+                    }
+                }
+                Poll::Pending => {
+                    // if channel is full, then keep particles in the queue
+                    let len = self.queue.len();
+                    if len > 30 {
+                        log::warn!("Particle queue seems to have stalled; queue {}", len);
+                    } else {
+                        log::trace!(target: "network", "Connection pool outlet is pending; queue {}", len);
+                    }
+                    if self.outlet.is_closed() {
+                        log::error!("Particle outlet closed");
+                    }
+                    break;
+                }
+                Poll::Ready(Err(err)) => {
+                    log::warn!("ConnectionPool particle inlet has been dropped: {}", err);
+                    break;
+                }
+            }
+        }
+
+        self.meter(|m| m.particle_queue_size.set(self.queue.len() as i64));
+        while let Poll::Ready(Some(cmd)) = self.commands.poll_next_unpin(cx) {
+            self.execute(cmd)
+        }
+
+        if let Some(event) = self.events.pop_front() {
+            return Poll::Ready(event);
+        }
+
+        Poll::Pending
+    }
+}
+
\ No newline at end of file diff --git a/src/connection_pool/connection_pool.rs.html b/src/connection_pool/connection_pool.rs.html new file mode 100644 index 0000000000..6bed9a3402 --- /dev/null +++ b/src/connection_pool/connection_pool.rs.html @@ -0,0 +1,103 @@ +connection_pool.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use std::fmt::{Display, Formatter};
+
+use futures::{future::BoxFuture, stream::BoxStream};
+use libp2p::{core::Multiaddr, PeerId};
+
+use particle_protocol::{Contact, ExtendedParticle, SendStatus};
+
+#[derive(Debug, Clone)]
+pub enum LifecycleEvent {
+    Connected(Contact),
+    Disconnected(Contact),
+}
+
+impl Display for LifecycleEvent {
+    fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
+        match self {
+            LifecycleEvent::Connected(c) => write!(f, "Connected {c}"),
+            LifecycleEvent::Disconnected(c) => write!(f, "Disconnected {c}"),
+        }
+    }
+}
+
+pub trait ConnectionPoolT {
+    fn dial(&self, addr: Multiaddr) -> BoxFuture<'static, Option<Contact>>;
+    fn connect(&self, contact: Contact) -> BoxFuture<'static, bool>;
+    fn disconnect(&self, peer_id: PeerId) -> BoxFuture<'static, bool>;
+    fn is_connected(&self, peer_id: PeerId) -> BoxFuture<'static, bool>;
+    fn get_contact(&self, peer_id: PeerId) -> BoxFuture<'static, Option<Contact>>;
+    fn send(&self, to: Contact, particle: ExtendedParticle) -> BoxFuture<'static, SendStatus>;
+    fn count_connections(&self) -> BoxFuture<'static, usize>;
+    fn lifecycle_events(&self) -> BoxStream<'static, LifecycleEvent>;
+}
+
\ No newline at end of file diff --git a/src/connection_pool/lib.rs.html b/src/connection_pool/lib.rs.html new file mode 100644 index 0000000000..c24eb99d10 --- /dev/null +++ b/src/connection_pool/lib.rs.html @@ -0,0 +1,87 @@ +lib.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+#![warn(rust_2018_idioms)]
+#![deny(
+    dead_code,
+    nonstandard_style,
+    unused_imports,
+    unused_mut,
+    unused_variables,
+    unused_unsafe,
+    unreachable_patterns,
+    unreachable_code
+)]
+#![feature(try_blocks)]
+
+pub use api::ConnectionPoolApi;
+// to be available in benchmarks
+pub use api::Command;
+pub use behaviour::ConnectionPoolBehaviour;
+
+pub use crate::connection_pool::ConnectionPoolT;
+pub use crate::connection_pool::LifecycleEvent;
+
+mod api;
+mod behaviour;
+mod connection_pool;
+
\ No newline at end of file diff --git a/src/control_macro/lib.rs.html b/src/control_macro/lib.rs.html new file mode 100644 index 0000000000..ab88deb8ce --- /dev/null +++ b/src/control_macro/lib.rs.html @@ -0,0 +1,171 @@ +lib.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+#![warn(rust_2018_idioms)]
+#![deny(
+    dead_code,
+    nonstandard_style,
+    unused_imports,
+    unused_mut,
+    unused_variables,
+    unused_unsafe,
+    unreachable_patterns
+)]
+
+/// Takes option as an argument, unwraps if `Some`, exit function with `Ok(default)` otherwise
+/// Ought to make it easier to short-circuit in functions returning `Result<Option<_>>`
+#[macro_export]
+macro_rules! ok_get {
+    ($opt:expr) => {{
+        let r = { $opt };
+        match r {
+            Some(r) => r,
+            None => return Ok(<_>::default()),
+        }
+    }};
+}
+
+/// Retrieves value from `Some`, returns on `None`
+#[macro_export]
+macro_rules! get_return {
+    ($opt:expr) => {{
+        let r = { $opt };
+        match r {
+            Some(r) => r,
+            None => return,
+        }
+    }};
+}
+
+/// Retrieves value from `Some`, returns on `None`
+#[macro_export]
+macro_rules! unwrap_return {
+    ($opt:expr, $alternative:expr) => {{
+        let r = { $opt };
+        match r {
+            Some(r) => r,
+            None => {
+                let alt = { $alternative };
+                return alt;
+            }
+        }
+    }};
+}
+
+#[macro_export]
+macro_rules! measure {
+    ($val:expr) => {{
+        let start = ::std::time::Instant::now();
+        match $val {
+            tmp => {
+                let elapsed_ms = start.elapsed().as_millis();
+                if elapsed_ms > 100 {
+                    println!("{} took {} ms", stringify!($val), elapsed_ms);
+                }
+                tmp
+            }
+        }
+    }};
+}
+
\ No newline at end of file diff --git a/src/core_distributor/core_range.rs.html b/src/core_distributor/core_range.rs.html new file mode 100644 index 0000000000..7e72f453d4 --- /dev/null +++ b/src/core_distributor/core_range.rs.html @@ -0,0 +1,609 @@ +core_range.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use std::fmt::{Debug, Display, Formatter};
+use std::str::FromStr;
+
+use ccp_shared::types::PhysicalCoreId;
+use nonempty::NonEmpty;
+use range_set_blaze::RangeSetBlaze;
+use serde::{Deserialize, Deserializer, Serialize, Serializer};
+use thiserror::Error;
+
+#[derive(Clone, PartialEq)]
+pub struct CoreRange(pub(crate) RangeSetBlaze<usize>);
+impl CoreRange {
+    pub fn is_subset(&self, cores: &NonEmpty<PhysicalCoreId>) -> bool {
+        let range: RangeSetBlaze<usize> =
+            RangeSetBlaze::from_iter(cores.into_iter().map(|core| <usize>::from(*core)));
+
+        self.0.is_subset(&range)
+    }
+}
+
+impl Debug for CoreRange {
+    fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
+        f.write_str(self.0.to_string().as_str())
+    }
+}
+
+impl Default for CoreRange {
+    fn default() -> Self {
+        CoreRange(RangeSetBlaze::from_iter(0..num_cpus::get_physical()))
+    }
+}
+
+impl TryFrom<&[usize]> for CoreRange {
+    type Error = ParseError;
+
+    fn try_from(value: &[usize]) -> Result<Self, Self::Error> {
+        if value.is_empty() {
+            return Err(ParseError::EmptyRange);
+        }
+        Ok(CoreRange(RangeSetBlaze::from_iter(value)))
+    }
+}
+
+impl FromStr for CoreRange {
+    type Err = ParseError;
+
+    /// Parse CoreRange from string like "1,2-30,31"
+    fn from_str(s: &str) -> Result<Self, Self::Err> {
+        let mut result: RangeSetBlaze<usize> = RangeSetBlaze::new();
+        let trimmed = s.trim();
+        if trimmed.is_empty() {
+            return Err(ParseError::EmptyRange);
+        }
+
+        for part in trimmed.split(',') {
+            let trimmed = part.trim();
+            // either a single number or a dash range
+            let range: Vec<&str> = trimmed.split('-').collect();
+            match range[..] {
+                [l, r] => {
+                    let l = l
+                        .parse::<usize>()
+                        .map_err(|_| ParseError::WrongRangeFormat {
+                            raw_str: trimmed.to_string(),
+                        })?;
+                    let r = r
+                        .parse::<usize>()
+                        .map_err(|_| ParseError::WrongRangeFormat {
+                            raw_str: trimmed.to_string(),
+                        })?;
+                    // insert the inclusive range
+                    result.ranges_insert(l..=r);
+                }
+                [value] => {
+                    let value =
+                        value
+                            .parse::<usize>()
+                            .map_err(|_| ParseError::WrongRangeFormat {
+                                raw_str: trimmed.to_string(),
+                            })?;
+                    result.insert(value);
+                }
+                _ => {
+                    return Err(ParseError::WrongRangeFormat {
+                        raw_str: trimmed.to_string(),
+                    });
+                }
+            }
+        }
+
+        Ok(CoreRange(result))
+    }
+}
+
+impl Display for CoreRange {
+    fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
+        for (index, range) in self.0.ranges().enumerate() {
+            if index != 0 {
+                write!(f, ",")?;
+            };
+            let start = range.start();
+            let end = range.end();
+            if start == end {
+                write!(f, "{}", start)?;
+            } else {
+                write!(f, "{}-{}", start, end)?;
+            }
+        }
+        Ok(())
+    }
+}
+
+impl Serialize for CoreRange {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        serializer.serialize_str(self.to_string().as_str())
+    }
+}
+
+impl<'de> Deserialize<'de> for CoreRange {
+    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
+    where
+        D: Deserializer<'de>,
+    {
+        let raw_str = String::deserialize(deserializer)?;
+        CoreRange::from_str(raw_str.as_str()).map_err(|e| {
+            serde::de::Error::custom(format!("failed to deserialize core range {raw_str} {e:?}"))
+        })
+    }
+}
+
+#[derive(Debug, Error, PartialEq)]
+pub enum ParseError {
+    #[error("Range can't be an empty")]
+    EmptyRange,
+    #[error("Failed to parse: {raw_str}")]
+    WrongRangeFormat { raw_str: String },
+}
+
+#[cfg(test)]
+mod tests {
+    use crate::core_range::{CoreRange, ParseError};
+
+    #[test]
+    fn range_parsing_test() {
+        let core_range: CoreRange = "0-2".parse().unwrap();
+        assert!(core_range.0.contains(0));
+        assert!(core_range.0.contains(1));
+        assert!(core_range.0.contains(2));
+        assert!(!core_range.0.contains(3));
+    }
+
+    #[test]
+    fn values_parsing_test() {
+        let core_range: CoreRange = "0,1,3".parse().unwrap();
+        assert!(core_range.0.contains(0));
+        assert!(core_range.0.contains(1));
+        assert!(!core_range.0.contains(2));
+        assert!(core_range.0.contains(3));
+    }
+
+    #[test]
+    fn wrong_parsing_test() {
+        let result = "aaaa".parse::<CoreRange>();
+        assert!(result.is_err());
+        if let Err(err) = result {
+            assert_eq!(
+                err,
+                ParseError::WrongRangeFormat {
+                    raw_str: "aaaa".to_string()
+                }
+            );
+            assert_eq!(err.to_string(), "Failed to parse: aaaa")
+        }
+    }
+
+    #[test]
+    fn wrong_parsing_test_2() {
+        let result = "1-a".parse::<CoreRange>();
+        assert!(result.is_err());
+        if let Err(err) = result {
+            assert_eq!(
+                err,
+                ParseError::WrongRangeFormat {
+                    raw_str: "1-a".to_string()
+                }
+            );
+            assert_eq!(err.to_string(), "Failed to parse: 1-a")
+        }
+    }
+
+    #[test]
+    fn wrong_parsing_test_3() {
+        let result = "a-1".parse::<CoreRange>();
+        assert!(result.is_err());
+        if let Err(err) = result {
+            assert_eq!(
+                err,
+                ParseError::WrongRangeFormat {
+                    raw_str: "a-1".to_string()
+                }
+            );
+            assert_eq!(err.to_string(), "Failed to parse: a-1")
+        }
+    }
+
+    #[test]
+    fn wrong_parsing_test_4() {
+        let result = "a-1-2,3".parse::<CoreRange>();
+        assert!(result.is_err());
+        if let Err(err) = result {
+            assert_eq!(
+                err,
+                ParseError::WrongRangeFormat {
+                    raw_str: "a-1-2".to_string()
+                }
+            );
+            assert_eq!(err.to_string(), "Failed to parse: a-1-2")
+        }
+    }
+
+    #[test]
+    fn empty_parsing_test_3() {
+        let result = "".parse::<CoreRange>();
+        assert!(result.is_err());
+        if let Err(err) = result {
+            assert_eq!(err, ParseError::EmptyRange);
+        }
+    }
+
+    #[test]
+    fn slice_convert() {
+        let core_range = CoreRange::try_from(&vec![1, 2, 3, 10][..]).unwrap();
+
+        assert!(!core_range.0.contains(0));
+        assert!(core_range.0.contains(1));
+        assert!(core_range.0.contains(2));
+        assert!(core_range.0.contains(3));
+        assert!(core_range.0.contains(10));
+        assert!(!core_range.0.contains(11));
+    }
+
+    #[test]
+    fn empty_slice_convert() {
+        let result = CoreRange::try_from(&vec![][..]);
+
+        assert!(result.is_err());
+        if let Err(err) = result {
+            assert_eq!(err, ParseError::EmptyRange);
+            assert_eq!(err.to_string(), "Range can't be an empty")
+        }
+    }
+
+    #[test]
+    fn last() {
+        let core_range: CoreRange = "0-2".parse().unwrap();
+        assert!(core_range.0.contains(0));
+        assert!(core_range.0.contains(1));
+        assert!(core_range.0.contains(2));
+        assert!(!core_range.0.contains(3));
+    }
+
+    #[test]
+    fn compare_ranges() {
+        let core_range_1: CoreRange = "0-2".parse().unwrap();
+        let core_range_2: CoreRange = "0,1,2".parse().unwrap();
+        assert_eq!(core_range_1, core_range_2);
+    }
+
+    #[test]
+    fn fmt() {
+        let core_range_1: CoreRange = "0-2,5,7-9".parse().unwrap();
+        assert_eq!(format!("{}", core_range_1), "0-2,5,7-9");
+    }
+
+    #[test]
+    fn range_is_inclusive() {
+        let core_range_1: CoreRange = "1-3".parse().unwrap();
+        let actual: Vec<usize> = core_range_1.0.iter().collect();
+        let expected = vec![1, 2, 3];
+        assert_eq!(actual, expected)
+    }
+}
+
\ No newline at end of file diff --git a/src/core_distributor/distributor.rs.html b/src/core_distributor/distributor.rs.html new file mode 100644 index 0000000000..f91dc7fff0 --- /dev/null +++ b/src/core_distributor/distributor.rs.html @@ -0,0 +1,1623 @@ +distributor.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+762
+763
+764
+765
+766
+767
+768
+769
+770
+771
+772
+773
+774
+775
+776
+777
+778
+779
+780
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+794
+795
+796
+797
+798
+799
+800
+801
+802
+803
+804
+805
+806
+807
+808
+809
+810
+811
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use std::collections::VecDeque;
+use std::ops::Deref;
+use std::path::PathBuf;
+use std::sync::Arc;
+
+use ccp_shared::types::{LogicalCoreId, PhysicalCoreId, CUID};
+use cpu_utils::CPUTopology;
+use fxhash::FxBuildHasher;
+use parking_lot::RwLock;
+use range_set_blaze::RangeSetBlaze;
+
+use crate::errors::{AcquireError, CreateError, LoadingError, PersistError};
+use crate::persistence::{PersistenceTask, PersistentCoreDistributorState, StatePersister};
+use crate::strategy::{AcquireStrategy, AcquireStrategyInner, AcquireStrategyOperations};
+use crate::types::{AcquireRequest, Assignment, SystemAssignment, WorkType};
+use crate::{BiMap, CoreRange, Map, MultiMap};
+
+#[cfg_attr(feature = "mockall", mockall::automock)]
+pub trait CoreDistributor: Send + Sync {
+    fn acquire_worker_cores(
+        &self,
+        acquire_request: AcquireRequest,
+    ) -> Result<Assignment, AcquireError>;
+
+    fn release_worker_cores(&self, unit_ids: &[CUID]);
+
+    fn get_system_cpu_assignment(&self) -> SystemAssignment;
+}
+
+/// `PersistentCoreDistributor` is a CPU core distributor responsible for allocating and releasing CPU cores
+/// based on workload requirements. It maintains the state of core allocations, persists
+/// the state to disk, and provides methods for acquiring and releasing cores.
+pub struct PersistentCoreDistributor {
+    file_path: PathBuf,
+    // inner state
+    state: RwLock<CoreDistributorState>,
+    // persistent task notification channel
+    sender: tokio::sync::mpsc::Sender<()>,
+
+    acquire_strategy: AcquireStrategyInner,
+}
+
+impl From<PersistentCoreDistributorState> for CoreDistributorState {
+    fn from(value: PersistentCoreDistributorState) -> Self {
+        Self {
+            cores_mapping: value.cores_mapping.into_iter().collect(),
+            system_cores: value.system_cores.into_iter().collect(),
+            available_cores: value.available_cores.into_iter().collect(),
+            unit_id_mapping: value.unit_id_mapping.into_iter().collect(),
+            work_type_mapping: value.work_type_mapping.into_iter().collect(),
+        }
+    }
+}
+
+impl PersistentCoreDistributor {
+    /// Loads the state from `file_name` if exists. If not creates a new empty state
+    // TODO: split it for two methods
+    pub fn from_path(
+        file_path: PathBuf,
+        system_cpu_count: usize,
+        core_range: CoreRange,
+        acquire_strategy: AcquireStrategy,
+        cpu_topology: &dyn CPUTopology,
+    ) -> Result<(Arc<Self>, PersistenceTask), LoadingError> {
+        let exists = file_path.exists();
+        if exists {
+            let bytes = std::fs::read(&file_path).map_err(|err| LoadingError::IoError { err })?;
+            let raw_str = std::str::from_utf8(bytes.as_slice())
+                .map_err(|err| LoadingError::DecodeError { err })?;
+            let persistent_state: PersistentCoreDistributorState = toml::from_str(raw_str)
+                .map_err(|err| LoadingError::DeserializationError { err })?;
+
+            let config_range = &core_range.0;
+            let mut loaded_range = RangeSetBlaze::new();
+            for (physical_core_id, _) in &persistent_state.cores_mapping {
+                loaded_range.insert((*physical_core_id).into());
+            }
+
+            if config_range == &loaded_range
+                && persistent_state.system_cores.len() == system_cpu_count
+            {
+                let state: CoreDistributorState = persistent_state.into();
+                Ok(Self::make_instance_with_task(
+                    file_path,
+                    state,
+                    acquire_strategy,
+                ))
+            } else {
+                tracing::warn!(target: "core-distributor", "The initial config has been changed. Ignoring persisted core mapping");
+                let (core_distributor, task) = Self::new(
+                    file_path.clone(),
+                    system_cpu_count,
+                    core_range,
+                    acquire_strategy,
+                    cpu_topology,
+                )
+                .map_err(|err| LoadingError::CreateCoreDistributor { err })?;
+                core_distributor
+                    .persist()
+                    .map_err(|err| LoadingError::PersistError { err })?;
+                Ok((core_distributor, task))
+            }
+        } else {
+            tracing::debug!(target: "core-distributor", "No persisted core mapping was not found. Creating a new one.");
+            let (core_distributor, task) = Self::new(
+                file_path.clone(),
+                system_cpu_count,
+                core_range,
+                acquire_strategy,
+                cpu_topology,
+            )
+            .map_err(|err| LoadingError::CreateCoreDistributor { err })?;
+            core_distributor
+                .persist()
+                .map_err(|err| LoadingError::PersistError { err })?;
+            Ok((core_distributor, task))
+        }
+    }
+
+    /// Creates an empty core distributor with only system cores assigned
+    fn new(
+        file_name: PathBuf,
+        system_cpu_count: usize,
+        core_range: CoreRange,
+        acquire_strategy: AcquireStrategy,
+        cpu_topology: &dyn CPUTopology,
+    ) -> Result<(Arc<Self>, PersistenceTask), CreateError> {
+        let available_core_count = core_range.0.len() as usize;
+
+        if system_cpu_count == 0 {
+            return Err(CreateError::IllegalSystemCoreCount);
+        }
+
+        if system_cpu_count > available_core_count {
+            return Err(CreateError::NotEnoughCores {
+                available: available_core_count,
+                required: system_cpu_count,
+            });
+        }
+
+        // retrieve info about physical cores
+        let physical_cores = cpu_topology
+            .physical_cores()
+            .map_err(|err| CreateError::CollectCoresData { err })?;
+
+        if !core_range.is_subset(&physical_cores) {
+            return Err(CreateError::WrongCoreRange { core_range });
+        }
+
+        let mut cores_mapping: MultiMap<PhysicalCoreId, LogicalCoreId> =
+            MultiMap::with_capacity_and_hasher(available_core_count, FxBuildHasher::default());
+
+        let mut available_cores: VecDeque<PhysicalCoreId> =
+            VecDeque::with_capacity(available_core_count);
+
+        for physical_core_id in physical_cores {
+            if core_range.0.contains(physical_core_id.into()) {
+                let logical_cores = cpu_topology
+                    .logical_cores_for_physical(physical_core_id)
+                    .map_err(|err| CreateError::CollectCoresData { err })?;
+                available_cores.push_back(physical_core_id);
+                for logical_core_id in logical_cores {
+                    cores_mapping.insert(physical_core_id, logical_core_id)
+                }
+            }
+        }
+
+        let mut system_cores: Vec<PhysicalCoreId> = Vec::new();
+        for _ in 0..system_cpu_count {
+            // SAFETY: this should never happen because we already checked the availability of cores
+            system_cores.push(
+                available_cores
+                    .pop_front()
+                    .expect("Unexpected state. Should not be empty never"),
+            );
+        }
+
+        let unit_id_mapping = BiMap::with_capacity_and_hashers(
+            available_core_count,
+            FxBuildHasher::default(),
+            FxBuildHasher::default(),
+        );
+
+        let type_mapping =
+            Map::with_capacity_and_hasher(available_core_count, FxBuildHasher::default());
+
+        let inner_state = CoreDistributorState {
+            cores_mapping,
+            system_cores,
+            available_cores,
+            unit_id_mapping,
+            work_type_mapping: type_mapping,
+        };
+
+        let result = Self::make_instance_with_task(file_name, inner_state, acquire_strategy);
+
+        Ok(result)
+    }
+
+    fn make_instance_with_task(
+        file_path: PathBuf,
+        state: CoreDistributorState,
+        acquire_strategy: AcquireStrategy,
+    ) -> (Arc<Self>, PersistenceTask) {
+        // This channel is used to notify a persistent task about changes.
+        // It has a size of 1 because we need only the fact that this change happen
+        let (sender, receiver) = tokio::sync::mpsc::channel(1);
+
+        let distributor = Self {
+            file_path,
+            sender,
+            state: RwLock::new(state),
+            acquire_strategy: acquire_strategy.into(),
+        };
+
+        let distributor = Arc::new(distributor);
+        let task = PersistenceTask::new(distributor.clone(), receiver);
+
+        (distributor, task)
+    }
+}
+
+impl StatePersister for PersistentCoreDistributor {
+    fn persist(&self) -> Result<(), PersistError> {
+        let lock = self.state.read();
+        let inner_state = lock.deref();
+        let persistent_state: PersistentCoreDistributorState = inner_state.into();
+        drop(lock);
+        persistent_state.persist(self.file_path.as_path())?;
+        Ok(())
+    }
+}
+
+impl CoreDistributor for PersistentCoreDistributor {
+    fn acquire_worker_cores(
+        &self,
+        acquire_request: AcquireRequest,
+    ) -> Result<Assignment, AcquireError> {
+        let mut lock = self.state.write();
+
+        let result = self.acquire_strategy.acquire(&mut lock, acquire_request)?;
+
+        // We are trying to notify a persistence task that the state has been changed.
+        // We don't care if the channel is full, it means the current state will be stored with the previous event
+        let _ = self.sender.try_send(());
+
+        Ok(result)
+    }
+
+    fn release_worker_cores(&self, unit_ids: &[CUID]) {
+        let mut lock = self.state.write();
+        self.acquire_strategy.release(&mut lock, unit_ids);
+    }
+
+    fn get_system_cpu_assignment(&self) -> SystemAssignment {
+        let lock = self.state.read();
+        let mut logical_core_ids = Vec::new();
+        for core in &lock.system_cores {
+            // SAFETY: The physical core always has corresponding logical ids,
+            // system cores can't have a wrong physical_core_id
+            let core_ids = lock
+                .cores_mapping
+                .get_vec(core)
+                .cloned()
+                .expect("Unexpected state. Should not be empty never");
+            for core_id in core_ids {
+                logical_core_ids.push(core_id);
+            }
+        }
+        SystemAssignment::new(lock.system_cores.clone(), logical_core_ids)
+    }
+}
+
+pub(crate) struct CoreDistributorState {
+    // mapping between physical and logical cores
+    // TODO: use a topology directly
+    pub cores_mapping: MultiMap<PhysicalCoreId, LogicalCoreId>,
+    // allocated system cores
+    pub system_cores: Vec<PhysicalCoreId>,
+    // free physical cores
+    pub available_cores: VecDeque<PhysicalCoreId>,
+    // mapping between physical core id and unit id
+    pub unit_id_mapping: BiMap<PhysicalCoreId, CUID>,
+    // mapping between unit id and workload type
+    pub work_type_mapping: Map<CUID, WorkType>,
+}
+
+#[cfg(test)]
+mod tests {
+    use std::collections::BTreeSet;
+    use std::str::FromStr;
+
+    use ccp_shared::types::{LogicalCoreId, PhysicalCoreId, CUID};
+    use cpu_utils::MockCPUTopology;
+    use hex::FromHex;
+    use mockall::predicate::eq;
+    use nonempty::nonempty;
+    use rand::Rng;
+
+    use crate::errors::AcquireError;
+    use crate::persistence::PersistentCoreDistributorState;
+    use crate::types::{AcquireRequest, WorkType};
+    use crate::{AcquireStrategy, CoreDistributor, CoreRange, PersistentCoreDistributor};
+
+    fn mocked_topology() -> MockCPUTopology {
+        let mut cpu_topology = MockCPUTopology::new();
+
+        cpu_topology.expect_physical_cores().returning(|| {
+            Ok(nonempty![
+                PhysicalCoreId::new(0),
+                PhysicalCoreId::new(1),
+                PhysicalCoreId::new(2),
+                PhysicalCoreId::new(3),
+                PhysicalCoreId::new(4),
+                PhysicalCoreId::new(5),
+                PhysicalCoreId::new(6),
+                PhysicalCoreId::new(7),
+            ])
+        });
+
+        cpu_topology
+            .expect_logical_cores_for_physical()
+            .with(eq(PhysicalCoreId::new(0)))
+            .returning(|_| Ok(nonempty![LogicalCoreId::new(0), LogicalCoreId::new(1)]));
+
+        cpu_topology
+            .expect_logical_cores_for_physical()
+            .with(eq(PhysicalCoreId::new(1)))
+            .returning(|_| Ok(nonempty![LogicalCoreId::new(2), LogicalCoreId::new(3)]));
+
+        cpu_topology
+            .expect_logical_cores_for_physical()
+            .with(eq(PhysicalCoreId::new(2)))
+            .returning(|_| Ok(nonempty![LogicalCoreId::new(4), LogicalCoreId::new(5)]));
+
+        cpu_topology
+            .expect_logical_cores_for_physical()
+            .with(eq(PhysicalCoreId::new(3)))
+            .returning(|_| Ok(nonempty![LogicalCoreId::new(6), LogicalCoreId::new(7)]));
+
+        cpu_topology
+            .expect_logical_cores_for_physical()
+            .with(eq(PhysicalCoreId::new(4)))
+            .returning(|_| Ok(nonempty![LogicalCoreId::new(8), LogicalCoreId::new(9)]));
+
+        cpu_topology
+            .expect_logical_cores_for_physical()
+            .with(eq(PhysicalCoreId::new(5)))
+            .returning(|_| Ok(nonempty![LogicalCoreId::new(10), LogicalCoreId::new(11)]));
+
+        cpu_topology
+            .expect_logical_cores_for_physical()
+            .with(eq(PhysicalCoreId::new(6)))
+            .returning(|_| Ok(nonempty![LogicalCoreId::new(12), LogicalCoreId::new(13)]));
+
+        cpu_topology
+            .expect_logical_cores_for_physical()
+            .with(eq(PhysicalCoreId::new(7)))
+            .returning(|_| Ok(nonempty![LogicalCoreId::new(14), LogicalCoreId::new(15)]));
+
+        cpu_topology
+    }
+
+    #[test]
+    fn test_acquire_and_switch_strict() {
+        let cpu_topology = mocked_topology();
+        let temp_dir = tempfile::tempdir().expect("Failed to create temp dir");
+
+        let (distributor, _task) = PersistentCoreDistributor::from_path(
+            temp_dir.path().join("test.toml"),
+            2,
+            CoreRange::from_str("0-7").unwrap(),
+            AcquireStrategy::Strict,
+            &cpu_topology,
+        )
+        .unwrap();
+        let init_id_1 =
+            <CUID>::from_hex("54ae1b506c260367a054f80800a545f23e32c6bc4a8908c9a794cb8dad23e5ea")
+                .unwrap();
+        let init_id_2 =
+            <CUID>::from_hex("1cce3d08f784b11d636f2fb55adf291d43c2e9cbe7ae7eeb2d0301a96be0a3a0")
+                .unwrap();
+        let unit_ids = vec![init_id_1, init_id_2];
+        let assignment_1 = distributor
+            .acquire_worker_cores(AcquireRequest {
+                unit_ids: unit_ids.clone(),
+                work_type: WorkType::CapacityCommitment,
+            })
+            .unwrap();
+        let assignment_2 = distributor
+            .acquire_worker_cores(AcquireRequest {
+                unit_ids: unit_ids.clone(),
+                work_type: WorkType::Deal,
+            })
+            .unwrap();
+        let assignment_3 = distributor
+            .acquire_worker_cores(AcquireRequest {
+                unit_ids: unit_ids.clone(),
+                work_type: WorkType::CapacityCommitment,
+            })
+            .unwrap();
+        assert_eq!(assignment_1, assignment_2);
+        assert_eq!(
+            assignment_1
+                .cuid_cores
+                .keys()
+                .cloned()
+                .collect::<BTreeSet<_>>(),
+            BTreeSet::from_iter(unit_ids)
+        );
+        assert_eq!(assignment_1, assignment_2);
+        assert_eq!(assignment_1, assignment_3);
+    }
+
+    #[test]
+    fn test_acquire_and_release_strict() {
+        let cpu_topology = mocked_topology();
+
+        let temp_dir = tempfile::tempdir().expect("Failed to create temp dir");
+        let system_cpu_count = 2;
+        let (distributor, _task) = PersistentCoreDistributor::from_path(
+            temp_dir.path().join("test.toml"),
+            system_cpu_count,
+            CoreRange::from_str("0-7").unwrap(),
+            AcquireStrategy::Strict,
+            &cpu_topology,
+        )
+        .unwrap();
+        let before_lock = distributor.state.read();
+
+        let mut before_available_core = before_lock
+            .available_cores
+            .iter()
+            .cloned()
+            .collect::<Vec<_>>();
+        before_available_core.sort();
+        let before_unit_id_mapping = before_lock.unit_id_mapping.clone();
+        let before_type_mapping = before_lock.work_type_mapping.clone();
+        drop(before_lock);
+
+        assert_eq!(before_available_core.len(), 6);
+        assert_eq!(before_unit_id_mapping.len(), 0);
+        assert_eq!(before_type_mapping.len(), 0);
+
+        let init_id_1 =
+            <CUID>::from_hex("54ae1b506c260367a054f80800a545f23e32c6bc4a8908c9a794cb8dad23e5ea")
+                .unwrap();
+        let init_id_2 =
+            <CUID>::from_hex("1cce3d08f784b11d636f2fb55adf291d43c2e9cbe7ae7eeb2d0301a96be0a3a0")
+                .unwrap();
+        let unit_ids = vec![init_id_1, init_id_2];
+        let assignment = distributor
+            .acquire_worker_cores(AcquireRequest {
+                unit_ids: unit_ids.clone(),
+                work_type: WorkType::CapacityCommitment,
+            })
+            .unwrap();
+        assert_eq!(assignment.logical_core_ids().len(), 4);
+        assert_eq!(assignment.cuid_cores.len(), 2);
+
+        let after_assignment = distributor.state.read();
+
+        let after_assignment_available_core = after_assignment.available_cores.clone();
+        let after_assignment_unit_id_mapping = after_assignment.unit_id_mapping.clone();
+        let after_assignment_type_mapping = after_assignment.work_type_mapping.clone();
+        drop(after_assignment);
+
+        assert_eq!(
+            after_assignment_available_core.len(),
+            before_available_core.len() - 2
+        );
+        assert_eq!(after_assignment_unit_id_mapping.len(), 2);
+        assert_eq!(after_assignment_type_mapping.len(), 2);
+
+        distributor.release_worker_cores(&unit_ids);
+
+        let after_release_lock = distributor.state.read();
+
+        let mut after_release_available_core = after_release_lock
+            .available_cores
+            .iter()
+            .cloned()
+            .collect::<Vec<_>>();
+        after_release_available_core.sort();
+        let after_release_unit_id_mapping = after_release_lock.unit_id_mapping.clone();
+        let after_release_type_mapping = after_release_lock.work_type_mapping.clone();
+        drop(after_release_lock);
+
+        assert_eq!(after_release_available_core, before_available_core);
+        assert_eq!(after_release_unit_id_mapping, before_unit_id_mapping);
+        assert_eq!(after_release_type_mapping, before_type_mapping);
+    }
+
+    #[test]
+    fn test_acquire_error_message_strict() {
+        let temp_dir = tempfile::tempdir().expect("Failed to create temp dir");
+        let init_id_1 =
+            <CUID>::from_hex("54ae1b506c260367a054f80800a545f23e32c6bc4a8908c9a794cb8dad23e5ea")
+                .unwrap();
+        let init_id_2 =
+            <CUID>::from_hex("1cce3d08f784b11d636f2fb55adf291d43c2e9cbe7ae7eeb2d0301a96be0a3a0")
+                .unwrap();
+        let init_id_3 =
+            <CUID>::from_hex("271e0e06fdae1f0237055e78f5804416fd9ebb9ca5b52ae360d8124cde220dae")
+                .unwrap();
+        let persistent_state = PersistentCoreDistributorState {
+            cores_mapping: vec![
+                (PhysicalCoreId::new(1), LogicalCoreId::new(1)),
+                (PhysicalCoreId::new(1), LogicalCoreId::new(2)),
+                (PhysicalCoreId::new(2), LogicalCoreId::new(3)),
+                (PhysicalCoreId::new(2), LogicalCoreId::new(4)),
+                (PhysicalCoreId::new(3), LogicalCoreId::new(5)),
+                (PhysicalCoreId::new(3), LogicalCoreId::new(6)),
+            ],
+            system_cores: vec![PhysicalCoreId::new(1)],
+            available_cores: vec![PhysicalCoreId::new(2)],
+            unit_id_mapping: vec![(PhysicalCoreId::new(3), init_id_1)],
+            work_type_mapping: vec![(init_id_1, WorkType::Deal)],
+        };
+        let (distributor, _task) = PersistentCoreDistributor::make_instance_with_task(
+            temp_dir.into_path(),
+            persistent_state.into(),
+            AcquireStrategy::Strict,
+        );
+
+        distributor
+            .acquire_worker_cores(AcquireRequest {
+                unit_ids: vec![init_id_2],
+                work_type: WorkType::Deal,
+            })
+            .unwrap();
+
+        let result = distributor.acquire_worker_cores(AcquireRequest {
+            unit_ids: vec![init_id_3],
+            work_type: WorkType::Deal,
+        });
+
+        let expected = "Couldn't assign core: no free cores left. \
+        Required: 1, \
+        available: 0, \
+        acquire_request: { unit_ids: [271e0e06fdae1f0237055e78f5804416fd9ebb9ca5b52ae360d8124cde220dae], worker_type: Deal }, \
+        current assignment: [2 -> 1cce3d08f784b11d636f2fb55adf291d43c2e9cbe7ae7eeb2d0301a96be0a3a0, 3 -> 54ae1b506c260367a054f80800a545f23e32c6bc4a8908c9a794cb8dad23e5ea]".to_string();
+        assert_eq!(expected, result.unwrap_err().to_string());
+    }
+
+    #[test]
+    fn test_wrong_range() {
+        let cpu_topology = mocked_topology();
+        let temp_dir = tempfile::tempdir().expect("Failed to create temp dir");
+
+        let range = CoreRange::from_str("0-16384").unwrap();
+
+        let result = PersistentCoreDistributor::from_path(
+            temp_dir.path().join("test.toml"),
+            2,
+            range,
+            AcquireStrategy::Strict,
+            &cpu_topology,
+        );
+
+        assert!(result.is_err());
+        assert_eq!(
+            result.err().map(|err| err.to_string()),
+            Some("The specified Core range 0-16384 exceeds the available CPU count".to_string())
+        );
+    }
+
+    #[test]
+    fn test_reassignment_strict() {
+        let cpu_topology = mocked_topology();
+
+        let temp_dir = tempfile::tempdir().expect("Failed to create temp dir");
+        let system_cpu_count = 1;
+        let (distributor, _task) = PersistentCoreDistributor::from_path(
+            temp_dir.path().join("test.toml"),
+            system_cpu_count,
+            CoreRange::from_str("0-7").unwrap(),
+            AcquireStrategy::Strict,
+            &cpu_topology,
+        )
+        .unwrap();
+
+        let unit_ids_count = 7;
+        let unit_ids: Vec<CUID> = (0..unit_ids_count)
+            .map(|_| {
+                let mut rng = rand::thread_rng();
+                let bytes: [u8; 32] = rng.gen();
+                CUID::new(bytes)
+            })
+            .collect();
+
+        let assignment = distributor
+            .acquire_worker_cores(AcquireRequest {
+                unit_ids: unit_ids.clone(),
+                work_type: WorkType::CapacityCommitment,
+            })
+            .unwrap();
+        assert_eq!(assignment.logical_core_ids().len(), unit_ids_count * 2);
+        assert_eq!(assignment.cuid_cores.len(), unit_ids_count);
+
+        let assignment = distributor
+            .acquire_worker_cores(AcquireRequest {
+                unit_ids: unit_ids.clone(),
+                work_type: WorkType::Deal,
+            })
+            .unwrap();
+        assert_eq!(assignment.logical_core_ids().len(), unit_ids_count * 2);
+        assert_eq!(assignment.cuid_cores.len(), unit_ids_count);
+    }
+
+    #[test]
+    fn test_workload_assign_error() {
+        let cpu_topology = mocked_topology();
+
+        let temp_dir = tempfile::tempdir().expect("Failed to create temp dir");
+        let system_cpu_count = 1;
+        let (distributor, _task) = PersistentCoreDistributor::from_path(
+            temp_dir.path().join("test.toml"),
+            system_cpu_count,
+            CoreRange::from_str("0-7").unwrap(),
+            AcquireStrategy::Strict,
+            &cpu_topology,
+        )
+        .unwrap();
+
+        let unit_ids_count = 7;
+        let unit_ids: Vec<CUID> = (0..unit_ids_count)
+            .map(|_| {
+                let mut rng = rand::thread_rng();
+                let bytes: [u8; 32] = rng.gen();
+                CUID::new(bytes)
+            })
+            .collect();
+
+        let assignment = distributor
+            .acquire_worker_cores(AcquireRequest {
+                unit_ids: unit_ids.clone(),
+                work_type: WorkType::CapacityCommitment,
+            })
+            .unwrap();
+        assert_eq!(assignment.logical_core_ids().len(), unit_ids_count * 2);
+        assert_eq!(assignment.cuid_cores.len(), unit_ids_count);
+        let unit_ids: Vec<CUID> = (0..unit_ids_count)
+            .map(|_| {
+                let mut rng = rand::thread_rng();
+                let bytes: [u8; 32] = rng.gen();
+                CUID::new(bytes)
+            })
+            .collect();
+
+        let result = distributor.acquire_worker_cores(AcquireRequest {
+            unit_ids: unit_ids.clone(),
+            work_type: WorkType::Deal,
+        });
+
+        assert!(result.is_err());
+        if let Err(err) = result {
+            match err {
+                AcquireError::NotFoundAvailableCores {
+                    required,
+                    available,
+                    ..
+                } => {
+                    assert_eq!(required, unit_ids_count);
+                    assert_eq!(available, 0);
+                }
+            }
+        }
+    }
+
+    #[test]
+    fn test_reassignment_round_robin() {
+        let cpu_topology = mocked_topology();
+
+        let temp_dir = tempfile::tempdir().expect("Failed to create temp dir");
+        let system_cpu_count = 1;
+        let (distributor, _task) = PersistentCoreDistributor::from_path(
+            temp_dir.path().join("test.toml"),
+            system_cpu_count,
+            CoreRange::from_str("0-7").unwrap(),
+            AcquireStrategy::RoundRobin,
+            &cpu_topology,
+        )
+        .unwrap();
+
+        let unit_ids_count = 7;
+        let unit_ids: Vec<CUID> = (0..unit_ids_count * 2)
+            .map(|_| {
+                let mut rng = rand::thread_rng();
+                let bytes: [u8; 32] = rng.gen();
+                CUID::new(bytes)
+            })
+            .collect();
+
+        let assignment = distributor
+            .acquire_worker_cores(AcquireRequest {
+                unit_ids: unit_ids.clone(),
+                work_type: WorkType::CapacityCommitment,
+            })
+            .unwrap();
+        assert_eq!(assignment.logical_core_ids().len(), unit_ids_count * 2);
+        assert_eq!(assignment.cuid_cores.len(), unit_ids_count * 2);
+
+        let assignment = distributor
+            .acquire_worker_cores(AcquireRequest {
+                unit_ids: unit_ids.clone(),
+                work_type: WorkType::Deal,
+            })
+            .unwrap();
+        assert_eq!(assignment.logical_core_ids().len(), unit_ids_count * 2);
+        assert_eq!(assignment.cuid_cores.len(), unit_ids_count * 2);
+    }
+
+    #[test]
+    fn test_acquire_and_release_round_robin() {
+        let cpu_topology = mocked_topology();
+
+        let temp_dir = tempfile::tempdir().expect("Failed to create temp dir");
+        let system_cpu_count = 2;
+        let (distributor, _task) = PersistentCoreDistributor::from_path(
+            temp_dir.path().join("test.toml"),
+            system_cpu_count,
+            CoreRange::from_str("0-2").unwrap(),
+            AcquireStrategy::RoundRobin,
+            &cpu_topology,
+        )
+        .unwrap();
+        let before_lock = distributor.state.read();
+
+        let mut before_available_core = before_lock
+            .available_cores
+            .iter()
+            .cloned()
+            .collect::<Vec<_>>();
+        before_available_core.sort();
+        let before_unit_id_mapping = before_lock.unit_id_mapping.clone();
+        let before_type_mapping = before_lock.work_type_mapping.clone();
+        drop(before_lock);
+
+        assert_eq!(before_available_core.len(), 1);
+        assert_eq!(before_unit_id_mapping.len(), 0);
+        assert_eq!(before_type_mapping.len(), 0);
+
+        let init_id_1 =
+            <CUID>::from_hex("54ae1b506c260367a054f80800a545f23e32c6bc4a8908c9a794cb8dad23e5ea")
+                .unwrap();
+        let init_id_2 =
+            <CUID>::from_hex("1cce3d08f784b11d636f2fb55adf291d43c2e9cbe7ae7eeb2d0301a96be0a3a0")
+                .unwrap();
+        let unit_ids = vec![init_id_1, init_id_2];
+        let assignment = distributor
+            .acquire_worker_cores(AcquireRequest {
+                unit_ids: unit_ids.clone(),
+                work_type: WorkType::CapacityCommitment,
+            })
+            .unwrap();
+        assert_eq!(assignment.logical_core_ids().len(), 2);
+        assert_eq!(assignment.cuid_cores.len(), 2);
+
+        let after_assignment = distributor.state.read();
+
+        let after_assignment_available_core = after_assignment.available_cores.clone();
+        let after_assignment_unit_id_mapping = after_assignment.unit_id_mapping.clone();
+        let after_assignment_type_mapping = after_assignment.work_type_mapping.clone();
+        drop(after_assignment);
+
+        assert_eq!(
+            after_assignment_available_core.len(),
+            before_available_core.len()
+        );
+        assert_eq!(after_assignment_unit_id_mapping.len(), 1);
+        assert_eq!(after_assignment_type_mapping.len(), 2);
+
+        distributor.release_worker_cores(&unit_ids);
+
+        let after_release_lock = distributor.state.read();
+
+        let mut after_release_available_core = after_release_lock
+            .available_cores
+            .iter()
+            .cloned()
+            .collect::<Vec<_>>();
+        after_release_available_core.sort();
+        let after_release_unit_id_mapping = after_release_lock.unit_id_mapping.clone();
+        let after_release_type_mapping = after_release_lock.work_type_mapping.clone();
+        drop(after_release_lock);
+
+        assert_eq!(after_release_available_core, before_available_core);
+        assert_eq!(after_release_unit_id_mapping, before_unit_id_mapping);
+        assert_eq!(after_release_type_mapping, before_type_mapping);
+    }
+}
+
\ No newline at end of file diff --git a/src/core_distributor/dummy.rs.html b/src/core_distributor/dummy.rs.html new file mode 100644 index 0000000000..4ad7fb5f9a --- /dev/null +++ b/src/core_distributor/dummy.rs.html @@ -0,0 +1,131 @@ +dummy.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use ccp_shared::types::{LogicalCoreId, PhysicalCoreId, CUID};
+use fxhash::FxBuildHasher;
+
+use crate::errors::AcquireError;
+use crate::types::{AcquireRequest, Assignment, Cores, SystemAssignment};
+use crate::{CoreDistributor, Map};
+
+pub struct DummyCoreDistibutor;
+
+impl Default for DummyCoreDistibutor {
+    fn default() -> Self {
+        Self::new()
+    }
+}
+
+impl DummyCoreDistibutor {
+    pub fn new() -> Self {
+        Self {}
+    }
+}
+
+impl CoreDistributor for DummyCoreDistibutor {
+    fn acquire_worker_cores(
+        &self,
+        acquire_request: AcquireRequest,
+    ) -> Result<Assignment, AcquireError> {
+        let mut data = Map::with_hasher(FxBuildHasher::default());
+        for unit_id in acquire_request.unit_ids {
+            data.insert(
+                unit_id,
+                Cores {
+                    physical_core_id: PhysicalCoreId::new(0),
+                    logical_core_ids: vec![LogicalCoreId::new(0)],
+                },
+            );
+        }
+
+        Ok(Assignment::new(data))
+    }
+
+    fn release_worker_cores(&self, _unit_ids: &[CUID]) {}
+
+    fn get_system_cpu_assignment(&self) -> SystemAssignment {
+        SystemAssignment::new(vec![PhysicalCoreId::new(0)], vec![LogicalCoreId::new(0)])
+    }
+}
+
\ No newline at end of file diff --git a/src/core_distributor/errors.rs.html b/src/core_distributor/errors.rs.html new file mode 100644 index 0000000000..cfb934aae0 --- /dev/null +++ b/src/core_distributor/errors.rs.html @@ -0,0 +1,253 @@ +errors.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use std::fmt::{Display, Formatter, Write};
+use std::str::Utf8Error;
+
+use crate::CoreRange;
+use ccp_shared::types::CUID;
+use cpu_utils::{CPUTopologyError, PhysicalCoreId};
+use thiserror::Error;
+
+use crate::types::AcquireRequest;
+
+#[derive(Debug, Error)]
+pub enum CreateError {
+    #[error("System core count should be > 0")]
+    IllegalSystemCoreCount,
+    #[error("Too much system cores needed. Required: {required}, available: {required}")]
+    NotEnoughCores { available: usize, required: usize },
+    #[error("Failed to create CPU topology {err}")]
+    CreateTopology { err: CPUTopologyError },
+    #[error("Failed to collect cores data from OS {err:?}")]
+    CollectCoresData { err: CPUTopologyError },
+    #[error("The specified Core range {core_range} exceeds the available CPU count")]
+    WrongCoreRange { core_range: CoreRange },
+}
+
+#[derive(Debug, Error)]
+pub enum LoadingError {
+    #[error(transparent)]
+    CreateCoreDistributor {
+        #[from]
+        err: CreateError,
+    },
+    #[error("Failed to read core state: {err}")]
+    IoError {
+        #[from]
+        err: std::io::Error,
+    },
+    #[error("Failed to decode core state: {err}")]
+    DecodeError {
+        #[from]
+        err: Utf8Error,
+    },
+    #[error("Failed to deserialize core state: {err}")]
+    DeserializationError {
+        #[from]
+        err: toml::de::Error,
+    },
+    #[error(transparent)]
+    PersistError {
+        #[from]
+        err: PersistError,
+    },
+}
+
+#[derive(Debug, Error)]
+pub enum PersistError {
+    #[error("Failed to persist core state: {err}")]
+    IoError {
+        #[from]
+        err: std::io::Error,
+    },
+    #[error("Failed to serialize core state: {err}")]
+    SerializationError {
+        #[from]
+        err: toml::ser::Error,
+    },
+}
+
+#[derive(Debug, PartialEq)]
+pub struct CurrentAssignment {
+    data: Vec<(PhysicalCoreId, CUID)>,
+}
+
+impl CurrentAssignment {
+    pub fn new(data: Vec<(PhysicalCoreId, CUID)>) -> Self {
+        Self { data }
+    }
+}
+
+impl Display for CurrentAssignment {
+    fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
+        f.write_char('[')?;
+        for (core, cuid) in &self.data[0..self.data.len() - 1] {
+            f.write_str(core.to_string().as_str())?;
+            f.write_str(" -> ")?;
+            f.write_str(format!("{}", cuid).as_str())?;
+            f.write_str(", ")?;
+        }
+        let (core, cuid) = &self.data[self.data.len() - 1];
+        f.write_str(core.to_string().as_str())?;
+        f.write_str(" -> ")?;
+        f.write_str(format!("{}", cuid).as_str())?;
+
+        f.write_char(']')?;
+        Ok(())
+    }
+}
+
+#[derive(Debug, Error, PartialEq)]
+pub enum AcquireError {
+    #[error("Couldn't assign core: no free cores left. Required: {required}, available: {available}, acquire_request: {acquire_request}, current assignment: {current_assignment}")]
+    NotFoundAvailableCores {
+        required: usize,
+        available: usize,
+        acquire_request: AcquireRequest,
+        current_assignment: CurrentAssignment,
+    },
+}
+
\ No newline at end of file diff --git a/src/core_distributor/lib.rs.html b/src/core_distributor/lib.rs.html new file mode 100644 index 0000000000..ae73865c63 --- /dev/null +++ b/src/core_distributor/lib.rs.html @@ -0,0 +1,111 @@ +lib.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+#![feature(slice_take)]
+
+extern crate core;
+
+pub type Map<K, V> = HashMap<K, V, BuildHasherDefault<FxHasher>>;
+pub(crate) type MultiMap<K, V> = multimap::MultiMap<K, V, BuildHasherDefault<FxHasher>>;
+pub(crate) type BiMap<K, V> =
+    bimap::BiHashMap<K, V, BuildHasherDefault<FxHasher>, BuildHasherDefault<FxHasher>>;
+
+pub mod errors;
+
+pub mod types;
+
+mod core_range;
+mod distributor;
+mod persistence;
+mod strategy;
+
+#[cfg(feature = "dummy")]
+pub mod dummy;
+
+pub use ccp_shared::types::CUID;
+pub use core_range::CoreRange;
+pub use cpu_utils::pinning::ThreadPinner;
+pub use cpu_utils::LogicalCoreId;
+pub use cpu_utils::PhysicalCoreId;
+use fxhash::FxHasher;
+use std::collections::HashMap;
+use std::hash::BuildHasherDefault;
+
+pub use distributor::CoreDistributor;
+#[cfg(feature = "mockall")]
+pub use distributor::MockCoreDistributor;
+pub use distributor::PersistentCoreDistributor;
+pub use persistence::PersistenceTask;
+pub use strategy::AcquireStrategy;
+
\ No newline at end of file diff --git a/src/core_distributor/persistence.rs.html b/src/core_distributor/persistence.rs.html new file mode 100644 index 0000000000..1c15a81d6c --- /dev/null +++ b/src/core_distributor/persistence.rs.html @@ -0,0 +1,335 @@ +persistence.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use std::fs::File;
+use std::io::Write;
+use std::path::Path;
+use std::sync::Arc;
+
+use crate::distributor::CoreDistributorState;
+use ccp_shared::types::{LogicalCoreId, PhysicalCoreId, CUID};
+use futures::StreamExt;
+use hex_utils::serde_as::Hex;
+use serde::{Deserialize, Serialize};
+use serde_with::serde_as;
+use tokio::sync::mpsc::Receiver;
+use tokio_stream::wrappers::ReceiverStream;
+
+use crate::errors::PersistError;
+use crate::types::WorkType;
+
+pub(crate) trait StatePersister: Send + Sync {
+    fn persist(&self) -> Result<(), PersistError>;
+}
+
+pub struct PersistenceTask {
+    persister: Arc<dyn StatePersister>,
+    receiver: Receiver<()>,
+}
+
+impl PersistenceTask {
+    pub(crate) fn new(persistence: Arc<dyn StatePersister>, receiver: Receiver<()>) -> Self {
+        Self {
+            persister: persistence,
+            receiver,
+        }
+    }
+}
+
+impl PersistenceTask {
+    async fn process_events(self) {
+        let stream = ReceiverStream::from(self.receiver);
+        // We are not interested in the content of the event
+        // We are waiting for the event to initiate the persistence process
+        stream.for_each(move |_| {
+            let persister = self.persister.clone();
+            async move {
+                tokio::task::spawn_blocking(move || {
+                        let result =  persister.persist();
+                        match result {
+                            Ok(_) => {
+                                tracing::debug!(target: "core-distributor", "Core state was persisted");
+                            }
+                            Err(err) => {
+                                tracing::warn!(target: "core-distributor", "Failed to save core state {err}");
+                            }
+                        }
+                })
+                    .await
+                    .expect("Could not spawn persist task")
+            }
+        }).await;
+    }
+
+    pub async fn run(self) {
+        tokio::task::Builder::new()
+            .name("core-distributor-persist")
+            .spawn(self.process_events())
+            .expect("Could not spawn persist task");
+    }
+}
+
+#[serde_as]
+#[derive(Serialize, Deserialize)]
+pub struct PersistentCoreDistributorState {
+    pub cores_mapping: Vec<(PhysicalCoreId, LogicalCoreId)>,
+    pub system_cores: Vec<PhysicalCoreId>,
+    pub available_cores: Vec<PhysicalCoreId>,
+    #[serde_as(as = "Vec<(_, Hex)>")]
+    pub unit_id_mapping: Vec<(PhysicalCoreId, CUID)>,
+    #[serde_as(as = "Vec<(Hex, _)>")]
+    pub work_type_mapping: Vec<(CUID, WorkType)>,
+}
+
+impl PersistentCoreDistributorState {
+    pub fn persist(&self, file_path: &Path) -> Result<(), PersistError> {
+        let toml = toml::to_string_pretty(&self)
+            .map_err(|err| PersistError::SerializationError { err })?;
+        let mut file = File::create(file_path).map_err(|err| PersistError::IoError { err })?;
+        file.write(toml.as_bytes())
+            .map_err(|err| PersistError::IoError { err })?;
+        Ok(())
+    }
+}
+
+impl From<&CoreDistributorState> for PersistentCoreDistributorState {
+    fn from(value: &CoreDistributorState) -> Self {
+        Self {
+            cores_mapping: value.cores_mapping.iter().map(|(k, v)| (*k, *v)).collect(),
+            system_cores: value.system_cores.clone(),
+            available_cores: value.available_cores.iter().cloned().collect(),
+            unit_id_mapping: value
+                .unit_id_mapping
+                .iter()
+                .map(|(k, v)| (*k, (*v)))
+                .collect(),
+            work_type_mapping: value
+                .work_type_mapping
+                .iter()
+                .map(|(k, v)| ((*k), *v))
+                .collect(),
+        }
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use crate::persistence::PersistentCoreDistributorState;
+    use crate::types::WorkType;
+    use ccp_shared::types::{LogicalCoreId, PhysicalCoreId, CUID};
+    use hex::FromHex;
+
+    #[test]
+    fn test_serde() {
+        let init_id_1 =
+            <CUID>::from_hex("54ae1b506c260367a054f80800a545f23e32c6bc4a8908c9a794cb8dad23e5ea")
+                .unwrap();
+        let persistent_state = PersistentCoreDistributorState {
+            cores_mapping: vec![
+                (PhysicalCoreId::new(1), LogicalCoreId::new(1)),
+                (PhysicalCoreId::new(1), LogicalCoreId::new(2)),
+                (PhysicalCoreId::new(2), LogicalCoreId::new(3)),
+                (PhysicalCoreId::new(2), LogicalCoreId::new(4)),
+                (PhysicalCoreId::new(3), LogicalCoreId::new(5)),
+                (PhysicalCoreId::new(3), LogicalCoreId::new(6)),
+                (PhysicalCoreId::new(4), LogicalCoreId::new(7)),
+                (PhysicalCoreId::new(4), LogicalCoreId::new(8)),
+            ],
+            system_cores: vec![PhysicalCoreId::new(1)],
+            available_cores: vec![PhysicalCoreId::new(2), PhysicalCoreId::new(3)],
+            unit_id_mapping: vec![(PhysicalCoreId::new(4), init_id_1)],
+            work_type_mapping: vec![(init_id_1, WorkType::Deal)],
+        };
+        let actual = toml::to_string(&persistent_state).unwrap();
+        let expected = "cores_mapping = [[1, 1], [1, 2], [2, 3], [2, 4], [3, 5], [3, 6], [4, 7], [4, 8]]\n\
+        system_cores = [1]\n\
+        available_cores = [2, 3]\n\
+        unit_id_mapping = [[4, \"54ae1b506c260367a054f80800a545f23e32c6bc4a8908c9a794cb8dad23e5ea\"]]\n\
+        work_type_mapping = [[\"54ae1b506c260367a054f80800a545f23e32c6bc4a8908c9a794cb8dad23e5ea\", \"Deal\"]]\n";
+        assert_eq!(expected, actual)
+    }
+}
+
\ No newline at end of file diff --git a/src/core_distributor/strategy.rs.html b/src/core_distributor/strategy.rs.html new file mode 100644 index 0000000000..49f4c55307 --- /dev/null +++ b/src/core_distributor/strategy.rs.html @@ -0,0 +1,437 @@ +strategy.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use std::collections::HashMap;
+
+use ccp_shared::types::{PhysicalCoreId, CUID};
+use enum_dispatch::enum_dispatch;
+use fxhash::FxBuildHasher;
+
+use crate::distributor::CoreDistributorState;
+use crate::errors::{AcquireError, CurrentAssignment};
+use crate::types::{AcquireRequest, Assignment, Cores};
+use crate::Map;
+
+#[enum_dispatch]
+pub(crate) trait AcquireStrategyOperations {
+    fn acquire(
+        &self,
+        state: &mut CoreDistributorState,
+        acquire_request: AcquireRequest,
+    ) -> Result<Assignment, AcquireError>;
+
+    fn release(&self, state: &mut CoreDistributorState, unit_ids: &[CUID]);
+}
+
+pub enum AcquireStrategy {
+    Strict,
+    RoundRobin,
+}
+
+impl From<AcquireStrategy> for AcquireStrategyInner {
+    fn from(value: AcquireStrategy) -> Self {
+        match value {
+            AcquireStrategy::Strict => AcquireStrategyInner::Strict(StrictAcquireStrategy),
+            AcquireStrategy::RoundRobin => {
+                AcquireStrategyInner::RoundRobin(RoundRobinAcquireStrategy)
+            }
+        }
+    }
+}
+
+#[enum_dispatch(AcquireStrategyOperations)]
+pub(crate) enum AcquireStrategyInner {
+    Strict(StrictAcquireStrategy),
+    RoundRobin(RoundRobinAcquireStrategy),
+}
+
+pub(crate) struct StrictAcquireStrategy;
+
+impl AcquireStrategyOperations for StrictAcquireStrategy {
+    fn acquire(
+        &self,
+        state: &mut CoreDistributorState,
+        acquire_request: AcquireRequest,
+    ) -> Result<Assignment, AcquireError> {
+        let mut cuid_cores: Map<CUID, Cores> = HashMap::with_capacity_and_hasher(
+            acquire_request.unit_ids.len(),
+            FxBuildHasher::default(),
+        );
+
+        let worker_unit_type = &acquire_request.work_type;
+
+        let available = state.available_cores.len();
+
+        let core_allocation = acquire_request
+            .unit_ids
+            .iter()
+            .map(|&unit_id| {
+                (
+                    unit_id,
+                    // TODO: introduce a new enum to make code self-documented.
+                    state.unit_id_mapping.get_by_right(&unit_id).cloned(),
+                )
+            })
+            .collect::<Vec<_>>();
+
+        let required = core_allocation
+            .iter()
+            .filter(|(_, core)| core.is_none())
+            .count();
+
+        if required > available {
+            let current_assignment: Vec<(PhysicalCoreId, CUID)> = state
+                .unit_id_mapping
+                .iter()
+                .map(|(k, v)| (*k, *v))
+                .collect();
+            return Err(AcquireError::NotFoundAvailableCores {
+                required,
+                available,
+                acquire_request: acquire_request.clone(),
+                current_assignment: CurrentAssignment::new(current_assignment),
+            });
+        }
+
+        for (unit_id, physical_core_id) in core_allocation {
+            let physical_core_id = match physical_core_id {
+                None => {
+                    // SAFETY: this should never happen because we already checked the availability of cores
+                    let core_id = state
+                        .available_cores
+                        .pop_back()
+                        .expect("Unexpected state. Should not be empty never");
+                    state.unit_id_mapping.insert(core_id, unit_id);
+                    state.work_type_mapping.insert(unit_id, *worker_unit_type);
+                    core_id
+                }
+                Some(core_id) => {
+                    state.work_type_mapping.insert(unit_id, *worker_unit_type);
+                    core_id
+                }
+            };
+
+            // SAFETY: The physical core always has corresponding logical ids,
+            // unit_id_mapping can't have a wrong physical_core_id
+            let logical_core_ids = state
+                .cores_mapping
+                .get_vec(&physical_core_id)
+                .cloned()
+                .expect("Unexpected state. Should not be empty never");
+
+            cuid_cores.insert(
+                unit_id,
+                Cores {
+                    physical_core_id,
+                    logical_core_ids,
+                },
+            );
+        }
+
+        Ok(Assignment::new(cuid_cores))
+    }
+
+    fn release(&self, state: &mut CoreDistributorState, unit_ids: &[CUID]) {
+        for unit_id in unit_ids {
+            if let Some((physical_core_id, _)) = state.unit_id_mapping.remove_by_right(unit_id) {
+                state.available_cores.push_back(physical_core_id);
+                state.work_type_mapping.remove(unit_id);
+            }
+        }
+    }
+}
+
+pub(crate) struct RoundRobinAcquireStrategy;
+
+impl AcquireStrategyOperations for RoundRobinAcquireStrategy {
+    fn acquire(
+        &self,
+        state: &mut CoreDistributorState,
+        acquire_request: AcquireRequest,
+    ) -> Result<Assignment, AcquireError> {
+        let mut cuid_cores: Map<CUID, Cores> = HashMap::with_capacity_and_hasher(
+            acquire_request.unit_ids.len(),
+            FxBuildHasher::default(),
+        );
+        let worker_unit_type = acquire_request.work_type;
+        for unit_id in acquire_request.unit_ids {
+            let physical_core_id = state.unit_id_mapping.get_by_right(&unit_id).cloned();
+            let physical_core_id = match physical_core_id {
+                None => {
+                    // SAFETY: this should never happen because after the pop operation, we push it back
+                    let core_id = state
+                        .available_cores
+                        .pop_front()
+                        .expect("Unexpected state. Should not be empty never");
+                    state.unit_id_mapping.insert(core_id, unit_id);
+                    state.work_type_mapping.insert(unit_id, worker_unit_type);
+                    state.available_cores.push_back(core_id);
+                    core_id
+                }
+                Some(core_id) => {
+                    state.work_type_mapping.insert(unit_id, worker_unit_type);
+                    core_id
+                }
+            };
+
+            // SAFETY: The physical core always has corresponding logical ids,
+            // unit_id_core_mapping can't have a wrong physical_core_id
+            let logical_core_ids = state
+                .cores_mapping
+                .get_vec(&physical_core_id)
+                .cloned()
+                .expect("Unexpected state. Should not be empty never");
+
+            cuid_cores.insert(
+                unit_id,
+                Cores {
+                    physical_core_id,
+                    logical_core_ids,
+                },
+            );
+        }
+        Ok(Assignment::new(cuid_cores))
+    }
+
+    fn release(&self, state: &mut CoreDistributorState, unit_ids: &[CUID]) {
+        for unit_id in unit_ids {
+            state.unit_id_mapping.remove_by_right(unit_id);
+            state.work_type_mapping.remove(unit_id);
+        }
+    }
+}
+
\ No newline at end of file diff --git a/src/core_distributor/types.rs.html b/src/core_distributor/types.rs.html new file mode 100644 index 0000000000..531e75ba7f --- /dev/null +++ b/src/core_distributor/types.rs.html @@ -0,0 +1,227 @@ +types.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use std::collections::BTreeSet;
+use std::fmt::{Display, Formatter, Write};
+
+use ccp_shared::types::CUID;
+use cpu_utils::pinning::ThreadPinner;
+use cpu_utils::{LogicalCoreId, PhysicalCoreId};
+use serde::{Deserialize, Serialize};
+
+use crate::Map;
+
+#[derive(Debug, PartialEq, Eq, Hash, Clone, Copy, Serialize, Deserialize)]
+pub enum WorkType {
+    CapacityCommitment,
+    Deal,
+}
+
+#[derive(Debug, PartialEq, Clone)]
+pub struct AcquireRequest {
+    pub(crate) unit_ids: Vec<CUID>,
+    pub(crate) work_type: WorkType,
+}
+
+impl AcquireRequest {
+    pub fn new(unit_ids: Vec<CUID>, worker_type: WorkType) -> Self {
+        Self {
+            unit_ids,
+            work_type: worker_type,
+        }
+    }
+}
+
+impl Display for AcquireRequest {
+    fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
+        f.write_str("{ unit_ids: ")?;
+        f.write_char('[')?;
+        for cuid in &self.unit_ids {
+            f.write_str(format!("{}", cuid).as_str())?;
+        }
+        f.write_str("], ")?;
+        f.write_str("worker_type: ")?;
+        f.write_str(format!("{:?}", self.work_type).as_str())?;
+        f.write_str(" }")?;
+        Ok(())
+    }
+}
+
+#[derive(Debug, Eq, PartialEq, Clone)]
+pub struct Cores {
+    pub physical_core_id: PhysicalCoreId,
+    pub logical_core_ids: Vec<LogicalCoreId>,
+}
+
+#[derive(Debug, Eq, PartialEq, Clone)]
+pub struct Assignment {
+    // We don't need a cryptographically secure hash and it is better to use a fx hash here
+    // to improve performance
+    pub cuid_cores: Map<CUID, Cores>,
+}
+
+pub struct SystemAssignment {
+    pub physical_core_ids: Vec<PhysicalCoreId>,
+    pub logical_core_ids: Vec<LogicalCoreId>,
+}
+
+impl SystemAssignment {
+    pub(crate) fn new(
+        physical_core_ids: Vec<PhysicalCoreId>,
+        logical_core_ids: Vec<LogicalCoreId>,
+    ) -> Self {
+        Self {
+            physical_core_ids,
+            logical_core_ids,
+        }
+    }
+}
+
+impl Assignment {
+    pub(crate) fn new(cuid_cores: Map<CUID, Cores>) -> Self {
+        Self { cuid_cores }
+    }
+
+    pub fn logical_core_ids(&self) -> Vec<LogicalCoreId> {
+        self.cuid_cores
+            .iter()
+            .flat_map(|(_, cores)| cores.logical_core_ids.clone())
+            .collect::<BTreeSet<LogicalCoreId>>() // needed to remove duplicates
+            .into_iter()
+            .collect::<Vec<_>>()
+    }
+
+    pub fn pin_current_thread_with(&self, thread_pinner: &dyn ThreadPinner) {
+        thread_pinner.pin_current_thread_to_cpuset(&self.logical_core_ids());
+    }
+}
+
\ No newline at end of file diff --git a/src/created_swarm/lib.rs.html b/src/created_swarm/lib.rs.html new file mode 100644 index 0000000000..9587dadec0 --- /dev/null +++ b/src/created_swarm/lib.rs.html @@ -0,0 +1,97 @@ +lib.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+#![feature(try_blocks)]
+#![feature(async_closure)]
+#![warn(rust_2018_idioms)]
+#![deny(
+    dead_code,
+    nonstandard_style,
+    unused_imports,
+    unused_mut,
+    unused_variables,
+    unused_unsafe,
+    unreachable_patterns
+)]
+
+mod services;
+mod swarm;
+
+pub use crate::services::*;
+pub use crate::swarm::*;
+
+pub use server_config::system_services_config;
+pub use server_config::ChainConfig;
+
+pub use particle_args::{Args, JError};
+pub use particle_execution::{FunctionOutcome, ParticleParams};
+
+pub use fluence_app_service;
+pub use fluence_keypair;
+pub use fluence_spell_dtos;
+pub use system_services;
+
\ No newline at end of file diff --git a/src/created_swarm/services.rs.html b/src/created_swarm/services.rs.html new file mode 100644 index 0000000000..5c0667c436 --- /dev/null +++ b/src/created_swarm/services.rs.html @@ -0,0 +1,105 @@ +services.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use crate::CreatedSwarm;
+use fluence_libp2p::PeerId;
+use futures::future::BoxFuture;
+use futures::FutureExt;
+use maplit::hashmap;
+use particle_execution::FunctionOutcome;
+use serde_json::json;
+
+pub async fn add_print<'a>(swarms: impl Iterator<Item = &'a mut CreatedSwarm>) {
+    let print = |peer_id: PeerId| -> Box<
+        dyn Fn(_, _) -> BoxFuture<'static, FunctionOutcome> + 'static + Send + Sync,
+    > {
+        Box::new(move |args: particle_args::Args, _| {
+            async move {
+                println!("{} printing {}", peer_id, json!(args.function_args));
+                FunctionOutcome::Empty
+            }
+            .boxed()
+        })
+    };
+    for s in swarms {
+        s.aquamarine_api
+            .clone()
+            .add_service(
+                "test".into(),
+                hashmap! {
+                    "print".to_string() => print(s.peer_id).into(),
+                },
+            )
+            .await
+            .expect("add service");
+    }
+}
+
\ No newline at end of file diff --git a/src/created_swarm/swarm.rs.html b/src/created_swarm/swarm.rs.html new file mode 100644 index 0000000000..c9f74862b0 --- /dev/null +++ b/src/created_swarm/swarm.rs.html @@ -0,0 +1,1117 @@ +swarm.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use std::collections::HashMap;
+use std::convert::identity;
+use std::future::Future;
+use std::net::SocketAddr;
+use std::ops::Deref;
+use std::str::FromStr;
+use std::sync::Arc;
+use std::thread::available_parallelism;
+use std::{path::PathBuf, time::Duration};
+
+use derivative::Derivative;
+use fluence_keypair::KeyPair;
+use futures::{stream, FutureExt, StreamExt};
+use libp2p::core::multiaddr::Protocol;
+use libp2p::{core::Multiaddr, PeerId};
+use serde::Deserialize;
+
+use air_interpreter_fs::{air_interpreter_path, write_default_air_interpreter};
+use aquamarine::{AVMRunner, AquamarineApi, VmConfig};
+use aquamarine::{AquaRuntime, DataStoreConfig};
+use base64::{engine::general_purpose::STANDARD as base64, Engine};
+use cid_utils::Hash;
+use core_distributor::{AcquireStrategy, CoreRange, PersistenceTask, PersistentCoreDistributor};
+use cpu_utils::{CPUTopology, HwlocCPUTopology, LogicalCoreId, MockCPUTopology, PhysicalCoreId};
+use fluence_libp2p::random_multiaddr::{create_memory_maddr, create_tcp_maddr};
+use fluence_libp2p::Transport;
+use fs_utils::to_abs_path;
+use futures::stream::iter;
+use nonempty::{nonempty, NonEmpty};
+use nox::{Connectivity, Node};
+use particle_protocol::ProtocolConfig;
+use rand::RngCore;
+use server_config::{
+    persistent_dir, system_services_config, BootstrapConfig, ChainConfig, ChainListenerConfig,
+    Network, ResolvedConfig, UnresolvedConfig,
+};
+use tempfile::TempDir;
+use test_constants::{EXECUTION_TIMEOUT, IDLE_CONNECTION_TIMEOUT, TRANSPORT_TIMEOUT};
+use tokio::sync::oneshot;
+use tokio_util::sync::CancellationToken;
+use toy_vms::EasyVM;
+use tracing::{Instrument, Span};
+
+const HEALTH_CHECK_POLLING_INTERVAL: Duration = Duration::from_millis(100);
+
+// default bound on the number of computations it can perform simultaneously
+const DEFAULT_PARALLELISM: usize = 2;
+
+#[allow(clippy::upper_case_acronyms)]
+type AVM = aquamarine::AVMRunner;
+
+#[derive(Derivative)]
+#[derivative(Debug)]
+pub struct CreatedSwarm {
+    pub config: ResolvedConfig,
+    pub peer_id: PeerId,
+    pub multiaddr: Multiaddr,
+    // tmp dir, must be cleaned
+    pub tmp_dir: Arc<TempDir>,
+    // management_peer_id
+    #[derivative(Debug = "ignore")]
+    pub management_keypair: KeyPair,
+    // stop signal
+    pub exit_outlet: oneshot::Sender<()>,
+
+    pub cancellation_token: CancellationToken,
+    // node connectivity
+    #[derivative(Debug = "ignore")]
+    pub connectivity: Connectivity,
+    #[derivative(Debug = "ignore")]
+    pub aquamarine_api: AquamarineApi,
+    pub http_listen_addr: SocketAddr,
+    pub network_key: NetworkKey,
+}
+
+pub async fn make_swarms(n: usize) -> Vec<CreatedSwarm> {
+    make_swarms_with_cfg(n, identity).await
+}
+
+pub async fn make_swarms_with_cfg<F>(n: usize, mut update_cfg: F) -> Vec<CreatedSwarm>
+where
+    F: (FnMut(SwarmConfig) -> SwarmConfig),
+{
+    make_swarms_with(
+        n,
+        move |bs, maddr| {
+            let cfg = update_cfg(SwarmConfig::new(bs, maddr, NetworkKey::random()));
+            async move { create_swarm(cfg).await }
+        },
+        create_memory_maddr,
+        identity,
+        true,
+    )
+    .await
+}
+
+pub async fn make_swarms_with_transport_and_mocked_vm(
+    n: usize,
+    transport: Transport,
+) -> Vec<CreatedSwarm> {
+    let network_key = NetworkKey::random();
+
+    make_swarms_with::<EasyVM, _, _, _, _>(
+        n,
+        |bs, maddr| async {
+            create_swarm_with_runtime(SwarmConfig::new(bs, maddr, network_key.clone()), |_| None)
+                .await
+        },
+        move || match transport {
+            Transport::Memory => create_memory_maddr(),
+            Transport::Network => create_tcp_maddr(),
+        },
+        identity,
+        true,
+    )
+    .await
+}
+
+pub async fn make_swarms_with_mocked_vm<F, B>(
+    n: usize,
+    mut update_cfg: F,
+    delay: Option<Duration>,
+    bootstraps: B,
+) -> Vec<CreatedSwarm>
+where
+    F: (FnMut(SwarmConfig) -> SwarmConfig),
+    B: (FnMut(Vec<Multiaddr>) -> Vec<Multiaddr>),
+{
+    let network_key = NetworkKey::random();
+
+    make_swarms_with::<EasyVM, _, _, _, _>(
+        n,
+        move |bs, maddr| {
+            let cfg = update_cfg(SwarmConfig::new(bs, maddr, network_key.clone()));
+            async move { create_swarm_with_runtime(cfg, move |_| delay).await }
+        },
+        create_memory_maddr,
+        bootstraps,
+        true,
+    )
+    .await
+}
+
+pub async fn make_swarms_with_keypair(n: usize, host_keypair: KeyPair) -> Vec<CreatedSwarm> {
+    make_swarms_with_cfg(n, move |mut cfg| {
+        cfg.keypair = host_keypair.clone();
+        cfg
+    })
+    .await
+}
+
+type MakeSwarmsData<RT> = (
+    PeerId,
+    Box<Node<RT>>,
+    KeyPair,
+    SwarmConfig,
+    ResolvedConfig,
+    Span,
+    PersistenceTask,
+);
+
+pub async fn make_swarms_with<RT: AquaRuntime, F, FF, M, B>(
+    n: usize,
+    mut create_node: F,
+    mut create_maddr: M,
+    mut bootstraps: B,
+    wait_connected: bool,
+) -> Vec<CreatedSwarm>
+where
+    FF: Future<Output = MakeSwarmsData<RT>>,
+    F: (FnMut(Vec<Multiaddr>, Multiaddr) -> FF),
+    M: (FnMut() -> Multiaddr),
+    B: (FnMut(Vec<Multiaddr>) -> Vec<Multiaddr>),
+{
+    let addrs = (0..n).map(|_| create_maddr()).collect::<Vec<_>>();
+
+    let parallelism = available_parallelism()
+        .map(|x| x.get())
+        .unwrap_or(DEFAULT_PARALLELISM);
+
+    let nodes: Vec<CreatedSwarm> = stream::iter(addrs.clone())
+        .map(|addr| {
+            let addrs: Vec<Multiaddr> = addrs.clone().into_iter().filter(|a| a != &addr).collect();
+            let bootstraps = bootstraps(addrs);
+            let create_node_future = create_node(bootstraps, addr.clone());
+            async move {
+                let (peer_id, node, management_keypair, input_config, resolved_config, span, task) =
+                    create_node_future.await;
+                let connectivity = node.connectivity.clone();
+                let aquamarine_api = node.aquamarine_api.clone();
+                let started_node = node
+                    .start(peer_id)
+                    .instrument(span)
+                    .await
+                    .expect("node start");
+                let http_listen_addr = started_node
+                    .http_listen_addr
+                    .expect("could not take http listen addr");
+                task.run().await;
+                CreatedSwarm {
+                    config: resolved_config,
+                    peer_id,
+                    multiaddr: input_config.listen_on,
+                    tmp_dir: input_config.tmp_dir.clone(),
+                    management_keypair,
+                    exit_outlet: started_node.exit_outlet,
+                    cancellation_token: started_node.cancellation_token,
+                    connectivity,
+                    aquamarine_api,
+                    http_listen_addr,
+                    network_key: input_config.network_key.clone(),
+                }
+            }
+            .boxed_local()
+        })
+        .buffer_unordered(parallelism)
+        .collect()
+        .await;
+
+    // start all nodes
+    if wait_connected {
+        let addrs = nodes
+            .iter()
+            .map(|info| info.http_listen_addr)
+            .collect::<Vec<_>>();
+        wait_connected_on_addrs(addrs).await;
+    }
+
+    nodes
+}
+
+async fn wait_connected_on_addrs(addrs: Vec<SocketAddr>) {
+    let http_client = &reqwest::Client::new();
+
+    let healthcheck = iter(addrs).for_each_concurrent(None, |addr| async move {
+        loop {
+            let response = http_client
+                .get(format!("http://{}/health", addr))
+                .send()
+                .await
+                .unwrap();
+
+            if response.status() == reqwest::StatusCode::OK {
+                break;
+            }
+
+            tokio::time::sleep(HEALTH_CHECK_POLLING_INTERVAL).await
+        }
+    });
+
+    healthcheck.await;
+}
+
+#[derive(Clone, Debug)]
+pub struct NetworkKey([u8; 32]);
+
+impl NetworkKey {
+    pub fn random() -> Self {
+        let mut rng = rand::thread_rng();
+        let mut res: [u8; 32] = Default::default();
+        rng.fill_bytes(&mut res);
+        NetworkKey(res)
+    }
+}
+
+impl From<[u8; 32]> for NetworkKey {
+    fn from(value: [u8; 32]) -> Self {
+        NetworkKey(value)
+    }
+}
+
+impl From<NetworkKey> for [u8; 32] {
+    fn from(value: NetworkKey) -> Self {
+        value.0
+    }
+}
+
+#[derive(Clone, Derivative)]
+#[derivative(Debug)]
+pub struct SwarmConfig {
+    #[derivative(Debug = "ignore")]
+    pub keypair: KeyPair,
+    #[derivative(Debug = "ignore")]
+    pub management_keypair: KeyPair,
+    #[derivative(Debug = "ignore")]
+    pub builtins_keypair: KeyPair,
+    pub bootstraps: Vec<Multiaddr>,
+    pub listen_on: Multiaddr,
+    pub transport: Transport,
+    pub tmp_dir: Arc<TempDir>,
+    pub pool_size: Option<usize>,
+    pub builtins_dir: Option<PathBuf>,
+    pub spell_base_dir: Option<PathBuf>,
+    pub allowed_binaries: Vec<PathBuf>,
+    pub allowed_effectors: HashMap<String, HashMap<String, PathBuf>>,
+    pub enabled_system_services: Vec<String>,
+    pub extend_system_services: Vec<system_services::PackageDistro>,
+    pub override_system_services_config: Option<system_services_config::SystemServicesConfig>,
+    pub http_port: u16,
+    pub chain_config: Option<ChainConfig>,
+    pub chain_listener_config: Option<ChainListenerConfig>,
+    pub cc_events_dir: Option<PathBuf>,
+    pub network_key: NetworkKey,
+    pub cpu_cores_count: Option<u32>,
+    pub metrics_enabled: bool,
+}
+
+impl SwarmConfig {
+    pub fn new(bootstraps: Vec<Multiaddr>, listen_on: Multiaddr, network_key: NetworkKey) -> Self {
+        let transport = match listen_on.iter().next() {
+            Some(Protocol::Memory(_)) => Transport::Memory,
+            _ => Transport::Network,
+        };
+        let tmp_dir = tempfile::tempdir().expect("Could not create temp dir");
+        let tmp_dir = Arc::new(tmp_dir);
+        Self {
+            keypair: KeyPair::generate_ed25519(),
+            management_keypair: KeyPair::generate_ed25519(),
+            builtins_keypair: KeyPair::generate_ed25519(),
+            bootstraps,
+            listen_on,
+            transport,
+            tmp_dir,
+            pool_size: <_>::default(),
+            builtins_dir: None,
+            spell_base_dir: None,
+            allowed_binaries: vec!["/usr/bin/ipfs".into(), "/usr/bin/curl".into()],
+            allowed_effectors: HashMap::new(),
+            enabled_system_services: vec![],
+            extend_system_services: vec![],
+            override_system_services_config: None,
+            http_port: 0,
+            chain_config: None,
+            chain_listener_config: None,
+            cc_events_dir: None,
+            network_key,
+            cpu_cores_count: Some(128),
+            metrics_enabled: false,
+        }
+    }
+}
+
+pub struct BaseVmConfig {
+    pub peer_id: PeerId,
+    pub tmp_dir: PathBuf,
+    pub listen_on: Multiaddr,
+    pub manager: PeerId,
+}
+
+pub fn aqua_vm_config(
+    vm_config: BaseVmConfig,
+    // startup_peer_id: PeerId,
+) -> <AVM as AquaRuntime>::Config {
+    let BaseVmConfig {
+        peer_id, tmp_dir, ..
+    } = vm_config;
+
+    let persistent_dir = persistent_dir(&tmp_dir);
+    let air_interpreter = air_interpreter_path(&persistent_dir);
+    write_default_air_interpreter(&air_interpreter).expect("write air interpreter");
+
+    VmConfig::new(peer_id, air_interpreter, None, None, None, None, false)
+}
+
+pub async fn create_swarm_with_runtime<RT: AquaRuntime>(
+    config: SwarmConfig,
+    vm_config: impl Fn(BaseVmConfig) -> RT::Config,
+) -> MakeSwarmsData<RT> {
+    use serde_json::json;
+
+    let format = match &config.keypair {
+        KeyPair::Ed25519(_) => "ed25519",
+        KeyPair::Rsa(_) => "rsa",
+        KeyPair::Secp256k1(_) => "secp256k1",
+    };
+
+    let peer_id = libp2p::identity::Keypair::from(config.keypair.clone())
+        .public()
+        .to_peer_id();
+    let parent_span = tracing::info_span!("Node", peer_id = peer_id.to_base58());
+    let config_apply_span = tracing::info_span!(parent: &parent_span, "config");
+    let node_listen_span = tracing::info_span!(parent: &parent_span, "config");
+    let node_creation_span = tracing::info_span!(parent: &parent_span, "config");
+
+    let (node, management_kp, resolved_config, task) = config_apply_span.in_scope(|| {
+        let tmp_dir = config.tmp_dir.path().to_path_buf();
+
+        let node_config = json!({
+            "network": "dar",
+            "base_dir": tmp_dir.to_string_lossy(),
+            "root_key_pair": {
+                    "format": format,
+                    "generate_on_absence": false,
+                    "value": base64.encode(config.keypair.to_vec()),
+                },
+            "builtins_key_pair": {
+                    "format": format,
+                    "generate_on_absence": false,
+                    "value": base64.encode(config.builtins_keypair.to_vec()),
+                },
+            "builtins_base_dir": config.builtins_dir,
+            "external_multiaddresses": [config.listen_on],
+            "spell_base_dir": Some(config.spell_base_dir.clone().unwrap_or(to_abs_path(PathBuf::from("spell")))),
+            "http_port": config.http_port,
+            "listen_ip": "127.0.0.1",
+            "cc_events_dir": config.cc_events_dir,
+        });
+
+        let node_config: UnresolvedConfig =
+            UnresolvedConfig::deserialize(node_config).expect("created_swarm: deserialize config");
+
+        let mut resolved = node_config.resolve().expect("failed to resolve config");
+        resolved.node_config.transport_config.transport = Transport::Memory;
+        resolved.node_config.transport_config.socket_timeout = TRANSPORT_TIMEOUT;
+        resolved.node_config.protocol_config =
+            ProtocolConfig::new(TRANSPORT_TIMEOUT, TRANSPORT_TIMEOUT);
+        resolved.network=Network::Custom(config.network_key.clone().into());
+
+        resolved.node_config.bootstrap_nodes = config.bootstraps.clone();
+        resolved.node_config.bootstrap_config = BootstrapConfig::zero();
+        resolved.node_config.bootstrap_frequency = 1;
+
+        resolved.metrics_config.metrics_enabled = false;
+        resolved.node_config.health_config.health_check_enabled = true;
+
+        resolved.node_config.allow_local_addresses = true;
+
+        resolved.node_config.aquavm_pool_size = config.pool_size.unwrap_or(1);
+        resolved.node_config.particle_execution_timeout = EXECUTION_TIMEOUT;
+        resolved.node_config.transport_config.connection_idle_timeout = IDLE_CONNECTION_TIMEOUT;
+
+        let allowed_effectors = config.allowed_effectors.iter().map(|(cid, binaries)| {
+            (Hash::from_string(cid).unwrap(), binaries.clone())
+        }).collect::<_>();
+        resolved.node_config.allowed_effectors = allowed_effectors;
+
+        if let Some(config) = config.override_system_services_config.clone() {
+            resolved.system_services = config;
+        }
+
+        // `enable_system_services` has higher priority then `enable` field of the SystemServicesConfig
+        resolved.system_services.enable = config
+            .enabled_system_services
+            .iter()
+            .map(|service| {
+                system_services_config::ServiceKey::from_string(service)
+                    .unwrap_or_else(|| panic!("service {service} doesn't exist"))
+            })
+            .collect();
+
+
+        let management_peer_id = libp2p::identity::Keypair::from(config.management_keypair.clone())
+            .public()
+            .to_peer_id();
+        resolved.node_config.management_peer_id = management_peer_id;
+        resolved.chain_config = config.chain_config.clone();
+        resolved.chain_listener_config = config.chain_listener_config.clone();
+        resolved.metrics_config.metrics_enabled = config.metrics_enabled;
+
+        let vm_config = vm_config(BaseVmConfig {
+            peer_id,
+            tmp_dir: tmp_dir.clone(),
+            listen_on: config.listen_on.clone(),
+            manager: management_peer_id,
+        });
+
+        let data_store_config = DataStoreConfig::new(tmp_dir.clone());
+
+        let system_services_config = resolved.system_services.clone();
+        let system_service_distros =
+            system_services::SystemServiceDistros::default_from(system_services_config)
+                .expect("Failed to get default system service distros")
+                .extend(config.extend_system_services.clone());
+
+        let (cpu_topology, core_range): (Box<dyn CPUTopology>, CoreRange) = if let Some(mocked_topology_count) = config.cpu_cores_count {
+            let core_range = CoreRange::from_str(format!("0-{}", mocked_topology_count-1).as_str()).expect("Wrong core range");
+            let mut topology = MockCPUTopology::new();
+            topology.expect_physical_cores().returning(move || {
+                let mut physical_cores: Vec<PhysicalCoreId> = Vec::with_capacity(mocked_topology_count as usize);
+                for id in 0..mocked_topology_count{
+                    physical_cores.push(id.into());
+                }
+                let physical_cores = NonEmpty::from_vec(physical_cores).unwrap();
+                Ok(physical_cores)
+            });
+            topology.expect_logical_cores_for_physical().returning(|physical_core|{
+                Ok(nonempty![LogicalCoreId::new(physical_core.into())])
+            });
+            (Box::new(topology),core_range)
+        } else{
+            (Box::new(HwlocCPUTopology::new().expect("Failed to get cpu topology")), CoreRange::default())
+        };
+
+
+        let (core_distributor, task) = PersistentCoreDistributor::from_path(
+            tmp_dir.join("test-core-state.toml"),
+            1,
+            core_range,
+            AcquireStrategy::Strict,
+            cpu_topology.deref()
+        ).expect("Failed to create core distributor");
+
+        let thread_pinner = Arc::new(test_utils::pinning::DUMMY);
+
+        let node = Node::new(
+            resolved.clone(),
+            core_distributor,
+            thread_pinner,
+            vm_config,
+            data_store_config,
+            "some version",
+            "some version",
+            system_service_distros,
+        );
+        (node, config.management_keypair.clone(), resolved, task)
+    });
+
+    let mut node = node
+        .instrument(node_creation_span)
+        .await
+        .expect("create node");
+
+    node_listen_span.in_scope(|| {
+        node.listen(vec![config.listen_on.clone()]).expect("listen");
+        (
+            node.scope.get_host_peer_id(),
+            node,
+            management_kp,
+            config,
+            resolved_config,
+            parent_span.clone(),
+            task,
+        )
+    })
+}
+
+pub async fn create_swarm(config: SwarmConfig) -> MakeSwarmsData<AVMRunner> {
+    create_swarm_with_runtime(config, aqua_vm_config).await
+}
+
\ No newline at end of file diff --git a/src/fluence_libp2p/connected_point.rs.html b/src/fluence_libp2p/connected_point.rs.html new file mode 100644 index 0000000000..91d0dc880e --- /dev/null +++ b/src/fluence_libp2p/connected_point.rs.html @@ -0,0 +1,57 @@ +connected_point.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use libp2p::core::{connection::ConnectedPoint, Multiaddr};
+
+/// Retrieves multiaddr of the remote peer
+pub fn remote_multiaddr(cp: &ConnectedPoint) -> &Multiaddr {
+    match cp {
+        ConnectedPoint::Dialer { address, .. } => address,
+        ConnectedPoint::Listener { send_back_addr, .. } => send_back_addr,
+    }
+}
+
\ No newline at end of file diff --git a/src/fluence_libp2p/lib.rs.html b/src/fluence_libp2p/lib.rs.html new file mode 100644 index 0000000000..f866b2fc90 --- /dev/null +++ b/src/fluence_libp2p/lib.rs.html @@ -0,0 +1,95 @@ +lib.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+#![recursion_limit = "512"]
+#![warn(rust_2018_idioms)]
+#![deny(
+    dead_code,
+    nonstandard_style,
+    unused_imports,
+    unused_mut,
+    unused_variables,
+    unused_unsafe,
+    unreachable_patterns
+)]
+
+mod connected_point;
+mod macros;
+pub mod random_multiaddr;
+mod random_peer_id;
+mod serde;
+#[cfg(feature = "tokio")]
+mod transport;
+
+pub use self::serde::*;
+pub use connected_point::*;
+pub use random_peer_id::RandomPeerId;
+#[cfg(feature = "tokio")]
+pub use transport::{build_memory_transport, build_transport, Transport};
+
+// libp2p reexports
+pub use libp2p::PeerId;
+
\ No newline at end of file diff --git a/src/fluence_libp2p/macros.rs.html b/src/fluence_libp2p/macros.rs.html new file mode 100644 index 0000000000..c7318ec9fd --- /dev/null +++ b/src/fluence_libp2p/macros.rs.html @@ -0,0 +1,179 @@ +macros.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+#[macro_export] // https://github.com/rust-lang/rust/issues/57966#issuecomment-461077932
+/// Intended to simplify simple polling functions that just return internal events from a
+/// internal queue.
+macro_rules! event_polling {
+    ($func_name:ident, $event_field_name:ident, $poll_type:ty$(, $tick:ident)?) => {
+        fn $func_name(
+            &mut self,
+            _: &mut std::task::Context,
+            _: &mut impl libp2p::swarm::PollParameters,
+        ) -> std::task::Poll<$poll_type> {
+            use std::task::Poll;
+
+            $(self.$tick())?;
+
+            if let Some(event) = self.$event_field_name.pop_front() {
+                return Poll::Ready(event);
+            }
+
+            Poll::Pending
+        }
+    };
+}
+
+#[macro_export] // https://github.com/rust-lang/rust/issues/57966#issuecomment-461077932
+/// Generates a type of events produced by Swarm by its name
+macro_rules! generate_swarm_event_type {
+    ($swarm_type_name:ty) => {
+        ::libp2p::swarm::NetworkBehaviourAction<
+                <<<$swarm_type_name as ::libp2p::swarm::NetworkBehaviour>::ConnectionHandler
+                    as ::libp2p::swarm::IntoConnectionHandler>::Handler
+                    as ::libp2p::swarm::protocols_handler::ConnectionHandler>::InEvent, // InEvent
+                <$swarm_type_name as ::libp2p::swarm::NetworkBehaviour>::OutEvent // OutEvent
+            >
+    }
+}
+
+#[macro_export]
+macro_rules! poll_loop {
+    ($self:expr,$behaviour:expr,$cx:expr,$params:expr$(,$into_event:expr)?) => {{
+        loop {
+            match NetworkBehaviour::poll($behaviour, $cx, $params) {
+                Poll::Ready(::libp2p::swarm::NetworkBehaviourAction::GenerateEvent(event)) => {
+                    ::libp2p::swarm::NetworkBehaviourEventProcess::inject_event($self, event)
+                }
+                Poll::Ready(::libp2p::swarm::NetworkBehaviourAction::NotifyHandler {
+                    peer_id,
+                    event,
+                    handler,
+                }) => {
+                    $(let event = $into_event(event);)?
+                    return Poll::Ready(::libp2p::swarm::NetworkBehaviourAction::NotifyHandler {
+                        peer_id,
+                        event,
+                        handler,
+                    })
+                }
+                Poll::Ready(::libp2p::swarm::NetworkBehaviourAction::DialAddress { address }) => {
+                    return Poll::Ready(::libp2p::swarm::NetworkBehaviourAction::DialAddress { address })
+                }
+                Poll::Ready(::libp2p::swarm::NetworkBehaviourAction::ReportObservedAddr { address, score }) => {
+                    return Poll::Ready(::libp2p::swarm::NetworkBehaviourAction::ReportObservedAddr { address, score })
+                }
+                Poll::Ready(::libp2p::swarm::NetworkBehaviourAction::DialPeer { peer_id, condition }) => {
+                    return Poll::Ready(::libp2p::swarm::NetworkBehaviourAction::DialPeer { peer_id, condition })
+                }
+                Poll::Pending => break,
+            }
+        }
+    }};
+}
+
\ No newline at end of file diff --git a/src/fluence_libp2p/random_multiaddr.rs.html b/src/fluence_libp2p/random_multiaddr.rs.html new file mode 100644 index 0000000000..85435faa82 --- /dev/null +++ b/src/fluence_libp2p/random_multiaddr.rs.html @@ -0,0 +1,71 @@ +random_multiaddr.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use libp2p::core::multiaddr::Protocol;
+use libp2p::core::Multiaddr;
+use rand::Rng;
+
+pub fn create_memory_maddr() -> Multiaddr {
+    let port = 1 + rand::random::<u64>();
+    let addr: Multiaddr = Protocol::Memory(port).into();
+    addr
+}
+
+pub fn create_tcp_maddr() -> Multiaddr {
+    let port: u16 = 1000 + rand::thread_rng().gen_range(1..3000);
+    let mut maddr: Multiaddr = Protocol::Ip4("127.0.0.1".parse().unwrap()).into();
+    maddr.push(Protocol::Tcp(port));
+    maddr
+}
+
\ No newline at end of file diff --git a/src/fluence_libp2p/random_peer_id.rs.html b/src/fluence_libp2p/random_peer_id.rs.html new file mode 100644 index 0000000000..29b1e9b233 --- /dev/null +++ b/src/fluence_libp2p/random_peer_id.rs.html @@ -0,0 +1,59 @@ +random_peer_id.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use libp2p::identity::Keypair;
+use libp2p::PeerId;
+
+pub struct RandomPeerId();
+impl RandomPeerId {
+    /// Generates PeerId from random Ed25519 key
+    pub fn random() -> PeerId {
+        Keypair::generate_ed25519().public().to_peer_id()
+    }
+}
+
\ No newline at end of file diff --git a/src/fluence_libp2p/serde.rs.html b/src/fluence_libp2p/serde.rs.html new file mode 100644 index 0000000000..7d2cf94ffa --- /dev/null +++ b/src/fluence_libp2p/serde.rs.html @@ -0,0 +1,181 @@ +serde.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+// This module is intended to provide a way to serialize/deserialize PeerId and Multihash.
+
+pub mod peerid_serializer_opt {
+    use libp2p::PeerId;
+    use serde::{Deserialize, Deserializer, Serialize, Serializer};
+    use std::str::FromStr;
+
+    pub fn serialize<S>(value: &Option<PeerId>, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        value.map(|p| p.to_base58()).serialize(serializer)
+    }
+
+    pub fn deserialize<'de, D>(deserializer: D) -> Result<Option<PeerId>, D::Error>
+    where
+        D: Deserializer<'de>,
+    {
+        let opt: Option<String> = Option::deserialize(deserializer)?;
+        match opt {
+            None => Ok(None),
+            Some(str) => PeerId::from_str(&str)
+                .map_err(|e| {
+                    serde::de::Error::custom(format!("peer id deserialization failed for {e:?}"))
+                })
+                .map(Some),
+        }
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use crate::RandomPeerId;
+    use libp2p::PeerId;
+    use serde::{Deserialize, Serialize};
+    use std::str::FromStr;
+
+    #[test]
+    fn multihash() {
+        use multihash::Multihash;
+
+        #[derive(Eq, PartialEq, Clone, Debug, Serialize, Deserialize)]
+        struct Test {
+            multihash_1: Multihash<64>,
+            multihash_2: Multihash<64>,
+        }
+
+        let peer_id_1 = RandomPeerId::random();
+        let peer_id_2 = PeerId::from_str("QmY28NSCefB532XbERtnKHadexGuNzAfYnh5fJk6qhLsSi").unwrap();
+
+        let test = Test {
+            multihash_1: Multihash::from(peer_id_1),
+            multihash_2: Multihash::from(peer_id_2),
+        };
+
+        let serialized_test = serde_json::to_value(test.clone());
+        assert!(
+            serialized_test.is_ok(),
+            "failed to serialize test struct: {}",
+            serialized_test.err().unwrap()
+        );
+
+        let deserialized_test = serde_json::from_value::<Test>(serialized_test.unwrap());
+        assert!(
+            deserialized_test.is_ok(),
+            "failed to deserialize test struct: {}",
+            deserialized_test.err().unwrap()
+        );
+        assert_eq!(deserialized_test.unwrap(), test);
+    }
+}
+
\ No newline at end of file diff --git a/src/fluence_libp2p/transport.rs.html b/src/fluence_libp2p/transport.rs.html new file mode 100644 index 0000000000..c99830c071 --- /dev/null +++ b/src/fluence_libp2p/transport.rs.html @@ -0,0 +1,253 @@ +transport.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use std::time::Duration;
+
+use futures::{AsyncRead, AsyncWrite};
+use libp2p::core::muxing::StreamMuxerBox;
+use libp2p::core::transport::{Boxed, MemoryTransport};
+use libp2p::core::Multiaddr;
+use libp2p::dns::tokio::Transport as TokioDnsConfig;
+use libp2p::tcp::Transport as TcpTransport;
+use libp2p::tcp::{tokio::Tcp as TokioTcp, Config as GenTcpConfig};
+use libp2p::{core, identity::Keypair, PeerId, Transport as NetworkTransport};
+use serde::{Deserialize, Serialize};
+
+pub fn build_transport(
+    transport: Transport,
+    key_pair: &Keypair,
+    timeout: Duration,
+) -> Boxed<(PeerId, StreamMuxerBox)> {
+    match transport {
+        Transport::Network => build_network_transport(key_pair, timeout),
+        Transport::Memory => build_memory_transport(key_pair, timeout),
+    }
+}
+
+/// Creates transport that is common for all connections.
+///
+/// Transport is based on TCP with SECIO as the encryption layer and MPLEX otr YAMUX as
+/// the multiplexing layer.
+pub fn build_network_transport(
+    key_pair: &Keypair,
+    socket_timeout: Duration,
+) -> Boxed<(PeerId, StreamMuxerBox)> {
+    let tcp = || {
+        let tcp = TcpTransport::<TokioTcp>::new(GenTcpConfig::default().nodelay(true));
+
+        TokioDnsConfig::system(tcp).expect("Can't build DNS")
+    };
+
+    let transport = {
+        let mut websocket = libp2p::websocket::WsConfig::new(tcp());
+        websocket.set_tls_config(libp2p::websocket::tls::Config::client());
+        websocket.or_transport(tcp())
+    };
+
+    configure_transport(transport, key_pair, socket_timeout)
+}
+
+pub fn configure_transport<T, C>(
+    transport: T,
+    key_pair: &Keypair,
+    transport_timeout: Duration,
+) -> Boxed<(PeerId, StreamMuxerBox)>
+where
+    T: NetworkTransport<Output = C> + Send + Sync + Unpin + 'static,
+    C: AsyncRead + AsyncWrite + Unpin + Send + Unpin + 'static,
+    T::Dial: Send + Unpin + 'static,
+    T::ListenerUpgrade: Send + Unpin + 'static,
+    T::Error: Send + Unpin + Sync + 'static,
+{
+    let multiplex = {
+        let mut mplex = libp2p_mplex::MplexConfig::default();
+        mplex.set_max_num_streams(1024 * 1024);
+
+        let mut yamux = libp2p::yamux::Config::default();
+        yamux.set_max_num_streams(1024 * 1024);
+
+        core::upgrade::SelectUpgrade::new(yamux, mplex)
+    };
+
+    let auth_config = libp2p::noise::Config::new(key_pair).expect("create noise keypair");
+
+    transport
+        .upgrade(core::upgrade::Version::V1)
+        .authenticate(auth_config)
+        .multiplex(multiplex)
+        .timeout(transport_timeout)
+        .boxed()
+}
+
+pub fn build_memory_transport(
+    key_pair: &Keypair,
+    transport_timeout: Duration,
+) -> Boxed<(PeerId, StreamMuxerBox)> {
+    let transport = MemoryTransport::default();
+
+    configure_transport(transport, key_pair, transport_timeout)
+}
+
+#[derive(Clone, Debug, Deserialize, Serialize, Copy)]
+pub enum Transport {
+    Memory,
+    Network,
+}
+
+impl Transport {
+    pub fn is_network(&self) -> bool {
+        matches!(self, Transport::Network)
+    }
+
+    pub fn from_maddr(maddr: &Multiaddr) -> Self {
+        use libp2p::core::multiaddr::Protocol::Memory;
+        if maddr.iter().any(|p| matches!(p, Memory(_))) {
+            Transport::Memory
+        } else {
+            Transport::Network
+        }
+    }
+}
+
\ No newline at end of file diff --git a/src/fs_utils/lib.rs.html b/src/fs_utils/lib.rs.html new file mode 100644 index 0000000000..3c46f2a679 --- /dev/null +++ b/src/fs_utils/lib.rs.html @@ -0,0 +1,573 @@ +lib.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+#![recursion_limit = "512"]
+#![warn(rust_2018_idioms)]
+#![deny(
+    dead_code,
+    nonstandard_style,
+    unused_imports,
+    unused_mut,
+    unused_variables,
+    unused_unsafe,
+    unreachable_patterns
+)]
+
+use eyre::{eyre, Context};
+use futures_util::StreamExt;
+use std::fmt::Debug;
+use std::fs;
+use std::fs::{DirBuilder, Permissions};
+use std::future::Future;
+use std::io::ErrorKind;
+use std::os::unix::fs::DirBuilderExt;
+use std::path::{Path, PathBuf};
+use std::thread::available_parallelism;
+use thiserror::Error;
+use tokio::fs::DirEntry;
+use tokio_stream::wrappers::ReadDirStream;
+
+// default bound on the number of computations it can perform simultaneously
+const DEFAULT_PARALLELISM: usize = 2;
+
+type Err = Box<dyn std::error::Error + Send + Sync>;
+type Res<T> = Result<T, Err>;
+
+pub fn to_abs_path(path: PathBuf) -> PathBuf {
+    match std::env::current_dir().ok() {
+        Some(c) => c.join(path),
+        None => path,
+    }
+}
+
+pub fn create_dirs<Item>(dirs: &[Item]) -> Result<(), std::io::Error>
+where
+    Item: AsRef<Path> + Debug,
+{
+    for dir in dirs {
+        create_dir(dir)?;
+    }
+
+    Ok(())
+}
+
+pub fn set_write_only(path: &Path) -> Result<(), std::io::Error> {
+    use std::os::unix::fs::PermissionsExt;
+
+    let permissions = Permissions::from_mode(0o733);
+    std::fs::set_permissions(path, permissions).map_err(|err| {
+        std::io::Error::new(
+            err.kind(),
+            format!("error making path write only (733) {err:?}: {path:?}"),
+        )
+    })
+}
+
+pub fn create_dir<P: AsRef<Path> + Debug>(dir: P) -> Result<(), std::io::Error> {
+    std::fs::create_dir_all(&dir)
+        .map_err(|err| std::io::Error::new(err.kind(), format!("{err:?}: {dir:?}")))
+}
+
+// TODO: this is a hack, remove after fix in marine. mask 300 doesn't work on macos
+cfg_if::cfg_if! {
+     if #[cfg(target_os = "macos")] {
+        const WRITE_ONLY_MASK: u32 = 0o700;
+    } else {
+        const WRITE_ONLY_MASK: u32 = 0o300;
+    }
+}
+
+pub fn create_dir_write_only<P: AsRef<Path> + Debug>(dir: P) -> Result<(), std::io::Error> {
+    DirBuilder::new()
+        .recursive(true)
+        .mode(WRITE_ONLY_MASK)
+        .create(&dir)
+        .map_err(|err| std::io::Error::new(err.kind(), format!("{err:?}: {dir:?}")))
+}
+
+pub fn remove_dirs<Item>(dirs: &[Item]) -> Result<(), std::io::Error>
+where
+    Item: AsRef<Path> + Debug,
+{
+    for dir in dirs {
+        remove_dir(dir.as_ref())?;
+    }
+
+    Ok(())
+}
+
+pub fn remove_dir(dir: &Path) -> Result<(), std::io::Error> {
+    match std::fs::remove_dir_all(dir) {
+        Ok(_) => Ok(()),
+        // ignore NotFound
+        Err(err) if err.kind() == ErrorKind::NotFound => Ok(()),
+        Err(err) => Err(std::io::Error::new(
+            err.kind(),
+            format!("error removing directory {dir:?}: {err:?}"),
+        )),
+    }
+}
+
+pub fn remove_file(file: &Path) -> Result<(), std::io::Error> {
+    match std::fs::remove_file(file) {
+        Ok(_) => Ok(()),
+        // ignore NotFound
+        Err(err) if err.kind() == ErrorKind::NotFound => Ok(()),
+        Err(err) => Err(std::io::Error::new(
+            err.kind(),
+            format!("error removing file {file:?}: {err:?}"),
+        )),
+    }
+}
+
+pub fn file_stem(path: impl AsRef<Path>) -> eyre::Result<String> {
+    let path = path.as_ref();
+    Ok(path
+        .file_stem()
+        .ok_or_else(|| eyre!("invalid path (no file name): {:?}", path))?
+        .to_str()
+        .ok_or_else(|| eyre!("path {:?} contain non-UTF-8 character", path))?
+        .to_string())
+}
+
+pub fn file_name(path: impl AsRef<Path>) -> eyre::Result<String> {
+    let path = path.as_ref();
+    Ok(path
+        .file_name()
+        .ok_or_else(|| eyre!("invalid path (no file name): {:?}", path))?
+        .to_str()
+        .ok_or_else(|| eyre!("path {:?} contain non-UTF-8 character", path))?
+        .to_string())
+}
+
+pub fn copy_dir_all(src: impl AsRef<Path>, dst: impl AsRef<Path>) -> eyre::Result<()> {
+    fs::create_dir_all(&dst)?;
+    for entry in fs::read_dir(src)? {
+        let entry = entry?;
+        if entry.file_type()?.is_dir() {
+            copy_dir_all(entry.path(), dst.as_ref().join(entry.file_name()))?;
+        } else {
+            fs::copy(entry.path(), dst.as_ref().join(entry.file_name()))?;
+        }
+    }
+
+    Ok(())
+}
+
+pub fn canonicalize(path: impl AsRef<Path>) -> eyre::Result<PathBuf> {
+    path.as_ref().canonicalize().context(format!(
+        "Error canonicalizing path '{}'",
+        path.as_ref().display()
+    ))
+}
+
+/// List files in directory
+pub fn list_files(dir: &Path) -> Option<impl Iterator<Item = PathBuf>> {
+    let dir = std::fs::read_dir(dir).ok()?;
+    Some(dir.filter_map(|p| p.ok()?.path().into()))
+}
+
+#[derive(Debug, Error)]
+pub enum LoadDataError {
+    #[error("Error creating directory for data {path:?}: {err}")]
+    CreateDir {
+        path: PathBuf,
+        #[source]
+        err: std::io::Error,
+    },
+    #[error("Error reading persisted data from {path:?}: {err}")]
+    ReadPersistedData {
+        path: PathBuf,
+        #[source]
+        err: std::io::Error,
+    },
+    #[error("Error deserializing data from {path:?}: {err}")]
+    DeserializeData {
+        path: PathBuf,
+        #[source]
+        err: Err,
+    },
+}
+
+/// Load some data from disk in parallel
+pub async fn load_persisted_data<T>(
+    data_dir: &Path,
+    filter: fn(&Path) -> bool,
+    de: fn(&[u8]) -> Res<T>,
+) -> Result<Vec<(T, PathBuf)>, LoadDataError> {
+    let parallelism = available_parallelism()
+        .map(|x| x.get())
+        .unwrap_or(DEFAULT_PARALLELISM);
+    let list_files = tokio::fs::read_dir(data_dir).await.ok();
+    let entries = match list_files {
+        Some(entries) => {
+            let entries: Vec<(T, PathBuf)> = ReadDirStream::new(entries)
+                .filter_map(|res| async move {
+                    match res {
+                        Ok(entry) => process_dir_entry(entry, filter, de),
+                        Err(err) => {
+                            tracing::warn!("Could not read data directory: {err}");
+                            None
+                        }
+                    }
+                })
+                .buffer_unordered(parallelism)
+                //collect only loaded data and unwrap Option
+                .filter_map(|e| async { e })
+                .collect()
+                .await;
+
+            entries
+        }
+        None => {
+            // Attempt to create directory
+            tokio::fs::create_dir_all(data_dir)
+                .await
+                .map_err(|err| LoadDataError::CreateDir {
+                    path: data_dir.to_path_buf(),
+                    err,
+                })?;
+            vec![]
+        }
+    };
+
+    Ok(entries)
+}
+
+fn process_dir_entry<T>(
+    entry: DirEntry,
+    filter: fn(&Path) -> bool,
+    de: fn(&[u8]) -> Res<T>,
+) -> Option<impl Future<Output = Option<(T, PathBuf)>> + Sized> {
+    let path = entry.path();
+    if filter(path.as_path()) {
+        let task = async move {
+            let res = parse_persisted_data(path.as_path(), de).await;
+            if let Err(err) = &res {
+                tracing::warn!("Failed to load data: {err}")
+            }
+            res.ok().map(|data| (data, path))
+        };
+
+        Some(task)
+    } else {
+        None
+    }
+}
+
+async fn parse_persisted_data<T>(file: &Path, de: fn(&[u8]) -> Res<T>) -> Result<T, LoadDataError> {
+    let bytes = tokio::fs::read(file)
+        .await
+        .map_err(|err| LoadDataError::ReadPersistedData {
+            err,
+            path: file.to_path_buf(),
+        })?;
+
+    de(bytes.as_slice()).map_err(|err| LoadDataError::DeserializeData {
+        err,
+        path: file.to_path_buf(),
+    })
+}
+
\ No newline at end of file diff --git a/src/health/lib.rs.html b/src/health/lib.rs.html new file mode 100644 index 0000000000..e44a017d47 --- /dev/null +++ b/src/health/lib.rs.html @@ -0,0 +1,289 @@ +lib.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+//! Health check registry implementation.
+//!
+//! See [`HealthCheckRegistry`] for details.
+
+pub trait HealthCheck: Send + Sync + 'static {
+    fn status(&self) -> eyre::Result<()>;
+}
+
+pub struct HealthCheckRegistry {
+    checks: Vec<(&'static str, Box<dyn HealthCheck>)>,
+}
+
+///  The result of the health check, which can be one of the following:
+/// HealthCheckResult::Ok(oks): If all health checks pass successfully. oks is a vector containing the names of the passed health checks.
+/// HealthCheckResult::Fail(fails): If all health checks fail. fails is a vector containing the names of the failed health checks.
+/// HealthCheckResult::Warning(oks, fails): If some health checks pass while others fail. oks is a vector containing the names of the passed health checks, and fails is a vector containing the names of the failed health checks.
+#[derive(Debug, PartialEq)]
+pub enum HealthStatus {
+    Ok(Vec<&'static str>),
+    Warning(Vec<&'static str>, Vec<&'static str>),
+    Fail(Vec<&'static str>),
+}
+/// A HealthCheckRegistry is a collection of health checks that can be registered and executed.
+/// Each health check is associated with a name and is expected to implement the HealthCheck trait.
+impl HealthCheckRegistry {
+    pub fn new() -> Self {
+        HealthCheckRegistry { checks: Vec::new() }
+    }
+
+    pub fn register(&mut self, name: &'static str, check: impl HealthCheck) {
+        self.checks.push((name, Box::new(check)));
+    }
+
+    pub fn status(&self) -> HealthStatus {
+        let mut fails = Vec::new();
+        let mut oks = Vec::new();
+
+        for (name, check) in &self.checks {
+            match check.status() {
+                Ok(_) => oks.push(*name),
+                Err(_) => {
+                    fails.push(*name);
+                }
+            }
+        }
+
+        if fails.is_empty() {
+            HealthStatus::Ok(oks)
+        } else if oks.is_empty() {
+            HealthStatus::Fail(fails)
+        } else {
+            HealthStatus::Warning(oks, fails)
+        }
+    }
+}
+
+impl Default for HealthCheckRegistry {
+    fn default() -> Self {
+        HealthCheckRegistry::new()
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+
+    // A mock health check implementation for testing purposes.
+    struct MockHealthCheck {
+        should_pass: bool,
+    }
+
+    impl HealthCheck for MockHealthCheck {
+        fn status(&self) -> eyre::Result<()> {
+            if self.should_pass {
+                Ok(())
+            } else {
+                Err(eyre::eyre!("Health check failed"))
+            }
+        }
+    }
+
+    #[test]
+    fn test_health_check_registry_empty() {
+        let registry = HealthCheckRegistry::new();
+        let status = registry.status();
+        assert_eq!(status, HealthStatus::Ok(vec![]))
+    }
+
+    #[test]
+    fn test_health_check_registry_single_check_pass() {
+        let mut registry = HealthCheckRegistry::new();
+        let mock_check = MockHealthCheck { should_pass: true };
+        registry.register("MockCheck1", mock_check);
+
+        let status = registry.status();
+        assert_eq!(status, HealthStatus::Ok(vec!["MockCheck1"]))
+    }
+
+    #[test]
+    fn test_health_check_registry_single_check_fail() {
+        let mut registry = HealthCheckRegistry::new();
+        let mock_check = MockHealthCheck { should_pass: false };
+        registry.register("MockCheck1", mock_check);
+
+        let status = registry.status();
+        assert_eq!(status, HealthStatus::Fail(vec!["MockCheck1"]))
+    }
+
+    #[test]
+    fn test_health_check_registry_multiple_checks() {
+        let mut registry = HealthCheckRegistry::new();
+        let mock_check1 = MockHealthCheck { should_pass: true };
+        let mock_check2 = MockHealthCheck { should_pass: false };
+        let mock_check3 = MockHealthCheck { should_pass: true };
+        registry.register("MockCheck1", mock_check1);
+        registry.register("MockCheck2", mock_check2);
+        registry.register("MockCheck3", mock_check3);
+
+        let status = registry.status();
+        assert_eq!(
+            status,
+            HealthStatus::Warning(vec!["MockCheck1", "MockCheck3"], vec!["MockCheck2"])
+        );
+    }
+}
+
\ No newline at end of file diff --git a/src/hex_utils/lib.rs.html b/src/hex_utils/lib.rs.html new file mode 100644 index 0000000000..b4d5755bd8 --- /dev/null +++ b/src/hex_utils/lib.rs.html @@ -0,0 +1,199 @@ +lib.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+pub use hex::FromHexError;
+
+/// Decode hex to bytes tolerating absence and presence of 0x prefix
+pub fn decode_hex(h: &str) -> Result<Vec<u8>, FromHexError> {
+    let h = h.trim_start_matches("0x");
+    hex::decode(h)
+}
+
+/// Encode bytes to hex with 0x prefix
+pub fn encode_hex_0x<T: AsRef<[u8]>>(data: T) -> String {
+    let hex = hex::encode(data);
+    format!("0x{}", hex)
+}
+
+/// Encode bytes to hex with 0x prefix and zero padding of a specified length
+pub fn encode_hex_0x_zero_pad<T: AsRef<[u8]>>(data: T, width: usize) -> String {
+    format!("0x{:0>width$}", hex::encode(data))
+}
+
+/// A simple renaming to force to consider the absence of '0x' prefix
+pub fn encode_hex_no_prefix<T: AsRef<[u8]>>(data: T) -> String {
+    hex::encode(data)
+}
+
+#[cfg(feature = "serde_with")]
+pub mod serde_as {
+    use core::fmt;
+    use hex::{FromHex, ToHex};
+    use serde_with::__private__::{DeError, Visitor};
+    use serde_with::serde::{Deserializer, Serializer};
+    use serde_with::{DeserializeAs, SerializeAs};
+    use std::fmt::Display;
+    use std::marker::PhantomData;
+
+    pub struct Hex;
+    impl<T> SerializeAs<T> for Hex
+    where
+        T: ToHex,
+    {
+        fn serialize_as<S>(source: &T, serializer: S) -> Result<S::Ok, S::Error>
+        where
+            S: Serializer,
+        {
+            serializer.collect_str(source.encode_hex::<String>().as_str())
+        }
+    }
+
+    impl<'de, T> DeserializeAs<'de, T> for Hex
+    where
+        T: FromHex,
+        T::Error: Display,
+    {
+        fn deserialize_as<D>(deserializer: D) -> Result<T, D::Error>
+        where
+            D: Deserializer<'de>,
+        {
+            struct Helper<S>(PhantomData<S>);
+            impl<'de, S> Visitor<'de> for Helper<S>
+            where
+                S: FromHex,
+                <S as FromHex>::Error: Display,
+            {
+                type Value = S;
+
+                fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
+                    formatter.write_str("a string")
+                }
+
+                fn visit_str<E>(self, value: &str) -> Result<Self::Value, E>
+                where
+                    E: DeError,
+                {
+                    Self::Value::from_hex(value.as_bytes()).map_err(DeError::custom)
+                }
+            }
+
+            deserializer.deserialize_str(Helper(PhantomData))
+        }
+    }
+}
+
\ No newline at end of file diff --git a/src/ivalue_utils/lib.rs.html b/src/ivalue_utils/lib.rs.html new file mode 100644 index 0000000000..1ccc6236aa --- /dev/null +++ b/src/ivalue_utils/lib.rs.html @@ -0,0 +1,183 @@ +lib.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+#![warn(rust_2018_idioms)]
+#![deny(
+    dead_code,
+    nonstandard_style,
+    unused_imports,
+    unused_mut,
+    unused_variables,
+    unused_unsafe,
+    unreachable_patterns
+)]
+
+use fluence_it_types::ne_vec::NEVec;
+pub use fluence_it_types::IType;
+pub use fluence_it_types::IValue;
+
+use serde_json::Value as JValue;
+
+pub fn as_str(v: &IValue) -> Option<&str> {
+    if let IValue::String(s) = v {
+        Some(s.as_str())
+    } else {
+        None
+    }
+}
+
+pub fn into_string(v: IValue) -> Option<String> {
+    if let IValue::String(s) = v {
+        Some(s)
+    } else {
+        None
+    }
+}
+
+/// Converts result of call_service into `IValue::Record`
+pub fn into_record_opt(v: std::result::Result<Option<JValue>, JValue>) -> Option<IValue> {
+    match v {
+        Ok(None) => unit(),
+        Ok(Some(v)) => ok(v),
+        Err(e) => error(e),
+    }
+}
+
+/// Converts result of call_service into `IValue::Record`
+pub fn into_record(v: std::result::Result<JValue, JValue>) -> Option<IValue> {
+    match v {
+        Ok(v) => ok(v),
+        Err(e) => error(e),
+    }
+}
+
+/// Converts successful result of call_service into `IValue::Record`  
+pub fn ok(value: JValue) -> Option<IValue> {
+    let value = IValue::String(value.to_string());
+    Some(IValue::Record(
+        NEVec::new(vec![IValue::U32(0), value]).unwrap(),
+    ))
+}
+
+/// Converts erroneous result of call_service into `IValue::Record`
+pub fn error(err: JValue) -> Option<IValue> {
+    let err = IValue::String(err.to_string());
+    Some(IValue::Record(
+        NEVec::new(vec![IValue::U32(1), err]).unwrap(),
+    ))
+}
+
+/// Converts empty result of call_service into `IValue::Record`
+pub fn unit() -> Option<IValue> {
+    Some(IValue::Record(
+        NEVec::new(vec![IValue::S32(0), IValue::String("\"\"".to_string())]).unwrap(),
+    ))
+}
+
\ No newline at end of file diff --git a/src/json_utils/base64_serde.rs.html b/src/json_utils/base64_serde.rs.html new file mode 100644 index 0000000000..3b0f4d17e9 --- /dev/null +++ b/src/json_utils/base64_serde.rs.html @@ -0,0 +1,81 @@ +base64_serde.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use base64::{engine::general_purpose::STANDARD as base64, Engine};
+use serde::{Deserialize, Deserializer, Serialize, Serializer};
+
+#[allow(clippy::ptr_arg)] // This is a serializer for Vec<u8>, it is required to be of that type
+pub fn serialize<S>(value: &Vec<u8>, serializer: S) -> Result<S::Ok, S::Error>
+where
+    S: Serializer,
+{
+    base64.encode(value).serialize(serializer)
+}
+
+pub fn deserialize<'de, D>(deserializer: D) -> Result<Vec<u8>, D::Error>
+where
+    D: Deserializer<'de>,
+{
+    let str = String::deserialize(deserializer)?;
+
+    base64
+        .decode(str)
+        .map_err(|e| serde::de::Error::custom(format!("base64 deserialization failed: {e:?}")))
+}
+
\ No newline at end of file diff --git a/src/json_utils/lib.rs.html b/src/json_utils/lib.rs.html new file mode 100644 index 0000000000..5bad4075a9 --- /dev/null +++ b/src/json_utils/lib.rs.html @@ -0,0 +1,109 @@ +lib.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+#![warn(rust_2018_idioms)]
+#![deny(
+    dead_code,
+    nonstandard_style,
+    unused_imports,
+    unused_mut,
+    unused_variables,
+    unused_unsafe,
+    unreachable_patterns
+)]
+
+use serde_json::Value as JValue;
+
+pub mod base64_serde;
+
+pub fn into_string(v: JValue) -> Option<String> {
+    if let JValue::String(s) = v {
+        return Some(s);
+    }
+
+    None
+}
+
+pub fn into_array(v: JValue) -> Option<Vec<JValue>> {
+    if let JValue::Array(s) = v {
+        return Some(s);
+    }
+
+    None
+}
+
+/// Converts an error into IValue::String
+pub fn err_as_value<E: core::fmt::Debug + core::fmt::Display>(err: E) -> JValue {
+    JValue::String(format!("Error: {err}\n{err:?}"))
+}
+
\ No newline at end of file diff --git a/src/kademlia/api.rs.html b/src/kademlia/api.rs.html new file mode 100644 index 0000000000..df7fad7a06 --- /dev/null +++ b/src/kademlia/api.rs.html @@ -0,0 +1,233 @@ +api.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use std::convert::identity;
+
+use futures::{future::BoxFuture, FutureExt};
+use libp2p::{core::Multiaddr, PeerId};
+use multihash::Multihash;
+use particle_protocol::Contact;
+use tokio::sync::{mpsc, oneshot};
+
+use crate::error::{KademliaError, Result};
+
+type Future<T> = BoxFuture<'static, T>;
+
+pub trait KademliaApiT {
+    fn bootstrap(&self) -> Future<Result<()>>;
+    fn add_contact(&self, contact: Contact) -> bool;
+    fn local_lookup(&self, peer: PeerId) -> Future<Result<Vec<Multiaddr>>>;
+    fn discover_peer(&self, peer: PeerId) -> Future<Result<Vec<Multiaddr>>>;
+    fn neighborhood(&self, key: Multihash<64>, count: usize) -> Future<Result<Vec<PeerId>>>;
+}
+
+// marked `pub` to be available in benchmarks
+#[derive(Debug)]
+pub enum Command {
+    AddContact {
+        contact: Contact,
+    },
+    LocalLookup {
+        peer: PeerId,
+        out: oneshot::Sender<Vec<Multiaddr>>,
+    },
+    Bootstrap {
+        out: oneshot::Sender<Result<()>>,
+    },
+    DiscoverPeer {
+        peer: PeerId,
+        out: oneshot::Sender<Result<Vec<Multiaddr>>>,
+    },
+    Neighborhood {
+        key: Multihash<64>,
+        count: usize,
+        out: oneshot::Sender<Result<Vec<PeerId>>>,
+    },
+}
+
+#[derive(Clone, Debug)]
+pub struct KademliaApi {
+    // NOTE: marked `pub` to be available in benchmarks
+    pub outlet: mpsc::UnboundedSender<Command>,
+}
+
+impl KademliaApi {
+    fn execute<R, F>(&self, cmd: F) -> Future<Result<R>>
+    where
+        R: Send + Sync + 'static,
+        F: FnOnce(oneshot::Sender<Result<R>>) -> Command,
+    {
+        let (out, inlet) = oneshot::channel();
+        if self.outlet.send(cmd(out)).is_err() {
+            return futures::future::err(KademliaError::Cancelled).boxed();
+        }
+        inlet
+            .map(|r| r.map_err(|_| KademliaError::Cancelled).and_then(identity))
+            .boxed()
+    }
+}
+
+impl KademliaApiT for KademliaApi {
+    fn bootstrap(&self) -> Future<Result<()>> {
+        self.execute(|out| Command::Bootstrap { out })
+    }
+
+    fn add_contact(&self, contact: Contact) -> bool {
+        let cmd = Command::AddContact { contact };
+        let send = self.outlet.send(cmd);
+        send.is_ok()
+    }
+
+    fn local_lookup(&self, peer: PeerId) -> Future<Result<Vec<Multiaddr>>> {
+        let (out, inlet) = oneshot::channel();
+        let cmd = Command::LocalLookup { peer, out };
+        let send = self.outlet.send(cmd);
+        if send.is_err() {
+            return futures::future::err(KademliaError::Cancelled).boxed();
+        }
+        inlet
+            .map(|r| r.map_err(|_| KademliaError::Cancelled))
+            .boxed()
+    }
+
+    fn discover_peer(&self, peer: PeerId) -> Future<Result<Vec<Multiaddr>>> {
+        self.execute(|out| Command::DiscoverPeer { peer, out })
+    }
+
+    fn neighborhood(&self, key: Multihash<64>, count: usize) -> Future<Result<Vec<PeerId>>> {
+        self.execute(|out| Command::Neighborhood { key, count, out })
+    }
+}
+
\ No newline at end of file diff --git a/src/kademlia/behaviour.rs.html b/src/kademlia/behaviour.rs.html new file mode 100644 index 0000000000..90aa1dc06b --- /dev/null +++ b/src/kademlia/behaviour.rs.html @@ -0,0 +1,1743 @@ +behaviour.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+762
+763
+764
+765
+766
+767
+768
+769
+770
+771
+772
+773
+774
+775
+776
+777
+778
+779
+780
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+794
+795
+796
+797
+798
+799
+800
+801
+802
+803
+804
+805
+806
+807
+808
+809
+810
+811
+812
+813
+814
+815
+816
+817
+818
+819
+820
+821
+822
+823
+824
+825
+826
+827
+828
+829
+830
+831
+832
+833
+834
+835
+836
+837
+838
+839
+840
+841
+842
+843
+844
+845
+846
+847
+848
+849
+850
+851
+852
+853
+854
+855
+856
+857
+858
+859
+860
+861
+862
+863
+864
+865
+866
+867
+868
+869
+870
+871
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use std::ops::Mul;
+use std::sync::Arc;
+use std::task::{Context, Poll};
+use std::{
+    cmp::min,
+    collections::HashMap,
+    task::Waker,
+    time::{Duration, Instant},
+};
+
+use futures::FutureExt;
+use futures_timer::Delay;
+use libp2p::core::Endpoint;
+use libp2p::kad::Config as LibP2PKadConfig;
+use libp2p::kad::StoreInserts;
+use libp2p::swarm::behaviour::FromSwarm;
+use libp2p::swarm::THandlerInEvent;
+use libp2p::swarm::THandlerOutEvent;
+use libp2p::swarm::ToSwarm;
+use libp2p::swarm::{ConnectionDenied, ConnectionId, THandler};
+use libp2p::{
+    core::Multiaddr,
+    kad::{
+        self, store::MemoryStore, BootstrapError, BootstrapOk, BootstrapResult,
+        Event as KademliaEvent, GetClosestPeersError, GetClosestPeersOk, GetClosestPeersResult,
+        QueryId, QueryResult,
+    },
+    swarm::NetworkBehaviour,
+    PeerId, StreamProtocol,
+};
+use libp2p_kad::{KBucketKey, Mode};
+use libp2p_metrics::{Metrics, Recorder};
+use multihash::Multihash;
+use tokio::sync::{mpsc, oneshot};
+#[cfg(test)]
+use tracing::Span;
+
+use control_macro::get_return;
+use particle_protocol::Contact;
+
+use crate::error::{KademliaError, Result};
+use crate::{Command, KademliaApi};
+
+#[derive(Debug, Clone)]
+pub struct ProtocolName(&'static str);
+
+#[derive(Debug, Clone)]
+pub struct KademliaConfig {
+    pub peer_id: PeerId,
+    pub max_packet_size: Option<usize>,
+    pub query_timeout: Duration,
+    pub replication_factor: Option<usize>,
+    pub peer_fail_threshold: usize,
+    pub ban_cooldown: Duration,
+    pub protocol_name: StreamProtocol,
+}
+#[derive(Debug)]
+pub enum PendingQuery {
+    Peer(PeerId),
+    Neighborhood(oneshot::Sender<Result<Vec<PeerId>>>),
+    Unit(oneshot::Sender<Result<()>>),
+}
+
+#[derive(Debug)]
+struct PendingPeer {
+    out: oneshot::Sender<Result<Vec<Multiaddr>>>,
+    created: Instant,
+}
+
+impl PendingPeer {
+    pub fn new(out: oneshot::Sender<Result<Vec<Multiaddr>>>) -> Self {
+        Self {
+            out,
+            created: Instant::now(),
+        }
+    }
+}
+
+#[derive(Default, Debug)]
+struct FailedPeer {
+    /// When the peer was banned
+    pub ban: Option<Instant>,
+    /// How many times we failed to discover the peer
+    pub count: usize,
+}
+
+impl FailedPeer {
+    pub fn increment(&mut self) {
+        self.count += 1;
+    }
+}
+
+pub struct Kademlia {
+    kademlia: kad::Behaviour<MemoryStore>,
+    commands: mpsc::UnboundedReceiver<Command>,
+
+    queries: HashMap<QueryId, PendingQuery>,
+    pending_peers: HashMap<PeerId, Vec<PendingPeer>>,
+    failed_peers: HashMap<PeerId, FailedPeer>,
+    config: KademliaConfig,
+    waker: Option<Waker>,
+    // Timer to track timed out requests, and return errors ASAP
+    timer: Delay,
+    metrics: Option<Arc<Metrics>>,
+    #[cfg(test)]
+    parent_span: Span,
+}
+
+impl From<KademliaConfig> for LibP2PKadConfig {
+    fn from(value: KademliaConfig) -> Self {
+        let mut cfg = LibP2PKadConfig::default();
+
+        cfg.set_query_timeout(value.query_timeout);
+
+        if let Some(max_packet_size) = value.max_packet_size {
+            cfg.set_max_packet_size(max_packet_size);
+        }
+
+        if let Some(replication_factor) = value.replication_factor {
+            if let Some(replication_factor) = std::num::NonZeroUsize::new(replication_factor) {
+                cfg.set_replication_factor(replication_factor);
+            } else {
+                log::warn!(
+                    "Invalid config value: replication_factor must be > 0, was {:?}",
+                    value.replication_factor
+                )
+            }
+        }
+
+        cfg.set_protocol_names(vec![value.protocol_name]);
+
+        cfg
+    }
+}
+
+impl Kademlia {
+    pub fn new(
+        config: KademliaConfig,
+        metrics: Option<Arc<Metrics>>,
+        #[cfg(test)] parent_span: Span,
+    ) -> (Self, KademliaApi) {
+        let timer = Delay::new(config.query_timeout);
+
+        let peer_id = config.peer_id;
+        let store = MemoryStore::new(peer_id);
+        let mut kad_config: LibP2PKadConfig = config.clone().into();
+        // By default, all records from peers are automatically stored.
+        // `FilterBoth` means it's the Kademlia behaviour handler's responsibility
+        // to determine whether or not Provider records and KV records ("both") get stored,
+        // where we implement logic to validate/prune incoming records.
+        kad_config.set_record_filtering(StoreInserts::FilterBoth);
+        let mut kademlia = kad::Behaviour::with_config(peer_id, store, kad_config);
+        kademlia.set_mode(Some(Mode::Server));
+
+        let (outlet, commands) = mpsc::unbounded_channel();
+        let api = KademliaApi { outlet };
+
+        let behaviour = Self {
+            kademlia,
+            commands,
+            queries: <_>::default(),
+            pending_peers: <_>::default(),
+            failed_peers: <_>::default(),
+            config,
+            waker: None,
+            timer,
+            metrics,
+            #[cfg(test)]
+            parent_span,
+        };
+
+        (behaviour, api)
+    }
+
+    fn execute(&mut self, cmd: Command) {
+        match cmd {
+            Command::AddContact { contact } => self.add_contact(contact),
+            Command::Bootstrap { out } => self.bootstrap(out),
+            Command::LocalLookup { peer, out } => self.local_lookup(&peer, out),
+            Command::DiscoverPeer { peer, out } => self.discover_peer(peer, out),
+            Command::Neighborhood { key, count, out } => self.neighborhood(key, count, out),
+        }
+    }
+
+    pub fn add_kad_node(&mut self, peer: PeerId, addresses: Vec<Multiaddr>) {
+        for addr in addresses {
+            self.kademlia.add_address(&peer, addr.clone());
+        }
+        self.wake();
+    }
+}
+
+impl Kademlia {
+    pub fn add_contact(&mut self, contact: Contact) {
+        debug_assert!(!contact.addresses.is_empty(), "no addresses in contact");
+
+        for addr in contact.addresses {
+            self.kademlia.add_address(&contact.peer_id, addr);
+        }
+    }
+
+    pub fn bootstrap(&mut self, outlet: oneshot::Sender<Result<()>>) {
+        if let Ok(query_id) = self.kademlia.bootstrap() {
+            self.queries.insert(query_id, PendingQuery::Unit(outlet));
+            self.wake();
+        } else {
+            outlet.send(Err(KademliaError::NoKnownPeers)).ok();
+        }
+    }
+
+    fn addresses_of_peer(&mut self, peer_id: &PeerId) -> Vec<Multiaddr> {
+        let conn_id = ConnectionId::new_unchecked(1);
+        // TODO: this method doesn't use params except of peer_id
+        let res = self.kademlia.handle_pending_outbound_connection(
+            conn_id,
+            Some(*peer_id),
+            vec![].as_slice(),
+            Endpoint::Dialer,
+        );
+        match res {
+            Ok(res) => res,
+            Err(e) => {
+                log::warn!("Could not get addresses of peer {:?} {:?}", peer_id, e);
+                vec![]
+            }
+        }
+    }
+
+    pub fn local_lookup(&mut self, peer_id: &PeerId, outlet: oneshot::Sender<Vec<Multiaddr>>) {
+        outlet.send(self.addresses_of_peer(peer_id)).ok();
+    }
+
+    pub fn discover_peer(&mut self, peer: PeerId, outlet: oneshot::Sender<Result<Vec<Multiaddr>>>) {
+        let local = self.addresses_of_peer(&peer);
+        if !local.is_empty() {
+            outlet.send(Ok(local)).ok();
+            return;
+        }
+        if self.is_banned(&peer) {
+            outlet.send(Err(KademliaError::PeerBanned)).ok();
+            return;
+        }
+
+        let pending = PendingPeer::new(outlet);
+        let outlets = self.pending_peers.entry(peer).or_default();
+        // If there are existing outlets, then discovery process is already running
+        let discovering = !outlets.is_empty();
+        // Subscribe on discovery result
+        outlets.push(pending);
+
+        // Run discovery only if there's no discovery already running
+        if !discovering {
+            let query_id = self.kademlia.get_closest_peers(peer);
+            self.queries.insert(query_id, PendingQuery::Peer(peer));
+            self.wake();
+        }
+    }
+
+    pub fn neighborhood(
+        &mut self,
+        key: Multihash<64>,
+        count: usize,
+        outlet: oneshot::Sender<Result<Vec<PeerId>>>,
+    ) {
+        let key: KBucketKey<Multihash<64>> = key.into();
+        let peers = self.kademlia.get_closest_local_peers(&key);
+        let peers = peers.take(count);
+        let peers = peers.map(|p| p.into_preimage());
+        outlet.send(Ok(peers.collect())).ok();
+        self.wake();
+    }
+
+    pub fn remote_neighborhood(
+        &mut self,
+        key: Multihash<64>,
+        outlet: oneshot::Sender<Result<Vec<PeerId>>>,
+    ) {
+        let query_id = self.kademlia.get_closest_peers(key);
+        self.queries
+            .insert(query_id, PendingQuery::Neighborhood(outlet));
+        self.wake();
+    }
+
+    pub fn protocol_name(&self) -> &StreamProtocol {
+        &self.config.protocol_name
+    }
+}
+
+impl Kademlia {
+    fn peer_discovered(&mut self, peer: PeerId, addresses: Vec<Multiaddr>) {
+        tracing::trace!(
+            target: "network",
+            "discovered peer {} with {:?} addresses",
+            peer,
+            addresses,
+        );
+
+        if let Some(pendings) = self.pending_peers.remove(&peer) {
+            for pending in pendings {
+                pending.out.send(Ok(addresses.clone())).ok();
+            }
+        }
+
+        // unban peer
+        self.failed_peers.remove(&peer);
+    }
+
+    fn closest_finished(&mut self, id: QueryId, result: GetClosestPeersResult) {
+        use GetClosestPeersError::Timeout;
+
+        match get_return!(self.queries.remove(&id)) {
+            PendingQuery::Peer(peer_id) => {
+                let addresses = self.addresses_of_peer(&peer_id);
+                // if addresses are empty - do nothing, let it be finished by timeout;
+                // motivation: more addresses might appear later through other events
+                if !addresses.is_empty() {
+                    self.peer_discovered(peer_id, addresses)
+                }
+            }
+            PendingQuery::Neighborhood(outlet) => {
+                let result = match result {
+                    Ok(GetClosestPeersOk { peers, .. }) if !peers.is_empty() => Ok(peers),
+                    Ok(GetClosestPeersOk { .. }) => Err(KademliaError::NoPeersFound),
+                    Err(Timeout { peers, .. }) if !peers.is_empty() => Ok(peers),
+                    Err(Timeout { .. }) => Err(KademliaError::QueryTimedOut),
+                };
+                outlet.send(result).ok();
+            }
+            PendingQuery::Unit(outlet) => {
+                outlet.send(Ok(())).ok();
+            }
+        }
+    }
+
+    fn bootstrap_finished(&mut self, id: QueryId, result: BootstrapResult) {
+        // how many buckets there are left to try
+        let num_remaining = match result {
+            Ok(BootstrapOk { num_remaining, .. }) => Some(num_remaining),
+            Err(BootstrapError::Timeout { num_remaining, .. }) => num_remaining,
+        };
+
+        // if all desired buckets were tried, signal bootstrap completion
+        // note that it doesn't care about successes or errors; that's because bootstrap keeps
+        // going through next buckets even if it failed on previous buckets
+        if num_remaining == Some(0) {
+            if let Some(PendingQuery::Unit(outlet)) = self.queries.remove(&id) {
+                outlet.send(Ok(())).ok();
+            }
+        }
+    }
+
+    fn poll(&mut self, cx: &mut std::task::Context) -> std::task::Poll<()> {
+        self.waker = Some(cx.waker().clone());
+
+        // Ingest and execute new commands
+        let mut wake = false;
+        while let Poll::Ready(Some(cmd)) = self.commands.poll_recv(cx) {
+            wake = true;
+            self.execute(cmd)
+        }
+        if wake {
+            cx.waker().wake_by_ref()
+        }
+
+        // Exit early to avoid Instant::now calculation
+        if self.pending_peers.is_empty() && self.failed_peers.is_empty() {
+            return Poll::Pending;
+        };
+
+        let failed_peers = &mut self.failed_peers;
+        let config = &self.config;
+        // timer will wake up current task after `next_wake`
+        let mut next_wake = min(config.query_timeout, config.ban_cooldown);
+        let now = Instant::now();
+
+        // Remove empty keys
+        self.pending_peers.retain(|id, peers| {
+            // remove expired
+            let expired = peers.extract_if(|p| {
+                has_timed_out(now, p.created, config.query_timeout.mul(2), &mut next_wake)
+            });
+
+            let mut timed_out = false;
+            for p in expired {
+                timed_out = true;
+                // notify expired
+                p.out.send(Err(KademliaError::PeerTimedOut)).ok();
+            }
+            // count failure if there was at least 1 timeout
+            if timed_out {
+                failed_peers.entry(*id).or_default().increment();
+            }
+
+            // empty entries will be removed
+            !peers.is_empty()
+        });
+
+        self.failed_peers.retain(|_, failed| {
+            if let Some(ban) = failed.ban {
+                // unban (remove) a peer if cooldown has passed
+                let unban = has_timed_out(now, ban, config.ban_cooldown, &mut next_wake);
+                if unban {
+                    return false;
+                }
+            }
+
+            // ban peers with too many failures
+            if failed.count >= config.peer_fail_threshold {
+                failed.ban = Some(now);
+            }
+
+            true
+        });
+
+        // task will be awaken after `next_wake`
+        self.timer.reset(next_wake);
+        // register current task within timer
+        self.timer.poll_unpin(cx).is_ready(); // `is_ready` here is to avoid "must use" warning
+
+        Poll::Pending
+    }
+
+    fn wake(&self) {
+        if let Some(waker) = self.waker.as_ref() {
+            waker.wake_by_ref()
+        }
+    }
+
+    fn is_banned(&self, peer: &PeerId) -> bool {
+        self.failed_peers
+            .get(peer)
+            .map_or(false, |f| f.ban.is_some())
+    }
+
+    fn inject_kad_event(&mut self, event: KademliaEvent) {
+        if let Some(metrics) = self.metrics.as_ref() {
+            metrics.record(&event);
+        }
+
+        match event {
+            KademliaEvent::OutboundQueryProgressed { id, result, .. } => match result {
+                QueryResult::GetClosestPeers(result) => self.closest_finished(id, result),
+                QueryResult::Bootstrap(result) => self.bootstrap_finished(id, result),
+                _ => {}
+            },
+            KademliaEvent::UnroutablePeer { .. } => {}
+            KademliaEvent::RoutingUpdated {
+                peer, addresses, ..
+            } => self.peer_discovered(peer, addresses.into_vec()),
+            KademliaEvent::RoutablePeer { peer, address }
+            | KademliaEvent::PendingRoutablePeer { peer, address } => {
+                self.peer_discovered(peer, vec![address])
+            }
+            KademliaEvent::InboundRequest { .. } => {}
+            KademliaEvent::ModeChanged { .. } => {}
+        }
+    }
+}
+
+/// Calculate whether some entity has reached its timeout.
+/// `now` - current time
+/// `timestamp` - starting point
+/// `timeout` - after what time it should be marked as timed out
+/// `wake` - if entity has not timed out, when to wake
+fn has_timed_out(now: Instant, timestamp: Instant, timeout: Duration, wake: &mut Duration) -> bool {
+    let elapsed = now.duration_since(timestamp);
+    // how much has passed of the designated timeout
+    match timeout.checked_sub(elapsed) {
+        // didn't reach timeout yet
+        Some(wake_after) if !wake_after.is_zero() => {
+            // wake up earlier, if needed
+            *wake = min(wake_after, *wake);
+            false
+        }
+        // timed out
+        _ => true,
+    }
+}
+
+impl NetworkBehaviour for Kademlia {
+    type ConnectionHandler = <kad::Behaviour<MemoryStore> as NetworkBehaviour>::ConnectionHandler;
+    type ToSwarm = ();
+
+    fn handle_pending_inbound_connection(
+        &mut self,
+        _connection_id: ConnectionId,
+        _local_addr: &Multiaddr,
+        _remote_addr: &Multiaddr,
+    ) -> std::result::Result<(), ConnectionDenied> {
+        self.kademlia
+            .handle_pending_inbound_connection(_connection_id, _local_addr, _remote_addr)
+    }
+
+    fn handle_established_inbound_connection(
+        &mut self,
+        connection_id: ConnectionId,
+        peer_id: PeerId,
+        local_addr: &Multiaddr,
+        remote_addr: &Multiaddr,
+    ) -> std::result::Result<THandler<Self>, ConnectionDenied> {
+        self.kademlia.handle_established_inbound_connection(
+            connection_id,
+            peer_id,
+            local_addr,
+            remote_addr,
+        )
+    }
+
+    fn handle_pending_outbound_connection(
+        &mut self,
+        _connection_id: ConnectionId,
+        maybe_peer: Option<PeerId>,
+        _addresses: &[Multiaddr],
+        _effective_role: Endpoint,
+    ) -> std::result::Result<Vec<Multiaddr>, ConnectionDenied> {
+        let peer_id = match maybe_peer {
+            None => return Ok(vec![]),
+            Some(peer_id) => peer_id,
+        };
+        Ok(self.addresses_of_peer(&peer_id))
+    }
+
+    fn handle_established_outbound_connection(
+        &mut self,
+        connection_id: ConnectionId,
+        peer_id: PeerId,
+        addr: &Multiaddr,
+        role_override: Endpoint,
+    ) -> std::result::Result<THandler<Self>, ConnectionDenied> {
+        self.kademlia.handle_established_outbound_connection(
+            connection_id,
+            peer_id,
+            addr,
+            role_override,
+        )
+    }
+
+    fn on_swarm_event(&mut self, event: FromSwarm<'_>) {
+        #[cfg(test)]
+        let kademlia_span = tracing::info_span!(parent: &self.parent_span, "Kademlia");
+        #[cfg(test)]
+        let _enter = kademlia_span.enter();
+        log::trace!("Behaviour event {:?}", event);
+        match event {
+            FromSwarm::ConnectionEstablished(e) => {
+                self.kademlia
+                    .on_swarm_event(FromSwarm::ConnectionEstablished(e));
+            }
+            FromSwarm::ConnectionClosed(e) => {
+                self.kademlia.on_swarm_event(FromSwarm::ConnectionClosed(e));
+            }
+            FromSwarm::AddressChange(e) => {
+                self.kademlia.on_swarm_event(FromSwarm::AddressChange(e));
+            }
+            FromSwarm::DialFailure(e) => {
+                self.kademlia.on_swarm_event(FromSwarm::DialFailure(e));
+            }
+            FromSwarm::ListenFailure(e) => {
+                self.kademlia.on_swarm_event(FromSwarm::ListenFailure(e));
+            }
+            FromSwarm::NewListener(e) => {
+                self.kademlia.on_swarm_event(FromSwarm::NewListener(e));
+            }
+            FromSwarm::NewListenAddr(e) => {
+                self.kademlia.on_swarm_event(FromSwarm::NewListenAddr(e));
+            }
+            FromSwarm::ExpiredListenAddr(e) => {
+                self.kademlia
+                    .on_swarm_event(FromSwarm::ExpiredListenAddr(e));
+            }
+            FromSwarm::ListenerError(e) => {
+                self.kademlia.on_swarm_event(FromSwarm::ListenerError(e));
+            }
+            FromSwarm::ListenerClosed(e) => {
+                self.kademlia.on_swarm_event(FromSwarm::ListenerClosed(e));
+            }
+            FromSwarm::NewExternalAddrCandidate(e) => {
+                self.kademlia
+                    .on_swarm_event(FromSwarm::NewExternalAddrCandidate(e));
+            }
+            FromSwarm::ExternalAddrExpired(e) => {
+                self.kademlia
+                    .on_swarm_event(FromSwarm::ExternalAddrExpired(e));
+            }
+            FromSwarm::ExternalAddrConfirmed(e) => {
+                self.kademlia
+                    .on_swarm_event(FromSwarm::ExternalAddrConfirmed(e));
+            }
+            e => {
+                tracing::warn!("Unexpected event {:?}", e);
+                #[cfg(test)]
+                panic!("Unexpected event")
+            }
+        }
+    }
+
+    fn on_connection_handler_event(
+        &mut self,
+        peer_id: PeerId,
+        connection_id: ConnectionId,
+        event: THandlerOutEvent<Self>,
+    ) {
+        self.kademlia
+            .on_connection_handler_event(peer_id, connection_id, event)
+    }
+
+    fn poll(&mut self, cx: &mut Context<'_>) -> Poll<ToSwarm<(), THandlerInEvent<Self>>> {
+        use Poll::{Pending, Ready};
+        use ToSwarm::*;
+        #[cfg(test)]
+        let kademlia_span = tracing::info_span!(parent: &self.parent_span, "Kademlia");
+        #[cfg(test)]
+        let _enter = kademlia_span.enter();
+        loop {
+            if self.poll(cx).is_pending() {
+                break;
+            }
+        }
+
+        #[rustfmt::skip]
+        loop {
+            match self.kademlia.poll(cx) {
+                Pending => return Pending,
+                Ready(GenerateEvent(e)) => self.inject_kad_event(e),
+                Ready(Dial { opts }) => return Ready(Dial { opts }),
+                Ready(NotifyHandler { peer_id, handler, event }) => return Ready(NotifyHandler { peer_id, handler, event }),
+                Ready(NewExternalAddrCandidate(address)) => return Ready(NewExternalAddrCandidate(address)),
+                Ready(ExternalAddrConfirmed(address)) => return Ready(ExternalAddrConfirmed(address)),
+                Ready(ExternalAddrExpired(address)) => return Ready(ExternalAddrExpired(address)),
+                Ready(CloseConnection { peer_id, connection }) => return Ready(CloseConnection { peer_id, connection }),
+                Ready(ListenOn { opts }) => return Ready(ListenOn {opts}),
+                Ready(RemoveListener { id }) => return Ready(RemoveListener {id}),
+                Ready(e) => {
+                    tracing::warn!("Unexpected event {:?}", e);
+                    #[cfg(test)]
+                    panic!("Unexpected event")
+                }
+            }
+        }
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use std::task::Poll;
+    use std::time::Duration;
+
+    use futures::StreamExt;
+    use libp2p::core::Multiaddr;
+    use libp2p::multiaddr::Protocol;
+    use libp2p::Swarm;
+    use libp2p::SwarmBuilder;
+    use libp2p::{PeerId, StreamProtocol};
+    use libp2p_identity::Keypair;
+    use rand::distributions::Alphanumeric;
+    use rand::Rng;
+    use tokio::sync::oneshot;
+
+    use fluence_libp2p::random_multiaddr::create_memory_maddr;
+    use fluence_libp2p::{build_memory_transport, RandomPeerId};
+    use log_utils::enable_logs;
+
+    use crate::{KademliaConfig, KademliaError};
+
+    use super::Kademlia;
+
+    fn kad_config(peer_id: PeerId, network_id: String) -> KademliaConfig {
+        let protocol_name = format!("/fluence/kad/{}/1.0.0", network_id);
+        let protocol_name = StreamProtocol::try_from_owned(protocol_name).unwrap();
+        KademliaConfig {
+            peer_id,
+            max_packet_size: None,
+            query_timeout: Duration::from_millis(100),
+            replication_factor: None,
+            peer_fail_threshold: 1,
+            ban_cooldown: Duration::from_secs(1),
+            protocol_name,
+        }
+    }
+
+    fn make_node(human_readable_id: String, network_id: String) -> (Swarm<Kademlia>, Multiaddr) {
+        use fluence_keypair::KeyPair;
+
+        let kp = KeyPair::generate_ed25519();
+        let peer_id = kp.get_peer_id();
+        let span = tracing::info_span!(
+            "Node",
+            peer_id = peer_id.to_base58(),
+            id = human_readable_id
+        );
+        let _guard = span.enter();
+        let config = kad_config(peer_id, network_id);
+        let (kad, _) = Kademlia::new(config, None, span.clone());
+        let timeout = Duration::from_secs(20);
+
+        let kp: Keypair = kp.into();
+        let mut swarm = SwarmBuilder::with_existing_identity(kp.clone())
+            .with_tokio()
+            .with_other_transport(|_| build_memory_transport(&kp, timeout))
+            .unwrap()
+            .with_behaviour(|_| kad)
+            .unwrap()
+            .with_swarm_config(|cfg| cfg.with_idle_connection_timeout(Duration::from_secs(1)))
+            .build();
+
+        let mut maddr = create_memory_maddr();
+        maddr.push(Protocol::P2p(peer_id));
+
+        Swarm::listen_on(&mut swarm, maddr.clone()).expect("Could not make swarm");
+
+        tracing::info!("Node created");
+        (swarm, maddr)
+    }
+
+    fn generate_network_id() -> String {
+        let network_id: String = rand::thread_rng()
+            .sample_iter(&Alphanumeric)
+            .take(7)
+            .map(char::from)
+            .collect();
+
+        format!("test_{}", network_id)
+    }
+
+    #[tokio::test(flavor = "multi_thread", worker_threads = 2)]
+    async fn discovery_heavy() {
+        enable_logs();
+        use tokio::time::timeout;
+
+        let network_id = generate_network_id();
+
+        let (mut a, a_addr) = make_node("a".to_string(), network_id.clone());
+        let (mut b, b_addr) = make_node("b".to_string(), network_id.clone());
+        let (c, c_addr) = make_node("c".to_string(), network_id.clone());
+        let (d, d_addr) = make_node("d".to_string(), network_id.clone());
+        let (e, e_addr) = make_node("e".to_string(), network_id);
+
+        // a knows everybody
+        Swarm::dial(&mut a, b_addr.clone()).unwrap();
+        Swarm::dial(&mut a, c_addr.clone()).unwrap();
+        Swarm::dial(&mut a, d_addr.clone()).unwrap();
+        Swarm::dial(&mut a, e_addr.clone()).unwrap();
+
+        a.behaviour_mut()
+            .kademlia
+            .add_address(Swarm::local_peer_id(&b), b_addr.clone());
+        a.behaviour_mut()
+            .kademlia
+            .add_address(Swarm::local_peer_id(&c), c_addr.clone());
+        a.behaviour_mut()
+            .kademlia
+            .add_address(Swarm::local_peer_id(&d), d_addr.clone());
+        a.behaviour_mut()
+            .kademlia
+            .add_address(Swarm::local_peer_id(&e), e_addr.clone());
+        a.behaviour_mut().kademlia.bootstrap().ok();
+
+        // b knows only a, wants to discover c
+        Swarm::dial(&mut b, a_addr.clone()).unwrap();
+        b.behaviour_mut()
+            .kademlia
+            .add_address(Swarm::local_peer_id(&a), a_addr.clone());
+        let (out, inlet) = oneshot::channel();
+        b.behaviour_mut()
+            .discover_peer(*Swarm::local_peer_id(&c), out);
+        let discover_fut = inlet;
+
+        let maddr = timeout(Duration::from_millis(10000), async move {
+            let mut swarms = vec![a, b, c, d, e];
+            let t = tokio::task::Builder::new()
+                .name("Kademlia")
+                .spawn(futures::future::poll_fn(move |ctx| {
+                    for swarm in swarms.iter_mut() {
+                        loop {
+                            if !swarm.poll_next_unpin(ctx).is_ready() {
+                                break;
+                            }
+                        }
+                    }
+                    ctx.waker().wake_by_ref();
+                    Poll::Pending as Poll<()>
+                }))
+                .expect("Could not spawn task");
+
+            let maddr = discover_fut.await;
+            t.abort();
+            maddr
+        })
+        .await;
+
+        assert_eq!(maddr.unwrap().unwrap().unwrap()[0], c_addr);
+    }
+
+    #[test]
+    fn dont_repeat_discovery() {
+        let network_id = generate_network_id();
+
+        let (mut node, _) = make_node("a".to_string(), network_id);
+        let peer = RandomPeerId::random();
+
+        node.behaviour_mut()
+            .discover_peer(peer, oneshot::channel().0);
+        assert_eq!(node.behaviour().queries.len(), 1);
+        node.behaviour_mut()
+            .discover_peer(peer, oneshot::channel().0);
+        assert_eq!(node.behaviour().queries.len(), 1);
+    }
+
+    #[tokio::test]
+    async fn ban() {
+        use tokio::time::timeout;
+
+        let network_id = generate_network_id();
+
+        let (mut node, _) = make_node("a".to_string(), network_id);
+        let peer = RandomPeerId::random();
+
+        node.behaviour_mut()
+            .discover_peer(peer, oneshot::channel().0);
+        assert_eq!(node.behaviour_mut().queries.len(), 1);
+
+        // Wait until peer is banned
+        timeout(Duration::from_millis(200), async {
+            loop {
+                node.select_next_some().await;
+                if !node.behaviour_mut().failed_peers.is_empty() {
+                    break;
+                }
+            }
+        })
+        .await
+        .ok();
+
+        assert_eq!(node.behaviour_mut().failed_peers.len(), 1);
+        assert!(node
+            .behaviour_mut()
+            .failed_peers
+            .get(&peer)
+            .unwrap()
+            .ban
+            .is_some());
+
+        let (out, inlet) = oneshot::channel();
+        node.behaviour_mut().discover_peer(peer, out);
+
+        let banned = timeout(Duration::from_millis(200), inlet)
+            .await
+            .unwrap()
+            .unwrap();
+        assert!(matches!(banned, Err(KademliaError::PeerBanned)));
+    }
+}
+
\ No newline at end of file diff --git a/src/kademlia/error.rs.html b/src/kademlia/error.rs.html new file mode 100644 index 0000000000..aefa43c9db --- /dev/null +++ b/src/kademlia/error.rs.html @@ -0,0 +1,77 @@ +error.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use thiserror::Error;
+
+pub(crate) type Result<T> = std::result::Result<T, KademliaError>;
+
+#[derive(Debug, Error)]
+pub enum KademliaError {
+    #[error("KademliaError::NoPeersFound")]
+    NoPeersFound,
+    #[error("KademliaError::PeerTimedOut")]
+    PeerTimedOut,
+    #[error("KademliaError::QueryTimedOut")]
+    QueryTimedOut,
+    #[error("KademliaError::Cancelled")]
+    Cancelled,
+    #[error("KademliaError::NoKnownPeers")]
+    NoKnownPeers,
+    #[error("KademliaError::PeerBanned")]
+    PeerBanned,
+}
+
\ No newline at end of file diff --git a/src/kademlia/lib.rs.html b/src/kademlia/lib.rs.html new file mode 100644 index 0000000000..d4924a4b82 --- /dev/null +++ b/src/kademlia/lib.rs.html @@ -0,0 +1,69 @@ +lib.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+#![feature(extract_if)]
+#![feature(stmt_expr_attributes)]
+
+mod api;
+mod behaviour;
+mod error;
+
+pub use api::KademliaApi;
+pub use api::KademliaApiT;
+pub use behaviour::Kademlia;
+pub use behaviour::KademliaConfig;
+pub use error::KademliaError;
+
+// to be available in benchmarks
+pub use api::Command;
+
\ No newline at end of file diff --git a/src/local_vm/lib.rs.html b/src/local_vm/lib.rs.html new file mode 100644 index 0000000000..b8721d4f4f --- /dev/null +++ b/src/local_vm/lib.rs.html @@ -0,0 +1,81 @@ +lib.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+#![feature(try_trait_v2)]
+#![warn(rust_2018_idioms)]
+#![deny(
+    dead_code,
+    nonstandard_style,
+    unused_imports,
+    unused_mut,
+    unused_variables,
+    unused_unsafe,
+    unreachable_patterns
+)]
+
+#[macro_use]
+extern crate fstrings;
+
+mod local_vm;
+
+pub use crate::local_vm::*;
+pub use aquamarine::DataStoreError;
+pub use aquamarine::ParticleDataStore;
+pub use avm_server::avm_runner::AVMRunner;
+
\ No newline at end of file diff --git a/src/local_vm/local_vm.rs.html b/src/local_vm/local_vm.rs.html new file mode 100644 index 0000000000..61b26282f5 --- /dev/null +++ b/src/local_vm/local_vm.rs.html @@ -0,0 +1,827 @@ +local_vm.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use std::convert::TryFrom;
+use std::ops::Try;
+use std::path::Path;
+use std::sync::Arc;
+use std::{collections::HashMap, time::Duration};
+
+use avm_server::avm_runner::{AVMRunner, RawAVMOutcome};
+use avm_server::{CallResults, CallServiceResult};
+use fstrings::f;
+use libp2p::PeerId;
+use marine_wasmtime_backend::WasmtimeWasmBackend;
+use serde_json::{json, Value as JValue};
+
+use air_interpreter_fs::{air_interpreter_path, write_default_air_interpreter};
+use aquamarine::{ParticleDataStore, WasmBackendConfig};
+use fluence_keypair::KeyPair;
+use now_millis::now_ms;
+use particle_args::{Args, JError};
+use particle_execution::FunctionOutcome;
+use particle_protocol::Particle;
+use uuid_utils::uuid;
+
+#[derive(Debug, PartialEq, Eq)]
+pub enum Instruction {
+    Seq(Box<Instruction>, Box<Instruction>),
+    Call(String),
+    Null,
+}
+
+impl Instruction {
+    #[allow(clippy::should_implement_trait)]
+    pub fn add(self, call: String) -> Self {
+        use Instruction::*;
+
+        let call = move || Seq(Call(call).into(), Null.into());
+        match self {
+            Null => call(),
+            Seq(left, r) if *r == Null => Seq(left, call().into()),
+            s @ Seq(..) => Seq(s.into(), call().into()),
+            i => panic!("Didn't expect instruction to be {i:?}"),
+        }
+    }
+
+    pub fn into_air(self) -> String {
+        use Instruction::*;
+
+        match self {
+            Null => "(null)".to_string(),
+            Call(call) => call,
+            Seq(l, r) => {
+                let l = l.into_air();
+                let r = r.into_air();
+                f!("(seq
+{l}
+{r}
+)")
+            }
+        }
+    }
+}
+
+pub type Returned = Option<Result<Vec<JValue>, Vec<JValue>>>;
+
+#[derive(Debug)]
+pub struct ClientFunctionsResult {
+    pub outcome: FunctionOutcome,
+    pub returned: Returned,
+}
+
+pub fn client_functions(data: &HashMap<String, JValue>, args: Args) -> ClientFunctionsResult {
+    match (args.service_id.as_str(), args.function_name.as_str()) {
+        ("load", _) | ("getDataSrv", _) => {
+            let value = data.get(args.function_name.as_str()).cloned();
+            let outcome = match value {
+                Some(v) => FunctionOutcome::Ok(v),
+                None => FunctionOutcome::Err(JError::new(f!(
+                    "variable not found: {args.function_name}"
+                ))),
+            };
+            ClientFunctionsResult {
+                outcome,
+                returned: None,
+            }
+        }
+        ("return", _) | ("op", "return") | ("callbackSrv", "response") => ClientFunctionsResult {
+            outcome: FunctionOutcome::Empty,
+            returned: Some(Ok(args.function_args)),
+        },
+        ("callbackSrv", _) => {
+            log::warn!("got callback: {:?}", args.function_args);
+            ClientFunctionsResult {
+                outcome: FunctionOutcome::Empty,
+                returned: None,
+            }
+        }
+        ("errorHandlingSrv", "error") => {
+            log::warn!("caught an error: {:?}", args.function_args);
+            ClientFunctionsResult {
+                outcome: FunctionOutcome::Empty,
+                returned: Some(Err(args.function_args)),
+            }
+        }
+        (_, "identity") => ClientFunctionsResult {
+            outcome: FunctionOutcome::from_output(args.function_args.into_iter().next()),
+            returned: None,
+        },
+        ("op", "noop") => ClientFunctionsResult {
+            outcome: FunctionOutcome::Empty,
+            returned: None,
+        },
+        ("run-console", "print") => {
+            println!("run-console: {}", json!(args.function_args));
+            log::info!("run-console: {}", json!(args.function_args));
+            ClientFunctionsResult {
+                outcome: FunctionOutcome::Empty,
+                returned: None,
+            }
+        }
+        (service, function) => {
+            let error = f!("service not found: {service} {function}");
+            println!("{error}");
+            log::warn!("{}", error);
+            ClientFunctionsResult {
+                outcome: FunctionOutcome::Err(JError::new(error)),
+                returned: None,
+            }
+        }
+    }
+}
+
+pub fn host_call(data: &HashMap<String, JValue>, args: Args) -> (CallServiceResult, Returned) {
+    let result = client_functions(data, args);
+    let outcome = result.outcome;
+    let outcome = match outcome {
+        FunctionOutcome::NotDefined { args, .. } => Err(JError::new(format!(
+            "Service with id '{}' not found (function {})",
+            args.service_id, args.function_name
+        ))),
+        FunctionOutcome::Empty => Ok(JValue::String(String::new())),
+        FunctionOutcome::Ok(v) => Ok(v),
+        FunctionOutcome::Err(err) => Err(err),
+    };
+
+    let outcome = match outcome {
+        Ok(result) => CallServiceResult {
+            ret_code: 0,
+            result,
+        },
+        Err(err) => CallServiceResult {
+            ret_code: 1,
+            result: JValue::from(err),
+        },
+    };
+
+    (outcome, result.returned)
+}
+
+pub fn make_wasm_backend() -> WasmtimeWasmBackend {
+    let wasmtime_config = WasmBackendConfig::default();
+    WasmtimeWasmBackend::new(wasmtime_config.into()).expect("Cannot create WasmtimeWasmBackend")
+}
+
+pub async fn make_vm(tmp_dir_path: &Path) -> AVMRunner<WasmtimeWasmBackend> {
+    let interpreter = air_interpreter_path(tmp_dir_path);
+    write_default_air_interpreter(&interpreter).expect("write air interpreter");
+
+    AVMRunner::new(
+        interpreter,
+        None,
+        <_>::default(),
+        i32::MAX,
+        make_wasm_backend(),
+    )
+    .await
+    .map_err(|err| {
+        log::error!("\n\n\nFailed to create local AVM: {:#?}\n\n\n", err);
+
+        println!("\n\n\nFailed to create local AVM: {err:#?}\n\n\n");
+
+        err
+    })
+    .expect("vm should be created")
+}
+
+pub fn wrap_script(
+    script: String,
+    data: &HashMap<String, JValue>,
+    relay: impl Into<Option<PeerId>>,
+    generated: bool,
+    executor: Option<PeerId>,
+) -> String {
+    let executor = executor
+        .map(|p| format!("\"{p}\""))
+        .unwrap_or(String::from("%init_peer_id%"));
+
+    let load_variables = if generated {
+        "   (null)".to_string()
+    } else {
+        data.keys()
+            .map(|name| f!(r#"  (call {executor} ("load" "{name}") [] {name})"#))
+            .fold(Instruction::Null, |acc, call| acc.add(call))
+            .into_air()
+    };
+
+    let catch = f!(r#"(call {executor} ("errorHandlingSrv" "error") [%last_error%])"#);
+    let catch = if let Some(relay) = relay.into() {
+        f!(r#"
+        (seq
+            (call "{relay}" ("op" "identity") [])
+            {catch}
+        )
+        "#)
+    } else {
+        catch
+    };
+
+    let script = f!(r#"
+(seq
+{load_variables}
+    (xor
+        {script}
+        {catch}
+    )
+)
+    "#);
+
+    script
+}
+
+#[allow(clippy::too_many_arguments)]
+pub async fn make_particle(
+    peer_id: PeerId,
+    service_in: &HashMap<String, JValue>,
+    script: String,
+    relay: impl Into<Option<PeerId>>,
+    local_vm: &mut AVMRunner<WasmtimeWasmBackend>,
+    data_store: Arc<ParticleDataStore>,
+    generated: bool,
+    particle_ttl: Duration,
+    key_pair: &KeyPair,
+) -> Particle {
+    let script = wrap_script(script, service_in, relay, generated, None);
+
+    let id = uuid();
+    let timestamp = now_ms() as u64;
+    let ttl = particle_ttl.as_millis() as u32;
+
+    let mut particle = Particle {
+        id: id.clone(),
+        init_peer_id: peer_id,
+        timestamp,
+        ttl,
+        script: script.clone(),
+        signature: vec![],
+        data: vec![],
+    };
+    // We can sign at this point since the `data` which is evaluated below isn't part of the signature
+    particle.sign(key_pair).expect("sign particle");
+
+    let mut call_results: CallResults = <_>::default();
+    let mut particle_data = vec![];
+    loop {
+        let prev_data = data_store
+            .read_data(
+                id.as_str(),
+                peer_id.to_base58().as_str(),
+                &particle.signature,
+            )
+            .await
+            .expect("Could not load prev data");
+
+        let RawAVMOutcome {
+            data,
+            call_requests,
+            ..
+        } = local_vm
+            .call(
+                &script,
+                prev_data,
+                particle_data,
+                peer_id.to_string(),
+                timestamp,
+                ttl,
+                peer_id.to_string(),
+                call_results,
+                key_pair,
+                id.clone(),
+            )
+            .await
+            .expect("execute & make particle");
+
+        data_store
+            .store_data(
+                &data,
+                id.as_str(),
+                peer_id.to_base58().as_str(),
+                &particle.signature,
+            )
+            .await
+            .expect("local vm could not store particle.data data");
+
+        particle_data = data;
+        call_results = <_>::default();
+
+        if call_requests.is_empty() {
+            break;
+        }
+        for (id, call) in call_requests {
+            let args = Args::try_from(call).expect("valid args");
+            let result = host_call(service_in, args);
+            call_results.insert(id, result.0);
+        }
+        tokio::task::yield_now().await;
+    }
+
+    particle.data = particle_data;
+
+    tracing::info!(
+        particle_id = id,
+        "Made a particle with timestamp = {}, TTL = {}",
+        particle.ttl,
+        particle.timestamp
+    );
+
+    particle
+}
+
+pub async fn read_args(
+    particle: Particle,
+    peer_id: PeerId,
+    local_vm: &mut AVMRunner<WasmtimeWasmBackend>,
+    data_store: Arc<ParticleDataStore>,
+    key_pair: &KeyPair,
+) -> Option<Result<Vec<JValue>, Vec<JValue>>> {
+    let mut call_results: CallResults = <_>::default();
+    let mut particle_data = particle.data;
+    loop {
+        let prev_data = data_store
+            .read_data(
+                particle.id.as_str(),
+                peer_id.to_base58().as_str(),
+                &particle.signature,
+            )
+            .await
+            .expect("Could not load prev data");
+
+        let RawAVMOutcome {
+            data,
+            call_requests,
+            ..
+        } = local_vm
+            .call(
+                &particle.script,
+                prev_data,
+                particle_data,
+                particle.init_peer_id.to_string(),
+                particle.timestamp,
+                particle.ttl,
+                peer_id.to_string(),
+                call_results,
+                key_pair,
+                particle.id.clone(),
+            )
+            .await
+            .expect("execute & make particle");
+
+        data_store
+            .store_data(
+                &data,
+                particle.id.as_str(),
+                peer_id.to_base58().as_str(),
+                &particle.signature,
+            )
+            .await
+            .expect("local vm could not store particle.data data");
+
+        particle_data = data;
+        call_results = <_>::default();
+
+        if call_requests.is_empty() {
+            return None;
+        }
+        for (id, call) in call_requests {
+            let args = Args::try_from(call).expect("valid args");
+            let (call_result, returned) = host_call(&<_>::default(), args);
+            call_results.insert(id, call_result);
+
+            if returned.is_some() {
+                return returned;
+            }
+        }
+        tokio::task::yield_now().await;
+    }
+}
+
\ No newline at end of file diff --git a/src/log_format/lib.rs.html b/src/log_format/lib.rs.html new file mode 100644 index 0000000000..ba245bd998 --- /dev/null +++ b/src/log_format/lib.rs.html @@ -0,0 +1,831 @@ +lib.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use nu_ansi_term::{Color, Style};
+use std::fmt;
+use tracing::{Event, Level, Subscriber};
+use tracing_log::NormalizeEvent;
+use tracing_subscriber::fmt::format::Writer;
+use tracing_subscriber::fmt::time::{FormatTime, SystemTime};
+use tracing_subscriber::fmt::{FmtContext, FormatEvent, FormatFields, FormattedFields};
+use tracing_subscriber::registry::LookupSpan;
+
+#[derive(Debug, Clone)]
+#[allow(unused)]
+pub struct Format<T = SystemTime> {
+    pub(crate) timer: T,
+    pub(crate) display_timestamp: bool,
+    pub(crate) display_target: bool,
+    pub(crate) display_level: bool,
+    pub(crate) display_span_list: bool,
+}
+
+impl Default for Format<SystemTime> {
+    fn default() -> Self {
+        Format {
+            timer: SystemTime,
+            display_timestamp: true,
+            display_target: true,
+            display_level: true,
+            display_span_list: false,
+        }
+    }
+}
+
+#[allow(unused)]
+impl<T> Format<T> {
+    /// Use the given [`timer`] for log message timestamps.
+    ///
+    /// See [`time` module] for the provided timer implementations.
+    ///
+    /// Note that using the `"time"` feature flag enables the
+    /// additional time formatters [`UtcTime`] and [`LocalTime`], which use the
+    /// [`time` crate] to provide more sophisticated timestamp formatting
+    /// options.
+    ///
+    /// [`timer`]: super::time::FormatTime
+    /// [`time` module]: mod@super::time
+    /// [`UtcTime`]: super::time::UtcTime
+    /// [`LocalTime`]: super::time::LocalTime
+    /// [`time` crate]: https://docs.rs/time/0.3
+    pub fn with_timer<T2>(self, timer: T2) -> Format<T2> {
+        Format {
+            timer,
+            display_target: self.display_target,
+            display_timestamp: self.display_timestamp,
+            display_level: self.display_level,
+            display_span_list: self.display_span_list,
+        }
+    }
+
+    /// Do not emit timestamps with log messages.
+    pub fn without_time(self) -> Format<()> {
+        Format {
+            timer: (),
+            display_timestamp: false,
+            display_target: self.display_target,
+            display_level: self.display_level,
+            display_span_list: self.display_span_list,
+        }
+    }
+
+    /// Sets whether or not an event's target is displayed.
+    pub fn with_target(self, display_target: bool) -> Format<T> {
+        Format {
+            display_target,
+            ..self
+        }
+    }
+
+    /// Sets whether or not an event's spans is displayed.
+    pub fn with_display_span_list(self, display_span_list: bool) -> Format<T> {
+        Format {
+            display_span_list,
+            ..self
+        }
+    }
+
+    /// Sets whether or not an event's level is displayed.
+    pub fn with_level(self, display_level: bool) -> Format<T> {
+        Format {
+            display_level,
+            ..self
+        }
+    }
+
+    #[inline]
+    fn format_timestamp(&self, writer: &mut Writer<'_>) -> fmt::Result
+    where
+        T: FormatTime,
+    {
+        // If timestamps are disabled, do nothing.
+        if !self.display_timestamp {
+            return Ok(());
+        }
+
+        // If ANSI color codes are enabled, format the timestamp with ANSI
+        // colors.
+        {
+            if writer.has_ansi_escapes() {
+                let style = nu_ansi_term::Style::new().dimmed();
+                write!(writer, "{}", style.prefix())?;
+
+                // If getting the timestamp failed, don't bail --- only bail on
+                // formatting errors.
+                if self.timer.format_time(writer).is_err() {
+                    writer.write_str("<unknown time>")?;
+                }
+
+                write!(writer, "{} ", style.suffix())?;
+                return Ok(());
+            }
+        }
+
+        // Otherwise, just format the timestamp without ANSI formatting.
+        // If getting the timestamp failed, don't bail --- only bail on
+        // formatting errors.
+        if self.timer.format_time(writer).is_err() {
+            writer.write_str("<unknown time>")?;
+        }
+        writer.write_char(' ')
+    }
+}
+
+impl<S, N, T> FormatEvent<S, N> for Format<T>
+where
+    S: Subscriber + for<'a> LookupSpan<'a>,
+    N: for<'a> FormatFields<'a> + 'static,
+    T: FormatTime,
+{
+    fn format_event(
+        &self,
+        ctx: &FmtContext<'_, S, N>,
+        mut writer: Writer<'_>,
+        event: &Event<'_>,
+    ) -> fmt::Result {
+        let normalized_meta = event.normalized_metadata();
+        let meta = normalized_meta.as_ref().unwrap_or_else(|| event.metadata());
+
+        self.format_timestamp(&mut writer)?;
+
+        if self.display_level {
+            let fmt_level = { FmtLevel::new(meta.level(), writer.has_ansi_escapes()) };
+            write!(writer, "{} ", fmt_level)?;
+        }
+
+        let dimmed = if writer.has_ansi_escapes() {
+            Style::new().dimmed()
+        } else {
+            Style::new()
+        };
+
+        if self.display_span_list {
+            if let Some(scope) = ctx.event_scope() {
+                let bold = if writer.has_ansi_escapes() {
+                    Style::new().bold()
+                } else {
+                    Style::new()
+                };
+
+                let mut spans = scope.from_root().peekable();
+
+                if spans.peek().is_some() {
+                    write!(writer, "{}", bold.paint("{"))?;
+                }
+                let mut first_write = true;
+
+                for span in spans {
+                    let ext = span.extensions();
+                    if let Some(fields) = &ext.get::<FormattedFields<N>>() {
+                        if !fields.is_empty() {
+                            if first_write {
+                                write!(writer, " ")?;
+                                first_write = false;
+                            }
+                            write!(writer, "{}", fields)?;
+                            write!(writer, " ")?;
+                        }
+                    }
+                }
+                write!(writer, "{}", bold.paint("}"))?;
+            };
+            write!(writer, " ")?;
+        };
+
+        if self.display_target {
+            write!(
+                writer,
+                "{}{} ",
+                dimmed.paint(meta.target()),
+                dimmed.paint(":")
+            )?;
+        }
+
+        ctx.format_fields(writer.by_ref(), event)?;
+        writeln!(writer)
+    }
+}
+
+const TRACE_STR: &str = "TRACE";
+const DEBUG_STR: &str = "DEBUG";
+const INFO_STR: &str = " INFO";
+const WARN_STR: &str = " WARN";
+const ERROR_STR: &str = "ERROR";
+
+struct FmtLevel<'a> {
+    level: &'a Level,
+    ansi: bool,
+}
+
+impl<'a> FmtLevel<'a> {
+    pub(crate) fn new(level: &'a Level, ansi: bool) -> Self {
+        Self { level, ansi }
+    }
+}
+
+impl<'a> fmt::Display for FmtLevel<'a> {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        if self.ansi {
+            match *self.level {
+                Level::TRACE => write!(f, "{}", Color::Purple.paint(TRACE_STR)),
+                Level::DEBUG => write!(f, "{}", Color::Blue.paint(DEBUG_STR)),
+                Level::INFO => write!(f, "{}", Color::Green.paint(INFO_STR)),
+                Level::WARN => write!(f, "{}", Color::Yellow.paint(WARN_STR)),
+                Level::ERROR => write!(f, "{}", Color::Red.paint(ERROR_STR)),
+            }
+        } else {
+            match *self.level {
+                Level::TRACE => f.pad(TRACE_STR),
+                Level::DEBUG => f.pad(DEBUG_STR),
+                Level::INFO => f.pad(INFO_STR),
+                Level::WARN => f.pad(WARN_STR),
+                Level::ERROR => f.pad(ERROR_STR),
+            }
+        }
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use std::sync::{Arc, Mutex};
+    use std::{fmt, io};
+
+    use subscriber::with_default;
+    use tracing::{info_span, subscriber};
+    use tracing_subscriber::fmt::format::Writer;
+    use tracing_subscriber::fmt::time::FormatTime;
+    use tracing_subscriber::fmt::{MakeWriter, Subscriber};
+
+    use crate::Format;
+
+    #[derive(Clone, Debug)]
+    struct MockWriter {
+        buf: Arc<Mutex<Vec<u8>>>,
+    }
+
+    #[derive(Clone, Debug)]
+    struct MockMakeWriter {
+        buf: Arc<Mutex<Vec<u8>>>,
+    }
+
+    impl MockMakeWriter {
+        fn new() -> Self {
+            Self {
+                buf: Arc::new(Mutex::new(Vec::new())),
+            }
+        }
+        fn get_content(&self) -> String {
+            let buf = self.buf.lock().unwrap();
+            std::str::from_utf8(&buf[..]).unwrap().to_owned()
+        }
+    }
+
+    impl MockWriter {
+        fn new(buf: Arc<Mutex<Vec<u8>>>) -> Self {
+            Self { buf }
+        }
+    }
+
+    impl io::Write for MockWriter {
+        fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
+            self.buf.lock().unwrap().write(buf)
+        }
+
+        fn flush(&mut self) -> io::Result<()> {
+            self.buf.lock().unwrap().flush()
+        }
+    }
+
+    impl<'a> MakeWriter<'a> for MockMakeWriter {
+        type Writer = MockWriter;
+
+        fn make_writer(&'a self) -> Self::Writer {
+            MockWriter::new(self.buf.clone())
+        }
+    }
+
+    pub(crate) struct MockTime;
+    impl FormatTime for MockTime {
+        fn format_time(&self, w: &mut Writer<'_>) -> fmt::Result {
+            write!(w, "fake time")
+        }
+    }
+
+    #[test]
+    fn test_simple_info() {
+        let make_writer = MockMakeWriter::new();
+
+        let format = Format::default().with_timer(MockTime);
+        let subscriber = Subscriber::builder()
+            .with_ansi(false)
+            .event_format(format)
+            .with_writer(make_writer.clone())
+            .finish();
+
+        with_default(subscriber, || {
+            tracing::info!("info message");
+        });
+
+        let expected = "fake time  INFO log_format::tests: info message\n";
+
+        assert_eq!(expected, make_writer.get_content());
+    }
+
+    #[test]
+    fn test_asni_info() {
+        let writer = MockMakeWriter::new();
+
+        let format = Format::default().with_timer(MockTime);
+        let subscriber = Subscriber::builder()
+            .with_ansi(true)
+            .event_format(format)
+            .with_writer(writer.clone())
+            .finish();
+
+        with_default(subscriber, || {
+            tracing::info!("info message");
+        });
+
+        let expected =  "\u{1b}[2mfake time\u{1b}[0m \u{1b}[32m INFO\u{1b}[0m \u{1b}[2mlog_format::tests\u{1b}[0m\u{1b}[2m:\u{1b}[0m info message\n";
+
+        assert_eq!(expected, writer.get_content());
+    }
+
+    #[test]
+    fn test_simple_info_with_span() {
+        let writer = MockMakeWriter::new();
+
+        let format = Format::default()
+            .with_timer(MockTime)
+            .with_display_span_list(true);
+        let subscriber = Subscriber::builder()
+            .with_ansi(false)
+            .event_format(format)
+            .with_writer(writer.clone())
+            .finish();
+
+        with_default(subscriber, || {
+            let span_1 = info_span!("test", id = "test-id", id_x = "test-id-x");
+            let span_2 = info_span!(parent: &span_1, "test", id = "test-id-x", id_2 ="test-id-2", id_2="test-id-3");
+            tracing::info!(parent: &span_2, "info message");
+        });
+
+        let expected = "fake time  INFO { id=\"test-id\" id_x=\"test-id-x\" id=\"test-id-x\" id_2=\"test-id-2\" id_2=\"test-id-3\" } log_format::tests: info message\n";
+
+        assert_eq!(expected, writer.get_content());
+    }
+
+    #[test]
+    fn test_simple_info_without_spans() {
+        let writer = MockMakeWriter::new();
+
+        let format = Format::default()
+            .with_timer(MockTime)
+            .with_display_span_list(true);
+        let subscriber = Subscriber::builder()
+            .with_ansi(false)
+            .event_format(format)
+            .with_writer(writer.clone())
+            .finish();
+
+        with_default(subscriber, || {
+            tracing::info!("info message");
+        });
+
+        let expected = "fake time  INFO  log_format::tests: info message\n";
+
+        assert_eq!(expected, writer.get_content());
+    }
+}
+
\ No newline at end of file diff --git a/src/log_utils/lib.rs.html b/src/log_utils/lib.rs.html new file mode 100644 index 0000000000..936e98daf2 --- /dev/null +++ b/src/log_utils/lib.rs.html @@ -0,0 +1,327 @@ +lib.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use log::Level;
+use log_format::Format;
+use tracing_subscriber::filter::Directive;
+
+fn default_directives() -> Vec<Directive> {
+    let namespaces = vec![
+        "run-console=trace",
+        "sorcerer=trace",
+        "key_manager=trace",
+        "spell_event_bus=trace",
+        "aquamarine=trace",
+        "network=trace",
+        "network_api=trace",
+        "aquamarine::actor=debug",
+        "nox::bootstrapper=info",
+        "yamux::connection::stream=info",
+        "tokio_threadpool=info",
+        "tokio_reactor=info",
+        "mio=info",
+        "tokio_io=info",
+        "soketto=info",
+        "yamix=info",
+        "multistream_select=info",
+        "libp2p_swarm=info",
+        "libp2p_secio=info",
+        "libp2p_websocket::framed=info",
+        "libp2p_ping=info",
+        "libp2p_core::upgrade::apply=info",
+        "libp2p_core::upgrade=info",
+        "libp2p_kad::kbucket=info",
+        "libp2p_kad=info",
+        "libp2p_kad::query=info",
+        "libp2p_kad::iterlog=info",
+        "libp2p_plaintext=info",
+        "libp2p_identify::protocol=info",
+        "cranelift_codegen=off",
+        "cranelift_codegen::context=off",
+        "wasmer_wasi=info",
+        "wasmer_interface_types_fl=info",
+        "polling=info",
+        "walrus=info",
+        "regalloc2=info",
+        "cranelift_wasm=info",
+        "wasmtime_cranelift=info",
+        "tokio=info",
+        "libp2p_noise=info",
+        "yamux=info",
+        "wasmtime_jit=info",
+        "wasi_common=info",
+        "particle_reap=info",
+        "marine_core::module::marine_module=info",
+        "runtime::resource=info",
+        "connected_client=debug",
+        "listener=debug",
+        "chain-listener=debug",
+    ];
+
+    namespaces
+        .into_iter()
+        .map(|ns| {
+            ns.trim()
+                .parse()
+                .unwrap_or_else(|e| panic!("cannot parse {ns} to Directive: {e}"))
+        })
+        .collect()
+}
+
+#[allow(dead_code)]
+// Enables logging, filtering out unnecessary details
+pub fn enable_logs() {
+    enable_logs_for(LogSpec::default())
+}
+
+pub struct LogSpec {
+    level: tracing::metadata::Level,
+    directives: Vec<Directive>,
+    wasm_log: Level,
+}
+
+impl Default for LogSpec {
+    fn default() -> Self {
+        Self::new(vec![])
+            .with_defaults()
+            .with_level(tracing::metadata::Level::INFO)
+            .with_wasm_level(Level::Info)
+    }
+}
+
+impl LogSpec {
+    pub fn new(directives: Vec<Directive>) -> Self {
+        Self {
+            level: tracing::metadata::Level::INFO,
+            directives,
+            wasm_log: Level::Info,
+        }
+    }
+
+    pub fn with_level(mut self, level: tracing::metadata::Level) -> Self {
+        self.level = level;
+
+        self
+    }
+
+    pub fn with_defaults(mut self) -> Self {
+        self.directives = default_directives()
+            .into_iter()
+            .chain(self.directives)
+            .collect();
+
+        self
+    }
+
+    pub fn with_wasm_level(mut self, level: Level) -> Self {
+        self.wasm_log = level;
+
+        self
+    }
+
+    pub fn with_directives(mut self, directives: Vec<Directive>) -> Self {
+        self.directives = self.directives.into_iter().chain(directives).collect();
+
+        self
+    }
+}
+
+pub fn enable_logs_for(spec: LogSpec) {
+    std::env::set_var("WASM_LOG", spec.wasm_log.to_string().to_lowercase());
+
+    let mut filter = tracing_subscriber::EnvFilter::builder()
+        .with_default_directive(spec.level.into())
+        .from_env()
+        .expect("invalid RUST_LOG");
+
+    for d in spec.directives {
+        filter = filter.add_directive(d);
+    }
+    let format = Format::default().with_display_span_list(true);
+
+    tracing_subscriber::fmt()
+        .event_format(format)
+        .with_env_filter(filter)
+        .try_init()
+        .ok();
+}
+
\ No newline at end of file diff --git a/src/now_millis/lib.rs.html b/src/now_millis/lib.rs.html new file mode 100644 index 0000000000..b1470e3a34 --- /dev/null +++ b/src/now_millis/lib.rs.html @@ -0,0 +1,75 @@ +lib.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use std::time::{Duration, SystemTime, UNIX_EPOCH};
+
+/// Returns UNIX timestamp as Duration
+pub fn now() -> Duration {
+    SystemTime::now()
+        .duration_since(UNIX_EPOCH)
+        .expect("system time before Unix epoch")
+}
+
+/// Returns UNIX timestamp in milliseconds
+pub fn now_ms() -> u128 {
+    now().as_millis()
+}
+
+/// Returns UNIX timestamp in seconds
+pub fn now_sec() -> u64 {
+    now().as_secs()
+}
+
\ No newline at end of file diff --git a/src/nox/behaviour/identify.rs.html b/src/nox/behaviour/identify.rs.html new file mode 100644 index 0000000000..aab352462f --- /dev/null +++ b/src/nox/behaviour/identify.rs.html @@ -0,0 +1,245 @@ +identify.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use itertools::Itertools;
+use libp2p::{
+    core::{multiaddr::Protocol, Multiaddr},
+    identify::Event as IdentifyEvent,
+};
+use particle_protocol::PROTOCOL_NAME;
+use tokio::sync::oneshot;
+
+use super::FluenceNetworkBehaviour;
+
+/// Network address information is exchanged via Identify protocol.
+/// That information is passed to relay, so nodes know each other's addresses
+impl FluenceNetworkBehaviour {
+    pub fn inject_identify_event(&mut self, event: IdentifyEvent, allow_local_addresses: bool) {
+        match event {
+            IdentifyEvent::Received { peer_id, info, .. } => {
+                log::trace!(
+                    "Identify received from {}: protocols: {:?} version: {} listen addrs {:?}",
+                    peer_id,
+                    info.protocols,
+                    info.protocol_version,
+                    info.listen_addrs
+                );
+
+                let addresses = filter_addresses(info.listen_addrs.clone(), allow_local_addresses);
+
+                let mut supports_kademlia = false;
+                let mut supports_fluence = false;
+
+                for protocol in info.protocols.iter() {
+                    if !supports_kademlia && protocol.eq(self.kademlia.protocol_name()) {
+                        supports_kademlia = true;
+                    }
+                    if !supports_fluence && protocol.eq(&PROTOCOL_NAME) {
+                        supports_fluence = true;
+                    }
+                    if supports_fluence && supports_kademlia {
+                        break;
+                    }
+                }
+
+                if supports_fluence {
+                    let protocols: Vec<_> = info.protocols.iter().map(|p| p.to_string()).collect();
+                    log::debug!(
+                        target: "network",
+                        "Found fluence peer {}: protocols: {:?} version: {} listen addrs {:?}",
+                        peer_id, protocols, info.protocol_version, addresses
+                    );
+                    // Add addresses to connection pool disregarding whether it supports kademlia or not
+                    // we want to have full info on non-kademlia peers as well
+                    self.connection_pool
+                        .add_discovered_addresses(peer_id, addresses.clone());
+                    if supports_kademlia {
+                        self.kademlia.add_kad_node(peer_id, addresses);
+                    }
+                } else {
+                    log::debug!(
+                        target: "blocked",
+                        "Found peer {} not supported fluence protocol, protocols: {:?} version: {} listen addrs {:?}. skipping...",
+                        peer_id, info.protocols,
+                        info.protocol_version,
+                        info.listen_addrs
+                    );
+                    let (out, _inlet) = oneshot::channel();
+                    self.connection_pool.disconnect(peer_id, out);
+                }
+            }
+
+            // TODO: handle error?
+            IdentifyEvent::Error { error, peer_id } => {
+                log::debug!("Identify error on {}: {}", peer_id, error);
+            }
+
+            // We don't care about outgoing identification info
+            IdentifyEvent::Sent { .. } | IdentifyEvent::Pushed { .. } => {}
+        }
+    }
+}
+
+fn filter_addresses(addresses: Vec<Multiaddr>, allow_local: bool) -> Vec<Multiaddr> {
+    // Deduplicate addresses
+    let addresses = addresses.iter().unique();
+
+    if allow_local {
+        // Return all addresses
+        addresses.cloned().collect()
+    } else {
+        // Keep only global addresses
+        addresses
+            .filter(|maddr| !is_local_maddr(maddr))
+            .cloned()
+            .collect()
+    }
+}
+
+fn is_local_maddr(maddr: &Multiaddr) -> bool {
+    maddr.iter().any(|p| match p {
+        Protocol::Ip4(addr) => !addr.is_global(),
+        Protocol::Ip6(addr) => !addr.is_global(),
+        Protocol::Memory(_) => true,
+        _ => false,
+    })
+}
+
\ No newline at end of file diff --git a/src/nox/behaviour/network.rs.html b/src/nox/behaviour/network.rs.html new file mode 100644 index 0000000000..3b7c9823ea --- /dev/null +++ b/src/nox/behaviour/network.rs.html @@ -0,0 +1,257 @@ +network.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+use libp2p::identify::Config as IdentifyConfig;
+use libp2p::{
+    connection_limits::Behaviour as ConnectionLimits,
+    identify::Behaviour as Identify,
+    ping::{Behaviour as Ping, Config as PingConfig},
+    swarm::NetworkBehaviour,
+    PeerId,
+};
+use tokio::sync::mpsc;
+
+use connection_pool::ConnectionPoolBehaviour;
+use health::HealthCheckRegistry;
+use kademlia::{Kademlia, KademliaConfig};
+use particle_protocol::{ExtendedParticle, PROTOCOL_NAME};
+use server_config::NetworkConfig;
+
+use crate::connectivity::Connectivity;
+use crate::health::{BootstrapNodesHealth, ConnectivityHealth, KademliaBootstrapHealth};
+
+/// Coordinates protocols, so they can cooperate
+#[derive(NetworkBehaviour)]
+pub struct FluenceNetworkBehaviour {
+    identify: Identify,
+    ping: Ping,
+    connection_limits: ConnectionLimits,
+    pub(crate) connection_pool: ConnectionPoolBehaviour,
+    pub(crate) kademlia: Kademlia,
+}
+
+struct KademliaConfigAdapter {
+    peer_id: PeerId,
+    config: server_config::KademliaConfig,
+}
+
+impl From<KademliaConfigAdapter> for KademliaConfig {
+    fn from(value: KademliaConfigAdapter) -> Self {
+        Self {
+            peer_id: value.peer_id,
+            max_packet_size: value.config.max_packet_size,
+            query_timeout: value.config.query_timeout,
+            replication_factor: value.config.replication_factor,
+            peer_fail_threshold: value.config.peer_fail_threshold,
+            ban_cooldown: value.config.ban_cooldown,
+            protocol_name: value.config.protocol_name,
+        }
+    }
+}
+
+impl FluenceNetworkBehaviour {
+    pub fn new(
+        cfg: NetworkConfig,
+        health_registry: Option<&mut HealthCheckRegistry>,
+    ) -> (Self, Connectivity, mpsc::Receiver<ExtendedParticle>) {
+        let local_public_key = cfg.key_pair.public();
+        let identify = Identify::new(
+            IdentifyConfig::new(PROTOCOL_NAME.into(), local_public_key)
+                .with_agent_version(cfg.node_version.into()),
+        );
+        let ping = Ping::new(PingConfig::new());
+
+        let kad_config = KademliaConfigAdapter {
+            peer_id: cfg.local_peer_id,
+            config: cfg.kademlia_config,
+        };
+
+        let (kademlia, kademlia_api) = Kademlia::new(kad_config.into(), cfg.libp2p_metrics);
+        let (connection_pool, particle_stream, connection_pool_api) = ConnectionPoolBehaviour::new(
+            cfg.particle_queue_buffer,
+            cfg.protocol_config,
+            cfg.local_peer_id,
+            cfg.connection_pool_metrics,
+        );
+
+        let connection_limits = ConnectionLimits::new(cfg.connection_limits);
+
+        let this = Self {
+            kademlia,
+            connection_pool,
+            connection_limits,
+            identify,
+            ping,
+        };
+
+        let bootstrap_nodes = cfg.bootstrap_nodes.clone();
+
+        let health = health_registry.map(|registry| {
+            let bootstrap_nodes = BootstrapNodesHealth::new(bootstrap_nodes);
+            let kademlia_bootstrap = KademliaBootstrapHealth::default();
+            registry.register("bootstrap_nodes", bootstrap_nodes.clone());
+            registry.register("kademlia_bootstrap", kademlia_bootstrap.clone());
+
+            ConnectivityHealth {
+                bootstrap_nodes,
+                kademlia_bootstrap,
+            }
+        });
+
+        let connectivity = Connectivity {
+            peer_id: cfg.local_peer_id,
+            kademlia: kademlia_api,
+            connection_pool: connection_pool_api,
+            bootstrap_nodes: cfg.bootstrap_nodes.into_iter().collect(),
+            bootstrap_frequency: cfg.bootstrap_frequency,
+            metrics: cfg.connectivity_metrics,
+            health,
+        };
+
+        (this, connectivity, particle_stream)
+    }
+}
+
\ No newline at end of file diff --git a/src/nox/builtins.rs.html b/src/nox/builtins.rs.html new file mode 100644 index 0000000000..7e101f4ada --- /dev/null +++ b/src/nox/builtins.rs.html @@ -0,0 +1,79 @@ +builtins.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use futures::FutureExt;
+use particle_builtins::{ok, CustomService, NodeInfo};
+use particle_execution::ServiceFunction;
+use serde_json::json;
+
+pub fn make_peer_builtin(node_info: NodeInfo) -> (String, CustomService) {
+    (
+        "peer".to_string(),
+        CustomService::new(
+            vec![("identify", make_peer_identify_closure(node_info))],
+            None,
+        ),
+    )
+}
+fn make_peer_identify_closure(node_info: NodeInfo) -> ServiceFunction {
+    ServiceFunction::Immut(Box::new(move |_args, _params| {
+        let node_info = node_info.clone();
+        async move { ok(json!(node_info)) }.boxed()
+    }))
+}
+
\ No newline at end of file diff --git a/src/nox/connectivity.rs.html b/src/nox/connectivity.rs.html new file mode 100644 index 0000000000..17100e0107 --- /dev/null +++ b/src/nox/connectivity.rs.html @@ -0,0 +1,629 @@ +connectivity.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use std::cmp::min;
+use std::collections::HashSet;
+use std::time::Duration;
+
+use crate::health::ConnectivityHealth;
+use connection_pool::{ConnectionPoolApi, ConnectionPoolT, LifecycleEvent};
+use fluence_libp2p::PeerId;
+use futures::{stream::iter, StreamExt};
+use humantime_serde::re::humantime::format_duration as pretty;
+use kademlia::{KademliaApi, KademliaApiT, KademliaError};
+use libp2p::Multiaddr;
+use particle_protocol::{Contact, ExtendedParticle, SendStatus};
+use peer_metrics::{ConnectivityMetrics, Resolution};
+use tokio::time::sleep;
+use tracing::{instrument, Instrument, Span};
+
+use crate::tasks::Tasks;
+
+#[derive(Clone)]
+/// This structure is just a composition of Kademlia and ConnectionPool.
+/// It exists solely for code conciseness (i.e. avoid tuples);
+/// there's no architectural motivation behind
+pub struct Connectivity {
+    pub peer_id: PeerId,
+    pub kademlia: KademliaApi,
+    pub connection_pool: ConnectionPoolApi,
+    pub bootstrap_nodes: HashSet<Multiaddr>,
+    /// Bootstrap will be executed after [1, N, 2*N, 3*N, ...] bootstrap nodes connected
+    /// This setting specify that N.
+    pub bootstrap_frequency: usize,
+    pub metrics: Option<ConnectivityMetrics>,
+    pub health: Option<ConnectivityHealth>,
+}
+
+impl Connectivity {
+    pub fn start(self) -> Tasks {
+        let reconnect_bootstraps = tokio::task::Builder::new()
+            .name("reconnect_bootstraps")
+            .spawn(self.clone().reconnect_bootstraps().in_current_span())
+            .expect("Could not spawn task");
+        let run_bootstrap = tokio::task::Builder::new()
+            .name("run_bootstrap")
+            .spawn(self.kademlia_bootstrap().in_current_span())
+            .expect("Could not spawn task");
+
+        Tasks::new("Connectivity", vec![run_bootstrap, reconnect_bootstraps])
+    }
+
+    #[instrument(level = tracing::Level::INFO, skip_all)]
+    pub async fn resolve_contact(&self, target: PeerId, particle_id: &str) -> Option<Contact> {
+        let metrics = self.metrics.as_ref();
+        let contact = self.connection_pool.get_contact(target).await;
+        if let Some(contact) = contact {
+            // contact is connected directly to current node
+            if let Some(m) = metrics {
+                m.count_resolution(Resolution::Local)
+            }
+            return Some(contact);
+        } else {
+            // contact isn't connected, have to discover it
+            let contact = self.discover_peer(target).await;
+            match contact {
+                Ok(Some(contact)) => {
+                    // connect to the discovered contact
+                    let connected = self.connection_pool.connect(contact.clone()).await;
+                    if connected {
+                        if let Some(m) = metrics {
+                            m.count_resolution(Resolution::Kademlia)
+                        }
+                        return Some(contact);
+                    }
+                    if let Some(m) = metrics {
+                        m.count_resolution(Resolution::ConnectionFailed)
+                    }
+                    tracing::warn!(
+                        particle_id = particle_id,
+                        "{} Couldn't connect to {}",
+                        self.peer_id,
+                        target
+                    );
+                }
+                Ok(None) => {
+                    if let Some(m) = metrics {
+                        m.count_resolution(Resolution::KademliaNotFound)
+                    }
+                    tracing::warn!(
+                        particle_id = particle_id,
+                        "{} Couldn't discover {}",
+                        self.peer_id,
+                        target
+                    );
+                }
+                Err(err) => {
+                    if let Some(m) = metrics {
+                        m.count_resolution(Resolution::KademliaError)
+                    }
+                    let id = particle_id;
+                    tracing::warn!(
+                        particle_id = id,
+                        "{} Failed to discover {}: {}",
+                        self.peer_id,
+                        target,
+                        err
+                    );
+                }
+            }
+        };
+
+        None
+    }
+
+    #[instrument(level = tracing::Level::INFO, skip_all)]
+    pub async fn send(&self, contact: Contact, particle: ExtendedParticle) -> bool {
+        tracing::debug!(
+            particle_id = particle.particle.id,
+            "Sending particle to {}",
+            contact
+        );
+        let metrics = self.metrics.as_ref();
+        let id = particle.particle.id.clone();
+        let sent = self.connection_pool.send(contact.clone(), particle).await;
+        match &sent {
+            SendStatus::Ok => {
+                if let Some(m) = metrics {
+                    m.send_particle_ok(&id)
+                }
+                tracing::info!(particle_id = id, "Sent particle to {}", contact);
+            }
+            err => {
+                if let Some(m) = metrics {
+                    m.send_particle_failed(&id);
+                }
+                tracing::warn!(
+                    particle_id = id,
+                    "Failed to send particle to {}, reason: {:?}",
+                    contact,
+                    err
+                )
+            }
+        }
+
+        matches!(sent, SendStatus::Ok)
+    }
+
+    /// Discover a peer via Kademlia
+    pub async fn discover_peer(&self, target: PeerId) -> Result<Option<Contact>, KademliaError> {
+        // discover contact addresses through Kademlia
+        let addresses = self.kademlia.discover_peer(target).await?;
+        if addresses.is_empty() {
+            return Ok(None);
+        }
+
+        Ok(Some(Contact::new(target, addresses)))
+    }
+
+    /// Run kademlia bootstrap after first bootstrap is connected, and then every `frequency`
+    pub async fn kademlia_bootstrap(self) {
+        let kademlia = self.kademlia;
+        let pool = self.connection_pool;
+        let bootstrap_nodes = self.bootstrap_nodes;
+        let frequency = self.bootstrap_frequency;
+        let health = self.health.as_ref();
+
+        if !bootstrap_nodes.is_empty() {
+            // Count connected (and reconnected) bootstrap nodes
+            let connections = {
+                use tokio_stream::StreamExt as stream;
+                let events = pool.lifecycle_events();
+                stream::filter_map(events, move |e| {
+                    log::trace!(target: "network", "Connection pool event: {:?}", e);
+                    if let LifecycleEvent::Connected(c) = e {
+                        let mut addresses = c.addresses.iter();
+                        addresses.find(|addr| bootstrap_nodes.contains(addr))?;
+                        return Some(c);
+                    }
+                    None
+                })
+            }
+            .enumerate();
+
+            connections
+                .for_each(move |(n, contact)| {
+                    let kademlia = kademlia.clone();
+                    async move {
+                        if n % frequency == 0 {
+                            kademlia.add_contact(contact);
+                            if let Err(err) = kademlia.bootstrap().await {
+                                log::warn!("Kademlia bootstrap failed: {}", err);
+                                if let Some(h) = health {
+                                    h.kademlia_bootstrap.on_boostrap_failed()
+                                }
+                            } else {
+                                log::info!("Kademlia bootstrap finished");
+                                if let Some(h) = health {
+                                    h.kademlia_bootstrap.on_boostrap_finished()
+                                }
+                            }
+                        }
+                    }
+                })
+                .await;
+        } else {
+            // there is no bootstrap nodes, that means bootstrap process is finished
+            if let Some(h) = health {
+                h.kademlia_bootstrap.on_boostrap_finished();
+            }
+        }
+    }
+
+    /// Dial bootstraps, and then re-dial on each disconnection
+    pub async fn reconnect_bootstraps(self) {
+        let pool = self.connection_pool;
+        let kademlia = self.kademlia;
+        let bootstrap_nodes = self.bootstrap_nodes;
+        let metrics = self.metrics.as_ref();
+        let health = self.health.as_ref();
+
+        let disconnections = {
+            use tokio_stream::StreamExt as stream;
+
+            let bootstrap_nodes = bootstrap_nodes.clone();
+            let events = pool.lifecycle_events();
+            stream::filter_map(events, move |e| {
+                if let LifecycleEvent::Disconnected(Contact { addresses, .. }) = e {
+                    let addresses = addresses.into_iter();
+                    let addresses = addresses.filter(|addr| bootstrap_nodes.contains(addr));
+                    let addresses = addresses.collect::<Vec<_>>();
+                    if !addresses.is_empty() {
+                        metrics.map(|m| m.bootstrap_disconnected.inc());
+                        if let Some(h) = health {
+                            h.bootstrap_nodes
+                                .on_bootstrap_disconnected(addresses.clone())
+                        }
+                    };
+                    return Some(iter(addresses));
+                }
+                None
+            })
+        }
+        .flatten();
+
+        // TODO: take from config
+        let max = Duration::from_secs(60);
+        // TODO: exponential backoff + random?
+        let delta = Duration::from_secs(5);
+
+        let reconnect = move |kademlia: KademliaApi,
+                              pool: ConnectionPoolApi,
+                              addr: Multiaddr,
+                              parent_span: Span| {
+            (async move {
+                let mut delay = Duration::from_secs(0);
+                loop {
+                    tracing::info!("Will reconnect bootstrap {}", addr);
+                    if let Some(contact) = pool.dial(addr.clone()).await {
+                        tracing::info!("Connected bootstrap {}", contact);
+                        let ok = kademlia.add_contact(contact);
+                        debug_assert!(ok, "kademlia.add_contact");
+                        metrics.map(|m| m.bootstrap_connected.inc());
+                        if let Some(h) = health {
+                            h.bootstrap_nodes.on_bootstrap_connected(addr)
+                        }
+                        break;
+                    }
+
+                    delay = min(delay + delta, max);
+                    log::warn!("can't connect bootstrap {} (pause {})", addr, pretty(delay));
+                    sleep(delay).await;
+                }
+            })
+            .instrument(parent_span)
+        };
+
+        let parent_span = tracing::Span::current();
+        let bootstraps = iter(bootstrap_nodes.clone().into_iter().collect::<Vec<_>>());
+        bootstraps
+            .chain(disconnections)
+            .for_each_concurrent(None, |addr| {
+                reconnect(kademlia.clone(), pool.clone(), addr, parent_span.clone())
+            })
+            .await;
+    }
+}
+
+impl AsRef<KademliaApi> for Connectivity {
+    fn as_ref(&self) -> &KademliaApi {
+        &self.kademlia
+    }
+}
+
+impl AsRef<ConnectionPoolApi> for Connectivity {
+    fn as_ref(&self) -> &ConnectionPoolApi {
+        &self.connection_pool
+    }
+}
+
\ No newline at end of file diff --git a/src/nox/dispatcher.rs.html b/src/nox/dispatcher.rs.html new file mode 100644 index 0000000000..7f972b2d51 --- /dev/null +++ b/src/nox/dispatcher.rs.html @@ -0,0 +1,321 @@ +dispatcher.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use futures::{FutureExt, StreamExt};
+use prometheus_client::registry::Registry;
+use tokio::sync::mpsc;
+use tokio_stream::wrappers::ReceiverStream;
+use tracing::{instrument, Instrument};
+
+use aquamarine::{AquamarineApi, AquamarineApiError, RemoteRoutingEffects};
+use fluence_libp2p::PeerId;
+use particle_protocol::{ExtendedParticle, Particle};
+use peer_metrics::DispatcherMetrics;
+
+use crate::effectors::Effectors;
+use crate::tasks::Tasks;
+
+type Effects = Result<RemoteRoutingEffects, AquamarineApiError>;
+
+#[derive(Clone)]
+pub struct Dispatcher {
+    #[allow(unused)]
+    peer_id: PeerId,
+    /// Number of concurrently processed particles
+    particle_parallelism: Option<usize>,
+    aquamarine: AquamarineApi,
+    effectors: Effectors,
+    metrics: Option<DispatcherMetrics>,
+}
+
+impl Dispatcher {
+    pub fn new(
+        peer_id: PeerId,
+        aquamarine: AquamarineApi,
+        effectors: Effectors,
+        particle_parallelism: Option<usize>,
+        registry: Option<&mut Registry>,
+    ) -> Self {
+        Self {
+            peer_id,
+            effectors,
+            aquamarine,
+            particle_parallelism,
+            metrics: registry.map(|r| DispatcherMetrics::new(r, particle_parallelism)),
+        }
+    }
+}
+
+impl Dispatcher {
+    pub fn start(
+        self,
+        particle_stream: mpsc::Receiver<ExtendedParticle>,
+        effects_stream: mpsc::Receiver<Effects>,
+    ) -> Tasks {
+        log::info!("starting dispatcher");
+        let particle_stream = ReceiverStream::new(particle_stream);
+        let effects_stream = ReceiverStream::new(effects_stream);
+        let particles = tokio::task::Builder::new()
+            .name("particles")
+            .spawn(
+                self.clone()
+                    .process_particles(particle_stream)
+                    .in_current_span(),
+            )
+            .expect("Could not spawn task");
+        let effects = tokio::task::Builder::new()
+            .name("effects")
+            .spawn(self.process_effects(effects_stream).in_current_span())
+            .expect("Could not spawn task");
+
+        Tasks::new("Dispatcher", vec![particles, effects])
+    }
+
+    pub async fn process_particles<Src>(self, particle_stream: Src)
+    where
+        Src: futures::Stream<Item = ExtendedParticle> + Unpin + Send + Sync + 'static,
+    {
+        let parallelism = self.particle_parallelism;
+        let aquamarine = self.aquamarine;
+        let metrics = self.metrics;
+        particle_stream
+            .for_each_concurrent(parallelism, move |ext_particle| {
+                let current_span = tracing::info_span!(parent: ext_particle.span.as_ref(), "Dispatcher::process_particles::for_each");
+                let _ = current_span.enter();
+                let async_span = tracing::info_span!("Dispatcher::process_particles::async");
+                let aquamarine = aquamarine.clone();
+                let metrics = metrics.clone();
+                let particle: &Particle = ext_particle.as_ref();
+
+                if particle.is_expired() {
+                    let particle_id = &particle.id.as_str();
+                    if let Some(m) = metrics {
+                        m.particle_expired(particle_id);
+                    }
+                    tracing::info!(target: "expired", particle_id = particle_id, "Particle is expired");
+                    return async {}.boxed();
+                }
+
+                async move {
+                    aquamarine
+                        .execute(ext_particle, None)
+                        // do not log errors: Aquamarine will log them fine
+                        .map(|_| ())
+                        .await
+                }
+                    .instrument(async_span)
+                .boxed()
+            })
+            .await;
+
+        log::error!("Particle stream has ended");
+    }
+
+    #[instrument(level = tracing::Level::INFO, skip_all)]
+    async fn process_effects<Src>(self, effects_stream: Src)
+    where
+        Src: futures::Stream<Item = Effects> + Unpin + Send + Sync + 'static,
+    {
+        let parallelism = self.particle_parallelism;
+        let effectors = self.effectors;
+        effects_stream
+            .for_each_concurrent(parallelism, move |effects| {
+                let effectors = effectors.clone();
+
+                async move {
+                    match effects {
+                        Ok(effects) => {
+                            let async_span = tracing::info_span!(parent: effects.particle.span.as_ref(), "Dispatcher::effectors::execute");
+                            // perform effects as instructed by aquamarine
+                            effectors.execute(effects).instrument(async_span).await;
+                        }
+                        Err(err) => {
+                            // particles are sent in fire and forget fashion, so
+                            // there's nothing to do here but log
+                            log::warn!("Error executing particle: {}", err);
+                        }
+                    };
+                }
+            })
+            .await;
+
+        log::error!("Effects stream has ended");
+    }
+}
+
\ No newline at end of file diff --git a/src/nox/effectors.rs.html b/src/nox/effectors.rs.html new file mode 100644 index 0000000000..da7b5ee5b1 --- /dev/null +++ b/src/nox/effectors.rs.html @@ -0,0 +1,141 @@ +effectors.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use futures::{stream::iter, StreamExt};
+use tracing::instrument;
+
+use aquamarine::RemoteRoutingEffects;
+use particle_protocol::Particle;
+
+use crate::connectivity::Connectivity;
+
+#[derive(Clone)]
+pub struct Effectors {
+    pub connectivity: Connectivity,
+}
+
+impl Effectors {
+    pub fn new(connectivity: Connectivity) -> Self {
+        Self { connectivity }
+    }
+
+    /// Perform effects that Aquamarine instructed us to
+    #[instrument(level = tracing::Level::INFO, skip_all)]
+    pub async fn execute(self, effects: RemoteRoutingEffects) {
+        let particle: &Particle = effects.particle.as_ref();
+        if particle.is_expired() {
+            tracing::info!(target: "expired", particle_id = particle.id, "Particle is expired");
+            return;
+        }
+
+        // take every next peers, and try to send particle there concurrently
+        let nps = iter(effects.next_peers);
+        let particle = &effects.particle;
+        let connectivity = self.connectivity.clone();
+        nps.for_each_concurrent(None, move |target| {
+            let connectivity = connectivity.clone();
+            let particle = particle.clone();
+            async move {
+                // resolve contact
+                if let Some(contact) = connectivity
+                    .resolve_contact(target, particle.as_ref())
+                    .await
+                {
+                    // forward particle
+                    let sent = connectivity.send(contact, particle).await;
+                    if sent {
+                        // resolved and sent, exit
+                    }
+                }
+            }
+        })
+        .await;
+    }
+}
+
\ No newline at end of file diff --git a/src/nox/health.rs.html b/src/nox/health.rs.html new file mode 100644 index 0000000000..d4b5ec7a1e --- /dev/null +++ b/src/nox/health.rs.html @@ -0,0 +1,431 @@ +health.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use health::HealthCheck;
+use libp2p::Multiaddr;
+use parking_lot::RwLock;
+use std::collections::HashMap;
+use std::sync::atomic::{AtomicBool, Ordering};
+use std::sync::Arc;
+
+#[derive(Clone)]
+pub struct ConnectivityHealth {
+    pub bootstrap_nodes: BootstrapNodesHealth,
+    pub kademlia_bootstrap: KademliaBootstrapHealth,
+}
+
+#[derive(Clone)]
+pub struct BootstrapNodesHealth {
+    bootstrap_nodes_statuses: Arc<RwLock<HashMap<Multiaddr, bool>>>,
+}
+
+impl BootstrapNodesHealth {
+    pub fn new(bootstrap_nodes: Vec<Multiaddr>) -> Self {
+        let bootstrap_nodes_statuses = bootstrap_nodes
+            .into_iter()
+            .map(|addr| (addr, false))
+            .collect::<HashMap<_, _>>();
+        Self {
+            bootstrap_nodes_statuses: Arc::new(RwLock::new(bootstrap_nodes_statuses)),
+        }
+    }
+
+    pub fn on_bootstrap_disconnected(&self, addresses: Vec<Multiaddr>) {
+        let mut guard = self.bootstrap_nodes_statuses.write();
+        for addr in addresses {
+            guard.insert(addr, false);
+        }
+    }
+
+    pub fn on_bootstrap_connected(&self, addr: Multiaddr) {
+        let mut guard = self.bootstrap_nodes_statuses.write();
+        guard.insert(addr, true);
+    }
+}
+
+impl HealthCheck for BootstrapNodesHealth {
+    fn status(&self) -> eyre::Result<()> {
+        let guard = self.bootstrap_nodes_statuses.read();
+        for (addr, connected) in guard.iter() {
+            if !connected {
+                return Err(eyre::eyre!("Bootstrap {} is not connected", addr));
+            }
+        }
+        Ok(())
+    }
+}
+
+#[derive(Clone)]
+pub struct KademliaBootstrapHealth {
+    status: Arc<AtomicBool>,
+}
+
+impl KademliaBootstrapHealth {
+    pub fn on_boostrap_finished(&self) {
+        self.status.store(true, Ordering::Release)
+    }
+
+    pub fn on_boostrap_failed(&self) {
+        self.status.store(false, Ordering::Release)
+    }
+}
+
+impl Default for KademliaBootstrapHealth {
+    fn default() -> Self {
+        Self {
+            status: Arc::new(AtomicBool::default()),
+        }
+    }
+}
+
+impl HealthCheck for KademliaBootstrapHealth {
+    fn status(&self) -> eyre::Result<()> {
+        let status = self.status.load(Ordering::Acquire);
+        if status {
+            Ok(())
+        } else {
+            Err(eyre::eyre!("Kademlia bootstrap not finished"))
+        }
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+    use std::thread;
+
+    #[test]
+    fn test_bootstrap_nodes_health_all_connected() {
+        let bootstrap_nodes = vec![
+            "/ip4/127.0.0.1/tcp/5000".parse().unwrap(),
+            "/ip4/127.0.0.1/tcp/5001".parse().unwrap(),
+        ];
+        let bootstrap_health = BootstrapNodesHealth::new(bootstrap_nodes.clone());
+
+        // Simulate connections to the bootstrap nodes
+        bootstrap_health.on_bootstrap_connected(bootstrap_nodes[0].clone());
+        bootstrap_health.on_bootstrap_connected(bootstrap_nodes[1].clone());
+
+        let status = bootstrap_health.status();
+        assert!(status.is_ok());
+    }
+
+    #[test]
+    fn test_bootstrap_nodes_health_partial_connected() {
+        let bootstrap_nodes = vec![
+            "/ip4/127.0.0.1/tcp/5000".parse().unwrap(),
+            "/ip4/127.0.0.1/tcp/5001".parse().unwrap(),
+        ];
+        let bootstrap_health = BootstrapNodesHealth::new(bootstrap_nodes.clone());
+
+        // Simulate connections to only one of the bootstrap nodes
+        bootstrap_health.on_bootstrap_connected(bootstrap_nodes[0].clone());
+
+        let status = bootstrap_health.status();
+        assert!(status.is_err());
+    }
+
+    #[test]
+    fn test_bootstrap_nodes_health_concurrent_access() {
+        let bootstrap_nodes = vec![
+            "/ip4/127.0.0.1/tcp/5000".parse().unwrap(),
+            "/ip4/127.0.0.1/tcp/5001".parse().unwrap(),
+        ];
+        let bootstrap_health = Arc::new(BootstrapNodesHealth::new(bootstrap_nodes.clone()));
+        let health_clone = bootstrap_health.clone();
+
+        let bootstrap_node = bootstrap_nodes[0].clone();
+        // Simulate concurrent access by spawning multiple threads.
+        let thread_handle = thread::spawn(move || {
+            let health = health_clone;
+            // Simulate connections to the bootstrap nodes in separate threads.
+            health.on_bootstrap_connected(bootstrap_node);
+        });
+
+        // Simulate connections to the bootstrap nodes in the main thread.
+        bootstrap_health.on_bootstrap_connected(bootstrap_nodes[1].clone());
+
+        // Wait for the spawned thread to finish.
+        thread_handle.join().unwrap();
+
+        let status = bootstrap_health.status();
+        assert!(status.is_ok());
+    }
+
+    #[test]
+    fn new_health_instance_should_have_default_status_false() {
+        let health = KademliaBootstrapHealth::default();
+        assert!(!health.status.load(Ordering::Acquire));
+    }
+
+    #[test]
+    fn on_bootstrap_finished_should_set_status_to_true() {
+        let health = KademliaBootstrapHealth::default();
+        health.on_boostrap_finished();
+        assert!(health.status.load(Ordering::Acquire));
+    }
+
+    #[test]
+    fn on_bootstrap_failed_should_set_status_to_false() {
+        let health = KademliaBootstrapHealth::default();
+        health.on_boostrap_failed();
+        assert!(!health.status.load(Ordering::Acquire));
+    }
+
+    #[test]
+    fn status_should_return_ok_if_bootstrap_finished() {
+        let health = KademliaBootstrapHealth::default();
+        health.on_boostrap_finished();
+        assert!(health.status().is_ok());
+    }
+
+    #[test]
+    fn status_should_return_error_if_bootstrap_failed() {
+        let health = KademliaBootstrapHealth::default();
+        health.on_boostrap_failed();
+        assert!(health.status().is_err());
+    }
+
+    #[test]
+    fn status_error_should_contain_expected_message() {
+        let health = KademliaBootstrapHealth::default();
+        health.on_boostrap_failed();
+        let result = health.status();
+        assert_eq!(
+            result.err().unwrap().to_string(),
+            "Kademlia bootstrap not finished"
+        );
+    }
+}
+
\ No newline at end of file diff --git a/src/nox/http.rs.html b/src/nox/http.rs.html new file mode 100644 index 0000000000..e60e7bf436 --- /dev/null +++ b/src/nox/http.rs.html @@ -0,0 +1,1159 @@ +http.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use crate::Versions;
+use axum::body::Body;
+use axum::http::header::CONTENT_TYPE;
+use axum::response::ErrorResponse;
+use axum::{
+    extract::State,
+    http::StatusCode,
+    response::{IntoResponse, Response},
+    routing::get,
+    Json, Router,
+};
+use health::{HealthCheckRegistry, HealthStatus};
+use libp2p::PeerId;
+use prometheus_client::encoding::text::encode;
+use prometheus_client::registry::Registry;
+use serde_json::{json, Value};
+use server_config::ResolvedConfig;
+use std::net::SocketAddr;
+use std::sync::Arc;
+use tokio::sync::oneshot;
+
+async fn handler_404() -> impl IntoResponse {
+    (StatusCode::NOT_FOUND, "No such endpoint")
+}
+
+async fn handle_metrics(State(state): State<RouteState>) -> axum::response::Result<Response<Body>> {
+    let mut buf = String::new();
+    let registry = state
+        .0
+        .metric_registry
+        .as_ref()
+        .ok_or((StatusCode::NOT_FOUND, "No such endpoint"))?;
+    encode(&mut buf, registry).map_err(|e| {
+        tracing::warn!("Metrics encode error: {}", e);
+        ErrorResponse::from(StatusCode::INTERNAL_SERVER_ERROR)
+    })?;
+
+    let body = Body::from(buf);
+    Response::builder()
+        .header(
+            CONTENT_TYPE,
+            "application/openmetrics-text; version=1.0.0; charset=utf-8",
+        )
+        .body(body)
+        .map_err(|e| {
+            tracing::warn!("Could not create metric response: {}", e);
+            ErrorResponse::from(StatusCode::INTERNAL_SERVER_ERROR)
+        })
+}
+
+async fn handle_peer_id(State(state): State<RouteState>) -> Response {
+    let peer_id = state.0.peer_id;
+    Json(json!({
+        "peer_id": peer_id.to_string(),
+    }))
+    .into_response()
+}
+
+async fn handle_versions(State(state): State<RouteState>) -> Response {
+    let versions = &state.0.versions;
+    Json(json!({
+        "node": versions.node_version,
+        "avm": versions.avm_version,
+        "spell": versions.spell_version,
+        "aqua_ipfs": versions.system_service.aqua_ipfs_version,
+        "trust_graph": versions.system_service.trust_graph_version,
+        "registry": versions.system_service.registry_version,
+        "decider": versions.system_service.decider_version,
+    }))
+    .into_response()
+}
+
+/// Health check endpoint follows consul contract https://developer.hashicorp.com/consul/docs/services/usage/checks#http-checks
+async fn handle_health(State(state): State<RouteState>) -> axum::response::Result<Response> {
+    fn make_json(keys: Vec<&'static str>, status: &str) -> Vec<Value> {
+        keys.into_iter().map(|k| json!({k: status})).collect()
+    }
+
+    let registry = state
+        .0
+        .health_registry
+        .as_ref()
+        .ok_or((StatusCode::NOT_FOUND, "No such endpoint"))?;
+    let result = match registry.status() {
+        HealthStatus::Ok(keys) => (StatusCode::OK, Json(make_json(keys, "Ok"))).into_response(),
+        HealthStatus::Warning(ok, fail) => {
+            let mut result = make_json(ok, "Ok");
+            let mut fail = make_json(fail, "Fail");
+            result.append(&mut fail);
+            (StatusCode::TOO_MANY_REQUESTS, Json(result)).into_response()
+        }
+        HealthStatus::Fail(keys) => (
+            StatusCode::SERVICE_UNAVAILABLE,
+            Json(make_json(keys, "Fail")),
+        )
+            .into_response(),
+    };
+    Ok(result)
+}
+
+async fn handle_config(State(state): State<RouteState>) -> axum::response::Result<Response> {
+    let toml = toml::to_string_pretty(&state.0.nox_config);
+    match toml {
+        Ok(toml) => Ok((StatusCode::OK, toml).into_response()),
+        Err(error) => {
+            tracing::warn!(error = error.to_string(), "Could not serialize config");
+            Err(StatusCode::INTERNAL_SERVER_ERROR.into())
+        }
+    }
+}
+
+#[derive(Clone)]
+struct RouteState(Arc<Inner>);
+
+struct Inner {
+    peer_id: PeerId,
+    versions: Versions,
+    metric_registry: Option<Registry>,
+    health_registry: Option<HealthCheckRegistry>,
+    nox_config: Option<ResolvedConfig>,
+}
+#[derive(Debug)]
+pub struct StartedHttp {
+    pub listen_addr: SocketAddr,
+}
+
+#[derive(Default)]
+pub struct HttpEndpointData {
+    metrics_registry: Option<Registry>,
+    health_registry: Option<HealthCheckRegistry>,
+    nox_config: Option<ResolvedConfig>,
+}
+
+impl HttpEndpointData {
+    pub fn new(
+        metrics_registry: Option<Registry>,
+        health_registry: Option<HealthCheckRegistry>,
+        nox_config: Option<ResolvedConfig>,
+    ) -> Self {
+        Self {
+            metrics_registry,
+            health_registry,
+            nox_config,
+        }
+    }
+}
+
+pub async fn start_http_endpoint(
+    listen_addr: SocketAddr,
+    peer_id: PeerId,
+    versions: Versions,
+    http_endpoint_data: HttpEndpointData,
+    notify: oneshot::Sender<StartedHttp>,
+) -> eyre::Result<()> {
+    let state = RouteState(Arc::new(Inner {
+        peer_id,
+        versions,
+        metric_registry: http_endpoint_data.metrics_registry,
+        health_registry: http_endpoint_data.health_registry,
+        nox_config: http_endpoint_data.nox_config,
+    }));
+    let app: Router = Router::new()
+        .route("/metrics", get(handle_metrics))
+        .route("/peer_id", get(handle_peer_id))
+        .route("/versions", get(handle_versions))
+        .route("/health", get(handle_health))
+        .route("/config", get(handle_config))
+        .fallback(handler_404)
+        .with_state(state);
+
+    let listener = tokio::net::TcpListener::bind(listen_addr).await?;
+    let local_addr = listener.local_addr()?;
+    let server = axum::serve(listener, app.into_make_service());
+    notify
+        .send(StartedHttp {
+            listen_addr: local_addr,
+        })
+        .expect("Could not send http info");
+    server.await?;
+    Ok(())
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+    use eyre::Context;
+    use health::HealthCheck;
+    use reqwest::StatusCode;
+    use server_config::UnresolvedConfig;
+    use std::net::SocketAddr;
+    use std::path::Path;
+
+    fn test_versions() -> Versions {
+        Versions {
+            node_version: "node_test_version".to_string(),
+            avm_version: "avm_test_version".to_string(),
+            spell_version: "spell_test_version".to_string(),
+            system_service: system_services::Versions {
+                aqua_ipfs_version: "aqua_ipfs_test_version",
+                trust_graph_version: "trust_graph_test_version",
+                registry_version: "registry_test_version",
+                decider_version: "decider_test_version",
+            },
+        }
+    }
+
+    #[tokio::test]
+    async fn test_version_route() {
+        // Create a test server
+        let addr = "127.0.0.1:0".parse::<SocketAddr>().unwrap();
+
+        let (notify_sender, notify_receiver) = oneshot::channel();
+        tokio::spawn(async move {
+            start_http_endpoint(
+                addr,
+                PeerId::random(),
+                test_versions(),
+                HttpEndpointData::default(),
+                notify_sender,
+            )
+            .await
+            .unwrap();
+        });
+
+        let http_info = notify_receiver.await.unwrap();
+
+        let client = reqwest::Client::new();
+
+        let response = client
+            .get(format!("http://{}/versions", http_info.listen_addr))
+            .send()
+            .await
+            .unwrap();
+        let status = response.status();
+        let body = response.bytes().await.unwrap();
+        assert_eq!(status, StatusCode::OK);
+        assert_eq!(&body[..], br#"{"node":"node_test_version","avm":"avm_test_version","spell":"spell_test_version","aqua_ipfs":"aqua_ipfs_test_version","trust_graph":"trust_graph_test_version","registry":"registry_test_version","decider":"decider_test_version"}"#);
+    }
+
+    #[tokio::test]
+    async fn test_peer_id_route() {
+        // Create a test server
+        let addr = "127.0.0.1:0".parse::<SocketAddr>().unwrap();
+        let peer_id = PeerId::random();
+
+        let (notify_sender, notify_receiver) = oneshot::channel();
+        tokio::spawn(async move {
+            start_http_endpoint(
+                addr,
+                peer_id,
+                test_versions(),
+                HttpEndpointData::default(),
+                notify_sender,
+            )
+            .await
+            .unwrap();
+        });
+
+        let http_info = notify_receiver.await.unwrap();
+
+        let client = reqwest::Client::new();
+
+        let response = client
+            .get(format!("http://{}/peer_id", http_info.listen_addr))
+            .send()
+            .await
+            .unwrap();
+        let status = response.status();
+        let body = response.bytes().await.unwrap();
+        assert_eq!(status, StatusCode::OK);
+        assert_eq!(
+            &body[..],
+            format!(r#"{{"peer_id":"{}"}}"#, peer_id).as_bytes()
+        );
+    }
+
+    #[tokio::test]
+    async fn test_health_route_empty_registry() {
+        // Create a test server
+        let addr = "127.0.0.1:0".parse::<SocketAddr>().unwrap();
+        let peer_id = PeerId::random();
+
+        let (notify_sender, notify_receiver) = oneshot::channel();
+        let health_registry = HealthCheckRegistry::new();
+        let endpoint_config = HttpEndpointData {
+            metrics_registry: None,
+            health_registry: Some(health_registry),
+            nox_config: None,
+        };
+
+        tokio::spawn(async move {
+            start_http_endpoint(
+                addr,
+                peer_id,
+                test_versions(),
+                endpoint_config,
+                notify_sender,
+            )
+            .await
+            .unwrap();
+        });
+
+        let http_info = notify_receiver.await.unwrap();
+
+        let client = reqwest::Client::new();
+
+        let response = client
+            .get(format!("http://{}/health", http_info.listen_addr))
+            .send()
+            .await
+            .unwrap();
+        let status = response.status();
+        let body = response.bytes().await.unwrap();
+        assert_eq!(status, StatusCode::OK);
+        assert_eq!(&body[..], (r#"[]"#).as_bytes());
+    }
+
+    #[tokio::test]
+    async fn test_health_route_success_checks() {
+        // Create a test server
+        let addr = "127.0.0.1:0".parse::<SocketAddr>().unwrap();
+        let peer_id = PeerId::random();
+
+        let (notify_sender, notify_receiver) = oneshot::channel();
+        let mut health_registry = HealthCheckRegistry::new();
+        struct SuccessHealthCheck {}
+        impl HealthCheck for SuccessHealthCheck {
+            fn status(&self) -> eyre::Result<()> {
+                Ok(())
+            }
+        }
+        let success_check = SuccessHealthCheck {};
+        health_registry.register("test_check", success_check);
+
+        let endpoint_config = HttpEndpointData {
+            metrics_registry: None,
+            health_registry: Some(health_registry),
+            nox_config: None,
+        };
+        tokio::spawn(async move {
+            start_http_endpoint(
+                addr,
+                peer_id,
+                test_versions(),
+                endpoint_config,
+                notify_sender,
+            )
+            .await
+            .unwrap();
+        });
+
+        let http_info = notify_receiver.await.unwrap();
+
+        let client = reqwest::Client::new();
+
+        let response = client
+            .get(format!("http://{}/health", http_info.listen_addr))
+            .send()
+            .await
+            .unwrap();
+        let status = response.status();
+        let body = response.bytes().await.unwrap();
+        assert_eq!(status, StatusCode::OK);
+        assert_eq!(&body[..], (r#"[{"test_check":"Ok"}]"#).as_bytes());
+    }
+
+    #[tokio::test]
+    async fn test_health_route_warn_checks() {
+        // Create a test server
+        let addr = "127.0.0.1:0".parse::<SocketAddr>().unwrap();
+        let peer_id = PeerId::random();
+
+        let (notify_sender, notify_receiver) = oneshot::channel();
+        let mut health_registry = HealthCheckRegistry::new();
+        struct SuccessHealthCheck {}
+        impl HealthCheck for SuccessHealthCheck {
+            fn status(&self) -> eyre::Result<()> {
+                Ok(())
+            }
+        }
+        let success_check = SuccessHealthCheck {};
+        struct FailHealthCheck {}
+        impl HealthCheck for FailHealthCheck {
+            fn status(&self) -> eyre::Result<()> {
+                Err(eyre::eyre!("Failed"))
+            }
+        }
+        let fail_check = FailHealthCheck {};
+        health_registry.register("test_check", success_check);
+        health_registry.register("test_check_2", fail_check);
+        let endpoint_config = HttpEndpointData {
+            metrics_registry: None,
+            health_registry: Some(health_registry),
+            nox_config: None,
+        };
+        tokio::spawn(async move {
+            start_http_endpoint(
+                addr,
+                peer_id,
+                test_versions(),
+                endpoint_config,
+                notify_sender,
+            )
+            .await
+            .unwrap();
+        });
+
+        let http_info = notify_receiver.await.unwrap();
+
+        let client = reqwest::Client::new();
+
+        let response = client
+            .get(format!("http://{}/health", http_info.listen_addr))
+            .send()
+            .await
+            .unwrap();
+        let status = response.status();
+        let body = response.bytes().await.unwrap();
+        assert_eq!(status, StatusCode::TOO_MANY_REQUESTS);
+        assert_eq!(
+            &body[..],
+            (r#"[{"test_check":"Ok"},{"test_check_2":"Fail"}]"#).as_bytes()
+        );
+    }
+
+    #[tokio::test]
+    async fn test_health_route_fail_checks() {
+        // Create a test server
+        let addr = "127.0.0.1:0".parse::<SocketAddr>().unwrap();
+        let peer_id = PeerId::random();
+
+        let (notify_sender, notify_receiver) = oneshot::channel();
+        let mut health_registry = HealthCheckRegistry::new();
+        struct FailHealthCheck {}
+        impl HealthCheck for FailHealthCheck {
+            fn status(&self) -> eyre::Result<()> {
+                Err(eyre::eyre!("Failed"))
+            }
+        }
+        let fail_check = FailHealthCheck {};
+        health_registry.register("test_check", fail_check);
+        let endpoint_config = HttpEndpointData {
+            metrics_registry: None,
+            health_registry: Some(health_registry),
+            nox_config: None,
+        };
+
+        tokio::spawn(async move {
+            start_http_endpoint(
+                addr,
+                peer_id,
+                test_versions(),
+                endpoint_config,
+                notify_sender,
+            )
+            .await
+            .unwrap();
+        });
+
+        let http_info = notify_receiver.await.unwrap();
+
+        let client = reqwest::Client::new();
+
+        let response = client
+            .get(format!("http://{}/health", http_info.listen_addr))
+            .send()
+            .await
+            .unwrap();
+        let status = response.status();
+        let body = response.bytes().await.unwrap();
+        assert_eq!(status, StatusCode::SERVICE_UNAVAILABLE);
+        assert_eq!(&body[..], (r#"[{"test_check":"Fail"}]"#).as_bytes());
+    }
+
+    #[tokio::test]
+    async fn test_config_endpoint() {
+        let tmp_dir = tempfile::tempdir().expect("Could not create temp dir");
+        let tmp_path = tmp_dir.path();
+        let resolved_config = get_config(tmp_path).await;
+
+        // Create a test server
+        let addr = "127.0.0.1:0".parse::<SocketAddr>().unwrap();
+        let peer_id = PeerId::random();
+
+        let (notify_sender, notify_receiver) = oneshot::channel();
+
+        let endpoint_config = HttpEndpointData {
+            metrics_registry: None,
+            health_registry: None,
+            nox_config: Some(resolved_config),
+        };
+
+        tokio::spawn(async move {
+            start_http_endpoint(
+                addr,
+                peer_id,
+                test_versions(),
+                endpoint_config,
+                notify_sender,
+            )
+            .await
+            .unwrap();
+        });
+
+        let http_info = notify_receiver.await.unwrap();
+
+        let client = reqwest::Client::new();
+
+        let response = client
+            .get(format!("http://{}/config", http_info.listen_addr))
+            .send()
+            .await
+            .unwrap();
+
+        let status = response.status();
+        let body = response.bytes().await.unwrap();
+        let expected_config = tokio::fs::read("./tests/http_expected_config.toml")
+            .await
+            .wrap_err("read test data")
+            .unwrap();
+
+        let expected_config = String::from_utf8(expected_config)
+            .wrap_err("decode test data")
+            .unwrap();
+
+        let base_dir = tmp_path.canonicalize().unwrap().display().to_string();
+
+        let expected_config = expected_config.replace("{base_dir}", &base_dir);
+
+        let result = std::str::from_utf8(&body[..])
+            .wrap_err("decode response data")
+            .unwrap();
+
+        assert_eq!(status, StatusCode::OK);
+        assert_eq!(result, expected_config);
+    }
+
+    async fn get_config(path: &Path) -> ResolvedConfig {
+        let unresolved_config = tokio::fs::read("./tests/http_test_config.toml")
+            .await
+            .wrap_err("read test data")
+            .unwrap();
+
+        let unresolved_config = String::from_utf8(unresolved_config)
+            .wrap_err("decode test data")
+            .unwrap();
+
+        let unresolved_config =
+            unresolved_config.replace("{base_dir}", &path.display().to_string());
+
+        let unresolved_config: UnresolvedConfig = toml::de::from_str(unresolved_config.as_str())
+            .wrap_err("parse config")
+            .unwrap();
+
+        unresolved_config
+            .resolve()
+            .wrap_err("resolve config")
+            .unwrap()
+    }
+}
+
\ No newline at end of file diff --git a/src/nox/layers.rs.html b/src/nox/layers.rs.html new file mode 100644 index 0000000000..ee4185403b --- /dev/null +++ b/src/nox/layers.rs.html @@ -0,0 +1,351 @@ +layers.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use std::str::FromStr;
+
+use libp2p::PeerId;
+use log_format::Format;
+use opentelemetry::trace::TracerProvider;
+use opentelemetry::{global, KeyValue};
+use opentelemetry_otlp::WithExportConfig;
+use opentelemetry_sdk::propagation::TraceContextPropagator;
+use opentelemetry_sdk::trace::Sampler;
+use opentelemetry_sdk::Resource;
+use server_config::TracingConfig;
+use tracing::level_filters::LevelFilter;
+use tracing::Subscriber;
+use tracing_appender::non_blocking::WorkerGuard;
+use tracing_subscriber::registry::LookupSpan;
+use tracing_subscriber::Layer;
+
+pub fn env_filter<S>() -> impl Layer<S>
+where
+    S: Subscriber + for<'span> LookupSpan<'span>,
+{
+    let rust_log = std::env::var("RUST_LOG")
+        .unwrap_or_default()
+        .replace(char::is_whitespace, "");
+
+    tracing_subscriber::EnvFilter::builder()
+        .with_default_directive(LevelFilter::INFO.into())
+        .parse_lossy(rust_log)
+        .add_directive("cranelift_codegen=off".parse().unwrap())
+        .add_directive("walrus=off".parse().unwrap())
+        .add_directive("polling=off".parse().unwrap())
+        .add_directive("wasmer_wasi_fl=error".parse().unwrap())
+        .add_directive("wasmer_interface_types_fl=error".parse().unwrap())
+        .add_directive("wasmer_wasi=error".parse().unwrap())
+        .add_directive("tokio_threadpool=error".parse().unwrap())
+        .add_directive("tokio_reactor=error".parse().unwrap())
+        .add_directive("mio=error".parse().unwrap())
+        .add_directive("tokio_io=error".parse().unwrap())
+        .add_directive("soketto=error".parse().unwrap())
+        .add_directive("cranelift_codegen=error".parse().unwrap())
+        .add_directive("tracing=error".parse().unwrap())
+        .add_directive("avm_server::runner=error".parse().unwrap())
+}
+
+pub fn log_layer<S>() -> (impl Layer<S>, WorkerGuard)
+where
+    S: Subscriber + for<'span> LookupSpan<'span>,
+{
+    let log_format = std::env::var("FLUENCE_LOG_FORMAT").unwrap_or_default();
+    let log_format = LogFormat::from_str(log_format.as_str()).unwrap_or(LogFormat::Default);
+
+    let log_display_span_list = std::env::var("FLUENCE_LOG_DISPLAY_SPAN_LIST").unwrap_or_default();
+    let log_display_span_list = log_display_span_list.trim().parse().unwrap_or_default();
+
+    let (non_blocking, guard) = tracing_appender::non_blocking(std::io::stdout());
+
+    let layer = match log_format {
+        LogFormat::Logfmt => tracing_logfmt::builder()
+            .with_target(true)
+            .with_span_path(false)
+            .with_span_name(false)
+            .layer()
+            .with_writer(non_blocking)
+            .boxed(),
+        LogFormat::Default => {
+            let format = Format::default().with_display_span_list(log_display_span_list);
+            tracing_subscriber::fmt::layer()
+                .event_format(format)
+                .with_writer(non_blocking)
+                .boxed()
+        }
+    };
+    (layer, guard)
+}
+
+#[derive(Clone, Debug, PartialEq)]
+pub enum LogFormat {
+    Logfmt,
+    Default,
+}
+
+impl FromStr for LogFormat {
+    type Err = String;
+
+    fn from_str(s: &str) -> Result<Self, Self::Err> {
+        match s.trim().to_ascii_lowercase().as_str() {
+            "logfmt" => Ok(LogFormat::Logfmt),
+            "default" => Ok(LogFormat::Default),
+            _ => Err("Unsupported log format".to_string()),
+        }
+    }
+}
+
+pub fn tracing_layer<S>(
+    tracing_config: &TracingConfig,
+    peer_id: PeerId,
+    version: &str,
+) -> eyre::Result<Option<impl Layer<S>>>
+where
+    S: Subscriber + for<'span> LookupSpan<'span>,
+{
+    let tracing_layer = match tracing_config {
+        TracingConfig::Disabled => None,
+        TracingConfig::Stdout => {
+            global::set_text_map_propagator(TraceContextPropagator::new());
+            let exporter = opentelemetry_stdout::SpanExporter::default();
+            let provider = opentelemetry_sdk::trace::TracerProvider::builder()
+                .with_simple_exporter(exporter)
+                .build();
+
+            let tracer = provider.tracer("rust-peer");
+
+            let tracing_layer = tracing_opentelemetry::layer::<S>().with_tracer(tracer);
+            Some(tracing_layer)
+        }
+        TracingConfig::Otlp {
+            endpoint,
+            sample_ratio,
+        } => {
+            let resource = Resource::new(vec![
+                KeyValue::new("service.name", "rust-peer"),
+                KeyValue::new("service.version", version.to_string()),
+                KeyValue::new("peer_id", peer_id.to_base58()),
+            ]);
+
+            let mut config = opentelemetry_sdk::trace::config().with_resource(resource);
+
+            if let Some(ratio) = sample_ratio {
+                config = config.with_sampler(Sampler::ParentBased(Box::new(
+                    Sampler::TraceIdRatioBased(*ratio),
+                )));
+            }
+
+            let tracer = opentelemetry_otlp::new_pipeline()
+                .tracing()
+                .with_exporter(
+                    opentelemetry_otlp::new_exporter()
+                        .tonic()
+                        .with_endpoint(endpoint.as_str()),
+                )
+                .with_trace_config(config)
+                .install_batch(opentelemetry_sdk::runtime::Tokio)?;
+
+            let tracing_layer = tracing_opentelemetry::layer::<S>().with_tracer(tracer);
+
+            global::set_text_map_propagator(TraceContextPropagator::new());
+            global::set_error_handler(move |err| {
+                tracing::warn!("OpenTelemetry trace error occurred. {}", err)
+            })?;
+
+            Some(tracing_layer)
+        }
+    };
+
+    Ok(tracing_layer)
+}
+
\ No newline at end of file diff --git a/src/nox/lib.rs.html b/src/nox/lib.rs.html new file mode 100644 index 0000000000..f99edca7a8 --- /dev/null +++ b/src/nox/lib.rs.html @@ -0,0 +1,173 @@ +lib.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+#![feature(extend_one)]
+#![feature(try_blocks)]
+#![feature(ip)]
+#![feature(extract_if)]
+#![recursion_limit = "512"]
+#![warn(rust_2018_idioms)]
+#![deny(
+    dead_code,
+    nonstandard_style,
+    unused_imports,
+    unused_mut,
+    unused_variables,
+    unused_unsafe,
+    unreachable_patterns
+)]
+
+mod builtins;
+mod connectivity;
+mod dispatcher;
+mod effectors;
+mod health;
+mod http;
+mod layers;
+mod metrics;
+mod node;
+mod tasks;
+mod behaviour {
+    mod identify;
+    mod network;
+
+    pub use network::{FluenceNetworkBehaviour, FluenceNetworkBehaviourEvent};
+}
+
+pub use behaviour::{FluenceNetworkBehaviour, FluenceNetworkBehaviourEvent};
+pub use http::StartedHttp;
+pub use node::Node;
+
+// to be available in benchmarks
+pub use connection_pool::Command as ConnectionPoolCommand;
+pub use connectivity::Connectivity;
+pub use kademlia::Command as KademliaCommand;
+pub use layers::env_filter;
+pub use layers::log_layer;
+pub use layers::tracing_layer;
+
+#[derive(Debug, Clone)]
+pub struct Versions {
+    pub node_version: String,
+    pub avm_version: String,
+    pub spell_version: String,
+    pub system_service: system_services::Versions,
+}
+
+impl Versions {
+    pub fn new(
+        node_version: String,
+        avm_version: String,
+        spell_version: String,
+        system_service: system_services::Versions,
+    ) -> Self {
+        Self {
+            node_version,
+            avm_version,
+            spell_version,
+            system_service,
+        }
+    }
+}
+
\ No newline at end of file diff --git a/src/nox/metrics.rs.html b/src/nox/metrics.rs.html new file mode 100644 index 0000000000..0077f37611 --- /dev/null +++ b/src/nox/metrics.rs.html @@ -0,0 +1,685 @@ +metrics.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use prometheus_client::collector::Collector;
+use prometheus_client::encoding::{DescriptorEncoder, EncodeMetric, MetricEncoder};
+use prometheus_client::metrics::counter::ConstCounter;
+use prometheus_client::metrics::gauge::ConstGauge;
+use prometheus_client::metrics::MetricType;
+use std::fmt::Error;
+use std::ops::Range;
+use std::time::Duration;
+use tokio::runtime::RuntimeMetrics;
+
+#[derive(Clone, Debug)]
+#[allow(dead_code)]
+pub struct TokioCollector {
+    metrics: RuntimeMetrics,
+}
+
+impl TokioCollector {
+    pub fn new() -> Self {
+        let handle = tokio::runtime::Handle::current();
+        let metrics = handle.metrics();
+        Self { metrics }
+    }
+}
+const WORKER_LABEL: &str = "worker";
+
+#[derive(Debug)]
+struct TokioWorkerHistogram {
+    sum: f64,
+    count: u64,
+    data: Vec<(f64, u64)>,
+}
+
+impl EncodeMetric for TokioWorkerHistogram {
+    fn encode(&self, mut encoder: MetricEncoder<'_>) -> std::result::Result<(), Error> {
+        encoder.encode_histogram::<()>(self.sum, self.count, &self.data, None)
+    }
+
+    fn metric_type(&self) -> MetricType {
+        MetricType::Histogram
+    }
+}
+struct TokioHistogramBuckets(Vec<Range<Duration>>);
+
+impl Collector for TokioCollector {
+    fn encode(&self, mut encoder: DescriptorEncoder<'_>) -> Result<(), Error> {
+        let workers_count = self.metrics.num_workers();
+
+        let histogram_buckets = if self.metrics.poll_count_histogram_enabled() {
+            let num_buckets = self.metrics.poll_count_histogram_num_buckets();
+            let bucket_ranges: Vec<Range<Duration>> = (0..num_buckets)
+                .map(|index| self.metrics.poll_count_histogram_bucket_range(index))
+                .collect();
+            Some(TokioHistogramBuckets(bucket_ranges))
+        } else {
+            None
+        };
+
+        let workers = ConstGauge::new(workers_count as i64);
+
+        let workers_encoder = encoder.encode_descriptor(
+            "workers",
+            "The number of worker threads used by the runtime",
+            None,
+            workers.metric_type(),
+        )?;
+
+        workers.encode(workers_encoder)?;
+
+        let active_tasks = ConstGauge::new(self.metrics.active_tasks_count() as i64);
+
+        let active_tasks_encoder = encoder.encode_descriptor(
+            "active_tasks",
+            "The number of active tasks in the runtime",
+            None,
+            active_tasks.metric_type(),
+        )?;
+
+        active_tasks.encode(active_tasks_encoder)?;
+
+        let num_blocking_threads = ConstGauge::new(self.metrics.num_blocking_threads() as i64);
+
+        let num_blocking_threads_encoder = encoder.encode_descriptor(
+            "num_blocking_threads",
+            "Еhe number of additional blocking threads spawned by the runtime",
+            None,
+            num_blocking_threads.metric_type(),
+        )?;
+
+        num_blocking_threads.encode(num_blocking_threads_encoder)?;
+
+        let num_idle_blocking_threads =
+            ConstGauge::new(self.metrics.num_idle_blocking_threads() as i64);
+
+        let num_idle_blocking_threads_encoder = encoder.encode_descriptor(
+            "num_idle_blocking_threads",
+            "Returns the number of idle blocking threads, which have spawned by the runtime",
+            None,
+            num_idle_blocking_threads.metric_type(),
+        )?;
+
+        num_idle_blocking_threads.encode(num_idle_blocking_threads_encoder)?;
+
+        let remote_schedule_count = ConstCounter::new(self.metrics.remote_schedule_count());
+
+        let remote_schedule_count_encoder = encoder.encode_descriptor(
+            "remote_schedule",
+            "Returns the number of tasks scheduled from outside of the runtime",
+            None,
+            remote_schedule_count.metric_type(),
+        )?;
+
+        remote_schedule_count.encode(remote_schedule_count_encoder)?;
+
+        let budget_forced_yield_count = ConstCounter::new(self.metrics.budget_forced_yield_count());
+
+        let budget_forced_yield_count_encoder = encoder.encode_descriptor(
+            "budget_forced_yield",
+            "Returns the number of times that tasks have been forced to yield back to the scheduler after exhausting their task budgets",
+            None,
+            budget_forced_yield_count.metric_type(),
+        )?;
+
+        budget_forced_yield_count.encode(budget_forced_yield_count_encoder)?;
+
+        let injection_queue_depth = ConstGauge::new(self.metrics.injection_queue_depth() as i64);
+
+        let injection_queue_depth_encoder = encoder.encode_descriptor(
+            "injection_queue_depth",
+            "Returns the number of tasks currently scheduled in the runtime's injection queue",
+            None,
+            injection_queue_depth.metric_type(),
+        )?;
+
+        injection_queue_depth.encode(injection_queue_depth_encoder)?;
+
+        let blocking_queue_depth = ConstGauge::new(self.metrics.blocking_queue_depth() as i64);
+
+        let blocking_queue_depth_encoder = encoder.encode_descriptor(
+            "blocking_queue_depth",
+            "Returns the number of tasks currently scheduled in the blocking thread pool",
+            None,
+            blocking_queue_depth.metric_type(),
+        )?;
+
+        blocking_queue_depth.encode(blocking_queue_depth_encoder)?;
+
+        for worker_id in 0..workers_count {
+            let labels = [(WORKER_LABEL.to_string(), worker_id.to_string())];
+
+            let worker_park = ConstCounter::new(self.metrics.worker_park_count(worker_id));
+
+            let mut worker_park_encoder = encoder.encode_descriptor(
+                "worker_park",
+                "Returns the total number of times the given worker thread has parked",
+                None,
+                worker_park.metric_type(),
+            )?;
+
+            let worker_park_encoder = worker_park_encoder.encode_family(&labels)?;
+
+            worker_park.encode(worker_park_encoder)?;
+
+            let worker_noop_count = ConstCounter::new(self.metrics.worker_noop_count(worker_id));
+
+            let mut worker_noop_count_encoder = encoder.encode_descriptor(
+                "worker_noop_count",
+                "Returns the number of times the given worker thread unparked but performed no work before parking again",
+                None,
+                worker_noop_count.metric_type(),
+            )?;
+            let worker_noop_count_encoder = worker_noop_count_encoder.encode_family(&labels)?;
+
+            worker_noop_count.encode(worker_noop_count_encoder)?;
+
+            let worker_steal = ConstCounter::new(self.metrics.worker_steal_count(worker_id));
+
+            let mut worker_steal_encoder = encoder.encode_descriptor(
+                "worker_steal",
+                "Returns the number of tasks the given worker thread stole from another worker thread",
+                None,
+                worker_steal.metric_type(),
+            )?;
+            let worker_steal_encoder = worker_steal_encoder.encode_family(&labels)?;
+
+            worker_steal.encode(worker_steal_encoder)?;
+
+            let worker_steal_operations =
+                ConstCounter::new(self.metrics.worker_steal_operations(worker_id));
+
+            let mut worker_steal_operations_encoder = encoder.encode_descriptor(
+                "worker_steal_operations",
+                "Returns the number of times the given worker thread stole tasks from another worker thread",
+                None,
+                worker_steal_operations.metric_type(),
+            )?;
+            let worker_steal_operations_encoder =
+                worker_steal_operations_encoder.encode_family(&labels)?;
+
+            worker_steal_operations.encode(worker_steal_operations_encoder)?;
+
+            let worker_poll = ConstCounter::new(self.metrics.worker_poll_count(worker_id));
+
+            let mut worker_poll_encoder = encoder.encode_descriptor(
+                "worker_poll",
+                "Returns the number of tasks the given worker thread has polled",
+                None,
+                worker_poll.metric_type(),
+            )?;
+            let worker_poll_encoder = worker_poll_encoder.encode_family(&labels)?;
+
+            worker_poll.encode(worker_poll_encoder)?;
+
+            let worker_busy_duration = ConstCounter::new(
+                self.metrics
+                    .worker_total_busy_duration(worker_id)
+                    .as_secs_f64(),
+            );
+
+            let mut worker_busy_duration_encoder = encoder.encode_descriptor(
+                "worker_busy_duration_sec",
+                "Returns the amount of time the given worker thread has been busy",
+                None,
+                worker_busy_duration.metric_type(),
+            )?;
+
+            let worker_busy_duration_encoder =
+                worker_busy_duration_encoder.encode_family(&labels)?;
+
+            worker_busy_duration.encode(worker_busy_duration_encoder)?;
+
+            let worker_local_schedule =
+                ConstCounter::new(self.metrics.worker_local_schedule_count(worker_id));
+
+            let mut worker_local_schedule_encoder = encoder
+                .encode_descriptor(
+                    "worker_local_schedule",
+                    "Returns the number of tasks scheduled from **within** the runtime on the given worker's local queue",
+                    None,
+                    worker_local_schedule.metric_type(),
+                )?;
+            let worker_local_schedule_encoder =
+                worker_local_schedule_encoder.encode_family(&labels)?;
+
+            worker_local_schedule.encode(worker_local_schedule_encoder)?;
+
+            let worker_local_queue_depth =
+                ConstGauge::new(self.metrics.worker_local_queue_depth(worker_id) as i64);
+
+            let mut worker_local_queue_depth_encoder = encoder.encode_descriptor(
+                "worker_local_queue_depth",
+                "Returns the number of tasks currently scheduled in the given worker's local queue",
+                None,
+                worker_local_queue_depth.metric_type(),
+            )?;
+            let worker_local_queue_depth_encoder =
+                worker_local_queue_depth_encoder.encode_family(&labels)?;
+
+            worker_local_queue_depth.encode(worker_local_queue_depth_encoder)?;
+
+            let worker_overflow = ConstCounter::new(self.metrics.worker_overflow_count(worker_id));
+
+            let mut worker_overflow_encoder = encoder.encode_descriptor(
+                "worker_overflow",
+                "Returns the number of times the given worker thread saturated its local queue",
+                None,
+                worker_overflow.metric_type(),
+            )?;
+            let worker_overflow_encoder = worker_overflow_encoder.encode_family(&labels)?;
+
+            worker_overflow.encode(worker_overflow_encoder)?;
+
+            let worker_mean_poll_time =
+                ConstCounter::new(self.metrics.worker_mean_poll_time(worker_id).as_secs_f64());
+
+            let mut worker_mean_poll_time_encoder = encoder.encode_descriptor(
+                "worker_mean_poll_time_sec",
+                "Returns the mean duration of task polls",
+                None,
+                worker_overflow.metric_type(),
+            )?;
+            let worker_mean_poll_time_encoder =
+                worker_mean_poll_time_encoder.encode_family(&labels)?;
+
+            worker_mean_poll_time.encode(worker_mean_poll_time_encoder)?;
+
+            if let Some(histogram_buckets) = histogram_buckets.as_ref() {
+                let mut data: Vec<(f64, u64)> = Vec::with_capacity(histogram_buckets.0.len());
+                let mut count: u64 = 0;
+
+                for (bucket_id, bucket) in histogram_buckets.0.iter().enumerate() {
+                    let mut key: f64 = bucket.end.as_nanos() as f64;
+                    let value = self
+                        .metrics
+                        .poll_count_histogram_bucket_count(worker_id, bucket_id);
+                    count += value;
+                    if bucket_id == histogram_buckets.0.len() - 1 {
+                        key = f64::MAX
+                    }
+                    data.push((key, value))
+                }
+
+                let histogram = TokioWorkerHistogram {
+                    sum: 0f64,
+                    count,
+                    data,
+                };
+
+                let mut poll_count_histogram_encoder = encoder.encode_descriptor(
+                    "poll_count_histogram",
+                    "Returns the distribution of task poll times in nanoseconds",
+                    None,
+                    worker_overflow.metric_type(),
+                )?;
+                let poll_count_histogram_encoder =
+                    poll_count_histogram_encoder.encode_family(&labels)?;
+
+                histogram.encode(poll_count_histogram_encoder)?;
+            }
+        }
+
+        Ok(())
+    }
+}
+
\ No newline at end of file diff --git a/src/nox/node.rs.html b/src/nox/node.rs.html new file mode 100644 index 0000000000..bb9a3d8c09 --- /dev/null +++ b/src/nox/node.rs.html @@ -0,0 +1,1839 @@ +node.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+762
+763
+764
+765
+766
+767
+768
+769
+770
+771
+772
+773
+774
+775
+776
+777
+778
+779
+780
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+794
+795
+796
+797
+798
+799
+800
+801
+802
+803
+804
+805
+806
+807
+808
+809
+810
+811
+812
+813
+814
+815
+816
+817
+818
+819
+820
+821
+822
+823
+824
+825
+826
+827
+828
+829
+830
+831
+832
+833
+834
+835
+836
+837
+838
+839
+840
+841
+842
+843
+844
+845
+846
+847
+848
+849
+850
+851
+852
+853
+854
+855
+856
+857
+858
+859
+860
+861
+862
+863
+864
+865
+866
+867
+868
+869
+870
+871
+872
+873
+874
+875
+876
+877
+878
+879
+880
+881
+882
+883
+884
+885
+886
+887
+888
+889
+890
+891
+892
+893
+894
+895
+896
+897
+898
+899
+900
+901
+902
+903
+904
+905
+906
+907
+908
+909
+910
+911
+912
+913
+914
+915
+916
+917
+918
+919
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use ccp_rpc_client::CCPRpcHttpClient;
+use cpu_utils::pinning::ThreadPinner;
+use eyre::WrapErr;
+use fluence_keypair::KeyPair;
+use futures::future::OptionFuture;
+use futures::{stream::StreamExt, FutureExt};
+use libp2p::swarm::SwarmEvent;
+use libp2p::SwarmBuilder;
+use libp2p::{
+    core::{muxing::StreamMuxerBox, transport::Boxed, Multiaddr},
+    identity::Keypair,
+    PeerId, Swarm, TransportError,
+};
+use libp2p_connection_limits::ConnectionLimits;
+use libp2p_metrics::{Metrics, Recorder};
+use prometheus_client::registry::Registry;
+use std::path::PathBuf;
+use std::process::exit;
+use std::sync::Arc;
+use std::{io, net::SocketAddr};
+use tokio::sync::{mpsc, oneshot};
+use tokio::task;
+use tokio_util::sync::CancellationToken;
+use tracing::Instrument;
+
+use aquamarine::{
+    AquaRuntime, AquamarineApi, AquamarineApiError, AquamarineBackend, DataStoreConfig,
+    RemoteRoutingEffects, VmPoolConfig, WasmBackendConfig,
+};
+use chain_connector::HttpChainConnector;
+use chain_listener::ChainListener;
+use config_utils::to_peer_id;
+use connection_pool::ConnectionPoolT;
+use core_distributor::CoreDistributor;
+use fluence_libp2p::build_transport;
+use health::HealthCheckRegistry;
+use particle_builtins::{
+    Builtins, BuiltinsConfig, CustomService, NodeInfo, ParticleAppServicesConfig,
+};
+use particle_execution::ParticleFunctionStatic;
+use particle_protocol::ExtendedParticle;
+use peer_metrics::{
+    ChainListenerMetrics, ConnectionPoolMetrics, ConnectivityMetrics, ParticleExecutorMetrics,
+    ServicesMetrics, ServicesMetricsBackend, SpellMetrics, VmPoolMetrics,
+};
+use server_config::system_services_config::ServiceKey;
+use server_config::{NetworkConfig, ResolvedConfig};
+use sorcerer::Sorcerer;
+use spell_event_bus::api::{PeerEvent, SpellEventBusApi, TriggerEvent};
+use spell_event_bus::bus::SpellEventBus;
+use system_services::{Deployer, SystemServiceDistros};
+use workers::{KeyStorage, PeerScopes, VmConfig, Workers, WorkersConfig};
+
+use crate::behaviour::FluenceNetworkBehaviourEvent;
+use crate::builtins::make_peer_builtin;
+use crate::dispatcher::Dispatcher;
+use crate::effectors::Effectors;
+use crate::http::{start_http_endpoint, HttpEndpointData};
+use crate::metrics::TokioCollector;
+use crate::{Connectivity, Versions};
+
+use super::behaviour::FluenceNetworkBehaviour;
+
+// TODO: documentation
+pub struct Node<RT: AquaRuntime> {
+    particle_stream: mpsc::Receiver<ExtendedParticle>,
+    effects_stream: mpsc::Receiver<Result<RemoteRoutingEffects, AquamarineApiError>>,
+    pub swarm: Swarm<FluenceNetworkBehaviour>,
+
+    pub connectivity: Connectivity,
+    pub aquamarine_api: AquamarineApi,
+    pub dispatcher: Dispatcher,
+    aquamarine_backend: AquamarineBackend<RT, Arc<Builtins<Connectivity>>>,
+    system_service_deployer: Deployer,
+
+    spell_event_bus_api: SpellEventBusApi,
+    spell_event_bus: SpellEventBus,
+    spell_events_receiver: mpsc::UnboundedReceiver<TriggerEvent>,
+    sorcerer: Sorcerer,
+
+    metrics_registry: Option<Registry>,
+    health_registry: Option<HealthCheckRegistry>,
+    libp2p_metrics: Option<Arc<Metrics>>,
+    services_metrics_backend: ServicesMetricsBackend,
+
+    http_listen_addr: Option<SocketAddr>,
+
+    pub builtins_management_peer_id: PeerId,
+
+    pub scope: PeerScopes,
+
+    allow_local_addresses: bool,
+    versions: Versions,
+
+    pub chain_listener: Option<ChainListener>,
+
+    workers: Arc<Workers>,
+
+    config: ResolvedConfig,
+}
+
+async fn setup_listener(
+    connector: Option<Arc<HttpChainConnector>>,
+    config: &ResolvedConfig,
+    core_distributor: Arc<dyn CoreDistributor>,
+    chain_listener_metrics: Option<ChainListenerMetrics>,
+) -> eyre::Result<Option<ChainListener>> {
+    if let (Some(connector), Some(chain_config), Some(listener_config)) = (
+        connector,
+        config.chain_config.clone(),
+        config.chain_listener_config.clone(),
+    ) {
+        let ccp_client = if let Some(ccp_endpoint) = listener_config.ccp_endpoint.clone() {
+            let ccp_client = CCPRpcHttpClient::new(ccp_endpoint.clone())
+                .await
+                .map_err(|err| {
+                    log::error!("Error connecting to CCP {ccp_endpoint}, error: {err}");
+                    err
+                })?;
+
+            Some(ccp_client)
+        } else {
+            None
+        };
+
+        let ws_client = ChainListener::create_ws_client(&listener_config.ws_endpoint).await?;
+        let cc_events_dir = config.dir_config.cc_events_dir.clone();
+        let host_id = config.root_key_pair.get_peer_id();
+
+        let chain_listener = ChainListener::new(
+            chain_config,
+            ws_client,
+            listener_config,
+            host_id,
+            connector,
+            core_distributor,
+            ccp_client,
+            cc_events_dir,
+            chain_listener_metrics,
+        );
+        Ok(Some(chain_listener))
+    } else {
+        Ok(None)
+    }
+}
+
+impl<RT: AquaRuntime> Node<RT> {
+    pub async fn new(
+        config: ResolvedConfig,
+        core_distributor: Arc<dyn CoreDistributor>,
+        thread_pinner: Arc<dyn ThreadPinner>,
+        vm_config: RT::Config,
+        data_store_config: DataStoreConfig,
+        node_version: &'static str,
+        air_version: &'static str,
+        system_service_distros: SystemServiceDistros,
+    ) -> eyre::Result<Box<Self>> {
+        let key_pair: Keypair = config.node_config.root_key_pair.clone().into();
+        let transport = config.transport_config.transport;
+        let transport =
+            build_transport(transport, &key_pair, config.transport_config.socket_timeout);
+
+        let builtins_peer_id = to_peer_id(&config.builtins_key_pair.clone().into());
+
+        let root_key_pair: KeyPair = key_pair.clone().into();
+
+        let key_storage = KeyStorage::from_path(
+            config.dir_config.keypairs_base_dir.clone(),
+            root_key_pair.clone(),
+        )
+        .await?;
+
+        let key_storage = Arc::new(key_storage);
+
+        let scopes = PeerScopes::new(
+            root_key_pair.get_peer_id(),
+            config.management_peer_id,
+            builtins_peer_id,
+            key_storage.clone(),
+        );
+
+        let workers_config = WorkersConfig::new(
+            config.node_config.workers_queue_buffer,
+            config
+                .node_config
+                .vm
+                .clone()
+                .map(|conf| VmConfig::new(conf.libvirt_uri, conf.bridge_name)),
+        );
+
+        let (workers, worker_events) = Workers::from_path(
+            workers_config,
+            config.dir_config.workers_base_dir.clone(),
+            key_storage.clone(),
+            core_distributor.clone(),
+            thread_pinner.clone(),
+        )
+        .await?;
+
+        let workers = Arc::new(workers);
+
+        let wasm_backend_config = services_wasm_backend_config(&config);
+
+        let services_config = ParticleAppServicesConfig::new(
+            scopes.get_host_peer_id(),
+            config.dir_config.services_persistent_dir.clone(),
+            config.dir_config.services_ephemeral_dir.clone(),
+            config_utils::particles_vault_dir(&config.dir_config.avm_base_dir),
+            config.services_envs.clone(),
+            config.management_peer_id,
+            builtins_peer_id,
+            config.node_config.default_service_memory_limit,
+            wasm_backend_config,
+        )
+        .expect("create services config");
+
+        let mut metrics_registry = if config.metrics_config.metrics_enabled {
+            Some(Registry::default())
+        } else {
+            None
+        };
+
+        let mut health_registry = if config.health_config.health_check_enabled {
+            Some(HealthCheckRegistry::default())
+        } else {
+            None
+        };
+
+        let libp2p_metrics = metrics_registry.as_mut().map(|r| Arc::new(Metrics::new(r)));
+        let connectivity_metrics = metrics_registry.as_mut().map(ConnectivityMetrics::new);
+        let connection_pool_metrics = metrics_registry.as_mut().map(ConnectionPoolMetrics::new);
+        let plumber_metrics = metrics_registry.as_mut().map(ParticleExecutorMetrics::new);
+        let vm_pool_metrics = metrics_registry.as_mut().map(VmPoolMetrics::new);
+        let spell_metrics = metrics_registry.as_mut().map(SpellMetrics::new);
+        let chain_listener_metrics = metrics_registry.as_mut().map(ChainListenerMetrics::new);
+
+        if config.metrics_config.tokio_metrics_enabled {
+            if let Some(r) = metrics_registry.as_mut() {
+                let r = r.sub_registry_with_prefix("tokio");
+                r.register_collector(Box::new(TokioCollector::new()))
+            }
+        }
+
+        #[allow(deprecated)]
+        let connection_limits = ConnectionLimits::default()
+            .with_max_pending_incoming(config.node_config.transport_config.max_pending_incoming)
+            .with_max_pending_outgoing(config.node_config.transport_config.max_pending_outgoing)
+            .with_max_established_incoming(
+                config.node_config.transport_config.max_established_incoming,
+            )
+            .with_max_established_outgoing(
+                config.node_config.transport_config.max_established_outgoing,
+            )
+            .with_max_established_per_peer(
+                config.node_config.transport_config.max_established_per_peer,
+            )
+            .with_max_established(config.node_config.transport_config.max_established);
+
+        let network_config = NetworkConfig::new(
+            libp2p_metrics.clone(),
+            connectivity_metrics,
+            connection_pool_metrics,
+            key_pair,
+            &config,
+            node_version,
+            connection_limits,
+        );
+
+        let allow_local_addresses = config.allow_local_addresses;
+
+        let (swarm, connectivity, particle_stream) = Self::swarm(
+            root_key_pair.clone().into(),
+            network_config,
+            transport,
+            config.external_addresses(),
+            health_registry.as_mut(),
+            metrics_registry.as_mut(),
+        )?;
+
+        let (services_metrics_backend, services_metrics) =
+            if let Some(registry) = metrics_registry.as_mut() {
+                ServicesMetrics::with_external_backend(
+                    config.metrics_config.metrics_timer_resolution,
+                    config.metrics_config.max_builtin_metrics_storage_size,
+                    registry,
+                )
+            } else {
+                ServicesMetrics::with_simple_backend(
+                    config.metrics_config.max_builtin_metrics_storage_size,
+                )
+            };
+
+        let builtins_config = BuiltinsConfig::new(
+            services_config,
+            config.dir_config.services_persistent_dir.clone(),
+            config.node_config.allowed_effectors.clone(),
+            config
+                .node_config
+                .dev_mode_config
+                .binaries
+                .clone()
+                .into_iter()
+                .collect(),
+            config.node_config.dev_mode_config.enable,
+        )
+        .expect("create services config");
+
+        let mut builtins = Self::builtins(
+            builtins_config,
+            connectivity.clone(),
+            services_metrics,
+            key_storage.clone(),
+            workers.clone(),
+            scopes.clone(),
+            health_registry.as_mut(),
+        );
+
+        builtins.services.create_persisted_services().await?;
+
+        let builtins = Arc::new(builtins);
+
+        let (effects_out, effects_in) = mpsc::channel(config.node_config.effects_queue_buffer);
+
+        let pool_config =
+            VmPoolConfig::new(config.aquavm_pool_size, config.particle_execution_timeout);
+        let avm_wasm_backend_config = avm_wasm_backend_config(&config);
+        let (aquamarine_backend, aquamarine_api) = AquamarineBackend::new(
+            pool_config,
+            vm_config,
+            avm_wasm_backend_config,
+            data_store_config,
+            Arc::clone(&builtins),
+            effects_out,
+            plumber_metrics,
+            vm_pool_metrics,
+            health_registry.as_mut(),
+            workers.clone(),
+            key_storage.clone(),
+            scopes.clone(),
+            worker_events,
+        )?;
+        let effectors = Effectors::new(connectivity.clone());
+        let dispatcher = {
+            let parallelism = config.particle_processor_parallelism;
+            Dispatcher::new(
+                scopes.get_host_peer_id(),
+                aquamarine_api.clone(),
+                effectors,
+                parallelism,
+                metrics_registry.as_mut(),
+            )
+        };
+
+        let recv_connection_pool_events = connectivity.connection_pool.lifecycle_events();
+        let sources = vec![recv_connection_pool_events.map(PeerEvent::from).boxed()];
+
+        let (spell_event_bus, spell_event_bus_api, spell_events_receiver) =
+            SpellEventBus::new(spell_metrics.clone(), sources);
+
+        let spell_service_api = spell_service_api::SpellServiceApi::new(builtins.services.clone());
+        let (sorcerer, mut custom_service_functions, spell_version) = Sorcerer::new(
+            builtins.services.clone(),
+            builtins.modules.clone(),
+            aquamarine_api.clone(),
+            config.clone(),
+            spell_event_bus_api.clone(),
+            workers.clone(),
+            key_storage.clone(),
+            scopes.clone(),
+            spell_service_api.clone(),
+            spell_metrics,
+        )
+        .await;
+
+        let allowed_binaries = config
+            .allowed_effectors
+            .values()
+            .flat_map(|v| v.values().cloned().collect::<Vec<PathBuf>>())
+            .collect::<std::collections::HashSet<_>>()
+            .into_iter()
+            .collect::<_>();
+        let node_info = NodeInfo {
+            external_addresses: config.external_addresses(),
+            node_version: env!("CARGO_PKG_VERSION"),
+            air_version: air_interpreter_wasm::VERSION,
+            spell_version: spell_version.clone(),
+            // TODO: remove
+            allowed_binaries,
+        };
+        if let Some(m) = metrics_registry.as_mut() {
+            peer_metrics::add_info_metrics(
+                m,
+                node_info.node_version.to_string(),
+                node_info.air_version.to_string(),
+                node_info.spell_version.clone(),
+            );
+        }
+        custom_service_functions.extend_one(make_peer_builtin(node_info));
+
+        let services = builtins.services.clone();
+        let modules = builtins.modules.clone();
+
+        let connector = if let Some(chain_config) = config.chain_config.clone() {
+            let host_id = scopes.get_host_peer_id();
+            let (chain_connector, chain_builtins) =
+                HttpChainConnector::new(chain_config.clone(), host_id).map_err(|err| {
+                    log::error!(
+                        "Error connecting to http endpoint {}, error: {err}",
+                        chain_config.http_endpoint
+                    );
+                    err
+                })?;
+            custom_service_functions.extend(chain_builtins.into_iter());
+            Some(chain_connector)
+        } else {
+            if config.system_services.enable.contains(&ServiceKey::Decider) {
+                log::error!(
+                    "Decider cannot be used without chain connector. Please, specify chain config"
+                );
+                exit(1);
+            }
+
+            None
+        };
+
+        custom_service_functions.into_iter().for_each(
+            move |(
+                service_id,
+                CustomService {
+                    functions,
+                    fallback,
+                },
+            )| {
+                let builtin = builtins.clone();
+                let task = async move { builtin.extend(service_id, functions, fallback).await };
+                task::Builder::new()
+                    .name("Builtin extend")
+                    .spawn(task)
+                    .expect("Could not spawn task");
+            },
+        );
+
+        let system_services_deployer = Deployer::new(
+            services,
+            modules,
+            sorcerer.spell_storage.clone(),
+            spell_event_bus_api.clone(),
+            spell_service_api,
+            scopes.get_host_peer_id(),
+            builtins_peer_id,
+            system_service_distros,
+        );
+
+        let versions = Versions::new(
+            node_version.to_string(),
+            air_version.to_string(),
+            spell_version,
+            system_services_deployer.versions(),
+        );
+
+        let chain_listener =
+            setup_listener(connector, &config, core_distributor, chain_listener_metrics).await?;
+
+        Ok(Self::with(
+            particle_stream,
+            effects_in,
+            swarm,
+            connectivity,
+            aquamarine_api,
+            dispatcher,
+            aquamarine_backend,
+            system_services_deployer,
+            spell_event_bus_api,
+            spell_event_bus,
+            spell_events_receiver,
+            sorcerer,
+            metrics_registry,
+            health_registry,
+            libp2p_metrics,
+            services_metrics_backend,
+            config.http_listen_addr(),
+            builtins_peer_id,
+            scopes,
+            allow_local_addresses,
+            versions,
+            chain_listener,
+            workers.clone(),
+            config,
+        ))
+    }
+
+    pub fn swarm(
+        key_pair: Keypair,
+        network_config: NetworkConfig,
+        transport: Boxed<(PeerId, StreamMuxerBox)>,
+        external_addresses: Vec<Multiaddr>,
+        health_registry: Option<&mut HealthCheckRegistry>,
+        metrics_registry: Option<&mut Registry>,
+    ) -> eyre::Result<(
+        Swarm<FluenceNetworkBehaviour>,
+        Connectivity,
+        mpsc::Receiver<ExtendedParticle>,
+    )> {
+        let connection_idle_timeout = network_config.connection_idle_timeout;
+
+        let (behaviour, connectivity, particle_stream) =
+            FluenceNetworkBehaviour::new(network_config, health_registry);
+
+        let mut swarm = match metrics_registry {
+            None => SwarmBuilder::with_existing_identity(key_pair)
+                .with_tokio()
+                .with_other_transport(|_| transport)?
+                .with_behaviour(|_| behaviour)?
+                .with_swarm_config(|cfg| cfg.with_idle_connection_timeout(connection_idle_timeout))
+                .build(),
+            Some(registry) => SwarmBuilder::with_existing_identity(key_pair)
+                .with_tokio()
+                .with_other_transport(|_| transport)?
+                .with_bandwidth_metrics(registry)
+                .with_behaviour(|_| behaviour)?
+                .with_swarm_config(|cfg| cfg.with_idle_connection_timeout(connection_idle_timeout))
+                .build(),
+        };
+        // Add external addresses to Swarm
+        external_addresses.iter().cloned().for_each(|addr| {
+            Swarm::add_external_address(&mut swarm, addr);
+        });
+        Ok((swarm, connectivity, particle_stream))
+    }
+
+    pub fn builtins(
+        config: BuiltinsConfig,
+        connectivity: Connectivity,
+        services_metrics: ServicesMetrics,
+        key_storage: Arc<KeyStorage>,
+        workers: Arc<Workers>,
+        scopes: PeerScopes,
+        health_registry: Option<&mut HealthCheckRegistry>,
+    ) -> Builtins<Connectivity> {
+        Builtins::new(
+            config,
+            connectivity,
+            services_metrics,
+            key_storage,
+            workers,
+            scopes,
+            health_registry,
+        )
+    }
+}
+
+pub struct StartedNode {
+    pub cancellation_token: CancellationToken,
+    pub exit_outlet: oneshot::Sender<()>,
+    pub http_listen_addr: Option<SocketAddr>,
+}
+
+impl<RT: AquaRuntime> Node<RT> {
+    #[allow(clippy::too_many_arguments)]
+    pub fn with(
+        particle_stream: mpsc::Receiver<ExtendedParticle>,
+        effects_stream: mpsc::Receiver<Result<RemoteRoutingEffects, AquamarineApiError>>,
+        swarm: Swarm<FluenceNetworkBehaviour>,
+        connectivity: Connectivity,
+        aquamarine_api: AquamarineApi,
+        dispatcher: Dispatcher,
+        aquamarine_backend: AquamarineBackend<RT, Arc<Builtins<Connectivity>>>,
+        system_service_deployer: Deployer,
+        spell_event_bus_api: SpellEventBusApi,
+        spell_event_bus: SpellEventBus,
+        spell_events_receiver: mpsc::UnboundedReceiver<TriggerEvent>,
+        sorcerer: Sorcerer,
+        metrics_registry: Option<Registry>,
+        health_registry: Option<HealthCheckRegistry>,
+        libp2p_metrics: Option<Arc<Metrics>>,
+        services_metrics_backend: ServicesMetricsBackend,
+        http_listen_addr: Option<SocketAddr>,
+        builtins_management_peer_id: PeerId,
+        scope: PeerScopes,
+        allow_local_addresses: bool,
+        versions: Versions,
+        chain_listener: Option<ChainListener>,
+        workers: Arc<Workers>,
+        config: ResolvedConfig,
+    ) -> Box<Self> {
+        let node_service = Self {
+            particle_stream,
+            effects_stream,
+            swarm,
+
+            connectivity,
+            aquamarine_api,
+            dispatcher,
+            aquamarine_backend,
+            system_service_deployer,
+            spell_event_bus_api,
+            spell_event_bus,
+            spell_events_receiver,
+            sorcerer,
+
+            metrics_registry,
+            health_registry,
+            libp2p_metrics,
+            services_metrics_backend,
+            http_listen_addr,
+            builtins_management_peer_id,
+            scope,
+            allow_local_addresses,
+            versions,
+            chain_listener,
+            workers,
+            config,
+        };
+
+        Box::new(node_service)
+    }
+
+    /// Starts node service
+    #[allow(clippy::boxed_local)] // Mike said it should be boxed
+    pub async fn start(self: Box<Self>, peer_id: PeerId) -> eyre::Result<StartedNode> {
+        let (exit_outlet, exit_inlet) = oneshot::channel();
+        let (http_bind_outlet, http_bind_inlet) = oneshot::channel();
+
+        let particle_stream = self.particle_stream;
+        let effects_stream = self.effects_stream;
+        let mut swarm = self.swarm;
+        let connectivity = self.connectivity;
+        let dispatcher = self.dispatcher;
+        let aquamarine_backend = self.aquamarine_backend;
+        let spell_event_bus = self.spell_event_bus;
+        let spell_events_receiver = self.spell_events_receiver;
+        let sorcerer = self.sorcerer;
+        let services_metrics_backend = self.services_metrics_backend;
+        let http_listen_addr = self.http_listen_addr;
+        let task_name = format!("node-{peer_id}");
+        let libp2p_metrics = self.libp2p_metrics;
+        let allow_local_addresses = self.allow_local_addresses;
+        let versions = self.versions;
+        let workers = self.workers.clone();
+        let chain_listener = self.chain_listener;
+
+        let http_endpoint_data = HttpEndpointData::new(
+            self.metrics_registry,
+            self.health_registry,
+            Some(self.config),
+        );
+
+        let cancellation_token = CancellationToken::new();
+        let task_cancellation_token = cancellation_token.clone();
+
+        task::Builder::new().name(&task_name.clone()).spawn(async move {
+            let mut http_server = if let Some(http_listen_addr) = http_listen_addr {
+                tracing::info!("Starting http endpoint at {}", http_listen_addr);
+                async move {
+                    start_http_endpoint(http_listen_addr, peer_id, versions,
+                                        http_endpoint_data, http_bind_outlet)
+                        .await
+                        .expect("Could not start http server");
+                }.boxed()
+            } else {
+                futures::future::pending().boxed()
+            };
+
+
+            let services_metrics_backend = services_metrics_backend.start();
+            let spell_event_bus = spell_event_bus.start();
+            let sorcerer = sorcerer.start(spell_events_receiver);
+            let chain_listener = chain_listener.map(|c| c.start());
+            let aquamarine_backend = aquamarine_backend.start();
+            let mut connectivity = connectivity.start();
+            let mut dispatcher = dispatcher.start(particle_stream, effects_stream);
+            let mut exit_inlet = Some(exit_inlet);
+
+            loop {
+                let exit_inlet = exit_inlet.as_mut().expect("Could not get exit inlet");
+                tokio::select! {
+                    Some(e) = swarm.next() => {
+                        if let Some(m) = libp2p_metrics.as_ref() { m.record(&e) }
+                        if let SwarmEvent::Behaviour(FluenceNetworkBehaviourEvent::Identify(event)) = e {
+                            swarm.behaviour_mut().inject_identify_event(event, allow_local_addresses);
+                        }
+                    },
+                    _ = &mut http_server => {},
+                    _ = &mut connectivity => {},
+                    _ = &mut dispatcher => {},
+                    _ = exit_inlet => {
+                        log::info!("Exit inlet");
+                        break;
+                    }
+                }
+            }
+
+            log::info!("Stopping node");
+            if let Some(c) = chain_listener { c.abort() }
+            services_metrics_backend.abort();
+            spell_event_bus.abort();
+            sorcerer.abort();
+            dispatcher.cancel().await;
+            connectivity.cancel().await;
+            aquamarine_backend.abort();
+            workers.shutdown();
+            task_cancellation_token.cancel()
+        }.in_current_span()).expect("Could not spawn task");
+
+        // Note: need to be after the start of the node to be able to subscribe spells
+        let deployer = self.system_service_deployer;
+        deployer
+            .deploy_system_services()
+            .await
+            .context("deploying system services failed")?;
+
+        self.spell_event_bus_api
+            .start_scheduling()
+            .await
+            .map_err(|e| eyre::eyre!("{e}"))
+            .context("running spell event bus failed")?;
+
+        let http_listen_addr = OptionFuture::from(http_listen_addr.map(|_| async {
+            let addr = http_bind_inlet.await.expect("http bind sender is dropped");
+            addr.listen_addr
+        }))
+        .await;
+
+        Ok(StartedNode {
+            exit_outlet,
+            http_listen_addr,
+            cancellation_token,
+        })
+    }
+
+    /// Starts node service listener.
+    #[inline]
+    pub fn listen(
+        &mut self,
+        addrs: impl Into<Vec<Multiaddr>>,
+    ) -> Result<(), TransportError<io::Error>> {
+        let addrs = addrs.into();
+        log::info!("Fluence listening on {:?}", addrs);
+
+        for addr in addrs {
+            Swarm::listen_on(&mut self.swarm, addr)?;
+        }
+        Ok(())
+    }
+}
+
+fn avm_wasm_backend_config(config: &ResolvedConfig) -> WasmBackendConfig {
+    WasmBackendConfig {
+        debug_info: config.node_config.avm_config.wasm_backend.debug_info,
+        wasm_backtrace: config.node_config.avm_config.wasm_backend.wasm_backtrace,
+        async_wasm_stack: config
+            .node_config
+            .avm_config
+            .wasm_backend
+            .async_wasm_stack
+            .as_u64() as usize,
+        max_wasm_stack: config
+            .node_config
+            .avm_config
+            .wasm_backend
+            .max_wasm_stack
+            .as_u64() as usize,
+        epoch_interruption_duration: config
+            .node_config
+            .avm_config
+            .wasm_backend
+            .epoch_interruption_duration,
+    }
+}
+
+fn services_wasm_backend_config(config: &ResolvedConfig) -> WasmBackendConfig {
+    WasmBackendConfig {
+        debug_info: config.node_config.services.wasm_backend.debug_info,
+        wasm_backtrace: config.node_config.services.wasm_backend.wasm_backtrace,
+        async_wasm_stack: config
+            .node_config
+            .services
+            .wasm_backend
+            .async_wasm_stack
+            .as_u64() as usize,
+        max_wasm_stack: config
+            .node_config
+            .services
+            .wasm_backend
+            .max_wasm_stack
+            .as_u64() as usize,
+        epoch_interruption_duration: config
+            .node_config
+            .services
+            .wasm_backend
+            .epoch_interruption_duration,
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use std::path::PathBuf;
+    use std::sync::Arc;
+    use std::time::Duration;
+
+    use libp2p::core::Multiaddr;
+    use libp2p::PeerId;
+    use maplit::hashmap;
+    use serde_json::json;
+
+    use air_interpreter_fs::{air_interpreter_path, write_default_air_interpreter};
+    use aquamarine::{AVMRunner, DataStoreConfig, VmConfig};
+    use config_utils::to_peer_id;
+    use connected_client::ConnectedClient;
+    use core_distributor::dummy::DummyCoreDistibutor;
+    use fs_utils::to_abs_path;
+    use server_config::{default_base_dir, load_config_with_args, persistent_dir};
+    use system_services::SystemServiceDistros;
+
+    use crate::Node;
+
+    #[tokio::test]
+    async fn run_node() {
+        log_utils::enable_logs();
+        let base_dir = default_base_dir();
+        let persistent_dir = persistent_dir(&base_dir);
+        fs_utils::create_dir(&base_dir).unwrap();
+        fs_utils::create_dir(&persistent_dir).unwrap();
+        write_default_air_interpreter(&air_interpreter_path(&persistent_dir)).unwrap();
+
+        let mut config = load_config_with_args(vec![], None)
+            .expect("Could not load config")
+            .resolve()
+            .expect("Could not resolve config");
+        config.transport_config.connection_idle_timeout = Duration::from_secs(60);
+        config.aquavm_pool_size = 1;
+        config.dir_config.spell_base_dir = to_abs_path(PathBuf::from("spell"));
+        config.system_services.enable = vec![];
+        config.http_config = None;
+        let vm_config = VmConfig::new(
+            to_peer_id(&config.root_key_pair.clone().into()),
+            config.dir_config.air_interpreter_path.clone(),
+            None,
+            None,
+            None,
+            None,
+            false,
+        );
+
+        let data_store_config = DataStoreConfig::new(config.dir_config.avm_base_dir.clone());
+
+        let system_service_distros =
+            SystemServiceDistros::default_from(config.system_services.clone())
+                .expect("can't create system services");
+
+        let core_distributor = Arc::new(DummyCoreDistibutor::new());
+        let thread_pinner = Arc::new(test_utils::pinning::DUMMY);
+
+        let mut node: Box<Node<AVMRunner>> = Node::new(
+            config,
+            core_distributor,
+            thread_pinner,
+            vm_config,
+            data_store_config,
+            "some version",
+            "some version",
+            system_service_distros,
+        )
+        .await
+        .expect("create node");
+
+        let listening_address: Multiaddr = "/ip4/127.0.0.1/tcp/7777".parse().unwrap();
+        node.listen(vec![listening_address.clone()]).unwrap();
+        let peer_id = PeerId::random();
+        let started_node = node.start(peer_id).await.expect("start node");
+
+        let mut client = ConnectedClient::connect_to_with_timeout(
+            listening_address,
+            Duration::from_secs(10),
+            Duration::from_secs(60),
+            Some(Duration::from_secs(2 * 60)),
+        )
+        .await
+        .expect("connect client");
+        let data = hashmap! {
+            "name" => json!("folex"),
+            "client" => json!(client.peer_id.to_string()),
+            "relay" => json!(client.node.to_string()),
+        };
+        client
+            .execute_particle(
+                r#"
+                (seq
+                    (call relay ("op" "identity") [])
+                    (call client ("return" "") [name])
+                )
+            "#,
+                data.clone(),
+            )
+            .await
+            .unwrap();
+
+        started_node.exit_outlet.send(()).unwrap();
+    }
+}
+
\ No newline at end of file diff --git a/src/nox/tasks.rs.html b/src/nox/tasks.rs.html new file mode 100644 index 0000000000..78aff89751 --- /dev/null +++ b/src/nox/tasks.rs.html @@ -0,0 +1,133 @@ +tasks.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use std::future::Future;
+use std::pin::Pin;
+use std::task::{Context, Poll};
+
+use futures::future::FusedFuture;
+use futures::FutureExt;
+use tokio::task::JoinHandle;
+
+/// Holds handles to spawned tasks
+pub struct Tasks {
+    name: &'static str,
+    /// Task that processes particles from particle stream
+    pub tasks: Vec<JoinHandle<()>>,
+}
+
+impl Tasks {
+    pub fn new(name: &'static str, tasks: Vec<JoinHandle<()>>) -> Self {
+        Self { name, tasks }
+    }
+
+    pub async fn cancel(self) {
+        for task in self.tasks {
+            task.abort();
+        }
+    }
+}
+
+impl Future for Tasks {
+    type Output = ();
+
+    fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
+        let _ = self.tasks.extract_if(|task| task.poll_unpin(cx).is_ready());
+
+        if self.is_terminated() {
+            log::warn!("{} tasks terminated", self.name);
+            Poll::Ready(())
+        } else {
+            Poll::Pending
+        }
+    }
+}
+
+impl FusedFuture for Tasks {
+    fn is_terminated(&self) -> bool {
+        self.tasks.is_empty()
+    }
+}
+
\ No newline at end of file diff --git a/src/particle_args/args.rs.html b/src/particle_args/args.rs.html new file mode 100644 index 0000000000..e0b448f2ad --- /dev/null +++ b/src/particle_args/args.rs.html @@ -0,0 +1,377 @@ +args.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use crate::args_error::ArgsError::{self, MissingField};
+
+use control_macro::ok_get;
+
+use crate::ArgsError::DeserializeError;
+use avm_server::{CallRequestParams, SecurityTetraplet};
+use serde::Deserialize;
+use serde_json::Value as JValue;
+use std::convert::TryFrom;
+
+#[derive(Debug, Clone)]
+/// Arguments passed by VM to host on call_service
+pub struct Args {
+    pub service_id: String,
+    pub function_name: String,
+    pub function_args: Vec<serde_json::Value>,
+    pub tetraplets: Vec<Vec<SecurityTetraplet>>,
+}
+
+impl Args {
+    /// Retrieves next json value from iterator, parse it to T
+    /// `field` is to generate a more accurate error message
+    pub fn next<T: for<'de> Deserialize<'de>>(
+        field: &'static str,
+        args: &mut impl Iterator<Item = JValue>,
+    ) -> Result<T, ArgsError> {
+        let value = args.next().ok_or(MissingField(field))?;
+        let value: T = Self::deserialize(field, value)?;
+
+        Ok(value)
+    }
+
+    /// Retrieves a json value from iterator if it's not empty, and parses it to Aqua's option representation
+    /// Aqua's option is expected to be an array of 1 or 0 elements.
+    /// For the sakes of backward compatibility, scalar value and absence of value are tolerated as well.
+    /// `field` is to generate a more accurate error message
+    ///
+    /// In short, function returns:
+    /// - if next arg is `T` or `[T]`               => Some(T)
+    /// - if next arg is `None` or `[]`             => None
+    /// - if next arg is array of several elements  => error
+    pub fn next_opt<T: for<'de> Deserialize<'de>>(
+        field: &'static str,
+        args: &mut impl Iterator<Item = JValue>,
+    ) -> Result<Option<T>, ArgsError> {
+        let value = ok_get!(args.next());
+
+        // TODO: get rid of untagged enum, and always deserialize to Vec<T> of one element.
+        #[derive(serde::Deserialize, Debug)]
+        #[serde(untagged)]
+        pub enum Opt<T> {
+            Array(Vec<T>),
+            Scalar(T),
+            None,
+        }
+        let value: Opt<T> = Self::deserialize(field, value)?;
+        let value = match value {
+            Opt::Scalar(v) => Some(v),
+            Opt::Array(v) if v.len() > 1 => {
+                return Err(ArgsError::NonUnaryOption {
+                    field,
+                    length: v.len(),
+                })
+            }
+            Opt::Array(v) => v.into_iter().next(),
+            Opt::None => None,
+        };
+        Ok(value)
+    }
+
+    /// `field` is to generate a more accurate error message
+    fn deserialize<T: for<'de> Deserialize<'de>>(
+        field: &'static str,
+        value: JValue,
+    ) -> Result<T, ArgsError> {
+        serde_json::from_value(value.clone()).map_err(|_| {
+            let expected_type = std::any::type_name::<T>();
+            let expected_type = expected_type.replace("alloc::vec::", "");
+            let expected_type = expected_type.replace("alloc::string::", "");
+            let expected_type =
+                expected_type.replace("particle_args::args::Args::next_opt::Opt", "Option");
+
+            DeserializeError {
+                field,
+                value,
+                expected_type,
+            }
+        })
+    }
+}
+
+impl TryFrom<CallRequestParams> for Args {
+    type Error = ArgsError;
+
+    fn try_from(value: CallRequestParams) -> Result<Self, Self::Error> {
+        Ok(Args {
+            service_id: value.service_id,
+            function_name: value.function_name,
+            function_args: value.arguments,
+            tetraplets: value.tetraplets,
+        })
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use super::Args;
+    use serde_json::json;
+
+    #[test]
+    fn test_next_opt() {
+        #[rustfmt::skip]
+        let mut args = vec![
+            json!([]),                    // as String => None
+            json!(["hi"]),                // as String => Some
+            json!(["hi", "hi"]),          // as Vec    => Some
+            json!([]),                    // as Vec    => None
+            json!(["hi", "hi"]),          // as String => Error
+            json!("hi"),                  // as String => Some
+            json!(["hi"]),                // as Vec    => Some
+            json!([[[[ "hi", "bye" ]]]])  // as String => Error
+            /* absence */                 // as String => None
+            /* absence */                 // as Vec    => None
+        ]
+        .into_iter();
+
+        fn hi() -> String {
+            "hi".to_string()
+        }
+
+        let none: Result<Option<String>, _> = Args::next_opt("", &mut args);
+        assert_eq!(none.unwrap(), None);
+
+        let some: Result<Option<String>, _> = Args::next_opt("", &mut args);
+        assert_eq!(some.unwrap(), Some(hi()));
+
+        let some_vec: Result<Option<Vec<String>>, _> = Args::next_opt("", &mut args);
+        assert_eq!(some_vec.unwrap(), Some(vec![hi(), hi()]));
+
+        let none_vec: Result<Option<Vec<String>>, _> = Args::next_opt("", &mut args);
+        assert_eq!(none_vec.unwrap(), None);
+
+        let scalar_err: Result<Option<String>, _> = Args::next_opt("scalar", &mut args);
+        assert!(scalar_err.is_err());
+        assert_eq!(
+            "Option's array must contain at most 1 element, 'scalar' was of 2 elements",
+            scalar_err.err().unwrap().to_string()
+        );
+
+        let some: Result<Option<String>, _> = Args::next_opt("", &mut args);
+        assert_eq!(some.unwrap(), Some(hi()));
+
+        let some_vec: Result<Option<Vec<String>>, _> = Args::next_opt("", &mut args);
+        assert_eq!(some_vec.unwrap(), Some(vec![hi()]));
+
+        let incorrect_type: Result<Option<Vec<(String, String)>>, _> =
+            Args::next_opt("field", &mut args);
+        assert_eq!(
+            r#"Error deserializing field 'field': expected Option<Vec<(String, String)>>, got [[[["hi","bye"]]]]"#,
+            incorrect_type.err().unwrap().to_string()
+        );
+
+        let none: Result<Option<String>, _> = Args::next_opt("", &mut args);
+        assert_eq!(none.unwrap(), None);
+
+        let none_vec: Result<Option<Vec<String>>, _> = Args::next_opt("", &mut args);
+        assert_eq!(none_vec.unwrap(), None);
+    }
+}
+
\ No newline at end of file diff --git a/src/particle_args/args_error.rs.html b/src/particle_args/args_error.rs.html new file mode 100644 index 0000000000..aa8aa4530e --- /dev/null +++ b/src/particle_args/args_error.rs.html @@ -0,0 +1,185 @@ +args_error.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use json_utils::err_as_value;
+
+use eyre::Report;
+use serde_json::{json, Value as JValue};
+use std::borrow::Cow;
+use std::fmt::{Display, Formatter};
+use thiserror::Error;
+
+#[derive(Debug, Error)]
+pub enum ArgsError {
+    #[error("Field '{0}' is missing from args to call_service")]
+    MissingField(&'static str),
+    #[error("Error while deserializing field '{field}': {err}")]
+    SerdeJson {
+        field: &'static str,
+        err: serde_json::Error,
+    },
+    #[error("Error while deserializing field '{field}': {err}")]
+    InvalidFormat {
+        field: &'static str,
+        err: Cow<'static, str>,
+    },
+    #[error("Option's array must contain at most 1 element, '{field}' was of {length} elements")]
+    NonUnaryOption { field: &'static str, length: usize },
+    #[error("Error deserializing field '{field}': expected {expected_type}, got {value}")]
+    DeserializeError {
+        field: &'static str,
+        value: JValue,
+        expected_type: String,
+    },
+}
+
+impl From<ArgsError> for JValue {
+    fn from(err: ArgsError) -> Self {
+        err_as_value(err)
+    }
+}
+
+#[derive(Debug, Clone)]
+/// An error that can be created from any other error
+/// Simplifies life by converting errors to be returnable from host closures
+pub struct JError(pub JValue);
+
+impl Display for JError {
+    fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
+        write!(f, "{}", self.0)
+    }
+}
+
+impl JError {
+    pub fn new(msg: impl AsRef<str>) -> Self {
+        Self(json!(msg.as_ref()))
+    }
+
+    pub fn from_eyre(err: Report) -> Self {
+        JError(err_as_value(err))
+    }
+}
+
+impl From<JError> for JValue {
+    fn from(err: JError) -> Self {
+        err.0
+    }
+}
+
+impl<E: std::error::Error> From<E> for JError {
+    fn from(err: E) -> Self {
+        JError(err_as_value(err))
+    }
+}
+
+// It's not possible to implement Error for JError in Rust
+// impl Error for JError {}
+
\ No newline at end of file diff --git a/src/particle_args/base58.rs.html b/src/particle_args/base58.rs.html new file mode 100644 index 0000000000..3e97c58adf --- /dev/null +++ b/src/particle_args/base58.rs.html @@ -0,0 +1,69 @@ +base58.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use crate::{Args, ArgsError};
+use serde_json::Value as JValue;
+
+pub fn from_base58(
+    name: &'static str,
+    args: &mut impl Iterator<Item = JValue>,
+) -> Result<Vec<u8>, ArgsError> {
+    let result: String = Args::next(name, args)?;
+    bs58::decode(result)
+        .into_vec()
+        .map_err(|err| ArgsError::InvalidFormat {
+            field: "key",
+            err: format!("not a base58: {err}").into(),
+        })
+}
+
\ No newline at end of file diff --git a/src/particle_args/lib.rs.html b/src/particle_args/lib.rs.html new file mode 100644 index 0000000000..d9685de00b --- /dev/null +++ b/src/particle_args/lib.rs.html @@ -0,0 +1,79 @@ +lib.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+#![warn(rust_2018_idioms)]
+#![deny(
+    dead_code,
+    nonstandard_style,
+    unused_imports,
+    unused_mut,
+    unused_variables,
+    unused_unsafe,
+    unreachable_patterns
+)]
+
+mod args;
+mod args_error;
+mod base58;
+
+pub use args::Args;
+pub use args_error::{ArgsError, JError};
+
+pub use avm_server::AVMError;
+pub use base58::from_base58;
+
\ No newline at end of file diff --git a/src/particle_builtins/builtins.rs.html b/src/particle_builtins/builtins.rs.html new file mode 100644 index 0000000000..d06cdc5dc6 --- /dev/null +++ b/src/particle_builtins/builtins.rs.html @@ -0,0 +1,3093 @@ +builtins.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+762
+763
+764
+765
+766
+767
+768
+769
+770
+771
+772
+773
+774
+775
+776
+777
+778
+779
+780
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+794
+795
+796
+797
+798
+799
+800
+801
+802
+803
+804
+805
+806
+807
+808
+809
+810
+811
+812
+813
+814
+815
+816
+817
+818
+819
+820
+821
+822
+823
+824
+825
+826
+827
+828
+829
+830
+831
+832
+833
+834
+835
+836
+837
+838
+839
+840
+841
+842
+843
+844
+845
+846
+847
+848
+849
+850
+851
+852
+853
+854
+855
+856
+857
+858
+859
+860
+861
+862
+863
+864
+865
+866
+867
+868
+869
+870
+871
+872
+873
+874
+875
+876
+877
+878
+879
+880
+881
+882
+883
+884
+885
+886
+887
+888
+889
+890
+891
+892
+893
+894
+895
+896
+897
+898
+899
+900
+901
+902
+903
+904
+905
+906
+907
+908
+909
+910
+911
+912
+913
+914
+915
+916
+917
+918
+919
+920
+921
+922
+923
+924
+925
+926
+927
+928
+929
+930
+931
+932
+933
+934
+935
+936
+937
+938
+939
+940
+941
+942
+943
+944
+945
+946
+947
+948
+949
+950
+951
+952
+953
+954
+955
+956
+957
+958
+959
+960
+961
+962
+963
+964
+965
+966
+967
+968
+969
+970
+971
+972
+973
+974
+975
+976
+977
+978
+979
+980
+981
+982
+983
+984
+985
+986
+987
+988
+989
+990
+991
+992
+993
+994
+995
+996
+997
+998
+999
+1000
+1001
+1002
+1003
+1004
+1005
+1006
+1007
+1008
+1009
+1010
+1011
+1012
+1013
+1014
+1015
+1016
+1017
+1018
+1019
+1020
+1021
+1022
+1023
+1024
+1025
+1026
+1027
+1028
+1029
+1030
+1031
+1032
+1033
+1034
+1035
+1036
+1037
+1038
+1039
+1040
+1041
+1042
+1043
+1044
+1045
+1046
+1047
+1048
+1049
+1050
+1051
+1052
+1053
+1054
+1055
+1056
+1057
+1058
+1059
+1060
+1061
+1062
+1063
+1064
+1065
+1066
+1067
+1068
+1069
+1070
+1071
+1072
+1073
+1074
+1075
+1076
+1077
+1078
+1079
+1080
+1081
+1082
+1083
+1084
+1085
+1086
+1087
+1088
+1089
+1090
+1091
+1092
+1093
+1094
+1095
+1096
+1097
+1098
+1099
+1100
+1101
+1102
+1103
+1104
+1105
+1106
+1107
+1108
+1109
+1110
+1111
+1112
+1113
+1114
+1115
+1116
+1117
+1118
+1119
+1120
+1121
+1122
+1123
+1124
+1125
+1126
+1127
+1128
+1129
+1130
+1131
+1132
+1133
+1134
+1135
+1136
+1137
+1138
+1139
+1140
+1141
+1142
+1143
+1144
+1145
+1146
+1147
+1148
+1149
+1150
+1151
+1152
+1153
+1154
+1155
+1156
+1157
+1158
+1159
+1160
+1161
+1162
+1163
+1164
+1165
+1166
+1167
+1168
+1169
+1170
+1171
+1172
+1173
+1174
+1175
+1176
+1177
+1178
+1179
+1180
+1181
+1182
+1183
+1184
+1185
+1186
+1187
+1188
+1189
+1190
+1191
+1192
+1193
+1194
+1195
+1196
+1197
+1198
+1199
+1200
+1201
+1202
+1203
+1204
+1205
+1206
+1207
+1208
+1209
+1210
+1211
+1212
+1213
+1214
+1215
+1216
+1217
+1218
+1219
+1220
+1221
+1222
+1223
+1224
+1225
+1226
+1227
+1228
+1229
+1230
+1231
+1232
+1233
+1234
+1235
+1236
+1237
+1238
+1239
+1240
+1241
+1242
+1243
+1244
+1245
+1246
+1247
+1248
+1249
+1250
+1251
+1252
+1253
+1254
+1255
+1256
+1257
+1258
+1259
+1260
+1261
+1262
+1263
+1264
+1265
+1266
+1267
+1268
+1269
+1270
+1271
+1272
+1273
+1274
+1275
+1276
+1277
+1278
+1279
+1280
+1281
+1282
+1283
+1284
+1285
+1286
+1287
+1288
+1289
+1290
+1291
+1292
+1293
+1294
+1295
+1296
+1297
+1298
+1299
+1300
+1301
+1302
+1303
+1304
+1305
+1306
+1307
+1308
+1309
+1310
+1311
+1312
+1313
+1314
+1315
+1316
+1317
+1318
+1319
+1320
+1321
+1322
+1323
+1324
+1325
+1326
+1327
+1328
+1329
+1330
+1331
+1332
+1333
+1334
+1335
+1336
+1337
+1338
+1339
+1340
+1341
+1342
+1343
+1344
+1345
+1346
+1347
+1348
+1349
+1350
+1351
+1352
+1353
+1354
+1355
+1356
+1357
+1358
+1359
+1360
+1361
+1362
+1363
+1364
+1365
+1366
+1367
+1368
+1369
+1370
+1371
+1372
+1373
+1374
+1375
+1376
+1377
+1378
+1379
+1380
+1381
+1382
+1383
+1384
+1385
+1386
+1387
+1388
+1389
+1390
+1391
+1392
+1393
+1394
+1395
+1396
+1397
+1398
+1399
+1400
+1401
+1402
+1403
+1404
+1405
+1406
+1407
+1408
+1409
+1410
+1411
+1412
+1413
+1414
+1415
+1416
+1417
+1418
+1419
+1420
+1421
+1422
+1423
+1424
+1425
+1426
+1427
+1428
+1429
+1430
+1431
+1432
+1433
+1434
+1435
+1436
+1437
+1438
+1439
+1440
+1441
+1442
+1443
+1444
+1445
+1446
+1447
+1448
+1449
+1450
+1451
+1452
+1453
+1454
+1455
+1456
+1457
+1458
+1459
+1460
+1461
+1462
+1463
+1464
+1465
+1466
+1467
+1468
+1469
+1470
+1471
+1472
+1473
+1474
+1475
+1476
+1477
+1478
+1479
+1480
+1481
+1482
+1483
+1484
+1485
+1486
+1487
+1488
+1489
+1490
+1491
+1492
+1493
+1494
+1495
+1496
+1497
+1498
+1499
+1500
+1501
+1502
+1503
+1504
+1505
+1506
+1507
+1508
+1509
+1510
+1511
+1512
+1513
+1514
+1515
+1516
+1517
+1518
+1519
+1520
+1521
+1522
+1523
+1524
+1525
+1526
+1527
+1528
+1529
+1530
+1531
+1532
+1533
+1534
+1535
+1536
+1537
+1538
+1539
+1540
+1541
+1542
+1543
+1544
+1545
+1546
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use std::collections::{HashMap, HashSet};
+use std::fmt::Debug;
+use std::ops::Try;
+use std::path::{Path, PathBuf};
+use std::str::FromStr;
+use std::sync::Arc;
+use std::time::{Duration, Instant};
+
+use derivative::Derivative;
+use fluence_app_service::TomlMarineNamedModuleConfig;
+use fluence_keypair::Signature;
+use libp2p::core::Multiaddr;
+use libp2p::kad::KBucketKey;
+use libp2p::kad::K_VALUE;
+use libp2p::PeerId;
+use multihash::Multihash;
+use serde::{Deserialize, Serialize};
+use serde_json::{json, Value as JValue, Value};
+use tokio::sync::RwLock;
+use JValue::Array;
+
+use connection_pool::ConnectionPoolApi;
+use connection_pool::ConnectionPoolT;
+use fs_utils::create_dirs;
+use fs_utils::to_abs_path;
+use health::HealthCheckRegistry;
+use kademlia::KademliaApi;
+use kademlia::KademliaApiT;
+use now_millis::now_ms;
+use now_millis::now_sec;
+use particle_args::from_base58;
+use particle_args::Args;
+use particle_args::ArgsError;
+use particle_args::JError;
+use particle_execution::FunctionOutcome;
+use particle_execution::ParticleParams;
+use particle_execution::ServiceFunction;
+use particle_modules::AddBlueprint;
+use particle_modules::EffectorsMode;
+use particle_modules::ModuleConfig;
+use particle_modules::ModuleRepository;
+use particle_modules::NamedModuleConfig;
+use particle_modules::WASIConfig;
+use particle_protocol::Contact;
+use particle_services::ParticleAppServices;
+use particle_services::ParticleAppServicesConfig;
+use particle_services::PeerScope;
+use particle_services::ServiceInfo;
+use particle_services::ServiceType;
+use peer_metrics::ServicesMetrics;
+use service_modules::Hash;
+use types::peer_id;
+use types::peer_scope::WorkerId;
+use uuid_utils::uuid;
+use workers::KeyStorage;
+use workers::PeerScopes;
+use workers::Workers;
+
+use crate::debug::fmt_custom_services;
+use crate::error::HostClosureCallError;
+use crate::error::HostClosureCallError::DecodeBase58;
+use crate::error::HostClosureCallError::DecodeUTF8;
+use crate::func::binary;
+use crate::func::unary;
+use crate::json;
+use crate::math;
+use crate::outcome::ok;
+use crate::outcome::wrap;
+use crate::outcome::wrap_unit;
+
+pub struct CustomService {
+    /// (function_name -> service function)
+    pub functions: HashMap<String, ServiceFunction>,
+    /// if set, all `function_name` mismatches with `custom_service.functions` will be routed to `fallback`
+    pub fallback: Option<ServiceFunction>,
+}
+
+impl CustomService {
+    pub fn new(funcs: Vec<(&str, ServiceFunction)>, fallback: Option<ServiceFunction>) -> Self {
+        Self {
+            functions: funcs
+                .into_iter()
+                .map(|(name, f)| (name.to_string(), f))
+                .collect(),
+            fallback,
+        }
+    }
+}
+
+#[derive(Derivative)]
+#[derivative(Debug)]
+pub struct Builtins<C> {
+    pub connectivity: C,
+    pub modules: ModuleRepository,
+    pub services: ParticleAppServices,
+    #[derivative(Debug(format_with = "fmt_custom_services"))]
+    pub custom_services: RwLock<HashMap<String, CustomService>>,
+    #[derivative(Debug = "ignore")]
+    workers: Arc<Workers>,
+    #[derivative(Debug = "ignore")]
+    key_storage: Arc<KeyStorage>,
+    #[derivative(Debug = "ignore")]
+    scopes: PeerScopes,
+    config: BuiltinsConfig,
+}
+
+#[derive(Debug)]
+pub struct BuiltinsConfig {
+    pub particle_app_services: ParticleAppServicesConfig,
+    /// Dir to store .wasm modules and their configs
+    pub modules_dir: PathBuf,
+    /// Path of the blueprint directory containing blueprints and wasm modules
+    pub blueprint_dir: PathBuf,
+    /// Is in the developer mode
+    pub is_dev_mode: bool,
+    /// Mapping of binary names to their paths for mounted binaries used in developer mode
+    pub mounted_binaries_mapping: HashMap<String, PathBuf>,
+    /// List of allowed effector modules by CID
+    pub allowed_effectors: HashMap<Hash, HashMap<String, PathBuf>>,
+}
+
+impl BuiltinsConfig {
+    pub fn new(
+        particle_app_services: ParticleAppServicesConfig,
+        persistent_dir: PathBuf,
+        allowed_effectors: HashMap<Hash, HashMap<String, PathBuf>>,
+        mounted_binaries_mapping: HashMap<String, PathBuf>,
+        is_dev_mode: bool,
+    ) -> Result<Self, std::io::Error> {
+        let persistent_dir = to_abs_path(persistent_dir);
+
+        let blueprint_dir = config_utils::blueprint_dir(&persistent_dir);
+        let modules_dir = config_utils::modules_dir(&persistent_dir);
+
+        create_dirs(&[&blueprint_dir, &modules_dir])?;
+
+        let allowed_effectors = allowed_effectors
+            .into_iter()
+            .map(|(cid, effector)| {
+                let effector = effector
+                    .into_iter()
+                    .map(|(name, path)| {
+                        let path_str = path.display();
+                        match path.try_exists() {
+                            Err(err) => tracing::warn!(
+                                "cannot check binary `{path_str}` for effector `{cid}`: {err}"
+                            ),
+                            Ok(false) => tracing::warn!(
+                                "binary `{path_str}` for effector `{cid}` does not exist"
+                            ),
+                            _ => {}
+                        };
+                        (name, path.to_path_buf())
+                    })
+                    .collect::<_>();
+                (cid, effector)
+            })
+            .collect::<_>();
+
+        let mounted_binaries_mapping = if !is_dev_mode {
+            HashMap::new()
+        } else {
+            mounted_binaries_mapping
+                .into_iter()
+                .map(|(name, path)| {
+                    let path_str = path.display();
+                    match path.try_exists() {
+                        Err(err) => tracing::warn!("cannot check binary `{path_str}`: {err}"),
+                        Ok(false) => tracing::warn!("binary `{path_str}` does not exist"),
+                        _ => {}
+                    };
+                    (name, path.to_path_buf())
+                })
+                .collect::<_>()
+        };
+        Ok(Self {
+            particle_app_services,
+            blueprint_dir,
+            modules_dir,
+            allowed_effectors,
+            mounted_binaries_mapping,
+            is_dev_mode,
+        })
+    }
+}
+
+impl<C> Builtins<C>
+where
+    C: Clone + Send + Sync + 'static + AsRef<KademliaApi> + AsRef<ConnectionPoolApi>,
+{
+    pub fn new(
+        config: BuiltinsConfig,
+        connectivity: C,
+        services_metrics: ServicesMetrics,
+        key_storage: Arc<KeyStorage>,
+        workers: Arc<Workers>,
+        scope: PeerScopes,
+        health_registry: Option<&mut HealthCheckRegistry>,
+    ) -> Self {
+        let effectors_mode = if config.is_dev_mode {
+            EffectorsMode::all_effectors(
+                config.allowed_effectors.clone(),
+                config.mounted_binaries_mapping.clone(),
+            )
+        } else {
+            EffectorsMode::restricted_effectors(config.allowed_effectors.clone())
+        };
+        let modules_dir = &config.modules_dir;
+        let blueprint_dir = &config.blueprint_dir;
+
+        let modules = ModuleRepository::new(modules_dir, blueprint_dir, effectors_mode);
+        let services = ParticleAppServices::new(
+            config.particle_app_services.clone(),
+            modules.clone(),
+            Some(services_metrics),
+            health_registry,
+            workers.clone(),
+            scope.clone(),
+        )
+        .expect("TODO async-marine: handle error from ParticleAppServices");
+
+        Self {
+            connectivity,
+            modules,
+            services,
+            workers,
+            custom_services: <_>::default(),
+            key_storage,
+            scopes: scope,
+            config,
+        }
+    }
+
+    pub async fn call(&self, args: Args, particle: ParticleParams) -> FunctionOutcome {
+        let mut start = Instant::now();
+        let result = self.builtins_call(args, particle).await;
+        let result = match result {
+            FunctionOutcome::NotDefined { args, params } => {
+                start = Instant::now();
+                self.custom_service_call(args, params).await
+            }
+            result => result,
+        };
+        let end = start.elapsed().as_secs();
+
+        match result {
+            FunctionOutcome::NotDefined { args, params } => self.call_service(args, params).await,
+            result => {
+                if let Some(metrics) = self.services.metrics.as_ref() {
+                    metrics.observe_builtins(result.not_err(), end as f64);
+                }
+                result
+            }
+        }
+    }
+
+    pub async fn custom_service_call(
+        &self,
+        args: Args,
+        particle: ParticleParams,
+    ) -> FunctionOutcome {
+        if let Some(function) = self
+            .custom_services
+            .read()
+            .await
+            .get(&args.service_id)
+            .and_then(|fs| {
+                fs.functions
+                    .get(&args.function_name)
+                    .or(fs.fallback.as_ref())
+            })
+        {
+            function.call(args, particle).await
+        } else {
+            FunctionOutcome::NotDefined {
+                args,
+                params: particle,
+            }
+        }
+    }
+
+    // TODO: get rid of all blocking methods (std::fs and such)
+    pub async fn builtins_call(&self, args: Args, particle: ParticleParams) -> FunctionOutcome {
+        use Result as R;
+
+        #[rustfmt::skip]
+        match (args.service_id.as_str(), args.function_name.as_str()) {
+            ("peer", "timestamp_ms") => ok(json!(now_ms() as u64)),
+            ("peer", "timestamp_sec") => ok(json!(now_sec())),
+            ("peer", "is_connected") => wrap(self.is_connected(args).await),
+            ("peer", "connect") => wrap(self.connect(args, particle).await),
+            ("peer", "get_contact") => self.get_contact(args).await,
+            ("peer", "timeout") => self.timeout(args).await,
+
+            ("kad", "neighborhood") => wrap(self.neighborhood(args).await),
+            ("kad", "neigh_with_addrs") => wrap(self.neighborhood_with_addresses(args).await),
+            ("kad", "merge") => wrap(self.kad_merge(args.function_args)),
+
+            ("srv", "list") => ok(self.list_services(particle).await),
+            ("srv", "create") => wrap(self.create_service(args, particle).await),
+            ("srv", "get_interface") => wrap(self.get_interface(args, particle).await),
+            ("srv", "resolve_alias") => wrap(self.resolve_alias(args, particle).await),
+            ("srv", "resolve_alias_opt") => wrap(self.resolve_alias_opt(args, particle).await),
+            ("srv", "add_alias") => wrap_unit(self.add_alias(args, particle).await),
+            ("srv", "remove") => wrap_unit(self.remove_service(args, particle).await),
+            ("srv", "info") => wrap(self.get_service_info(args, particle).await),
+
+            ("dist", "add_module_from_vault") => wrap(self.add_module_from_vault(args, particle).await),
+            ("dist", "add_module") => wrap(self.add_module(args, particle).await),
+            ("dist", "add_module_bytes_from_vault") => wrap(self.add_module_bytes_from_vault(args, particle).await),
+            ("dist", "add_blueprint") => wrap(self.add_blueprint(args, particle).await),
+            ("dist", "make_module_config") => wrap(make_module_config(args)),
+            ("dist", "load_module_config") => wrap(self.load_module_config_from_vault(args, particle)),
+            ("dist", "default_module_config") => wrap(self.default_module_config(args)),
+            ("dist", "make_blueprint") => wrap(self.make_blueprint(args)),
+            ("dist", "load_blueprint") => wrap(self.load_blueprint_from_vault(args, particle)),
+            ("dist", "list_modules") => wrap(self.list_modules()),
+            ("dist", "get_module_interface") => wrap(self.get_module_interface(args)),
+            ("dist", "list_blueprints") => wrap(self.get_blueprints()),
+            ("dist", "get_blueprint") => wrap(self.get_blueprint(args)),
+
+            ("op", "noop") => FunctionOutcome::Empty,
+            ("op", "array") => ok(Array(args.function_args)),
+            ("op", "array_length") => wrap(self.array_length(args.function_args)),
+            ("op", "concat") => wrap(self.concat(args.function_args)),
+            ("op", "string_to_b58") => wrap(self.string_to_b58(args.function_args)),
+            ("op", "string_from_b58") => wrap(self.string_from_b58(args.function_args)),
+            ("op", "bytes_from_b58") => wrap(self.bytes_from_b58(args.function_args)),
+            ("op", "bytes_to_b58") => wrap(self.bytes_to_b58(args.function_args)),
+            ("op", "sha256_string") => wrap(self.sha256_string(args.function_args)),
+            ("op", "concat_strings") => wrap(self.concat_strings(args.function_args)),
+            ("op", "identity") => self.identity(args.function_args),
+
+            ("debug", "stringify") => self.stringify(args.function_args),
+
+            ("stat", "service_memory") => wrap(self.service_mem_stats(args, particle).await),
+            ("stat", "service_stat") => wrap(self.service_stat(args, particle).await),
+
+            ("math", "add") => binary(args, |x: i64, y: i64| -> R<i64, _> { math::add(x, y) }),
+            ("math", "sub") => binary(args, |x: i64, y: i64| -> R<i64, _> { math::sub(x, y) }),
+            ("math", "mul") => binary(args, |x: i64, y: i64| -> R<i64, _> { math::mul(x, y) }),
+            ("math", "fmul") => binary(args, |x: f64, y: f64| -> R<i64, _> { math::fmul_floor(x, y) }),
+            ("math", "div") => binary(args, |x: i64, y: i64| -> R<i64, _> { math::div(x, y) }),
+            ("math", "rem") => binary(args, |x: i64, y: i64| -> R<i64, _> { math::rem(x, y) }),
+            ("math", "pow") => binary(args, |x: i64, y: u32| -> R<i64, _> { math::pow(x, y) }),
+            ("math", "log") => binary(args, |x: i64, y: i64| -> R<u32, _> { math::log(x, y) }),
+
+            ("cmp", "gt") => binary(args, |x: i64, y: i64| -> R<bool, _> { math::gt(x, y) }),
+            ("cmp", "gte") => binary(args, |x: i64, y: i64| -> R<bool, _> { math::gte(x, y) }),
+            ("cmp", "lt") => binary(args, |x: i64, y: i64| -> R<bool, _> { math::lt(x, y) }),
+            ("cmp", "lte") => binary(args, |x: i64, y: i64| -> R<bool, _> { math::lte(x, y) }),
+            ("cmp", "cmp") => binary(args, |x: i64, y: i64| -> R<i8, _> { math::cmp(x, y) }),
+
+            ("array", "sum") => unary(args, |xs: Vec<i64>| -> R<i64, _> { math::array_sum(xs) }),
+            ("array", "dedup") => unary(args, |xs: Vec<String>| -> R<Vec<String>, _> { math::dedup(xs) }),
+            ("array", "intersect") => binary(args, |xs: HashSet<String>, ys: HashSet<String>| -> R<Vec<String>, _> { math::intersect(xs, ys) }),
+            ("array", "diff") => binary(args, |xs: HashSet<String>, ys: HashSet<String>| -> R<Vec<String>, _> { math::diff(xs, ys) }),
+            ("array", "sdiff") => binary(args, |xs: HashSet<String>, ys: HashSet<String>| -> R<Vec<String>, _> { math::sdiff(xs, ys) }),
+            ("array", "slice") => wrap(self.array_slice(args.function_args)),
+            ("array", "length") => wrap(self.array_length(args.function_args)),
+
+            ("sig", "sign") => wrap(self.sign(args, particle)),
+            ("sig", "verify") => wrap(self.verify(args, particle)),
+            ("sig", "get_peer_id") => wrap(self.get_peer_id(particle)),
+
+            ("json", "obj") => wrap(json::obj(args)),
+            ("json", "put") => wrap(json::put(args)),
+            ("json", "puts") => wrap(json::puts(args)),
+            ("json", "parse") => unary(args, |s: String| -> R<JValue, _> { json::parse(&s) }),
+            ("json", "stringify") => unary(args, |v: JValue| -> R<String, _> { Ok(json::stringify(v)) }),
+            ("json", "obj_pairs") => unary(args, |vs: Vec<(String, JValue)>| -> R<JValue, _> { json::obj_from_pairs(vs) }),
+            ("json", "puts_pairs") => binary(args, |obj: JValue, vs: Vec<(String, JValue)>| -> R<JValue, _> { json::puts_from_pairs(obj, vs) }),
+
+            ("vault", "put") => wrap(self.vault_put(args, particle)),
+            ("vault", "cat") => wrap(self.vault_cat(args, particle)),
+
+            ("vm", "create") => wrap(self.create_vm(args, particle).await),
+            ("vm", "reboot") => wrap(self.reboot_vm(args, particle)),
+            ("vm", "reset") => wrap(self.reset_vm(args, particle)),
+            ("vm", "stop") => wrap(self.stop_vm(args, particle)),
+            ("vm", "start") => wrap(self.start_vm(args, particle)),
+            ("vm", "status") => wrap(self.status_vm(args, particle)),
+
+            ("run-console", "print") => {
+                self.guard_protected(&particle).await?;
+
+                let function_args = args.function_args.iter();
+                let decider = function_args.filter_map(JValue::as_str).any(|s| s.contains("decider"));
+                if decider {
+                    // if log comes from decider, log it as INFO
+                    log::info!(target: "run-console", "{}", json!(args.function_args));
+                } else {
+                    // log everything else as DEBUG
+                    log::debug!(target: "run-console", "{}", json!(args.function_args));
+                }
+                wrap_unit(Ok(()))
+            }
+            // NOTE: must be the same as in ServiceKey::AquaIpfs
+            // TODO: come up with some better way of restricting service access like aqua-ipfs
+            ("aqua-ipfs", _) => {
+                // If the call is on Host, we check that the caller is a host, a manager or
+                // a worker spell. Otherwise we allow the call to go and find an aqua-ipfs service
+                // since it can be a user-defined service which isn't the same as system aqua-ipfs.
+                // Allow anything when in the Dev Mode
+                if !self.config.is_dev_mode && matches!(particle.peer_scope, PeerScope::Host) {
+                    self.guard_protected(&particle).await?;
+                }
+                FunctionOutcome::NotDefined { args, params: particle }
+            }
+            _ => FunctionOutcome::NotDefined { args, params: particle },
+        }
+    }
+
+    async fn neighbor_peers(&self, args: Args) -> Result<Vec<PeerId>, JError> {
+        let mut args = args.function_args.into_iter();
+        let key = from_base58("key", &mut args)?;
+        let already_hashed: Option<bool> = Args::next_opt("already_hashed", &mut args)?;
+        let count: Option<usize> = Args::next_opt("count", &mut args)?;
+        let count = count.unwrap_or_else(|| K_VALUE.get());
+
+        let key = if already_hashed == Some(true) {
+            Multihash::from_bytes(&key)?
+        } else {
+            Multihash::wrap(0x12, &key[..])?
+        };
+        let neighbors = self.kademlia().neighborhood(key, count).await?;
+
+        Ok(neighbors)
+    }
+
+    async fn neighborhood(&self, args: Args) -> Result<JValue, JError> {
+        let neighbors = self.neighbor_peers(args).await?;
+        let neighbors = json!(neighbors
+            .into_iter()
+            .map(|id| id.to_string())
+            .collect::<Vec<_>>());
+
+        Ok(neighbors)
+    }
+
+    async fn neighborhood_with_addresses(&self, args: Args) -> Result<JValue, JError> {
+        use futures::stream::FuturesUnordered;
+        use futures::StreamExt;
+
+        let neighbors = self.neighbor_peers(args).await?;
+        let neighbors = neighbors
+            .into_iter()
+            .map(|peer| async move {
+                let contact = self.connection_pool().get_contact(peer).await;
+                (peer, contact)
+            })
+            .collect::<FuturesUnordered<_>>()
+            .map(|(peer_id, contact)| {
+                json!({
+                    "peer_id": peer_id.to_string(),
+                    "addresses": contact.map(|c| c.addresses).unwrap_or_default()
+                })
+            })
+            .collect::<Vec<_>>()
+            .await;
+        let neighbors = json!(neighbors);
+
+        Ok(neighbors)
+    }
+
+    async fn is_connected(&self, args: Args) -> Result<JValue, JError> {
+        let peer: String = Args::next("peer_id", &mut args.function_args.into_iter())?;
+        let peer = PeerId::from_str(peer.as_str())?;
+        let ok = self.connection_pool().is_connected(peer).await;
+        Ok(json!(ok))
+    }
+
+    async fn connect(&self, args: Args, params: ParticleParams) -> Result<JValue, JError> {
+        let mut args = args.function_args.into_iter();
+
+        let peer_id: String = Args::next("peer_id", &mut args)?;
+        let peer_id = PeerId::from_str(peer_id.as_str())?;
+        let addrs: Vec<Multiaddr> = Args::next_opt("addresses", &mut args)?.unwrap_or_default();
+
+        self.guard_protected(&params).await?;
+
+        let contact = Contact::new(peer_id, addrs);
+
+        let ok = self.connection_pool().connect(contact).await;
+        Ok(json!(ok))
+    }
+
+    async fn get_contact(&self, args: Args) -> FunctionOutcome {
+        let peer: String = Args::next("peer_id", &mut args.function_args.into_iter())?;
+        let peer = PeerId::from_str(peer.as_str())?;
+        let contact = self.connection_pool().get_contact(peer).await;
+        match contact {
+            Some(c) => FunctionOutcome::Ok(json!(c)),
+            None => FunctionOutcome::Empty,
+        }
+    }
+
+    async fn timeout(&self, args: Args) -> FunctionOutcome {
+        use std::future::pending;
+
+        let mut args = args.function_args.into_iter();
+
+        let dur_field = "duration_ms";
+        let duration = parse_from_str(dur_field, &mut args)?;
+        let duration = duration.ok_or(ArgsError::MissingField(dur_field))?;
+        let duration = Duration::from_millis(duration);
+
+        let message = Args::next_opt("message", &mut args)?;
+
+        // sleep for `duration`
+        tokio::time::timeout(duration, pending::<()>()).await.ok();
+
+        message
+            .map(|msg: String| FunctionOutcome::Ok(msg.into()))
+            .unwrap_or(FunctionOutcome::Empty)
+    }
+
+    fn string_to_b58(&self, args: Vec<serde_json::Value>) -> Result<JValue, JError> {
+        let mut args = args.into_iter();
+        let string: String = Args::next("string", &mut args)?;
+        let b58 = bs58::encode(string).into_string();
+        Ok(JValue::String(b58))
+    }
+
+    /// Attempts to decode UTF8 string from a given base58 string
+    /// May fail at base58 decoding and on UTF8 decoding
+    fn string_from_b58(&self, args: Vec<serde_json::Value>) -> Result<JValue, JError> {
+        let mut args = args.into_iter();
+        let string: String = Args::next("b58_string", &mut args)?;
+        let vec = bs58::decode(string).into_vec().map_err(DecodeBase58)?;
+        let string = String::from_utf8(vec).map_err(DecodeUTF8)?;
+        Ok(JValue::String(string))
+    }
+
+    fn bytes_from_b58(&self, args: Vec<serde_json::Value>) -> Result<JValue, JError> {
+        let mut args = args.into_iter();
+        let string: String = Args::next("b58_string", &mut args)?;
+        let vec = bs58::decode(string).into_vec().map_err(DecodeBase58)?;
+        Ok(json!(vec))
+    }
+
+    fn bytes_to_b58(&self, args: Vec<serde_json::Value>) -> Result<JValue, JError> {
+        let mut args = args.into_iter();
+        let bytes: Vec<u8> = Args::next("bytes", &mut args)?;
+        let string = bs58::encode(bytes).into_string();
+        Ok(JValue::String(string))
+    }
+
+    /// Returns SHA256 of the passed string
+    /// Accepts 3 arguments:
+    /// `string` – string to hash
+    /// `digest_only` boolean – if set to true, return only SHA256 digest, otherwise (by default) – full multihash
+    /// `as_bytes` boolean - if set to true, return result as array of bytes, otherwise (by default) – as base58 string
+    fn sha256_string(&self, args: Vec<serde_json::Value>) -> Result<JValue, JError> {
+        let mut args = args.into_iter();
+        let string: String = Args::next("string", &mut args)?;
+        let digest_only: Option<bool> = Args::next_opt("digest_only", &mut args)?;
+        let as_bytes: Option<bool> = Args::next_opt("as_bytes", &mut args)?;
+        let multihash: Multihash<64> = Multihash::wrap(0x12, string.as_bytes())?;
+
+        let result = if digest_only == Some(true) {
+            multihash.digest().to_vec()
+        } else {
+            multihash.to_bytes()
+        };
+
+        if as_bytes == Some(true) {
+            Ok(json!(result))
+        } else {
+            let b58 = bs58::encode(result).into_string();
+            Ok(JValue::String(b58))
+        }
+    }
+
+    /// Merge, sort by distance to first key, return top K
+    /// K is optional. If not passed, all elements are returned.
+    fn kad_merge(&self, args: Vec<serde_json::Value>) -> Result<JValue, JError> {
+        let mut args = args.into_iter();
+        let target: String = Args::next("target", &mut args)?;
+        let left: Vec<String> = Args::next("left", &mut args)?;
+        let right: Vec<String> = Args::next("right", &mut args)?;
+        let count: Option<usize> = Args::next_opt("count", &mut args)?;
+        let count = count.unwrap_or_else(|| K_VALUE.get());
+
+        let target = bs58::decode(target).into_vec().map_err(DecodeBase58)?;
+        let target = KBucketKey::from(target);
+        let left = left.into_iter();
+        let right = right.into_iter();
+
+        let mut keys: Vec<KBucketKey<_>> = left
+            .chain(right)
+            .map(|b58_str| {
+                Ok(KBucketKey::from(
+                    bs58::decode(b58_str).into_vec().map_err(DecodeBase58)?,
+                ))
+            })
+            .collect::<Result<Vec<_>, HostClosureCallError>>()?;
+        keys.sort_by_cached_key(|k| target.distance(k.as_ref()));
+        keys.dedup();
+
+        let keys = keys
+            .into_iter()
+            .map(|k| bs58::encode(k.into_preimage()).into_string());
+
+        let keys: Vec<_> = keys.take(count).collect();
+
+        Ok(json!(keys))
+    }
+
+    fn identity(&self, args: Vec<serde_json::Value>) -> FunctionOutcome {
+        if args.len() > 1 {
+            FunctionOutcome::Err(JError::new(format!(
+                "identity accepts up to 1 arguments, received {} arguments",
+                args.len()
+            )))
+        } else {
+            Try::from_output(args.into_iter().next())
+        }
+    }
+
+    fn stringify(&self, args: Vec<serde_json::Value>) -> FunctionOutcome {
+        let debug = if args.is_empty() {
+            // return valid JSON string
+            r#""<empty argument list>""#.to_string()
+        } else if args.len() == 1 {
+            args[0].to_string()
+        } else {
+            JValue::Array(args).to_string()
+        };
+
+        FunctionOutcome::Ok(JValue::String(debug))
+    }
+
+    /// Flattens an array of arrays
+    fn concat(&self, args: Vec<serde_json::Value>) -> Result<JValue, JError> {
+        let flattened: Vec<JValue> =
+            args.into_iter()
+                .enumerate()
+                .try_fold(vec![], |mut acc, (i, v)| match v {
+                    JValue::Array(mut array) => {
+                        acc.append(&mut array);
+                        Ok(acc)
+                    }
+                    _ => Err(JError::new(format!(
+                        "all arguments of 'concat' must be arrays: argument #{i} is not"
+                    ))),
+                })?;
+
+        Ok(JValue::Array(flattened))
+    }
+
+    /// Concatenates an array of arrays
+    fn concat_strings(&self, args: Vec<serde_json::Value>) -> Result<JValue, JError> {
+        let string: String =
+            args.into_iter()
+                .enumerate()
+                .try_fold(String::new(), |mut acc, (i, v)| match v {
+                    JValue::String(s) => {
+                        acc.push_str(&s);
+                        Ok(acc)
+                    }
+                    _ => Err(JError::new(format!(
+                        "all arguments of 'concat_strings' must be strings: argument #{i} is not"
+                    ))),
+                })?;
+
+        Ok(JValue::String(string))
+    }
+
+    fn array_length(&self, args: Vec<serde_json::Value>) -> Result<JValue, JError> {
+        match &args[..] {
+            [JValue::Array(array)] => Ok(json!(array.len())),
+            [_] => Err(JError::new("op array_length's argument must be an array")),
+            arr => Err(JError::new(format!(
+                "op array_length accepts exactly 1 argument: {} found",
+                arr.len()
+            ))),
+        }
+    }
+
+    /// takes a range of values from an array
+    /// slice(array: []JValue, start: usize, end: usize) -> []JValue
+    fn array_slice(&self, args: Vec<serde_json::Value>) -> Result<JValue, JError> {
+        let (array, start, end) = if let [array, start, end] = &args[..] {
+            (array, start, end)
+        } else {
+            return Err(JError::new(
+                "invalid number of parameters. need array, start index and end index",
+            ));
+        };
+
+        let array = match array {
+            JValue::Array(arr) if arr.is_empty() => return Ok(json!([])),
+            JValue::Array(arr) => arr,
+            e => {
+                return Err(JError::new(format!(
+                    "first argument must be an array, was {e}"
+                )));
+            }
+        };
+
+        let start = match start.as_u64() {
+            Some(n) => n as usize,
+            _ => {
+                return Err(JError::new(format!(
+                    "second argument (start index) must be an unsigned integer, was {start}"
+                )));
+            }
+        };
+
+        let end = match end.as_u64() {
+            Some(n) => n as usize,
+            _ => {
+                return Err(JError::new(format!(
+                    "third argument (end index) must be an unsigned integer, was {end}"
+                )));
+            }
+        };
+
+        if start > end || end > array.len() {
+            return Err(JError::new(format!(
+                "slice indexes out of bounds. start index: {:?}, end index: {:?}, array length: {:?}",
+                start, end, array.len())
+            ));
+        }
+
+        let slice: Vec<JValue> = array[start..end].to_vec();
+        Ok(JValue::Array(slice))
+    }
+
+    async fn add_module(&self, args: Args, params: ParticleParams) -> Result<JValue, JError> {
+        let mut args = args.function_args.into_iter();
+        let module_bytes: String = Args::next("module_bytes", &mut args)?;
+        let config = Args::next("config", &mut args)?;
+
+        self.guard_protected(&params).await?;
+        let hash = self.modules.add_module_base64(module_bytes, config)?;
+
+        Ok(json!(hash))
+    }
+
+    async fn add_module_from_vault(
+        &self,
+        args: Args,
+        params: ParticleParams,
+    ) -> Result<JValue, JError> {
+        let mut args = args.function_args.into_iter();
+        let module_path: String = Args::next("module_path", &mut args)?;
+        let config: TomlMarineNamedModuleConfig = Args::next("config", &mut args)?;
+
+        self.guard_protected(&params).await?;
+
+        let module_hash = self.modules.add_module_from_vault(
+            &self.services.vault,
+            self.scopes.to_peer_id(params.peer_scope),
+            config.name,
+            module_path,
+            params,
+        )?;
+
+        Ok(json!(module_hash))
+    }
+
+    async fn add_module_bytes_from_vault(
+        &self,
+        args: Args,
+        params: ParticleParams,
+    ) -> Result<Value, JError> {
+        let mut args = args.function_args.into_iter();
+        let module_name: String = Args::next("module_name", &mut args)?;
+        let module_path: String = Args::next("module_path", &mut args)?;
+
+        self.guard_protected(&params).await?;
+
+        let module_hash = self.modules.add_module_from_vault(
+            &self.services.vault,
+            self.scopes.to_peer_id(params.peer_scope),
+            module_name,
+            module_path,
+            params,
+        )?;
+
+        Ok(json!(module_hash))
+    }
+
+    async fn add_blueprint(&self, args: Args, params: ParticleParams) -> Result<JValue, JError> {
+        let mut args = args.function_args.into_iter();
+        let blueprint: String = Args::next("blueprint", &mut args)?;
+
+        self.guard_protected(&params).await?;
+
+        let blueprint = AddBlueprint::decode(blueprint.as_bytes()).map_err(|err| {
+            JError::new(format!("Error deserializing blueprint from IPLD: {err}"))
+        })?;
+        let blueprint_id = self.modules.add_blueprint(blueprint)?;
+        Ok(JValue::String(blueprint_id))
+    }
+
+    fn load_module_config_from_vault(
+        &self,
+        args: Args,
+        params: ParticleParams,
+    ) -> Result<JValue, JError> {
+        let mut args = args.function_args.into_iter();
+        let config_path: String = Args::next("config_path", &mut args)?;
+
+        let config = ModuleRepository::load_module_config_from_vault(
+            &self.services.vault,
+            self.scopes.to_peer_id(params.peer_scope),
+            config_path,
+            params,
+        )?;
+        let config = serde_json::to_value(config)
+            .map_err(|err| JError::new(format!("Error serializing config to JSON: {err}")))?;
+
+        Ok(config)
+    }
+    fn default_module_config(&self, args: Args) -> Result<JValue, JError> {
+        let mut args = args.function_args.into_iter();
+        let module_name: String = Args::next("module_name", &mut args)?;
+
+        let config = NamedModuleConfig {
+            name: module_name,
+            load_from: None,
+            file_name: None,
+            config: <_>::default(),
+        };
+        let config = serde_json::to_value(config)
+            .map_err(|err| JError::new(format!("Error serializing config to JSON: {err}")))?;
+
+        Ok(config)
+    }
+
+    fn make_blueprint(&self, args: Args) -> Result<JValue, JError> {
+        let mut args = args.function_args.into_iter();
+        let name = Args::next("name", &mut args)?;
+        let dependencies = Args::next("dependencies", &mut args)?;
+        let blueprint = AddBlueprint { name, dependencies };
+
+        let blueprint = blueprint
+            .to_string()
+            .map_err(|err| JError::new(format!("Error serializing blueprint to IPLD: {err}")))?;
+        Ok(json!(blueprint))
+    }
+
+    fn load_blueprint_from_vault(
+        &self,
+        args: Args,
+        params: ParticleParams,
+    ) -> Result<JValue, JError> {
+        let mut args = args.function_args.into_iter();
+        let blueprint_path: String = Args::next("blueprint_path", &mut args)?;
+
+        let current_peer_id = self.scopes.to_peer_id(params.peer_scope);
+        let data =
+            self.services
+                .vault
+                .cat_slice(current_peer_id, &params, Path::new(&blueprint_path))?;
+        let blueprint = AddBlueprint::decode(&data).map_err(|err| {
+            JError::new(format!(
+                "Error parsing blueprint from vault {blueprint_path:?}: {err}"
+            ))
+        })?;
+
+        let blueprint = blueprint
+            .to_string()
+            .map_err(|err| JError::new(format!("Error serializing blueprint to IPLD: {err}")))?;
+        Ok(json!(blueprint))
+    }
+
+    fn list_modules(&self) -> Result<JValue, JError> {
+        self.modules.list_modules()
+    }
+
+    fn get_module_interface(&self, args: Args) -> Result<JValue, JError> {
+        let mut args = args.function_args.into_iter();
+        let hash: String = Args::next("hex_hash", &mut args)?;
+        self.modules.get_interface(&hash)
+    }
+
+    fn get_blueprints(&self) -> Result<JValue, JError> {
+        self.modules
+            .get_blueprints()
+            .into_iter()
+            .map(|bp| {
+                serde_json::to_value(&bp).map_err(|err| {
+                    JError::new(format!("error serializing blueprint {bp:?}: {err}"))
+                })
+            })
+            .collect()
+    }
+
+    fn get_blueprint(&self, args: Args) -> Result<JValue, JError> {
+        let mut args = args.function_args.into_iter();
+        let blueprint_id: String = Args::next("blueprint_id", &mut args)?;
+
+        let blueprint = self.modules.get_blueprint_from_cache(&blueprint_id)?;
+
+        Ok(json!(blueprint))
+    }
+
+    async fn create_service(&self, args: Args, params: ParticleParams) -> Result<JValue, JError> {
+        let mut args = args.function_args.into_iter();
+        let blueprint_id: String = Args::next("blueprint_id", &mut args)?;
+
+        self.guard_protected(&params).await?;
+
+        let service_id = self
+            .services
+            .create_service(
+                params.peer_scope,
+                ServiceType::Service,
+                blueprint_id,
+                params.init_peer_id,
+            )
+            .await?;
+
+        Ok(JValue::String(service_id))
+    }
+
+    async fn remove_service(&self, args: Args, params: ParticleParams) -> Result<(), JError> {
+        let mut args = args.function_args.into_iter();
+        let service_id_or_alias: String = Args::next("service_id_or_alias", &mut args)?;
+
+        self.guard_protected(&params).await?;
+
+        self.services
+            .remove_service(
+                params.peer_scope,
+                &params.id,
+                &service_id_or_alias,
+                params.init_peer_id,
+                false,
+            )
+            .await?;
+
+        Ok(())
+    }
+
+    async fn list_services(&self, params: ParticleParams) -> JValue {
+        Array(
+            self.services
+                .list_services(params.peer_scope)
+                .await
+                .iter()
+                .map(|info| json!(Service::from(info, self.scopes.clone())))
+                .collect(),
+        )
+    }
+
+    async fn call_service(&self, function_args: Args, particle: ParticleParams) -> FunctionOutcome {
+        self.services
+            .call_service(function_args, particle, true)
+            .await
+    }
+
+    async fn get_interface(&self, args: Args, params: ParticleParams) -> Result<JValue, JError> {
+        let mut args = args.function_args.into_iter();
+        let service_id: String = Args::next("service_id", &mut args)?;
+        Ok(self
+            .services
+            .get_interface(params.peer_scope, service_id, &params.id)
+            .await?)
+    }
+
+    async fn add_alias(&self, args: Args, params: ParticleParams) -> Result<(), JError> {
+        let mut args = args.function_args.into_iter();
+
+        let alias: String = Args::next("alias", &mut args)?;
+        let service_id: String = Args::next("service_id", &mut args)?;
+
+        self.guard_protected(&params).await?;
+
+        self.services
+            .add_alias(
+                params.peer_scope,
+                alias.clone(),
+                service_id.clone(),
+                params.init_peer_id,
+            )
+            .await?;
+
+        log::debug!(
+            "Added alias {} for service {:?} {}",
+            alias,
+            params.peer_scope,
+            service_id
+        );
+
+        Ok(())
+    }
+
+    async fn resolve_alias(&self, args: Args, params: ParticleParams) -> Result<JValue, JError> {
+        let mut args = args.function_args.into_iter();
+        let alias: String = Args::next("alias", &mut args)?;
+        let service_id = self
+            .services
+            .resolve_alias(params.peer_scope, alias.clone(), &params.id)
+            .await?;
+
+        log::debug!(
+            "Resolved alias {} to service {:?} {}",
+            alias,
+            params.peer_scope,
+            service_id
+        );
+
+        Ok(JValue::String(service_id))
+    }
+
+    async fn resolve_alias_opt(
+        &self,
+        args: Args,
+        params: ParticleParams,
+    ) -> Result<JValue, JError> {
+        let mut args = args.function_args.into_iter();
+        let alias: String = Args::next("alias", &mut args)?;
+        let service_id_opt = self
+            .services
+            .resolve_alias(params.peer_scope, alias, &params.id)
+            .await
+            .map(|id| vec![JValue::String(id)])
+            .unwrap_or_default();
+
+        Ok(Array(service_id_opt))
+    }
+
+    async fn get_service_info(&self, args: Args, params: ParticleParams) -> Result<JValue, JError> {
+        let mut args = args.function_args.into_iter();
+        let service_id_or_alias: String = Args::next("service_id_or_alias", &mut args)?;
+        let info = self
+            .services
+            .get_service_info(params.peer_scope, service_id_or_alias, &params.id)
+            .await?;
+
+        Ok(json!(Service::from(&info, self.scopes.clone())))
+    }
+
+    fn kademlia(&self) -> &KademliaApi {
+        self.connectivity.as_ref()
+    }
+
+    fn connection_pool(&self) -> &ConnectionPoolApi {
+        self.connectivity.as_ref()
+    }
+
+    async fn service_mem_stats(
+        &self,
+        args: Args,
+        params: ParticleParams,
+    ) -> Result<JValue, JError> {
+        let mut args = args.function_args.into_iter();
+        let service_id_or_alias: String = Args::next("service_id", &mut args)?;
+
+        self.services
+            .get_service_mem_stats(params.peer_scope, service_id_or_alias, &params.id)
+            .await
+            .map(Array)
+    }
+
+    async fn service_stat(&self, args: Args, params: ParticleParams) -> Result<JValue, JError> {
+        let mut args = args.function_args.into_iter();
+        let service_id_or_alias: String = Args::next("service_id", &mut args)?;
+        // Resolve aliases; also checks that the requested service exists.
+        let service_id = self
+            .services
+            .to_service_id(params.peer_scope, service_id_or_alias, &params.id)
+            .await?;
+        let metrics = self
+            .services
+            .metrics
+            .as_ref()
+            .ok_or_else(|| JError::new("Service stats collection is disabled"))?;
+        if let Some(result) = metrics.builtin.read(&service_id) {
+            Ok(json!({
+                "status": true,
+                "error": "",
+                "result": vec![result],
+            }))
+        } else {
+            Ok(json!({
+                "status": false,
+                "error": format!("No stats were collected for the `{service_id}` service"),
+                "result": [],
+            }))
+        }
+    }
+
+    fn sign(&self, args: Args, params: ParticleParams) -> Result<JValue, JError> {
+        let tetraplets = args.tetraplets;
+        let mut args = args.function_args.into_iter();
+
+        // The `sign` is allowed only for a **worker** to sign on **worker** and for a **host** to sign on **host**.
+        // The manager is able to sign only on the host.
+        let init_peer_scope = self.scopes.scope(params.init_peer_id);
+        let is_manager_on_host = self.scopes.is_management(params.init_peer_id)
+            && matches!(params.peer_scope, PeerScope::Host);
+        if !init_peer_scope.map_or(is_manager_on_host, |result| params.peer_scope == result) {
+            return Err(JError::new(format!(
+                "peer '{}' is not allowed to sign data on '{}'",
+                params.init_peer_id,
+                self.scopes.to_peer_id(params.peer_scope)
+            )));
+        }
+
+        let result: Result<JValue, JError> = try {
+            let data: Vec<u8> = Args::next("data", &mut args)?;
+
+            let tetraplet = tetraplets.first().map(|v| v.as_slice());
+            if let Some([t]) = tetraplet {
+                if self.scopes.scope(PeerId::from_str(&t.peer_pk)?).is_err() {
+                    return Err(JError::new(format!(
+                        "data is expected to be produced by service 'registry' on peer '{}', was from peer '{}'",
+                        self.scopes.get_host_peer_id(), t.peer_pk
+                    )));
+                }
+
+                let duplet = (t.service_id.as_str(), t.function_name.as_str());
+                let metadata_bytes = ("registry", "get_record_metadata_bytes");
+                let record_bytes = ("registry", "get_record_bytes");
+
+                if duplet != record_bytes && duplet != metadata_bytes {
+                    return Err(JError::new(format!(
+                        "data is expected to result from a call to 'registry.get_record_bytes' or 'registry.get_record_metadata_bytes', was from '{}.{}'",
+                        t.service_id, t.function_name
+                    )));
+                }
+
+                if !t.lens.is_empty() {
+                    return Err(JError::new(
+                        "lens for data tetraplet is expected to be empty",
+                    ));
+                }
+            } else {
+                return Err(JError::new(format!("expected tetraplet for a scalar argument, got tetraplet for an array: {tetraplet:?}, tetraplets")));
+            }
+
+            let keypair = self.key_storage.get_keypair(params.peer_scope).unwrap(); //TODO: fix unwrap
+            json!(keypair.sign(&data)?.to_vec())
+        };
+
+        match result {
+            Ok(sig) => Ok(json!({
+                "success": true,
+                "error": [],
+                "signature": vec![sig]
+            })),
+
+            Err(error) => Ok(json!({
+                "success": false,
+                "error": vec![JValue::from(error)],
+                "signature": []
+            })),
+        }
+    }
+
+    fn verify(&self, args: Args, params: ParticleParams) -> Result<JValue, JError> {
+        let mut args = args.function_args.into_iter();
+        let signature: Vec<u8> = Args::next("signature", &mut args)?;
+        let data: Vec<u8> = Args::next("data", &mut args)?;
+        let pk = self
+            .key_storage
+            .get_keypair(params.peer_scope)
+            .ok_or(JError::new(format!(
+                "Not found key pair for scope {:?}",
+                params.peer_scope
+            )))?
+            .public();
+        let signature = Signature::from_bytes(pk.get_key_format(), signature);
+
+        Ok(JValue::Bool(pk.verify(&data, &signature).is_ok()))
+    }
+
+    fn get_peer_id(&self, params: ParticleParams) -> Result<JValue, JError> {
+        let peer_id = match params.peer_scope {
+            PeerScope::WorkerId(worker_id) => worker_id.to_string(),
+            PeerScope::Host => self.scopes.get_host_peer_id().to_string(),
+        };
+
+        Ok(JValue::String(peer_id))
+    }
+    fn vault_put(&self, args: Args, params: ParticleParams) -> Result<JValue, JError> {
+        let mut args = args.function_args.into_iter();
+        let data: String = Args::next("data", &mut args)?;
+        let name = uuid();
+        let current_peer_id = self.scopes.to_peer_id(params.peer_scope);
+        let virtual_path = self
+            .services
+            .vault
+            .put(current_peer_id, &params, name, &data)?;
+
+        Ok(JValue::String(virtual_path.display().to_string()))
+    }
+
+    fn vault_cat(&self, args: Args, params: ParticleParams) -> Result<JValue, JError> {
+        let mut args = args.function_args.into_iter();
+        let path: String = Args::next("path", &mut args)?;
+        let current_peer_id = self.scopes.to_peer_id(params.peer_scope);
+        self.services
+            .vault
+            .cat(current_peer_id, &params, Path::new(&path))
+            .map(JValue::String)
+            .map_err(|_| JError::new(format!("Error reading vault file `{path}`")))
+    }
+
+    async fn guard_protected(&self, particle: &ParticleParams) -> Result<(), JError> {
+        if self.is_worker_spell(particle).await
+            || self.scopes.is_host(particle.init_peer_id)
+            || self.scopes.is_management(particle.init_peer_id)
+        {
+            Ok(())
+        } else {
+            Err(JError::new(
+                "This function is only available to the host or worker spells",
+            ))
+        }
+    }
+
+    // Check that the particle is from a worker spell from a worker installed on the host
+    // 1. Particle ID must be in spell_{spell_id}_{n} format
+    // 2. init_peer_id must be a local peer id for the host (either host id or a worker id)
+    // 3. There must be a spell service with alias "worker-spell" on the init_peer_id
+    // 4. The spell service must have the same spell_id as in the particle and be of type "spell"
+    async fn is_worker_spell(&self, particle: &ParticleParams) -> bool {
+        let result: Option<_> = try {
+            let local_scope = self.scopes.scope(particle.init_peer_id).ok()?;
+            let spell_id = ParticleParams::get_spell_id(&particle.id)?;
+            let (worker_service, _) = self
+                .services
+                .get_service(local_scope, "worker-spell".to_string(), &particle.id)
+                .await
+                .ok()?;
+            worker_service.service_type == ServiceType::Spell
+                && worker_service.service_id == spell_id
+        };
+        result.unwrap_or(false)
+    }
+
+    fn allow_only_worker(&self, params: &ParticleParams) -> Result<WorkerId, JError> {
+        match params.peer_scope {
+            PeerScope::WorkerId(worker_id) => {
+                let is_worker = params.init_peer_id == worker_id.into();
+                let worker_creator = self.workers.get_worker_creator(worker_id)?;
+                let is_worker_creator = params.init_peer_id == worker_creator;
+                if !is_worker && !is_worker_creator {
+                    Err(JError::new(format!("Failed to create VM on {worker_id:?}, can be installed by worker creator {worker_creator} or worker itself {worker_id}")))
+                } else {
+                    Ok(worker_id)
+                }
+            }
+            PeerScope::Host => Err(JError::new("This function is only available for workers")),
+        }
+    }
+
+    // Create a VM from the image
+    // - `image` - path to the image in the *vault*
+    // Returns the name of the created VM
+    // Throws on errors
+    async fn create_vm(&self, args: Args, params: ParticleParams) -> Result<JValue, JError> {
+        let worker_id = self.allow_only_worker(&params)?;
+        let mut function_args = args.function_args.into_iter();
+
+        let image_arg: String = Args::next("image", &mut function_args)?;
+        let image_arg: PathBuf = image_arg.into();
+
+        let vault_image = self
+            .services
+            .vault
+            .to_real_path(worker_id.into(), &params, image_arg.as_path())
+            .map_err(|_| JError::new(format!("Image {} not found", image_arg.display())))?;
+
+        let vm_name = self
+            .workers
+            .create_vm(worker_id, vault_image.as_path())
+            .await
+            .map_err(|err| JError::new(format!("Failed to create vm: {err}")))?;
+
+        Ok(JValue::String(vm_name))
+    }
+
+    // Stop a VM assigned to a Worker if any
+    // Throws on errors
+    fn stop_vm(&self, _args: Args, params: ParticleParams) -> Result<JValue, JError> {
+        let worker_id = self.allow_only_worker(&params)?;
+        self.workers
+            .stop_vm(worker_id)
+            .map_err(|err| JError::new(err.to_string()))?;
+        Ok(JValue::Null)
+    }
+
+    // Start a VM assigned to a Worker if any
+    // Throws on errors
+    fn start_vm(&self, _args: Args, params: ParticleParams) -> Result<JValue, JError> {
+        let worker_id = self.allow_only_worker(&params)?;
+        self.workers
+            .start_vm(worker_id)
+            .map_err(|err| JError::new(err.to_string()))?;
+        Ok(JValue::Null)
+    }
+
+    // Reboot a VM assigned to a Worker if any
+    // Throws on errors
+    fn reboot_vm(&self, _args: Args, params: ParticleParams) -> Result<JValue, JError> {
+        let worker_id = self.allow_only_worker(&params)?;
+        self.workers
+            .reboot_vm(worker_id)
+            .map_err(|err| JError::new(err.to_string()))?;
+        Ok(JValue::Null)
+    }
+
+    // Reset a VM assigned to a Worker if any
+    // Throws on errors
+    fn reset_vm(&self, _args: Args, params: ParticleParams) -> Result<JValue, JError> {
+        let worker_id = self.allow_only_worker(&params)?;
+        self.workers
+            .reset_vm(worker_id)
+            .map_err(|err| JError::new(err.to_string()))?;
+        Ok(JValue::Null)
+    }
+
+    // Reset a VM assigned to a Worker if any
+    // Throws on errors
+    // Note: it's okay to allow anyone to get the VM status
+    fn status_vm(&self, _args: Args, params: ParticleParams) -> Result<JValue, JError> {
+        let worker_id = match params.peer_scope {
+            PeerScope::WorkerId(worker_id) => worker_id,
+            PeerScope::Host => {
+                return Err(JError::new("This function is only available on workers"));
+            }
+        };
+        let status = self
+            .workers
+            .status_vm(worker_id)
+            .map_err(|err| JError::new(err.to_string()))?;
+        Ok(JValue::String(status.to_string()))
+    }
+}
+
+fn make_module_config(args: Args) -> Result<JValue, JError> {
+    use toml_utils::table;
+
+    let mut args = args.function_args.into_iter();
+
+    let name = Args::next("name", &mut args)?;
+    // These are not used anymore, keep them for backward compatibility, because args are positional
+    let _mem_pages_count: Option<u32> = Args::next_opt("mem_pages_count", &mut args)?;
+    let _max_heap_size: Option<String> = Args::next_opt("max_heap_size", &mut args)?;
+
+    let logger_enabled = Args::next_opt("logger_enabled", &mut args)?;
+    // These are not used anymore, keep them for backward compatibility, because args are positional
+    let _preopened_files: Option<Vec<String>> = Args::next_opt("preopened_files", &mut args)?;
+    let envs = Args::next_opt("envs", &mut args)?.map(table);
+    let mapped_dirs = Args::next_opt("mapped_dirs", &mut args)?.map(table);
+    let mounted_binaries = Args::next_opt("mounted_binaries", &mut args)?.map(table);
+    let logging_mask = Args::next_opt("logging_mask", &mut args)?;
+
+    let config = NamedModuleConfig {
+        name,
+        load_from: None,
+        file_name: None,
+        config: ModuleConfig {
+            logger_enabled,
+            wasi: Some(WASIConfig { envs, mapped_dirs }),
+            mounted_binaries,
+            logging_mask,
+        },
+    };
+
+    let config = serde_json::to_value(config)
+        .map_err(|err| JError::new(format!("Error serializing config to JSON: {err}")))?;
+
+    Ok(config)
+}
+
+fn parse_from_str<T>(
+    field: &'static str,
+    mut args: &mut impl Iterator<Item = JValue>,
+) -> Result<Option<T>, JError>
+where
+    T: FromStr + for<'a> Deserialize<'a>,
+    <T as FromStr>::Err: std::error::Error + 'static,
+{
+    #[derive(thiserror::Error, Debug)]
+    #[error("Error while deserializing field {field_name}")]
+    struct Error<E: std::error::Error> {
+        field_name: String,
+        #[source]
+        err: E,
+    }
+
+    #[derive(serde::Deserialize, Debug)]
+    #[serde(untagged)]
+    pub enum Either<T> {
+        String(String),
+        Target(T),
+    }
+
+    let number: Option<Either<T>> = Args::next_opt(field, &mut args)?;
+
+    if number.is_none() {
+        return Ok(None);
+    }
+
+    number
+        .map(|i| match i {
+            Either::String(s) => Ok(s.parse::<T>()?),
+            Either::Target(n) => Ok(n),
+        })
+        .transpose()
+        .map_err(|err: T::Err| {
+            Error {
+                field_name: field.to_string(),
+                err,
+            }
+            .into()
+        })
+}
+
+#[derive(Debug, Serialize)]
+struct Service {
+    pub id: String,
+    pub blueprint_id: String,
+    pub service_type: ServiceType,
+    #[serde(serialize_with = "peer_id::serde::serialize")]
+    pub owner_id: PeerId,
+    pub aliases: Vec<String>,
+    #[serde(serialize_with = "peer_id::serde::serialize")]
+    pub worker_id: PeerId,
+}
+
+impl Service {
+    fn from(service_info: &ServiceInfo, peer_scopes: PeerScopes) -> Self {
+        let worker_id: PeerId = match service_info.peer_scope {
+            PeerScope::WorkerId(worker_id) => worker_id.into(),
+            PeerScope::Host => peer_scopes.get_host_peer_id(),
+        };
+
+        Service {
+            id: service_info.id.clone(),
+            blueprint_id: service_info.blueprint_id.clone(),
+            service_type: service_info.service_type.clone(),
+            owner_id: service_info.owner_id,
+            aliases: service_info.aliases.clone(),
+            worker_id,
+        }
+    }
+}
+
+#[cfg(test)]
+mod prop_tests {
+    use prop::collection::vec;
+    use proptest::arbitrary::StrategyFor;
+    use proptest::collection::{SizeRange, VecStrategy};
+    use proptest::prelude::*;
+    use serde_json::json;
+
+    use particle_args::Args;
+
+    use crate::builtins::make_module_config;
+
+    prop_compose! {
+      /// Generates ByteSize strings
+      fn heap_size
+        ()
+        // FIXME: limit is 100k GB because ByteSize can't handle exabytes. terabytes and petabytes are missing for the same reason.
+        (n in prop::option::of(0..100_000), si in "(?i)([kmg]i)?B")
+        -> Vec<String>
+      {
+        n.map(|n| vec![format!("{n} {si}")]).unwrap_or_default()
+      }
+    }
+
+    /// Wraps value into AIR-style option (vec of length 0 or 1)
+    pub fn air_opt<T: Strategy>(element: T) -> proptest::collection::VecStrategy<T> {
+        vec(element, 0..1)
+    }
+
+    /// Generates an associative array of strings of a given size
+    pub fn assoc_vec(size: impl Into<SizeRange>) -> VecStrategy<VecStrategy<StrategyFor<String>>> {
+        vec(vec(any::<String>(), 2..=2), size)
+    }
+
+    proptest! {
+        #[test]
+        fn module_config(
+            name in any::<String>(),
+            mem_pages in air_opt(any::<u32>()),
+            logger_enabled in air_opt(proptest::bool::ANY),
+            heap in heap_size(),
+            preopened_files in air_opt(any::<String>()),
+            envs in air_opt(assoc_vec(0..10)),
+            mapped_dirs in air_opt(assoc_vec(0..10)),
+            mounted_binaries in air_opt(assoc_vec(0..10)),
+            logging_mask in air_opt(any::<i32>()),
+        ) {
+            let mem_pages: Vec<u32> = mem_pages;
+            let heap: Vec<String> = heap;
+            let preopened_files: Vec<String> = preopened_files;
+            let envs: Vec<Vec<Vec<String>>> = envs;
+            let mapped_dirs: Vec<Vec<Vec<String>>> = mapped_dirs;
+            let mounted_binaries: Vec<Vec<Vec<String>>> = mounted_binaries;
+            let logging_mask: Vec<i32> = logging_mask;
+
+            let args = vec![
+                json!(name),              // required: name
+                json!(mem_pages),         // mem_pages_count = optional: None
+                json!(heap),              // optional: max_heap_size
+                json!(logger_enabled),    // optional: logger_enabled
+                json!(preopened_files),   // optional: preopened_files
+                json!(envs),              // optional: envs
+                json!(mapped_dirs),       // optional: mapped_dirs
+                json!(mounted_binaries),  // optional: mounted_binaries
+                json!(logging_mask),      // optional: logging_mask
+            ];
+            let args = Args {
+                service_id: "".to_string(),
+                function_name: "".to_string(),
+                function_args: args,
+                tetraplets: vec![],
+            };
+
+            let config = make_module_config(args).expect("parse config via make_module_config");
+            let config_name = config.get("name").and_then(|n| n.as_str()).expect("'name' field in the config");
+            prop_assert_eq!(config_name, name);
+        }
+    }
+}
+
\ No newline at end of file diff --git a/src/particle_builtins/debug.rs.html b/src/particle_builtins/debug.rs.html new file mode 100644 index 0000000000..184d4bbf3c --- /dev/null +++ b/src/particle_builtins/debug.rs.html @@ -0,0 +1,75 @@ +debug.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use std::collections::HashMap;
+use tokio::sync::RwLock;
+
+use crate::builtins::CustomService;
+
+pub fn fmt_custom_services(
+    services: &RwLock<HashMap<String, CustomService>>,
+    fmt: &mut std::fmt::Formatter<'_>,
+) -> Result<(), std::fmt::Error> {
+    fmt.debug_map()
+        .entries(
+            services
+                .blocking_read()
+                .iter()
+                .map(|(sid, fs)| (sid, fs.functions.keys().collect::<Vec<_>>())),
+        )
+        .finish()
+}
+
\ No newline at end of file diff --git a/src/particle_builtins/error.rs.html b/src/particle_builtins/error.rs.html new file mode 100644 index 0000000000..0883726331 --- /dev/null +++ b/src/particle_builtins/error.rs.html @@ -0,0 +1,57 @@ +error.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use std::string::FromUtf8Error;
+
+#[derive(thiserror::Error, Debug)]
+pub enum HostClosureCallError {
+    #[error("decode base58 failed: {0}")]
+    DecodeBase58(#[source] bs58::decode::Error),
+    #[error("decode from bytes to UTF8 failed: {0}")]
+    DecodeUTF8(#[source] FromUtf8Error),
+}
+
\ No newline at end of file diff --git a/src/particle_builtins/func.rs.html b/src/particle_builtins/func.rs.html new file mode 100644 index 0000000000..248852e417 --- /dev/null +++ b/src/particle_builtins/func.rs.html @@ -0,0 +1,121 @@ +func.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use serde::{Deserialize, Serialize};
+use serde_json::json;
+
+use particle_args::{Args, JError};
+use particle_execution::FunctionOutcome;
+
+pub fn unary<X, Out, F>(args: Args, f: F) -> FunctionOutcome
+where
+    X: for<'de> Deserialize<'de>,
+    Out: Serialize,
+    F: Fn(X) -> Result<Out, JError>,
+{
+    if args.function_args.len() != 1 {
+        let err = format!("expected 1 arguments, got {}", args.function_args.len());
+        return FunctionOutcome::Err(JError::new(err));
+    }
+    let mut args = args.function_args.into_iter();
+
+    let x: X = Args::next("x", &mut args)?;
+    let out = f(x)?;
+    FunctionOutcome::Ok(json!(out))
+}
+
+pub fn binary<X, Y, Out, F>(args: Args, f: F) -> FunctionOutcome
+where
+    X: for<'de> Deserialize<'de>,
+    Y: for<'de> Deserialize<'de>,
+    Out: Serialize,
+    F: Fn(X, Y) -> Result<Out, JError>,
+{
+    if args.function_args.len() != 2 {
+        let err = format!("expected 2 arguments, got {}", args.function_args.len());
+        return FunctionOutcome::Err(JError::new(err));
+    }
+    let mut args = args.function_args.into_iter();
+
+    let x: X = Args::next("x", &mut args)?;
+    let y: Y = Args::next("y", &mut args)?;
+    let out = f(x, y)?;
+    FunctionOutcome::Ok(json!(out))
+}
+
\ No newline at end of file diff --git a/src/particle_builtins/identify.rs.html b/src/particle_builtins/identify.rs.html new file mode 100644 index 0000000000..2a0cf5b481 --- /dev/null +++ b/src/particle_builtins/identify.rs.html @@ -0,0 +1,61 @@ +identify.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+use libp2p::core::Multiaddr;
+use serde::Serialize;
+use std::path::PathBuf;
+
+#[derive(Serialize, Clone, Debug)]
+pub struct NodeInfo {
+    pub external_addresses: Vec<Multiaddr>,
+    pub node_version: &'static str,
+    pub air_version: &'static str,
+    pub spell_version: String,
+    pub allowed_binaries: Vec<PathBuf>,
+}
+
\ No newline at end of file diff --git a/src/particle_builtins/json.rs.html b/src/particle_builtins/json.rs.html new file mode 100644 index 0000000000..a326df88c3 --- /dev/null +++ b/src/particle_builtins/json.rs.html @@ -0,0 +1,263 @@ +json.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use eyre::{eyre, Context};
+use particle_args::{Args, JError};
+use serde_json::Value as JValue;
+
+fn obj_from_iter(
+    mut object: serde_json::Map<String, JValue>,
+    args: &mut impl Iterator<Item = JValue>,
+) -> Result<serde_json::Map<String, JValue>, JError> {
+    loop {
+        match (args.next(), args.next()) {
+            (Some(JValue::String(name)), Some(value)) => { object.insert(name, value); },
+            (Some(key), None) => return Err(JError::new(eyre!(
+                "Expected odd number of arguments, got even. No value for key '{}'",
+                key
+            ).to_string())),
+            (Some(key), Some(value)) => return Err(JError::new(eyre!(
+                "All keys must be of type string. Key of the following pair is of invalid type: ({}, {})",
+                key,
+                value
+            ).to_string())),
+            (None, _) => break,
+        }
+    }
+
+    Ok(object)
+}
+
+/// Constructs a JSON object from a list of key value pairs.
+pub fn obj(args: Args) -> Result<JValue, JError> {
+    let mut args = args.function_args.into_iter();
+
+    let object = obj_from_iter(<_>::default(), &mut args)?;
+
+    Ok(JValue::Object(object))
+}
+
+/// Constructs a JSON object from a list of key value pairs.
+pub fn obj_from_pairs(
+    values: impl IntoIterator<Item = (String, JValue)>,
+) -> Result<JValue, JError> {
+    let map = values.into_iter().fold(
+        <serde_json::Map<String, JValue>>::default(),
+        |mut acc, (k, v)| {
+            acc.insert(k, v);
+            acc
+        },
+    );
+
+    Ok(JValue::Object(map))
+}
+
+/// Inserts a value into a JSON object
+pub fn put(args: Args) -> Result<JValue, JError> {
+    let mut args = args.function_args.into_iter();
+    let mut object: serde_json::Map<String, JValue> = Args::next("object", &mut args)?;
+    let key = Args::next("key", &mut args)?;
+    let value = Args::next("value", &mut args)?;
+
+    object.insert(key, value);
+
+    Ok(JValue::Object(object))
+}
+
+/// Inserts list of key value pairs into an object.
+pub fn puts(args: Args) -> Result<JValue, JError> {
+    let mut args = args.function_args.into_iter();
+    let object = Args::next("object", &mut args)?;
+
+    let object = obj_from_iter(object, &mut args)?;
+
+    Ok(JValue::Object(object))
+}
+
+/// Inserts list of key value pairs into an object.
+pub fn puts_from_pairs(
+    object: JValue,
+    values: impl IntoIterator<Item = (String, JValue)>,
+) -> Result<JValue, JError> {
+    if let JValue::Object(map) = object.clone() {
+        let map = values.into_iter().fold(map, |mut acc, (k, v)| {
+            acc.insert(k, v);
+            acc
+        });
+        Ok(JValue::Object(map))
+    } else {
+        Err(JError::new(format!("expected json object, got {object}")))
+    }
+}
+
+pub fn parse(json: &str) -> Result<JValue, JError> {
+    serde_json::from_str(json)
+        .context(format!("error parsing json {json}"))
+        .map_err(JError::from_eyre)
+}
+
+pub fn stringify(value: JValue) -> String {
+    value.to_string()
+}
+
+#[cfg(test)]
+mod tests {
+    use crate::json::parse;
+
+    #[test]
+    fn json_parse_string() {
+        use serde_json::json;
+
+        let str = json!("hellow");
+        let parsed = parse(&str.to_string());
+        assert_eq!(parsed.ok(), Some(str));
+    }
+}
+
\ No newline at end of file diff --git a/src/particle_builtins/lib.rs.html b/src/particle_builtins/lib.rs.html new file mode 100644 index 0000000000..7478491cb8 --- /dev/null +++ b/src/particle_builtins/lib.rs.html @@ -0,0 +1,95 @@ +lib.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+#![feature(stmt_expr_attributes)]
+#![feature(try_trait_v2)]
+#![feature(try_blocks)]
+#![recursion_limit = "512"]
+#![warn(rust_2018_idioms)]
+#![deny(
+    dead_code,
+    nonstandard_style,
+    unused_imports,
+    unused_mut,
+    unused_variables,
+    unused_unsafe,
+    unreachable_patterns
+)]
+
+pub use builtins::{Builtins, BuiltinsConfig, CustomService};
+pub use identify::NodeInfo;
+pub use outcome::{ok, wrap, wrap_unit};
+pub use particle_services::ParticleAppServicesConfig;
+mod builtins;
+mod debug;
+mod error;
+mod func;
+mod identify;
+mod json;
+mod math;
+mod outcome;
+mod particle_function;
+
\ No newline at end of file diff --git a/src/particle_builtins/math.rs.html b/src/particle_builtins/math.rs.html new file mode 100644 index 0000000000..1b6a4e6bd7 --- /dev/null +++ b/src/particle_builtins/math.rs.html @@ -0,0 +1,263 @@ +math.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use std::collections::HashSet;
+use std::ops::Mul;
+
+use itertools::Itertools;
+
+use particle_args::JError;
+
+/// x + y
+pub fn add(x: i64, y: i64) -> Result<i64, JError> {
+    x.checked_add(y)
+        .ok_or_else(|| JError::new("i64 add overflow"))
+}
+
+/// x - y
+pub fn sub(x: i64, y: i64) -> Result<i64, JError> {
+    let y = y
+        .checked_neg()
+        .ok_or_else(|| JError::new("i64 neg overflow"))?;
+    x.checked_add(y)
+        .ok_or_else(|| JError::new("i64 add overflow"))
+}
+
+/// x * y
+pub fn mul(x: i64, y: i64) -> Result<i64, JError> {
+    x.checked_mul(y)
+        .ok_or_else(|| JError::new("i64 mul overflow"))
+}
+
+/// floor(x * y) (x and y can be float)
+pub fn fmul_floor(x: f64, y: f64) -> Result<i64, JError> {
+    Ok(x.mul(y).floor() as i64)
+}
+
+/// x / y
+pub fn div(x: i64, y: i64) -> Result<i64, JError> {
+    x.checked_div(y)
+        .ok_or_else(|| JError::new("i64 div overflow"))
+}
+
+/// x % y (remainder)
+pub fn rem(x: i64, y: i64) -> Result<i64, JError> {
+    x.checked_rem(y)
+        .ok_or_else(|| JError::new("i64 rem overflow"))
+}
+
+/// x ^ y
+pub fn pow(x: i64, y: u32) -> Result<i64, JError> {
+    x.checked_pow(y)
+        .ok_or_else(|| JError::new("i64 pow overflow"))
+}
+
+/// log_x(y) (logarithm of base x)
+pub fn log(x: i64, y: i64) -> Result<u32, JError> {
+    y.checked_ilog(x)
+        .ok_or_else(|| JError::new("i64 log overflow"))
+}
+
+/// x > y
+pub fn gt(x: i64, y: i64) -> Result<bool, JError> {
+    Ok(x.gt(&y))
+}
+
+/// x >= y
+pub fn gte(x: i64, y: i64) -> Result<bool, JError> {
+    Ok(x.ge(&y))
+}
+
+/// x < y
+pub fn lt(x: i64, y: i64) -> Result<bool, JError> {
+    Ok(x.lt(&y))
+}
+
+/// x <= y
+pub fn lte(x: i64, y: i64) -> Result<bool, JError> {
+    Ok(x.le(&y))
+}
+
+/// compare x and y
+/// Less = -1
+/// Equal = 0
+/// Greater = 1
+pub fn cmp(x: i64, y: i64) -> Result<i8, JError> {
+    let ord = x.cmp(&y);
+    Ok(ord as i8)
+}
+
+/// fold(_ + _) (sum of all numbers in array)
+pub fn array_sum(xs: Vec<i64>) -> Result<i64, JError> {
+    xs.into_iter()
+        .try_fold(0, i64::checked_add)
+        .ok_or_else(|| JError::new("i64 add overflow"))
+}
+
+/// remove duplicates, not stable
+pub fn dedup(xs: Vec<String>) -> Result<Vec<String>, JError> {
+    Ok(xs.into_iter().unique().collect())
+}
+
+/// set-intersection of two arrays, not stable, deduplicates
+pub fn intersect(xs: HashSet<String>, ys: HashSet<String>) -> Result<Vec<String>, JError> {
+    Ok(xs.intersection(&ys).cloned().collect())
+}
+
+/// set-difference of two arrays, not stable, deduplicates
+pub fn diff(xs: HashSet<String>, ys: HashSet<String>) -> Result<Vec<String>, JError> {
+    Ok(xs.difference(&ys).cloned().collect())
+}
+
+/// symmetric difference of two arrays, not stable, deduplicates
+pub fn sdiff(xs: HashSet<String>, ys: HashSet<String>) -> Result<Vec<String>, JError> {
+    Ok(xs.symmetric_difference(&ys).cloned().collect())
+}
+
\ No newline at end of file diff --git a/src/particle_builtins/outcome.rs.html b/src/particle_builtins/outcome.rs.html new file mode 100644 index 0000000000..4de278f93e --- /dev/null +++ b/src/particle_builtins/outcome.rs.html @@ -0,0 +1,81 @@ +outcome.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use particle_args::JError;
+use particle_execution::FunctionOutcome;
+use serde_json::Value as JValue;
+
+pub fn ok(v: JValue) -> FunctionOutcome {
+    FunctionOutcome::Ok(v)
+}
+
+pub fn wrap(r: Result<JValue, JError>) -> FunctionOutcome {
+    match r {
+        Ok(v) => FunctionOutcome::Ok(v),
+        Err(err) => FunctionOutcome::Err(err),
+    }
+}
+
+pub fn wrap_unit(r: Result<(), JError>) -> FunctionOutcome {
+    match r {
+        Ok(_) => FunctionOutcome::Empty,
+        Err(err) => FunctionOutcome::Err(err),
+    }
+}
+
\ No newline at end of file diff --git a/src/particle_builtins/particle_function.rs.html b/src/particle_builtins/particle_function.rs.html new file mode 100644 index 0000000000..04c97463f6 --- /dev/null +++ b/src/particle_builtins/particle_function.rs.html @@ -0,0 +1,125 @@ +particle_function.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use async_trait::async_trait;
+use std::collections::HashMap;
+
+use connection_pool::ConnectionPoolApi;
+use kademlia::KademliaApi;
+use particle_args::Args;
+use particle_execution::{FunctionOutcome, ParticleFunction, ParticleParams, ServiceFunction};
+
+use crate::builtins::CustomService;
+use crate::Builtins;
+
+#[async_trait]
+impl<C> ParticleFunction for Builtins<C>
+where
+    C: Clone + Send + Sync + 'static + AsRef<KademliaApi> + AsRef<ConnectionPoolApi>,
+{
+    async fn call(&self, args: Args, particle: ParticleParams) -> FunctionOutcome {
+        Builtins::call(self, args, particle).await
+    }
+
+    async fn extend(
+        &self,
+        service: String,
+        functions: HashMap<String, ServiceFunction>,
+        fallback: Option<ServiceFunction>,
+    ) {
+        self.custom_services.write().await.insert(
+            service,
+            CustomService {
+                functions,
+                fallback,
+            },
+        );
+    }
+
+    async fn remove(&self, service: &str) {
+        self.custom_services
+            .write()
+            .await
+            .remove(service)
+            .map(|hm| (hm.functions, hm.fallback));
+    }
+}
+
\ No newline at end of file diff --git a/src/particle_execution/function_outcome.rs.html b/src/particle_execution/function_outcome.rs.html new file mode 100644 index 0000000000..d883c35c6c --- /dev/null +++ b/src/particle_execution/function_outcome.rs.html @@ -0,0 +1,197 @@ +function_outcome.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use std::convert::Infallible;
+use std::ops::{ControlFlow, FromResidual, Try};
+
+use serde_json::Value as JValue;
+
+use json_utils::err_as_value;
+use particle_args::{Args, JError};
+
+use crate::ParticleParams;
+
+#[allow(clippy::large_enum_variant)]
+#[derive(Debug, Clone)]
+pub enum FunctionOutcome {
+    NotDefined { args: Args, params: ParticleParams },
+    Empty,
+    Ok(JValue),
+    Err(JError),
+}
+
+impl FunctionOutcome {
+    /// Returns [false] if variant is [NotDefined]
+    pub fn is_defined(&self) -> bool {
+        !matches!(self, Self::NotDefined { .. })
+    }
+
+    /// Returns [false] if variant is [Err]
+    pub fn not_err(&self) -> bool {
+        !matches!(self, Self::Err { .. })
+    }
+
+    pub fn or_else(self, f: impl FnOnce(Args, ParticleParams) -> Self) -> Self {
+        if let FunctionOutcome::NotDefined { args, params } = self {
+            f(args, params)
+        } else {
+            self
+        }
+    }
+}
+
+impl<E: std::error::Error> From<E> for FunctionOutcome {
+    fn from(err: E) -> Self {
+        FunctionOutcome::Err(JError(err_as_value(err)))
+    }
+}
+
+impl Try for FunctionOutcome {
+    type Output = Option<JValue>;
+    type Residual = JError;
+
+    fn from_output(output: Self::Output) -> Self {
+        match output {
+            Some(v) => FunctionOutcome::Ok(v),
+            None => FunctionOutcome::Empty,
+        }
+    }
+
+    fn branch(self) -> ControlFlow<Self::Residual, Self::Output> {
+        match self {
+            FunctionOutcome::Err(err) => ControlFlow::Break(err),
+            FunctionOutcome::Empty | FunctionOutcome::NotDefined { .. } => {
+                ControlFlow::Continue(None)
+            }
+            FunctionOutcome::Ok(v) => ControlFlow::Continue(Some(v)),
+        }
+    }
+}
+
+impl FromResidual for FunctionOutcome {
+    fn from_residual(residual: JError) -> Self {
+        FunctionOutcome::Err(residual)
+    }
+}
+
+impl<E: Into<JError>> FromResidual<Result<Infallible, E>> for FunctionOutcome {
+    fn from_residual(residual: Result<Infallible, E>) -> Self {
+        let Err(e) = residual;
+        FunctionOutcome::Err(e.into())
+    }
+}
+
\ No newline at end of file diff --git a/src/particle_execution/lib.rs.html b/src/particle_execution/lib.rs.html new file mode 100644 index 0000000000..dc0e6ffb83 --- /dev/null +++ b/src/particle_execution/lib.rs.html @@ -0,0 +1,69 @@ +lib.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+#![feature(try_trait_v2)]
+#![feature(exhaustive_patterns)]
+
+pub use function_outcome::FunctionOutcome;
+pub use particle_function::{
+    Output as ParticleFunctionOutput, ParticleFunction, ParticleFunctionMut,
+    ParticleFunctionStatic, ServiceFunction, ServiceFunctionImmut, ServiceFunctionMut,
+};
+pub use particle_params::ParticleParams;
+pub use particle_vault::{ParticleVault, VaultError, VIRTUAL_PARTICLE_VAULT_PREFIX};
+
+mod function_outcome;
+mod particle_function;
+mod particle_params;
+mod particle_vault;
+
\ No newline at end of file diff --git a/src/particle_execution/particle_function.rs.html b/src/particle_execution/particle_function.rs.html new file mode 100644 index 0000000000..75e04ae696 --- /dev/null +++ b/src/particle_execution/particle_function.rs.html @@ -0,0 +1,225 @@ +particle_function.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use async_trait::async_trait;
+use std::collections::HashMap;
+use std::sync::Arc;
+
+use futures::future::BoxFuture;
+use particle_args::Args;
+
+use crate::{FunctionOutcome, ParticleParams};
+
+pub type Output<'a> = BoxFuture<'a, FunctionOutcome>;
+
+pub type ServiceFunctionMut =
+    Box<dyn FnMut(Args, ParticleParams) -> Output<'static> + 'static + Send + Sync>;
+pub type ServiceFunctionImmut =
+    Box<dyn Fn(Args, ParticleParams) -> Output<'static> + 'static + Send + Sync>;
+
+pub enum ServiceFunction {
+    Mut(tokio::sync::Mutex<ServiceFunctionMut>),
+    Immut(ServiceFunctionImmut),
+}
+
+impl ServiceFunction {
+    pub async fn call(&self, args: Args, particle: ParticleParams) -> FunctionOutcome {
+        match self {
+            ServiceFunction::Mut(f) => {
+                let mut func = f.lock().await;
+                func(args, particle).await
+            }
+            ServiceFunction::Immut(f) => f(args, particle).await,
+        }
+    }
+}
+
+impl From<ServiceFunctionImmut> for ServiceFunction {
+    fn from(f: ServiceFunctionImmut) -> Self {
+        ServiceFunction::Immut(f)
+    }
+}
+
+impl From<ServiceFunctionMut> for ServiceFunction {
+    fn from(f: ServiceFunctionMut) -> Self {
+        ServiceFunction::Mut(tokio::sync::Mutex::new(f))
+    }
+}
+
+#[async_trait]
+pub trait ParticleFunction: 'static + Send + Sync {
+    async fn call(&self, args: Args, particle: ParticleParams) -> FunctionOutcome;
+    async fn extend(
+        &self,
+        service: String,
+        functions: HashMap<String, ServiceFunction>,
+        fallback: Option<ServiceFunction>,
+    );
+    async fn remove(&self, service: &str);
+}
+
+pub trait ParticleFunctionMut: 'static + Send + Sync {
+    fn call_mut(&mut self, args: Args, particle: ParticleParams) -> Output<'_>;
+}
+
+#[async_trait]
+pub trait ParticleFunctionStatic: Clone + 'static + Send + Sync {
+    async fn call(&self, args: Args, particle: ParticleParams) -> FunctionOutcome;
+    async fn extend(
+        &self,
+        service: String,
+        functions: HashMap<String, ServiceFunction>,
+        fallback: Option<ServiceFunction>,
+    );
+    async fn remove(&self, service: &str);
+}
+
+#[async_trait]
+impl<F: ParticleFunction> ParticleFunctionStatic for Arc<F> {
+    async fn call(self: &Arc<F>, args: Args, particle: ParticleParams) -> FunctionOutcome {
+        let this = self.clone();
+        ParticleFunction::call(this.as_ref(), args, particle).await
+    }
+
+    async fn extend(
+        self: &Arc<F>,
+        service: String,
+        functions: HashMap<String, ServiceFunction>,
+        fallback: Option<ServiceFunction>,
+    ) {
+        ParticleFunction::extend(self.as_ref(), service, functions, fallback).await;
+    }
+
+    async fn remove(self: &Arc<F>, service: &str) {
+        ParticleFunction::remove(self.as_ref(), service).await;
+    }
+}
+
\ No newline at end of file diff --git a/src/particle_execution/particle_params.rs.html b/src/particle_execution/particle_params.rs.html new file mode 100644 index 0000000000..5f71c784f9 --- /dev/null +++ b/src/particle_execution/particle_params.rs.html @@ -0,0 +1,179 @@ +particle_params.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use fluence_app_service::ParticleParameters;
+use fluence_libp2p::PeerId;
+use particle_protocol::Particle;
+use types::peer_scope::PeerScope;
+
+/// Lightweight, static version of the [[Particle]] structure
+/// It exists to avoid cloning [[Particle::data]] when possible
+#[derive(Debug, Clone)]
+pub struct ParticleParams {
+    pub id: String,
+    pub init_peer_id: PeerId,
+    pub peer_scope: PeerScope,
+    /// Unix timestamp in milliseconds
+    pub timestamp: u64,
+    /// TTL in milliseconds
+    pub ttl: u32,
+    pub script: String,
+    pub signature: Vec<u8>,
+    // Particle token, `signature` signed with the peer's private key
+    pub token: String,
+}
+
+impl ParticleParams {
+    pub fn clone_from(particle: &Particle, peer_scope: PeerScope, token: String) -> Self {
+        let Particle {
+            id,
+            init_peer_id,
+            timestamp,
+            ttl,
+            script,
+            signature,
+            ..
+        } = particle;
+
+        Self {
+            id: id.clone(),
+            init_peer_id: *init_peer_id,
+            peer_scope,
+            timestamp: *timestamp,
+            ttl: *ttl,
+            script: script.clone(),
+            signature: signature.clone(),
+            token,
+        }
+    }
+
+    pub fn is_spell_particle(particle_id: &str) -> bool {
+        particle_id.starts_with("spell")
+    }
+
+    pub fn get_spell_id(particle_id: &str) -> Option<String> {
+        if ParticleParams::is_spell_particle(particle_id) {
+            particle_id.split('_').nth(1).map(|s| s.to_string())
+        } else {
+            None
+        }
+    }
+
+    pub fn to_particle_parameters(self) -> ParticleParameters {
+        ParticleParameters {
+            id: self.id,
+            init_peer_id: self.init_peer_id.to_string(),
+            timestamp: self.timestamp,
+            ttl: self.ttl,
+            script: self.script,
+            signature: self.signature,
+            token: self.token,
+        }
+    }
+}
+
\ No newline at end of file diff --git a/src/particle_execution/particle_vault.rs.html b/src/particle_execution/particle_vault.rs.html new file mode 100644 index 0000000000..ebbf79a05e --- /dev/null +++ b/src/particle_execution/particle_vault.rs.html @@ -0,0 +1,505 @@ +particle_vault.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use eyre::eyre;
+use fluence_app_service::ModuleDescriptor;
+use std::io::ErrorKind;
+use std::path;
+use std::path::{Path, PathBuf};
+
+use fluence_libp2p::PeerId;
+use thiserror::Error;
+
+use fs_utils::{create_dir, create_dir_write_only};
+
+use crate::ParticleParams;
+use crate::VaultError::WrongVault;
+use VaultError::{CleanupVault, CreateVault, InitializeVault};
+
+pub const VIRTUAL_PARTICLE_VAULT_PREFIX: &str = "/tmp/vault";
+
+#[derive(Debug, Clone)]
+pub struct ParticleVault {
+    vault_dir: PathBuf,
+}
+
+impl ParticleVault {
+    pub fn new(vault_dir: PathBuf) -> Self {
+        Self { vault_dir }
+    }
+
+    pub fn real_worker_particle_vault(&self, peer_id: PeerId) -> PathBuf {
+        self.vault_dir.join(peer_id.to_base58())
+    }
+
+    /// Returns Particle File Vault path on Nox's filesystem
+    pub fn real_particle_vault(
+        &self,
+        peer_id: PeerId,
+        particle_id: &str,
+        particle_token: &str,
+    ) -> PathBuf {
+        self.real_worker_particle_vault(peer_id)
+            .join(Self::format_particle_directory_name(
+                particle_id,
+                particle_token,
+            ))
+    }
+
+    /// Returns Particle File Vault path on Marine's filesystem (ie how it would look like inside service)
+    pub fn virtual_particle_vault(&self, particle_id: &str, particle_token: &str) -> PathBuf {
+        Path::new(VIRTUAL_PARTICLE_VAULT_PREFIX).join(Self::format_particle_directory_name(
+            particle_id,
+            particle_token,
+        ))
+    }
+
+    fn format_particle_directory_name(id: &str, token: &str) -> String {
+        format!("{}-{}", id, token)
+    }
+
+    pub async fn initialize(&self) -> Result<(), VaultError> {
+        tokio::fs::create_dir_all(&self.vault_dir)
+            .await
+            .map_err(InitializeVault)?;
+
+        Ok(())
+    }
+
+    pub fn initialize_worker(&self, worker_id: PeerId) -> Result<(), VaultError> {
+        let path = self.real_worker_particle_vault(worker_id);
+        create_dir_write_only(path).map_err(InitializeVault)
+    }
+
+    pub fn create(
+        &self,
+        current_peer_id: PeerId,
+        particle_id: &str,
+        particle_token: &str,
+    ) -> Result<(), VaultError> {
+        let path = self.real_particle_vault(current_peer_id, particle_id, particle_token);
+        create_dir(path).map_err(CreateVault)?;
+        Ok(())
+    }
+
+    pub fn put(
+        &self,
+        current_peer_id: PeerId,
+        particle: &ParticleParams,
+        filename: String,
+        payload: &str,
+    ) -> Result<PathBuf, VaultError> {
+        let vault_dir = self.real_particle_vault(current_peer_id, &particle.id, &particle.token);
+        // Note that we can't use `to_real_path` here since the target file cannot exist yet,
+        // but `to_real_path` do path normalization which requires existence of the file to resolve
+        // symlinks.
+        let real_path = vault_dir.join(&filename);
+        if let Some(parent_path) = real_path.parent() {
+            create_dir_write_only(parent_path).map_err(CreateVault)?;
+        }
+
+        std::fs::write(real_path.clone(), payload.as_bytes())
+            .map_err(|e| VaultError::WriteVault(e, filename))?;
+
+        self.to_virtual_path(current_peer_id, particle, &real_path)
+    }
+
+    pub fn cat(
+        &self,
+        current_peer_id: PeerId,
+        particle: &ParticleParams,
+        virtual_path: &Path,
+    ) -> Result<String, VaultError> {
+        let real_path = self.to_real_path(current_peer_id, particle, virtual_path)?;
+
+        let contents = std::fs::read_to_string(real_path)
+            .map_err(|e| VaultError::ReadVault(e, virtual_path.to_path_buf()))?;
+
+        Ok(contents)
+    }
+
+    pub fn cat_slice(
+        &self,
+        current_peer_id: PeerId,
+        particle: &ParticleParams,
+        virtual_path: &Path,
+    ) -> Result<Vec<u8>, VaultError> {
+        let real_path = self.to_real_path(current_peer_id, particle, virtual_path)?;
+        std::fs::read(real_path).map_err(|e| VaultError::ReadVault(e, virtual_path.to_path_buf()))
+    }
+
+    pub async fn cleanup(
+        &self,
+        peer_id: PeerId,
+        particle_id: &str,
+        particle_token: &str,
+    ) -> Result<(), VaultError> {
+        let path = self.real_particle_vault(peer_id, particle_id, particle_token);
+        match tokio::fs::remove_dir_all(&path).await {
+            Ok(_) => Ok(()),
+            // ignore NotFound
+            Err(err) if err.kind() == ErrorKind::NotFound => Ok(()),
+            Err(err) => Err(CleanupVault(err)),
+        }?;
+
+        Ok(())
+    }
+
+    /// Converts real path in `vault_dir` to virtual path with `VIRTUAL_PARTICLE_VAULT_PREFIX`.
+    /// Virtual path looks like `/tmp/vault/<particle_id>/<path>`.
+    fn to_virtual_path(
+        &self,
+        current_peer_id: PeerId,
+        particle: &ParticleParams,
+        path: &Path,
+    ) -> Result<PathBuf, VaultError> {
+        let virtual_prefix = self.virtual_particle_vault(&particle.id, &particle.token);
+        let real_prefix = self.real_particle_vault(current_peer_id, &particle.id, &particle.token);
+        let rest = path
+            .strip_prefix(&real_prefix)
+            .map_err(|e| WrongVault(Some(e), path.to_path_buf(), real_prefix))?;
+
+        Ok(virtual_prefix.join(rest))
+    }
+
+    /// Converts virtual path with `VIRTUAL_PARTICLE_VAULT_PREFIX` to real path in `vault_dir`.
+    /// Support full paths to the file in the vault starting this the prefix as well as relative paths
+    /// inside the vault.
+    /// For example, `some/file.txt` is valid and will be resolved to `REAL_PARTICLE_VAULT_PREFIX/some/file.txt`.
+    pub fn to_real_path(
+        &self,
+        current_peer_id: PeerId,
+        particle: &ParticleParams,
+        virtual_path: &Path,
+    ) -> Result<PathBuf, VaultError> {
+        let rest = if virtual_path.has_root() {
+            // If path starts with the `/` then we consider it a full path containing the virtual vault prefix
+            let virtual_prefix = self.virtual_particle_vault(&particle.id, &particle.token);
+            virtual_path.strip_prefix(&virtual_prefix).map_err(|e| {
+                WrongVault(Some(e), virtual_path.to_path_buf(), virtual_prefix.clone())
+            })?
+        } else {
+            // Otherwise we consider it a relative path inside the vault
+            virtual_path
+        };
+        let real_prefix = self.real_particle_vault(current_peer_id, &particle.id, &particle.token);
+        let real_path = real_prefix.join(rest);
+        let resolved_path = real_path
+            .canonicalize()
+            .map_err(|e| VaultError::NotFound(e, virtual_path.to_path_buf()))?;
+        // Check again after normalization that the path leads to the real particle vault
+        if resolved_path.starts_with(&real_prefix) {
+            Ok(resolved_path)
+        } else {
+            Err(WrongVault(None, resolved_path, real_prefix))
+        }
+    }
+
+    /// Map `vault_dir/$current-peer-id` to `/tmp/vault` inside the service.
+    /// Particle File Vaults will be available as `/tmp/vault/$particle_id`
+    pub fn inject_vault(
+        &self,
+        current_peer_id: PeerId,
+        module: &mut ModuleDescriptor,
+    ) -> eyre::Result<()> {
+        let wasi = module
+            .config
+            .wasi
+            .as_mut()
+            .ok_or(eyre!("Could not inject vault into empty WASI config"))?;
+
+        let vault_dir = self.real_worker_particle_vault(current_peer_id);
+
+        wasi.mapped_dirs
+            .insert(VIRTUAL_PARTICLE_VAULT_PREFIX.into(), vault_dir);
+
+        Ok(())
+    }
+}
+
+#[derive(Debug, Error)]
+pub enum VaultError {
+    #[error("Error creating vault_dir")]
+    InitializeVault(#[source] std::io::Error),
+    #[error("Error creating particle vault")]
+    CreateVault(#[source] std::io::Error),
+    #[error("Error cleaning up particle vault")]
+    CleanupVault(#[source] std::io::Error),
+    #[error("Incorrect vault path `{1}`: doesn't belong to vault (`{2}`)")]
+    WrongVault(#[source] Option<path::StripPrefixError>, PathBuf, PathBuf),
+    #[error("Incorrect vault  path `{1}`: doesn't exist")]
+    NotFound(#[source] std::io::Error, PathBuf),
+    #[error("Read vault failed for `{1}`: {0}")]
+    ReadVault(#[source] std::io::Error, PathBuf),
+    #[error("Write vault failed for filename `{1}`: {0}")]
+    WriteVault(#[source] std::io::Error, String),
+}
+
\ No newline at end of file diff --git a/src/particle_modules/error.rs.html b/src/particle_modules/error.rs.html new file mode 100644 index 0000000000..e40741ffc8 --- /dev/null +++ b/src/particle_modules/error.rs.html @@ -0,0 +1,351 @@ +error.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use std::fmt::Debug;
+use std::path::PathBuf;
+
+use base64::DecodeError;
+use fluence_app_service::{MarineError, TomlMarineNamedModuleConfig};
+use marine_it_parser::ITParserError;
+use marine_module_info_parser::ModuleInfoError;
+use serde_json::Value as JValue;
+use thiserror::Error;
+
+use json_utils::err_as_value;
+use particle_execution::VaultError;
+use service_modules::Blueprint;
+
+pub(super) type Result<T> = std::result::Result<T, ModuleError>;
+
+#[derive(Debug, Error)]
+pub enum ModuleError {
+    #[error("Error saving module {path:?}: {err}")]
+    AddModule {
+        path: PathBuf,
+        #[source]
+        err: std::io::Error,
+    },
+    #[error("Error serializing config to toml: {err} {config:?}")]
+    SerializeConfig {
+        #[source]
+        err: toml_edit::ser::Error,
+        config: TomlMarineNamedModuleConfig,
+    },
+    #[error("Error serializing module config to json: {0}")]
+    SerializeConfigJson(#[source] serde_json::error::Error),
+    #[error("Error serializing blueprint to toml: {err} {blueprint:?}")]
+    SerializeBlueprint {
+        #[source]
+        err: toml_edit::ser::Error,
+        blueprint: Blueprint,
+    },
+    #[error("Error serializing blueprint to json: {0}")]
+    SerializeBlueprintJson(String),
+    #[error("Error saving config to {path:?}: {err}")]
+    WriteConfig {
+        path: PathBuf,
+        #[source]
+        err: std::io::Error,
+    },
+    #[error("Blueprint wasn't found at {path:?}: {err}")]
+    NoSuchBlueprint {
+        path: PathBuf,
+        #[source]
+        err: std::io::Error,
+    },
+    #[error("Blueprint '{id}' wasn't found")]
+    BlueprintNotFound { id: String },
+    #[error("Blueprint '{id}' has empty list of dependencies")]
+    EmptyDependenciesList { id: String },
+    #[error("Blueprint '{id}' facade dependency is not a hash of a module")]
+    FacadeShouldBeHash { id: String },
+    #[error("Error parsing blueprint: {err}")]
+    IncorrectBlueprint {
+        #[source]
+        err: toml_edit::de::Error,
+    },
+    #[error("Module config wasn't found at {path:?}: {err}")]
+    NoModuleConfig {
+        path: PathBuf,
+        #[source]
+        err: std::io::Error,
+    },
+    #[error("Error parsing module config: {err}")]
+    IncorrectModuleConfig {
+        #[source]
+        err: toml_edit::de::Error,
+    },
+    #[error("Error writing blueprint to {path:?}: {err}")]
+    WriteBlueprint {
+        path: PathBuf,
+        #[source]
+        err: std::io::Error,
+    },
+    #[error("Error converting TomlMarineNamedModuleConfig to FaaSModuleConfig: {err}")]
+    ModuleConvertError {
+        #[source]
+        err: MarineError,
+    },
+    #[error("Module wasn't found on path {path:?}: {err}")]
+    ModuleNotFound {
+        path: PathBuf,
+        #[source]
+        err: std::io::Error,
+    },
+    #[error("Cannot read modules interface {path:?}: {err}")]
+    ReadModuleInterfaceError {
+        path: PathBuf,
+        #[source]
+        err: ITParserError,
+    },
+    #[error("Module with name {0} wasn't found, consider using module hash instead of a name")]
+    InvalidModuleName(String),
+    #[error("Expected module reference of format hash:xx got {reference}. Context: calculating blueprint hash")]
+    InvalidModuleReference { reference: String },
+    #[error("Error while decoding module bytes from base64: {err}")]
+    ModuleInvalidBase64 {
+        #[source]
+        #[from]
+        err: DecodeError,
+    },
+    #[error("Invalid module path {module_path:?}: {err}")]
+    InvalidModulePath {
+        module_path: String,
+        #[source]
+        err: eyre::Report,
+    },
+    #[error("Invalid module config path {config_path:?}: {err}")]
+    InvalidModuleConfigPath {
+        config_path: String,
+        #[source]
+        err: eyre::Report,
+    },
+    #[error("Error parsing module config from vault {config_path:?}: {err}")]
+    IncorrectVaultModuleConfig {
+        config_path: String,
+        #[source]
+        err: serde_json::Error,
+    },
+    #[error(
+    "Config error: max_heap_size = '{max_heap_size_wanted}' can't be bigger than {max_heap_size_allowed}'"
+    )]
+    MaxHeapSizeOverflow {
+        max_heap_size_wanted: u64,
+        max_heap_size_allowed: u64,
+    },
+    #[error("Config error: requested module effector {module_name} with CID {forbidden_cid} is forbidden on this host")]
+    ForbiddenEffector {
+        module_name: String,
+        forbidden_cid: String,
+    },
+    #[error("Module {module_name} with CID {module_cid} requested a binary `{binary_name}` which isn't in the configured list of binaries")]
+    InvalidEffectorMountedBinary {
+        module_name: String,
+        module_cid: String,
+        binary_name: String,
+    },
+    #[error(transparent)]
+    Vault(#[from] VaultError),
+    #[error(transparent)]
+    ModuleInfo(#[from] ModuleInfoError),
+    #[error(transparent)]
+    WrongModuleHash(#[from] eyre::ErrReport),
+}
+
+impl From<ModuleError> for JValue {
+    fn from(err: ModuleError) -> Self {
+        err_as_value(err)
+    }
+}
+
\ No newline at end of file diff --git a/src/particle_modules/files.rs.html b/src/particle_modules/files.rs.html new file mode 100644 index 0000000000..53f266809b --- /dev/null +++ b/src/particle_modules/files.rs.html @@ -0,0 +1,247 @@ +files.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use crate::error::{ModuleError::*, Result};
+
+use fluence_app_service::{ConfigContext, ModuleDescriptor, TomlMarineNamedModuleConfig};
+use service_modules::{
+    blueprint_file_name, blueprint_fname, module_config_name_hash, module_file_name_hash,
+    Blueprint, Hash,
+};
+
+use std::convert::TryInto;
+use std::path::Path;
+
+/// Load blueprint from disk
+pub fn load_blueprint(bp_dir: &Path, blueprint_id: &str) -> Result<Blueprint> {
+    let bp_path = bp_dir.join(blueprint_fname(blueprint_id));
+    let blueprint =
+        std::fs::read(&bp_path).map_err(|err| NoSuchBlueprint { path: bp_path, err })?;
+    let blueprint: Blueprint = toml_edit::de::from_slice(blueprint.as_slice())
+        .map_err(|err| IncorrectBlueprint { err })?;
+
+    Ok(blueprint)
+}
+
+/// Load ModuleDescriptor from disk for a given module name
+pub fn load_module_descriptor(modules_dir: &Path, module_hash: &Hash) -> Result<ModuleDescriptor> {
+    let config = modules_dir.join(module_config_name_hash(module_hash));
+    let config = load_config_by_path(&config)?;
+    // `base_path: None` tells Marine to resolve non-absolute paths relative to the current directory
+    let context = ConfigContext { base_path: None };
+
+    let mut config: ModuleDescriptor = context
+        .wrapped(config)
+        .try_into()
+        .map_err(|err| ModuleConvertError { err })?;
+
+    // TODO HACK: This is required because by default file_name is set to be same as import_name
+    //            That behavior is defined in TomlMarineNamedModuleConfig. Would be nice to refactor that behavior.
+    config.file_name = module_file_name_hash(module_hash);
+
+    Ok(config)
+}
+
+/// Load TomlMarineNamedModuleConfig from disk from a given path
+pub fn load_config_by_path(path: &Path) -> Result<TomlMarineNamedModuleConfig> {
+    let config = std::fs::read(path).map_err(|err| NoModuleConfig {
+        path: path.to_path_buf(),
+        err,
+    })?;
+    let config: TomlMarineNamedModuleConfig = toml_edit::de::from_slice(config.as_slice())
+        .map_err(|err| IncorrectModuleConfig { err })?;
+
+    Ok(config)
+}
+
+/// Adds a module to the filesystem, overwriting existing module.
+/// Also adds module config to the TomlMarineNamedModuleConfig
+pub fn add_module(
+    modules_dir: &Path,
+    module_hash: &Hash,
+    bytes: &[u8],
+    mut config: TomlMarineNamedModuleConfig,
+) -> Result<TomlMarineNamedModuleConfig> {
+    let wasm = modules_dir.join(module_file_name_hash(module_hash));
+    std::fs::write(&wasm, bytes).map_err(|err| AddModule { path: wasm, err })?;
+
+    // replace existing configuration with a new one
+    // TODO HACK: use custom structure for API; TomlMarineNamedModuleConfig is too powerful and clumsy.
+    // Set file_name = ${hash}.wasm
+    config.file_name = Some(module_file_name_hash(module_hash));
+    // The `load_from` field overrides `modules_dir` for a single module,
+    // so we set `load_from` to `None`, telling Marine to load modules from the `modules_dir`
+    config.load_from = None;
+
+    let toml = toml_edit::ser::to_string_pretty(&config).map_err(|err| SerializeConfig {
+        err,
+        config: config.clone(),
+    })?;
+    let path = modules_dir.join(module_config_name_hash(module_hash));
+    std::fs::write(&path, toml).map_err(|err| WriteConfig { path, err })?;
+
+    Ok(config)
+}
+
+pub fn load_module_by_path(path: &Path) -> Result<Vec<u8>> {
+    std::fs::read(path).map_err(|err| ModuleNotFound {
+        path: path.to_path_buf(),
+        err,
+    })
+}
+
+/// Saves new blueprint to disk
+pub fn add_blueprint(blueprint_dir: &Path, blueprint: &Blueprint) -> Result<()> {
+    let path = blueprint_dir.join(blueprint_file_name(blueprint));
+
+    // Save blueprint to disk
+    let bytes = toml_edit::ser::to_vec(&blueprint).map_err(|err| SerializeBlueprint {
+        err,
+        blueprint: blueprint.clone(),
+    })?;
+    std::fs::write(&path, bytes).map_err(|err| WriteBlueprint { path, err })?;
+
+    // TODO: check dependencies are satisfied?
+
+    Ok(())
+}
+
\ No newline at end of file diff --git a/src/particle_modules/lib.rs.html b/src/particle_modules/lib.rs.html new file mode 100644 index 0000000000..ae8af974db --- /dev/null +++ b/src/particle_modules/lib.rs.html @@ -0,0 +1,103 @@ +lib.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+#![feature(try_blocks)]
+#![feature(assert_matches)]
+#![warn(rust_2018_idioms)]
+#![deny(
+    dead_code,
+    nonstandard_style,
+    unused_imports,
+    unused_mut,
+    unused_variables,
+    unused_unsafe,
+    unreachable_patterns
+)]
+
+#[macro_use]
+extern crate fstrings;
+
+mod error;
+mod files;
+mod modules;
+
+pub use error::ModuleError;
+pub use files::{load_blueprint, load_module_by_path, load_module_descriptor};
+pub use modules::EffectorsMode;
+pub use modules::ModuleRepository;
+
+// reexport
+pub use fluence_app_service::{
+    TomlMarineModuleConfig as ModuleConfig, TomlMarineNamedModuleConfig as NamedModuleConfig,
+    TomlWASIConfig as WASIConfig,
+};
+pub use fs_utils::list_files;
+pub use service_modules::AddBlueprint;
+
\ No newline at end of file diff --git a/src/particle_modules/modules.rs.html b/src/particle_modules/modules.rs.html new file mode 100644 index 0000000000..18a2408225 --- /dev/null +++ b/src/particle_modules/modules.rs.html @@ -0,0 +1,1423 @@ +modules.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use std::collections::HashSet;
+use std::ops::Not;
+use std::{collections::HashMap, path::Path, path::PathBuf, sync::Arc};
+
+use base64::{engine::general_purpose::STANDARD as base64, Engine};
+use eyre::WrapErr;
+use fluence_app_service::{ModuleDescriptor, TomlMarineModuleConfig, TomlMarineNamedModuleConfig};
+use fstrings::f;
+use marine_it_parser::module_interface;
+use marine_module_info_parser::effects;
+use marine_module_info_parser::effects::WasmEffect;
+use parking_lot::RwLock;
+use serde_json::{json, Value as JValue};
+
+use fluence_libp2p::PeerId;
+use particle_args::JError;
+use particle_execution::{ParticleParams, ParticleVault};
+use service_modules::{
+    extract_module_file_name, is_blueprint, module_config_name_hash, module_file_name_hash,
+    AddBlueprint, Blueprint, Hash,
+};
+
+use crate::error::ModuleError::{
+    BlueprintNotFound, EmptyDependenciesList, ReadModuleInterfaceError,
+};
+use crate::error::Result;
+use crate::files::{self, load_config_by_path, load_module_descriptor};
+use crate::ModuleError::{
+    ForbiddenEffector, IncorrectVaultModuleConfig, InvalidEffectorMountedBinary,
+    SerializeBlueprintJson,
+};
+
+pub type Binaries = HashMap<String, PathBuf>;
+pub type Effectors = HashMap<Hash, Binaries>;
+
+#[derive(Debug, Clone)]
+pub struct EffectorsMode {
+    defined_effectors: Effectors,
+    default_binaries: Binaries,
+    is_restricted: bool,
+}
+
+impl EffectorsMode {
+    pub fn restricted_effectors(defined_effectors: Effectors) -> EffectorsMode {
+        Self {
+            defined_effectors,
+            default_binaries: Default::default(),
+            is_restricted: true,
+        }
+    }
+
+    pub fn all_effectors(
+        defined_effectors: Effectors,
+        default_binaries: Binaries,
+    ) -> EffectorsMode {
+        Self {
+            defined_effectors,
+            default_binaries,
+            is_restricted: false,
+        }
+    }
+}
+
+impl Default for EffectorsMode {
+    fn default() -> Self {
+        Self::restricted_effectors(Default::default())
+    }
+}
+
+#[derive(Debug, Clone)]
+pub struct ModuleRepository {
+    pub modules_dir: PathBuf,
+    blueprints_dir: PathBuf,
+    module_interface_cache: Arc<RwLock<HashMap<Hash, JValue>>>,
+    blueprints: Arc<RwLock<HashMap<String, Blueprint>>>,
+    effectors: EffectorsMode,
+}
+
+impl ModuleRepository {
+    pub fn new(modules_dir: &Path, blueprints_dir: &Path, effectors: EffectorsMode) -> Self {
+        let blueprints = Self::load_blueprints(blueprints_dir);
+        let blueprints_cache = Arc::new(RwLock::new(blueprints));
+
+        Self {
+            modules_dir: modules_dir.to_path_buf(),
+            blueprints_dir: blueprints_dir.to_path_buf(),
+            module_interface_cache: <_>::default(),
+            blueprints: blueprints_cache,
+            effectors,
+        }
+    }
+
+    fn make_effectors_config(
+        &self,
+        module_name: &str,
+        module_hash: &Hash,
+        mounted_binaries: HashSet<String>,
+    ) -> Result<&HashMap<String, PathBuf>> {
+        let binaries = match self.effectors.defined_effectors.get(module_hash) {
+            Some(binaries) => Ok(binaries),
+            None if !self.effectors.is_restricted => Ok(&self.effectors.default_binaries),
+            None => Err(ForbiddenEffector {
+                module_name: module_name.to_string(),
+                forbidden_cid: module_hash.to_string(),
+            }),
+        }?;
+
+        for mounted_binary_name in &mounted_binaries {
+            if !binaries
+                .keys()
+                .any(|binary_name| mounted_binary_name == binary_name)
+            {
+                return Err(InvalidEffectorMountedBinary {
+                    module_name: module_name.to_string(),
+                    module_cid: module_hash.to_string(),
+                    binary_name: mounted_binary_name.clone(),
+                });
+            }
+        }
+
+        Ok(binaries)
+    }
+
+    pub fn add_module(&self, name: String, module: Vec<u8>) -> Result<Hash> {
+        let hash = Hash::new(&module)?;
+        let (logger_enabled, mounted) = Self::get_module_effects(&module)?;
+        let effector_settings = mounted
+            .is_empty()
+            .not()
+            .then(|| self.make_effectors_config(&name, &hash, mounted))
+            .transpose()?;
+        let config = Self::make_config(name, logger_enabled, effector_settings);
+        let _config = files::add_module(&self.modules_dir, &hash, &module, config)?;
+
+        Ok(hash)
+    }
+
+    // TODO: generate config for modules also
+    pub fn add_system_module(
+        &self,
+        module: Vec<u8>,
+        config: TomlMarineNamedModuleConfig,
+    ) -> Result<Hash> {
+        let hash = Hash::new(&module)?;
+        let _config = files::add_module(&self.modules_dir, &hash, &module, config)?;
+        Ok(hash)
+    }
+
+    pub fn load_module_config_from_vault(
+        vault: &ParticleVault,
+        // TODO: refactor this out of this crate
+        current_peer_id: PeerId,
+        config_path: String,
+        particle: ParticleParams,
+    ) -> Result<TomlMarineNamedModuleConfig> {
+        let config = vault.cat_slice(current_peer_id, &particle, Path::new(&config_path))?;
+        serde_json::from_slice(&config)
+            .map_err(|err| IncorrectVaultModuleConfig { config_path, err })
+    }
+
+    /// Adds a module to the filesystem, overwriting existing module.
+    pub fn add_module_base64(
+        &self,
+        module: String,
+        config: TomlMarineNamedModuleConfig,
+    ) -> Result<String> {
+        let module = base64.decode(module)?;
+        let hash = self.add_module(config.name, module)?;
+
+        Ok(hash.to_string())
+    }
+
+    pub fn add_module_from_vault(
+        &self,
+        vault: &ParticleVault,
+        // TODO: refactor this out of this crate
+        current_peer_id: PeerId,
+        name: String,
+        module_path: String,
+        particle: ParticleParams,
+    ) -> Result<String> {
+        let module = vault.cat_slice(current_peer_id, &particle, Path::new(&module_path))?;
+        // copy module & config to module_dir
+        let hash = self.add_module(name, module)?;
+
+        Ok(hash.to_string())
+    }
+
+    /// Saves new blueprint to disk
+    pub fn add_blueprint(&self, blueprint: AddBlueprint) -> Result<String> {
+        let blueprint_name = blueprint.name.clone();
+        if blueprint.dependencies.is_empty() {
+            return Err(EmptyDependenciesList { id: blueprint_name });
+        }
+
+        let blueprint =
+            Blueprint::new(blueprint).map_err(|err| SerializeBlueprintJson(err.to_string()))?;
+        files::add_blueprint(&self.blueprints_dir, &blueprint)?;
+
+        self.blueprints
+            .write()
+            .insert(blueprint.id.clone(), blueprint.clone());
+
+        Ok(blueprint.id)
+    }
+
+    pub fn list_modules(&self) -> std::result::Result<JValue, JError> {
+        // TODO: refactor errors to enums
+        let modules = fs_utils::list_files(&self.modules_dir)
+            .into_iter()
+            .flatten()
+            .filter_map(|path| {
+                let hash = extract_module_file_name(&path)?;
+                let result: eyre::Result<_> = try {
+                    let hash = Hash::from_string(hash).wrap_err(f!("invalid module name {path:?}"))?;
+                    let config = self.modules_dir.join(module_config_name_hash(&hash));
+                    let config = load_config_by_path(&config).wrap_err(f!("load config ${config:?}"))?;
+
+                    (hash, config)
+                };
+
+                let result = match result {
+                    Ok((hash, config)) => json!({
+                        "name": config.name,
+                        "hash": hash.to_string(),
+                        "config": config.config,
+                    }),
+                    Err(err) => {
+                        log::warn!("list_modules error: {:?}", err);
+                        json!({
+                            "invalid_file_name": hash,
+                            "error": format!("{err:?}").split("Stack backtrace:").next().unwrap_or_default(),
+                        })
+                    }
+                };
+
+                Some(result)
+            })
+            .collect();
+
+        Ok(modules)
+    }
+
+    pub fn get_facade_interface(&self, id: &str) -> Result<JValue> {
+        let blueprints = self.blueprints.clone();
+
+        let bp = {
+            let lock = blueprints.read();
+            lock.get(id).cloned()
+        };
+
+        match bp {
+            None => Err(BlueprintNotFound { id: id.to_string() }),
+            Some(bp) => {
+                let dep = bp
+                    .get_facade_module()
+                    .ok_or(EmptyDependenciesList { id: id.to_string() })?;
+                self.get_interface_by_hash(&dep)
+            }
+        }
+    }
+
+    pub fn get_interface_by_hash(&self, hash: &Hash) -> Result<JValue> {
+        let cache: Arc<RwLock<HashMap<Hash, JValue>>> = self.module_interface_cache.clone();
+
+        get_interface_by_hash(&self.modules_dir, cache, hash)
+    }
+
+    pub fn get_interface(&self, hex_hash: &str) -> std::result::Result<JValue, JError> {
+        // TODO: refactor errors to ModuleErrors enum
+        let interface: eyre::Result<_> = try {
+            let hash = Hash::from_string(hex_hash)?;
+
+            get_interface_by_hash(
+                &self.modules_dir,
+                self.module_interface_cache.clone(),
+                &hash,
+            )?
+        };
+
+        interface.map_err(|err| {
+            JError::new(
+                format!("{err:?}")
+                    // TODO: send patch to eyre so it can be done through their API
+                    // Remove backtrace from the response
+                    .split("Stack backtrace:")
+                    .next()
+                    .unwrap_or_default(),
+            )
+        })
+    }
+
+    fn load_blueprints(blueprints_dir: &Path) -> HashMap<String, Blueprint> {
+        let blueprints: Vec<Blueprint> = fs_utils::list_files(blueprints_dir)
+            .into_iter()
+            .flatten()
+            .filter_map(|path| {
+                // Check if file name matches blueprint schema
+                let fname = path.file_name()?.to_str()?;
+                if !is_blueprint(fname) {
+                    return None;
+                }
+
+                let blueprint: eyre::Result<_> = try {
+                    // Read & deserialize TOML
+                    let bytes = std::fs::read(&path)?;
+                    let blueprint: Blueprint = toml_edit::de::from_slice(&bytes)?;
+                    blueprint
+                };
+
+                match blueprint {
+                    Ok(blueprint) => Some(blueprint),
+                    Err(err) => {
+                        log::warn!("load_blueprints error on file {}: {:?}", fname, err);
+                        None
+                    }
+                }
+            })
+            .collect();
+
+        let mut bp_map = HashMap::new();
+        for bp in blueprints.iter() {
+            bp_map.insert(bp.id.clone(), bp.clone());
+        }
+
+        bp_map
+    }
+
+    pub fn get_blueprint_from_cache(&self, id: &str) -> Result<Blueprint> {
+        let blueprints = self.blueprints.clone();
+        let blueprints = blueprints.read();
+        blueprints
+            .get(id)
+            .cloned()
+            .ok_or(BlueprintNotFound { id: id.to_string() })
+    }
+
+    /// Get available blueprints
+    pub fn get_blueprints(&self) -> Vec<Blueprint> {
+        self.blueprints.read().values().cloned().collect()
+    }
+
+    pub fn resolve_blueprint(&self, blueprint_id: &str) -> Result<Vec<ModuleDescriptor>> {
+        let blueprint = self.get_blueprint_from_cache(blueprint_id)?;
+
+        // Load all module descriptors
+        let module_descriptors: Vec<_> = blueprint
+            .dependencies
+            .into_iter()
+            .map(|m_hash| {
+                let config = load_module_descriptor(&self.modules_dir, &m_hash)?;
+                Ok(config)
+            })
+            .collect::<Result<_>>()?;
+
+        Ok(module_descriptors)
+    }
+
+    fn get_module_effects(module: &[u8]) -> Result<(bool, HashSet<String>)> {
+        let effects = effects::extract_from_bytes(module)?;
+        let mut logger_enabled = false;
+        let mut mounted_names = HashSet::new();
+        for effect in effects {
+            match effect {
+                WasmEffect::Logger => {
+                    logger_enabled = true;
+                }
+                WasmEffect::MountedBinary(name) => {
+                    mounted_names.insert(name);
+                }
+            }
+        }
+        Ok((logger_enabled, mounted_names))
+    }
+
+    fn make_config(
+        module_name: String,
+        logger_enabled: bool,
+        effector_settings: Option<&HashMap<String, PathBuf>>,
+    ) -> TomlMarineNamedModuleConfig {
+        let mounted_binaries = effector_settings.map(|effector_settings| {
+            effector_settings
+                .iter()
+                .map(|(name, path)| (name.clone(), path.to_string_lossy().to_string().into()))
+                .collect::<_>()
+        });
+
+        TomlMarineNamedModuleConfig {
+            name: module_name,
+            file_name: None,
+            load_from: None,
+            config: TomlMarineModuleConfig {
+                logger_enabled: Some(logger_enabled),
+                wasi: None,
+                mounted_binaries,
+                logging_mask: None,
+            },
+        }
+    }
+}
+
+fn get_interface_by_hash(
+    modules_dir: &Path,
+    cache: Arc<RwLock<HashMap<Hash, JValue>>>,
+    hash: &Hash,
+) -> Result<JValue> {
+    let interface_cache_opt = {
+        let lock = cache.read();
+        lock.get(hash).cloned()
+    };
+
+    let interface = match interface_cache_opt {
+        Some(interface) => interface,
+        None => {
+            let path = modules_dir.join(module_file_name_hash(hash));
+            let interface =
+                module_interface(&path).map_err(|err| ReadModuleInterfaceError { path, err })?;
+            let json = json!(interface);
+            json
+        }
+    };
+
+    cache.write().insert(hash.clone(), interface.clone());
+
+    Ok(interface)
+}
+
+#[cfg(test)]
+mod tests {
+    use base64::{engine::general_purpose::STANDARD as base64, Engine};
+    use fluence_app_service::{TomlMarineModuleConfig, TomlMarineNamedModuleConfig};
+    use maplit::hashmap;
+    use std::assert_matches::assert_matches;
+    use std::default::Default;
+    use std::path::PathBuf;
+    use tempdir::TempDir;
+
+    use service_modules::load_module;
+    use service_modules::Hash;
+
+    use crate::ModuleError::{ForbiddenEffector, InvalidEffectorMountedBinary};
+    use crate::{AddBlueprint, EffectorsMode, ModuleRepository};
+
+    #[test]
+    fn test_add_blueprint() {
+        let module_dir = TempDir::new("test").unwrap();
+        let bp_dir = TempDir::new("test").unwrap();
+        let repo = ModuleRepository::new(module_dir.path(), bp_dir.path(), Default::default());
+
+        let dep1 = Hash::new(&[1, 2, 3]).unwrap();
+        let dep2 = Hash::new(&[3, 2, 1]).unwrap();
+
+        let name1 = "bp1".to_string();
+        let resp1 = repo
+            .add_blueprint(AddBlueprint::new(
+                name1.clone(),
+                vec![dep1.clone(), dep2.clone()],
+            ))
+            .unwrap();
+        let bps1 = repo.get_blueprints();
+        assert_eq!(bps1.len(), 1);
+        let bp1 = bps1.first().unwrap();
+        assert_eq!(bp1.name, name1);
+
+        let name2 = "bp2".to_string();
+        let resp2 = repo
+            .add_blueprint(AddBlueprint::new("bp2".to_string(), vec![dep1, dep2]))
+            .unwrap();
+        let bps2 = repo.get_blueprints();
+        assert_eq!(bps2.len(), 2);
+        let bp2 = bps2.into_iter().find(|bp| bp.name == name2).unwrap();
+        assert_eq!(bp2.name, name2);
+
+        assert_ne!(resp1, resp2);
+        assert_ne!(bp1.id, bp2.id);
+    }
+
+    #[test]
+    fn test_add_module_get_interface() {
+        let module_dir = TempDir::new("test").unwrap();
+        let bp_dir = TempDir::new("test2").unwrap();
+        let repo = ModuleRepository::new(module_dir.path(), bp_dir.path(), Default::default());
+
+        let module = load_module(
+            "../crates/nox-tests/tests/tetraplets/artifacts",
+            "tetraplets",
+        )
+        .expect("load module");
+
+        let config: TomlMarineNamedModuleConfig = TomlMarineNamedModuleConfig {
+            name: "tetra".to_string(),
+            file_name: None,
+            load_from: None,
+            config: TomlMarineModuleConfig {
+                logger_enabled: None,
+                wasi: None,
+                mounted_binaries: None,
+                logging_mask: None,
+            },
+        };
+
+        let m_hash = repo
+            .add_module_base64(base64.encode(module), config)
+            .unwrap();
+
+        let result = repo.get_interface(&m_hash);
+        assert!(result.is_ok())
+    }
+
+    #[test]
+    fn test_add_module_effector_allowed() {
+        let effector_wasm_cid =
+            Hash::from_string("bafkreiepzclggkt57vu7yrhxylfhaafmuogtqly7wel7ozl5k2ehkd44oe")
+                .unwrap();
+
+        let effector_path = "../crates/nox-tests/tests/effector/artifacts";
+        let allowed_effectors = EffectorsMode::restricted_effectors(hashmap! {
+            effector_wasm_cid => hashmap! {
+                "ls".to_string() => PathBuf::from("/bin/ls"),
+            }
+        });
+
+        let module_dir = TempDir::new("test").unwrap();
+        let bp_dir = TempDir::new("test2").unwrap();
+        let repo = ModuleRepository::new(module_dir.path(), bp_dir.path(), allowed_effectors);
+
+        let module = load_module(effector_path, "effector").expect("load module");
+        let result = repo.add_module("effector".to_string(), module);
+        assert_matches!(result, Ok(_));
+    }
+
+    #[test]
+    fn test_add_module_effector_forbidden() {
+        let some_wasm_cid =
+            Hash::from_string("bafkreibjsugno2xsa2ee46xge5t6z4vuwpepyphedbykrfgmm7i6jg6ihe")
+                .unwrap();
+
+        let effector_path = "../crates/nox-tests/tests/effector/artifacts";
+        let allowed_effectors = EffectorsMode::restricted_effectors(hashmap! {
+            some_wasm_cid => hashmap! {
+                "ls".to_string() => PathBuf::from("/bin/ls"),
+                "cat".to_string() => PathBuf::from("/bin/cat"),
+            }
+        });
+
+        let module_dir = TempDir::new("test").unwrap();
+        let bp_dir = TempDir::new("test2").unwrap();
+        let repo = ModuleRepository::new(module_dir.path(), bp_dir.path(), allowed_effectors);
+
+        let module = load_module(effector_path, "effector").expect("load module");
+        let result = repo.add_module("effector".to_string(), module);
+        assert_matches!(result, Err(ForbiddenEffector { .. }));
+    }
+
+    #[test]
+    fn test_add_module_effector_invalid() {
+        let effector_wasm_cid =
+            Hash::from_string("bafkreiepzclggkt57vu7yrhxylfhaafmuogtqly7wel7ozl5k2ehkd44oe")
+                .unwrap();
+
+        let effector_path = "../crates/nox-tests/tests/effector/artifacts";
+        let allowed_effectors = EffectorsMode::restricted_effectors(hashmap! {
+            effector_wasm_cid => hashmap! {
+                "cat".to_string() => PathBuf::from("/bin/cat"),
+            }
+        });
+
+        let module_dir = TempDir::new("test").unwrap();
+        let bp_dir = TempDir::new("test2").unwrap();
+        let repo = ModuleRepository::new(module_dir.path(), bp_dir.path(), allowed_effectors);
+
+        let module = load_module(effector_path, "effector").expect("load module");
+        let result = repo.add_module("effector".to_string(), module);
+        let _cat = "cat".to_string();
+        assert_matches!(
+            result,
+            Err(InvalidEffectorMountedBinary {
+                binary_name: _cat,
+                ..
+            })
+        );
+    }
+
+    // When in dev mode, all effectors are allowed.
+    // When an effector is in the list of allowed binaries, the config is taken from the effectors config
+    // When an effector isn't in the list, all the binary paths are taken from dev_mode.binaries
+    //
+    // Here we test that the config for allowed effector is taken from the effectors config
+    #[test]
+    fn test_add_module_all_effectors_allowed_effector() {
+        let effector_wasm_cid =
+            Hash::from_string("bafkreiepzclggkt57vu7yrhxylfhaafmuogtqly7wel7ozl5k2ehkd44oe")
+                .unwrap();
+
+        let effector_path = "../crates/nox-tests/tests/effector/artifacts";
+        let allowed_effectors = EffectorsMode::all_effectors(
+            hashmap! {
+                effector_wasm_cid => hashmap! {
+                    "ls".to_string() => PathBuf::from("/bin/ls"),
+                }
+            },
+            hashmap! { "cat".to_string() => PathBuf::from("/bin/cat")},
+        );
+
+        let module_dir = TempDir::new("test").unwrap();
+        let bp_dir = TempDir::new("test2").unwrap();
+        let repo = ModuleRepository::new(module_dir.path(), bp_dir.path(), allowed_effectors);
+
+        let module = load_module(effector_path, "effector").expect("load module");
+        let result = repo.add_module("effector".to_string(), module);
+        assert_matches!(result, Ok(_));
+    }
+
+    // When in dev mode, all effectors are allowed.
+    // When an effector is in the list of allowed binaries, the config is taken from the effectors config
+    // When an effector isn't in the list, all the binary paths are taken from dev_mode.binaries
+    //
+    // Here we test that the config for an undefined effector is taken from the dev_mode.binaries config
+    #[test]
+    fn test_add_module_all_effectors_undefined_effector() {
+        let effector_path = "../crates/nox-tests/tests/effector/artifacts";
+        let allowed_effectors = EffectorsMode::all_effectors(
+            Default::default(),
+            hashmap! { "ls".to_string() => PathBuf::from("/bin/ls")},
+        );
+
+        let module_dir = TempDir::new("test").unwrap();
+        let bp_dir = TempDir::new("test2").unwrap();
+        let repo = ModuleRepository::new(module_dir.path(), bp_dir.path(), allowed_effectors);
+
+        let module = load_module(effector_path, "effector").expect("load module");
+        let result = repo.add_module("effector".to_string(), module);
+        assert_matches!(result, Ok(_));
+    }
+
+    // When in dev mode, all effectors are allowed.
+    // When an effector is in the list of allowed binaries, the config is taken from the effectors config
+    // When an effector isn't in the list, all the binary paths are taken from dev_mode.binaries
+    //
+    // Here we test that the config for a defined effector is taken from the effectors config
+    // and when the effector config is incorrect, the module creation fails even if the
+    // required path is present in the dev_mode.binaries
+    //
+    // I think this is the least surprising behavior and can prevent errors on deploying/publishing
+    #[test]
+    fn test_add_module_all_effectors_allowed_effector_wrong_config() {
+        let effector_wasm_cid =
+            Hash::from_string("bafkreiepzclggkt57vu7yrhxylfhaafmuogtqly7wel7ozl5k2ehkd44oe")
+                .unwrap();
+
+        let effector_path = "../crates/nox-tests/tests/effector/artifacts";
+        let allowed_effectors = EffectorsMode::all_effectors(
+            hashmap! {
+                effector_wasm_cid => hashmap! {
+                    "cat".to_string() => PathBuf::from("/bin/cat"),
+                }
+            },
+            hashmap! { "ls".to_string() => PathBuf::from("/bin/ls")},
+        );
+
+        let module_dir = TempDir::new("test").unwrap();
+        let bp_dir = TempDir::new("test2").unwrap();
+        let repo = ModuleRepository::new(module_dir.path(), bp_dir.path(), allowed_effectors);
+
+        let module = load_module(effector_path, "effector").expect("load module");
+        let result = repo.add_module("effector".to_string(), module);
+        let _cat = "cat".to_string();
+        assert_matches!(
+            result,
+            Err(InvalidEffectorMountedBinary {
+                binary_name: _cat,
+                ..
+            })
+        );
+    }
+
+    #[test]
+    fn test_add_module_pure() {
+        let module_dir = TempDir::new("test").unwrap();
+        let bp_dir = TempDir::new("test2").unwrap();
+        let repo = ModuleRepository::new(module_dir.path(), bp_dir.path(), Default::default());
+
+        let module = load_module(
+            "../crates/nox-tests/tests/tetraplets/artifacts",
+            "tetraplets",
+        )
+        .expect("load module");
+
+        let result = repo.add_module("pure".to_string(), module);
+        assert_matches!(result, Ok(_));
+    }
+}
+
\ No newline at end of file diff --git a/src/particle_protocol/contact.rs.html b/src/particle_protocol/contact.rs.html new file mode 100644 index 0000000000..de808bbc38 --- /dev/null +++ b/src/particle_protocol/contact.rs.html @@ -0,0 +1,115 @@ +contact.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use std::fmt::{Display, Formatter};
+
+use libp2p::{core::Multiaddr, PeerId};
+use serde::{Deserialize, Serialize};
+
+use types::peer_id;
+
+#[derive(Debug, Clone, Deserialize, Serialize, Eq, PartialEq)]
+pub struct Contact {
+    #[serde(
+        serialize_with = "peer_id::serde::serialize",
+        deserialize_with = "peer_id::serde::deserialize"
+    )]
+    pub peer_id: PeerId,
+    pub addresses: Vec<Multiaddr>,
+}
+
+impl Contact {
+    pub fn new(peer_id: PeerId, addresses: Vec<Multiaddr>) -> Self {
+        Self { peer_id, addresses }
+    }
+}
+
+impl Display for Contact {
+    fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
+        if self.addresses.is_empty() {
+            write!(f, "{} @ [no addr]", self.peer_id)
+        } else {
+            write!(
+                f,
+                "{} @ [{}, ({} more)]",
+                self.peer_id,
+                self.addresses[0],
+                self.addresses.len() - 1
+            )
+        }
+    }
+}
+
\ No newline at end of file diff --git a/src/particle_protocol/error.rs.html b/src/particle_protocol/error.rs.html new file mode 100644 index 0000000000..e1675ae398 --- /dev/null +++ b/src/particle_protocol/error.rs.html @@ -0,0 +1,101 @@ +error.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+use thiserror::Error;
+
+use fluence_keypair::error::{SigningError, VerificationError};
+
+#[derive(Debug, Error)]
+pub enum ParticleError {
+    #[error("Cannot sign particle {particle_id} with keypair not from init_peer_id {init_peer_id}: given {given_peer_id}")]
+    InvalidKeypair {
+        particle_id: String,
+        init_peer_id: String,
+        given_peer_id: String,
+    },
+    #[error("Failed to sign particle {particle_id} signature: {err}")]
+    SigningFailed {
+        #[source]
+        err: SigningError,
+        particle_id: String,
+    },
+    #[error("Failed to verify particle {particle_id} by {peer_id} with signature: {err}")]
+    SignatureVerificationFailed {
+        #[source]
+        err: VerificationError,
+        particle_id: String,
+        peer_id: String,
+    },
+    #[error("Failed to decode public key from init_peer_id of particle {particle_id}: {err}")]
+    DecodingError {
+        #[source]
+        err: fluence_keypair::error::DecodingError,
+        particle_id: String,
+    },
+}
+
\ No newline at end of file diff --git a/src/particle_protocol/lib.rs.html b/src/particle_protocol/lib.rs.html new file mode 100644 index 0000000000..7ce86ba119 --- /dev/null +++ b/src/particle_protocol/lib.rs.html @@ -0,0 +1,103 @@ +lib.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+#![feature(async_closure)]
+#![recursion_limit = "512"]
+#![warn(rust_2018_idioms)]
+#![deny(
+    dead_code,
+    nonstandard_style,
+    unused_imports,
+    unused_mut,
+    unused_variables,
+    unused_unsafe,
+    unreachable_patterns
+)]
+
+mod libp2p_protocol {
+    mod codec;
+    pub(super) mod message;
+    pub(super) mod upgrade;
+}
+
+mod contact;
+mod error;
+mod particle;
+
+pub use contact::Contact;
+pub use error::ParticleError;
+pub use libp2p_protocol::message::CompletionChannel;
+pub use libp2p_protocol::message::SendStatus;
+pub use libp2p_protocol::message::{HandlerMessage, ProtocolMessage};
+pub use libp2p_protocol::upgrade::ProtocolConfig;
+pub use particle::ExtendedParticle;
+pub use particle::Particle;
+
+pub const PROTOCOL_NAME: &str = "/fluence/particle/2.0.0";
+
\ No newline at end of file diff --git a/src/particle_protocol/libp2p_protocol/codec/fluence.rs.html b/src/particle_protocol/libp2p_protocol/codec/fluence.rs.html new file mode 100644 index 0000000000..4c03a860f3 --- /dev/null +++ b/src/particle_protocol/libp2p_protocol/codec/fluence.rs.html @@ -0,0 +1,391 @@ +fluence.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use crate::ProtocolMessage;
+use air_interpreter_sede::{
+    define_simple_representation, Format as SedeFormat, FromSerialized as _, MsgPackMultiformat,
+    ToSerialized as _,
+};
+use asynchronous_codec::{BytesMut, Decoder, Encoder};
+use std::io;
+use unsigned_varint::codec::UviBytes;
+
+const MAX_BUF_SIZE: usize = 100 * 1024 * 1024;
+
+type ProtocolMessageFormat = MsgPackMultiformat;
+
+define_simple_representation!(
+    ProtocolMessageRepresentation,
+    ProtocolMessage,
+    ProtocolMessageFormat,
+    Vec<u8>
+);
+
+pub struct FluenceCodec {
+    length: UviBytes<BytesMut>,
+}
+
+impl FluenceCodec {
+    pub fn new() -> Self {
+        let mut length: UviBytes<BytesMut> = UviBytes::default();
+        length.set_max_len(MAX_BUF_SIZE);
+        Self { length }
+    }
+}
+
+impl Decoder for FluenceCodec {
+    type Item = ProtocolMessage;
+    type Error = FluenceCodecError;
+
+    fn decode(&mut self, src: &mut BytesMut) -> Result<Option<Self::Item>, Self::Error> {
+        let bytes = self.length.decode(src)?;
+        if let Some(bytes) = bytes {
+            return ProtocolMessageRepresentation
+                .deserialize(&bytes)
+                .map(Some)
+                .map_err(FluenceCodecError::Deserialize);
+        }
+        Ok(None)
+    }
+}
+
+impl Encoder for FluenceCodec {
+    type Item<'a> = ProtocolMessage;
+    type Error = FluenceCodecError;
+
+    fn encode(&mut self, item: Self::Item<'_>, dst: &mut BytesMut) -> Result<(), Self::Error> {
+        let msg_buf = ProtocolMessageRepresentation
+            .serialize(&item)
+            .map_err(FluenceCodecError::Serialize)?;
+        self.length.encode(msg_buf[..].into(), dst)?;
+        Ok(())
+    }
+}
+
+#[derive(Debug)]
+pub enum FluenceCodecError {
+    /// IO error
+    Io(std::io::Error),
+    /// Length error
+    Length(std::io::Error),
+    Serialize(<ProtocolMessageFormat as SedeFormat<ProtocolMessage>>::SerializationError),
+    Deserialize(<ProtocolMessageFormat as SedeFormat<ProtocolMessage>>::DeserializationError),
+}
+
+impl From<std::io::Error> for FluenceCodecError {
+    fn from(e: std::io::Error) -> FluenceCodecError {
+        FluenceCodecError::Io(e)
+    }
+}
+
+impl std::error::Error for FluenceCodecError {
+    fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
+        match self {
+            FluenceCodecError::Io(ref e) => Some(e),
+            FluenceCodecError::Length(ref e) => Some(e),
+            FluenceCodecError::Serialize(ref e) => Some(e),
+            FluenceCodecError::Deserialize(ref e) => Some(e),
+        }
+    }
+}
+
+impl std::fmt::Display for FluenceCodecError {
+    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+        match self {
+            FluenceCodecError::Io(e) => write!(f, "I/O error: {}", e),
+            FluenceCodecError::Length(e) => write!(f, "I/O error: {}", e),
+            FluenceCodecError::Serialize(e) => write!(f, "Serialization error: {}", e),
+            FluenceCodecError::Deserialize(e) => write!(f, "Deserialization error: {}", e),
+        }
+    }
+}
+
+impl From<FluenceCodecError> for std::io::Error {
+    fn from(value: FluenceCodecError) -> Self {
+        match value {
+            FluenceCodecError::Io(e) => e,
+            FluenceCodecError::Length(e) => io::Error::new(io::ErrorKind::InvalidInput, e),
+            FluenceCodecError::Serialize(e) => io::Error::new(io::ErrorKind::InvalidInput, e),
+            FluenceCodecError::Deserialize(e) => io::Error::new(io::ErrorKind::InvalidInput, e),
+        }
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use crate::libp2p_protocol::codec::FluenceCodec;
+    use crate::{Particle, ProtocolMessage};
+    use asynchronous_codec::{BytesMut, Decoder, Encoder};
+    use base64::{engine::general_purpose::STANDARD as base64, Engine};
+    use libp2p::PeerId;
+    use std::str::FromStr;
+
+    #[test]
+    fn isomorphic_codec_test() {
+        let mut codec = FluenceCodec::new();
+        let initial_message = ProtocolMessage::Particle(Particle {
+            id: "id".to_string(),
+            init_peer_id: PeerId::random(),
+            timestamp: 1000,
+            ttl: 1000,
+            script: "script".to_string(),
+            signature: vec![0, 0, 128],
+            data: vec![0, 0, 255],
+        });
+        let mut bytes = BytesMut::new();
+        codec
+            .encode(initial_message.clone(), &mut bytes)
+            .expect("Encoding");
+
+        let result_message = codec.decode(&mut bytes).expect("Decoding");
+
+        assert_eq!(result_message, Some(initial_message))
+    }
+
+    #[test]
+    fn deserialization_test() {
+        let raw_str = "zwKBBIimYWN0aW9uqFBhcnRpY2xlpGRhdGGQomlk2SRkMjA1ZDE0OC00Y2YxLTRlNzYtOGY2ZS1mY\
+        2U5ODEwZjVlNmOsaW5pdF9wZWVyX2lk2TQxMkQzS29vV0xMRjdnUUtiNzd4WEhWWm4zS1hhMTR4cDNSQmlBa2JuSzJVQ\
+        lJwRGFSOEtipnNjcmlwdNk5KGNhbGwgJWluaXRfcGVlcl9pZCUgKCJnZXREYXRhU3J2IiAiLXJlbGF5LSIpIFtdIC1yZ\
+        WxheS0pqXNpZ25hdHVyZdwAQG/MtlwBTizM4UtycW3M4DzM9RPMtsyYGsyNbcy5Msy/zO/MvHoyzL9nFTV4zNgfzNUWz\
+        PDMwk7M08zwzMDMoszcFMyqeRnMyD/M9cyXEcz9zJzM8syNzIHM2czNzLXMnMznCql0aW1lc3RhbXDPAAABi/IqldOjd\
+        HRsAA==";
+        let hex_data = base64.decode(raw_str).expect("Base64");
+        let mut bytes = BytesMut::from(&hex_data[..]);
+
+        let mut codec = FluenceCodec::new();
+
+        let result = codec.decode(&mut bytes).expect("Decoding");
+
+        let peer_id = PeerId::from_str("12D3KooWLLF7gQKb77xXHVZn3KXa14xp3RBiAkbnK2UBRpDaR8Kb")
+            .expect("Peer id");
+        let expected = ProtocolMessage::Particle(Particle {
+            id: "d205d148-4cf1-4e76-8f6e-fce9810f5e6c".to_string(),
+            init_peer_id: peer_id,
+            timestamp: 1700574959059,
+            ttl: 0,
+            script: "(call %init_peer_id% (\"getDataSrv\" \"-relay-\") [] -relay-)".to_string(),
+            signature: vec![
+                111, 182, 92, 1, 78, 44, 225, 75, 114, 113, 109, 224, 60, 245, 19, 182, 152, 26,
+                141, 109, 185, 50, 191, 239, 188, 122, 50, 191, 103, 21, 53, 120, 216, 31, 213, 22,
+                240, 194, 78, 211, 240, 192, 162, 220, 20, 170, 121, 25, 200, 63, 245, 151, 17,
+                253, 156, 242, 141, 129, 217, 205, 181, 156, 231, 10,
+            ],
+            data: vec![],
+        });
+
+        assert_eq!(result, Some(expected))
+    }
+}
+
\ No newline at end of file diff --git a/src/particle_protocol/libp2p_protocol/codec/mod.rs.html b/src/particle_protocol/libp2p_protocol/codec/mod.rs.html new file mode 100644 index 0000000000..5318ff12d4 --- /dev/null +++ b/src/particle_protocol/libp2p_protocol/codec/mod.rs.html @@ -0,0 +1,45 @@ +mod.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+mod fluence;
+
+pub use self::fluence::FluenceCodec;
+
\ No newline at end of file diff --git a/src/particle_protocol/libp2p_protocol/message.rs.html b/src/particle_protocol/libp2p_protocol/message.rs.html new file mode 100644 index 0000000000..46524da860 --- /dev/null +++ b/src/particle_protocol/libp2p_protocol/message.rs.html @@ -0,0 +1,229 @@ +message.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use std::time::Duration;
+
+use serde::{Deserialize, Serialize};
+use tokio::sync::oneshot;
+
+use crate::Particle;
+
+#[derive(Debug, Default)]
+pub enum SendStatus {
+    Ok,
+    TimedOut {
+        after: Duration,
+        error: std::io::Error,
+    },
+    ProtocolError(String),
+    NotConnected,
+    #[default]
+    ConnectionPoolDied,
+}
+
+#[derive(Debug, Default)]
+pub enum CompletionChannel {
+    #[default]
+    Ignore,
+    Oneshot(oneshot::Sender<SendStatus>),
+}
+
+impl CompletionChannel {
+    pub fn outlet(self) -> Option<oneshot::Sender<SendStatus>> {
+        match self {
+            CompletionChannel::Ignore => None,
+            CompletionChannel::Oneshot(outlet) => Some(outlet),
+        }
+    }
+}
+
+#[derive(Debug)]
+pub enum HandlerMessage {
+    /// Particle being sent to remote peer. Contains a channel to signal write completion.
+    /// Send-only, can't be received.
+    OutParticle(Particle, CompletionChannel),
+    /// Particle being received from a remote peer.
+    /// Receive-only, can't be sent.
+    InParticle(Particle),
+    /// Dummy plug. Generated by the `OneshotHandler` when Inbound or Outbound Upgrade happened.
+    Upgrade,
+}
+
+impl HandlerMessage {
+    pub fn into_protocol_message(self) -> (ProtocolMessage, Option<oneshot::Sender<SendStatus>>) {
+        match self {
+            HandlerMessage::OutParticle(particle, channel) => {
+                (ProtocolMessage::Particle(particle), channel.outlet())
+            }
+            HandlerMessage::Upgrade => (ProtocolMessage::Upgrade, None),
+            HandlerMessage::InParticle(_) => {
+                unreachable!("InParticle is never sent, only received")
+            }
+        }
+    }
+}
+
+// Required by OneShotHandler in inject_fully_negotiated_outbound. And that's because
+// <ProtocolMessage as UpgradeOutbound>::Output is (), and OneshotHandler requires it to be
+// convertible to OneshotHandler::TEvent which is a ProtocolMessage
+impl From<()> for HandlerMessage {
+    fn from(_: ()) -> HandlerMessage {
+        HandlerMessage::Upgrade
+    }
+}
+#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)]
+#[serde(tag = "action")]
+pub enum ProtocolMessage {
+    Particle(Particle),
+    // TODO: is it needed?
+    Upgrade,
+}
+
+impl std::fmt::Display for ProtocolMessage {
+    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+        match self {
+            ProtocolMessage::Particle(particle) => particle.fmt(f),
+            ProtocolMessage::Upgrade => write!(f, "Upgrade"),
+        }
+    }
+}
+
+impl From<ProtocolMessage> for HandlerMessage {
+    fn from(msg: ProtocolMessage) -> HandlerMessage {
+        match msg {
+            ProtocolMessage::Particle(p) => HandlerMessage::InParticle(p),
+            ProtocolMessage::Upgrade => HandlerMessage::Upgrade,
+        }
+    }
+}
+
\ No newline at end of file diff --git a/src/particle_protocol/libp2p_protocol/upgrade.rs.html b/src/particle_protocol/libp2p_protocol/upgrade.rs.html new file mode 100644 index 0000000000..de658ed9ae --- /dev/null +++ b/src/particle_protocol/libp2p_protocol/upgrade.rs.html @@ -0,0 +1,543 @@ +upgrade.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use asynchronous_codec::{FramedRead, FramedWrite};
+use std::fmt::Debug;
+use std::{io, iter, time::Duration};
+
+use futures::{
+    future::BoxFuture, AsyncRead, AsyncWrite, AsyncWriteExt, FutureExt, SinkExt, StreamExt,
+};
+use libp2p::swarm::OneShotHandlerConfig;
+use libp2p::{
+    core::{InboundUpgrade, OutboundUpgrade, UpgradeInfo},
+    swarm::OneShotHandler,
+};
+use log::LevelFilter;
+use serde::{Deserialize, Serialize};
+
+use crate::libp2p_protocol::codec::FluenceCodec;
+use crate::{HandlerMessage, SendStatus, PROTOCOL_NAME};
+
+#[derive(Clone, Deserialize, Serialize, Debug)]
+pub struct ProtocolConfig {
+    /// Timeout for applying the given upgrade on a substream
+    #[serde(with = "humantime_serde", default = "default_upgrade_timeout")]
+    pub upgrade_timeout: Duration,
+    /// Timeout for outbound substream upgrades.
+    #[serde(
+        with = "humantime_serde",
+        default = "default_outbound_substream_timeout"
+    )]
+    pub outbound_substream_timeout: Duration,
+}
+
+impl Default for ProtocolConfig {
+    fn default() -> Self {
+        Self {
+            upgrade_timeout: default_upgrade_timeout(),
+            outbound_substream_timeout: default_outbound_substream_timeout(),
+        }
+    }
+}
+
+fn default_outbound_substream_timeout() -> Duration {
+    Duration::from_secs(10)
+}
+fn default_upgrade_timeout() -> Duration {
+    Duration::from_secs(10)
+}
+
+impl ProtocolConfig {
+    pub fn new(upgrade_timeout: Duration, outbound_substream_timeout: Duration) -> Self {
+        Self {
+            upgrade_timeout,
+            outbound_substream_timeout,
+        }
+    }
+}
+
+impl<OutProto: libp2p::swarm::handler::OutboundUpgradeSend, OutEvent> From<ProtocolConfig>
+    for OneShotHandler<ProtocolConfig, OutProto, OutEvent>
+{
+    fn from(item: ProtocolConfig) -> OneShotHandler<ProtocolConfig, OutProto, OutEvent> {
+        OneShotHandler::new(
+            libp2p::swarm::handler::SubstreamProtocol::new(item.clone(), ())
+                .with_timeout(item.upgrade_timeout),
+            OneShotHandlerConfig {
+                outbound_substream_timeout: item.outbound_substream_timeout,
+                ..<_>::default()
+            },
+        )
+    }
+}
+
+macro_rules! impl_upgrade_info {
+    ($tname:ident) => {
+        impl UpgradeInfo for $tname {
+            type Info = &'static str;
+            type InfoIter = iter::Once<Self::Info>;
+
+            fn protocol_info(&self) -> Self::InfoIter {
+                iter::once(PROTOCOL_NAME)
+            }
+        }
+    };
+}
+
+impl_upgrade_info!(ProtocolConfig);
+impl_upgrade_info!(HandlerMessage);
+
+impl<Socket> InboundUpgrade<Socket> for ProtocolConfig
+where
+    Socket: AsyncRead + Send + Unpin + 'static,
+{
+    type Output = HandlerMessage;
+    type Error = std::io::Error;
+    type Future = BoxFuture<'static, Result<Self::Output, Self::Error>>;
+
+    fn upgrade_inbound(self, socket: Socket, _: Self::Info) -> Self::Future {
+        async move {
+            let msg = FramedRead::new(socket, FluenceCodec::new())
+                .next()
+                .await
+                .ok_or(io::ErrorKind::UnexpectedEof)??;
+
+            Ok(msg)
+        }
+        .map(|result| match result {
+            Ok(msg) => {
+                if log::log_enabled!(log::Level::Debug) {
+                    log::debug!("Got inbound ProtocolMessage: {:?}", msg);
+                } else {
+                    log::info!("Got inbound ProtocolMessage: {}", msg);
+                }
+                let msg: HandlerMessage = msg.into();
+                Ok(msg)
+            }
+            Err(err) => {
+                log::warn!("Error processing inbound ProtocolMessage: {:?}", err);
+                Err(err)
+            }
+        })
+        .boxed()
+    }
+}
+
+impl<Socket> OutboundUpgrade<Socket> for HandlerMessage
+where
+    Socket: AsyncRead + AsyncWrite + Send + Unpin + 'static,
+{
+    type Output = ();
+    type Error = io::Error;
+    type Future = BoxFuture<'static, Result<Self::Output, Self::Error>>;
+
+    fn upgrade_outbound(self, mut socket: Socket, _: Self::Info) -> Self::Future {
+        async move {
+            let (msg, channel) = self.into_protocol_message();
+
+            if log::max_level() >= LevelFilter::Debug {
+                match serde_json::to_string(&msg) {
+                    Ok(str) => log::debug!("Sending ProtocolMessage: {}", str),
+                    Err(err) => log::warn!("Can't serialize {:?} to string {}", &msg, err),
+                }
+            }
+
+            let write = async move || -> Result<_, io::Error> {
+                FramedWrite::new(&mut socket, FluenceCodec::new())
+                    .send(msg)
+                    .await?;
+
+                // WARNING: It is vitally important to ALWAYS close after all writes
+                //          or some bytes may not be sent and it will lead to `unexpected EOF`
+                //          error on InboundUpgrade side.
+                //          See e.g. https://github.com/libp2p/rust-yamux/issues/117
+                socket.close().await?;
+                Ok(())
+            };
+
+            let result = write().await.map_err(|err| {
+                log::warn!("Error sending ProtocolMessage: {:?}", err);
+                err
+            });
+
+            if let Some(channel) = channel {
+                // it's ok to ignore error here: inlet might be dropped any time
+                let result = match &result {
+                    Ok(_) => SendStatus::Ok,
+                    Err(err) => SendStatus::ProtocolError(format!("{err:?}")),
+                };
+                channel.send(result).ok();
+            }
+
+            result
+        }
+        .boxed()
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use futures::prelude::*;
+    use libp2p::core::transport::{ListenerId, TransportEvent};
+    use libp2p::core::{
+        multiaddr::multiaddr,
+        transport::{memory::MemoryTransport, Transport},
+    };
+    use libp2p::{InboundUpgrade, OutboundUpgrade};
+    use rand::{thread_rng, Rng};
+
+    use crate::libp2p_protocol::message::ProtocolMessage;
+    use crate::{HandlerMessage, ProtocolConfig};
+
+    const BYTES: [u8; 175] = [
+        123, 34, 97, 99, 116, 105, 111, 110, 34, 58, 34, 80, 97, 114, 116, 105, 99, 108, 101, 34,
+        44, 34, 105, 100, 34, 58, 34, 49, 34, 44, 34, 105, 110, 105, 116, 95, 112, 101, 101, 114,
+        95, 105, 100, 34, 58, 34, 49, 50, 68, 51, 75, 111, 111, 87, 67, 74, 104, 76, 98, 78, 51,
+        118, 67, 101, 112, 109, 70, 106, 114, 87, 70, 53, 90, 70, 68, 71, 65, 117, 65, 89, 86, 121,
+        78, 74, 51, 70, 49, 49, 101, 80, 99, 119, 76, 76, 82, 120, 86, 76, 34, 44, 34, 116, 105,
+        109, 101, 115, 116, 97, 109, 112, 34, 58, 49, 54, 49, 55, 55, 51, 55, 48, 49, 54, 57, 51,
+        49, 44, 34, 116, 116, 108, 34, 58, 54, 53, 53, 50, 53, 44, 34, 115, 99, 114, 105, 112, 116,
+        34, 58, 34, 34, 44, 34, 115, 105, 103, 110, 97, 116, 117, 114, 101, 34, 58, 91, 93, 44, 34,
+        100, 97, 116, 97, 34, 58, 34, 34, 125,
+    ];
+
+    #[tokio::test]
+    async fn oneshot_channel_test() {
+        let mem_addr = multiaddr![Memory(thread_rng().gen::<u64>())];
+        let mut transport = MemoryTransport::new().boxed();
+        let listener_id = ListenerId::next();
+        transport.listen_on(listener_id, mem_addr).unwrap();
+
+        let listener_addr = match transport.select_next_some().now_or_never() {
+            Some(TransportEvent::NewAddress { listen_addr, .. }) => listen_addr,
+            p => panic!("MemoryTransport not listening on an address!: {:?}", p),
+        };
+
+        let inbound = tokio::task::spawn(async move {
+            let (listener_upgrade, _) = transport.select_next_some().await.into_incoming().unwrap();
+            // let listener_event = poll_fn(|ctx| Pin::new(&mut transport).poll(ctx)).await;
+            // let listener_event = listener.next().await.unwrap();
+            // let (listener_upgrade, _) = listener_event.unwrap().into_upgrade().unwrap();
+            let conn = listener_upgrade.await.unwrap();
+
+            let config = ProtocolConfig::default();
+            config.upgrade_inbound(conn, "/test/1").await.unwrap()
+        });
+        let msg: ProtocolMessage = serde_json::from_slice(&BYTES).unwrap();
+        let sent_particle = match msg {
+            ProtocolMessage::Particle(p) => p,
+            _ => unreachable!("must be particle"),
+        };
+        let msg = HandlerMessage::OutParticle(sent_particle.clone(), <_>::default());
+        let mut transport = MemoryTransport::new();
+        let c = transport.dial(listener_addr).unwrap().await.unwrap();
+        msg.upgrade_outbound(c, "/test/1").await.unwrap();
+        let received_particle = inbound.await.unwrap();
+
+        match received_particle {
+            HandlerMessage::InParticle(received_particle) => {
+                assert_eq!(sent_particle, received_particle)
+            }
+            _ => unreachable!("must be InParticle"),
+        }
+    }
+
+    #[test]
+    fn deserialize() {
+        let str = r#"{"action":"Particle","id":"2","init_peer_id":"12D3KooWAcn1f5iZ7wbo9QrYPFgq6o7DGkh7VwC8Zucn6DgWZQDo","timestamp":1617733422130,"ttl":65525,"script":"!","signature":[],"data":"MTJEM0tvb1dDM3dhcjhqcTJzaGFVQ2hSZWttYjNNN0RGRGl4ZkdVTm5ydGY0VlRGQVlVdywxMkQzS29vV0o2bVZLYXpKQzdyd2dtd0JpZm5LZ0JoR2NSTWtaOXdRTjY4dmJ1UGdIUjlO"}"#;
+
+        let _: ProtocolMessage = serde_json::from_str(str).unwrap();
+
+        let test_msg: Result<ProtocolMessage, _> = serde_json::from_slice(&BYTES);
+        test_msg.unwrap();
+    }
+}
+
\ No newline at end of file diff --git a/src/particle_protocol/particle.rs.html b/src/particle_protocol/particle.rs.html new file mode 100644 index 0000000000..71494f5dc1 --- /dev/null +++ b/src/particle_protocol/particle.rs.html @@ -0,0 +1,509 @@ +particle.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use std::convert::TryInto;
+use std::sync::Arc;
+use std::time::Duration;
+
+use derivative::Derivative;
+use libp2p::PeerId;
+use serde::{Deserialize, Serialize};
+use tracing::Span;
+
+use crate::error::ParticleError;
+use crate::error::ParticleError::{
+    DecodingError, InvalidKeypair, SignatureVerificationFailed, SigningFailed,
+};
+use fluence_keypair::{KeyPair, PublicKey, Signature};
+use fluence_libp2p::RandomPeerId;
+use now_millis::now_ms;
+use types::peer_id;
+
+#[derive(Clone, Debug)]
+pub struct ExtendedParticle {
+    pub particle: Particle,
+    pub span: Arc<Span>,
+}
+
+impl AsRef<Particle> for ExtendedParticle {
+    fn as_ref(&self) -> &Particle {
+        &self.particle
+    }
+}
+
+impl AsRef<str> for ExtendedParticle {
+    fn as_ref(&self) -> &str {
+        &self.particle.id
+    }
+}
+
+impl ExtendedParticle {
+    pub fn new(particle: Particle, span: Span) -> Self {
+        Self {
+            particle,
+            span: Arc::new(span),
+        }
+    }
+
+    pub fn linked(particle: Particle, span: Arc<Span>) -> Self {
+        Self {
+            particle,
+            span: span.clone(),
+        }
+    }
+}
+
+#[derive(Clone, Serialize, Deserialize, PartialEq, Derivative)]
+#[derivative(Debug)]
+pub struct Particle {
+    pub id: String,
+    #[serde(
+        serialize_with = "peer_id::serde::serialize",
+        deserialize_with = "peer_id::serde::deserialize"
+    )]
+    pub init_peer_id: PeerId,
+    // Unix timestamp in milliseconds
+    pub timestamp: u64,
+    // TTL in milliseconds
+    pub ttl: u32,
+    pub script: String,
+    #[serde(with = "serde_bytes")]
+    pub signature: Vec<u8>,
+    /// base64-encoded
+    #[serde(with = "serde_bytes")]
+    #[derivative(Debug(format_with = "fmt_data"))]
+    pub data: Vec<u8>,
+}
+
+impl Default for Particle {
+    fn default() -> Self {
+        Self {
+            id: "".to_string(),
+            // TODO: sure random peer id is OK as default?
+            init_peer_id: RandomPeerId::random(),
+            timestamp: 0,
+            ttl: 0,
+            script: "".to_string(),
+            signature: vec![],
+            data: vec![],
+        }
+    }
+}
+
+impl Particle {
+    pub fn is_expired(&self) -> bool {
+        if let Some(deadline) = self.deadline() {
+            return now_ms() > deadline as u128;
+        }
+
+        // If timestamp + ttl overflows u64, consider particle expired
+        true
+    }
+
+    /// Deadline in milliseconds
+    #[inline]
+    pub fn deadline(&self) -> Option<u64> {
+        self.timestamp.checked_add(self.ttl as u64)
+    }
+
+    pub fn time_to_live(&self) -> Duration {
+        if let Some(ttl) = self.deadline().and_then(|d| d.checked_sub(now_ms() as u64)) {
+            Duration::from_millis(ttl)
+        } else {
+            Duration::default()
+        }
+    }
+
+    /// return immutable particle fields in bytes for signing
+    /// concatenation of:
+    /// - id as bytes
+    /// - timestamp u64 as little-endian bytes
+    /// - ttl u32 as little-endian bytes
+    /// - script as bytes
+    fn as_bytes(&self) -> Vec<u8> {
+        let mut bytes = vec![];
+        bytes.extend(self.id.as_bytes());
+        bytes.extend(self.timestamp.to_le_bytes());
+        bytes.extend(self.ttl.to_le_bytes());
+        bytes.extend(self.script.as_bytes());
+
+        bytes
+    }
+
+    pub fn sign(&mut self, keypair: &KeyPair) -> Result<(), ParticleError> {
+        if self.init_peer_id != keypair.get_peer_id() {
+            return Err(InvalidKeypair {
+                particle_id: self.id.clone(),
+                init_peer_id: self.init_peer_id.to_base58(),
+                given_peer_id: keypair.get_peer_id().to_base58(),
+            });
+        }
+        self.signature = keypair
+            .sign(self.as_bytes().as_slice())
+            .map_err(|err| SigningFailed {
+                err,
+                particle_id: self.id.clone(),
+            })?
+            .to_vec()
+            .to_vec();
+
+        Ok(())
+    }
+
+    pub fn verify(&self) -> Result<(), ParticleError> {
+        let pk: PublicKey = self.init_peer_id.try_into().map_err(|err| DecodingError {
+            err,
+            particle_id: self.id.clone(),
+        })?;
+        let sig = Signature::from_bytes(pk.get_key_format(), self.signature.clone());
+        pk.verify(&self.as_bytes(), &sig)
+            .map_err(|err| SignatureVerificationFailed {
+                err,
+                particle_id: self.id.clone(),
+                peer_id: self.init_peer_id.to_base58(),
+            })
+    }
+}
+
+#[allow(clippy::ptr_arg)]
+fn fmt_data(data: &Vec<u8>, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
+    use base64::{engine::general_purpose::STANDARD as base64, Engine};
+
+    write!(f, "{}", base64.encode(data))
+}
+
+impl std::fmt::Display for Particle {
+    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+        write!(
+            f,
+            "particle id {}, init_user_id {}, timestamp {}, ttl {}, data [{} bytes]",
+            self.id,
+            self.init_peer_id,
+            self.timestamp,
+            self.ttl,
+            self.data.len()
+        )
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use crate::Particle;
+    use base64::{engine::general_purpose::STANDARD as base64, Engine};
+    use fluence_keypair::{KeyFormat, KeyPair};
+
+    #[test]
+    fn test_signature() {
+        let kp_bytes = base64
+            .decode("7h48PQ/f1rS9TxacmgODxbD42Il9B3KC117jvOPppPE=")
+            .unwrap();
+        assert_eq!(kp_bytes.len(), 32);
+
+        let kp = KeyPair::from_secret_key(kp_bytes, KeyFormat::Ed25519).unwrap();
+
+        // assert peer id
+        assert_eq!(
+            kp.get_peer_id().to_base58(),
+            "12D3KooWANqfCDrV79MZdMnMqTvDdqSAPSxdgFY1L6DCq2DVGB4D"
+        );
+
+        // test simple signature
+        let message = "message".to_string();
+
+        let signature = kp.sign(message.as_bytes()).unwrap();
+        assert!(kp.public().verify(message.as_bytes(), &signature).is_ok());
+        assert_eq!(base64.encode(signature.to_vec()), "sBW7H6/1fwAwF86ldwVm9BDu0YH3w30oFQjTWX0Tiu9yTVZHmxkV2OX4GL5jn0Iz0CrasGcOfozzkZwtJBPMBg==");
+
+        // test particle signature
+        let mut p = Particle {
+            id: "2883f959-e9e7-4843-8c37-205d393ca372".to_string(),
+            init_peer_id: kp.get_peer_id(),
+            timestamp: 1696934545662,
+            ttl: 7000,
+            script: "abc".to_string(),
+            signature: vec![],
+            data: vec![],
+        };
+
+        let particle_bytes = p.as_bytes();
+        assert_eq!(
+            base64.encode(particle_bytes),
+            "Mjg4M2Y5NTktZTllNy00ODQzLThjMzctMjA1ZDM5M2NhMzcy/kguGYsBAABYGwAAYWJj"
+        );
+
+        p.sign(&kp).unwrap();
+        assert!(p.verify().is_ok());
+        assert_eq!(base64.encode(&p.signature), "KceXDnOfqe0dOnAxiDsyWBIvUq6WHoT0ge+VMHXOZsjZvCNH7/10oufdlYfcPomfv28On6E87ZhDcHGBZcb7Bw==");
+    }
+}
+
\ No newline at end of file diff --git a/src/particle_services/app_services.rs.html b/src/particle_services/app_services.rs.html new file mode 100644 index 0000000000..7f25cd9a52 --- /dev/null +++ b/src/particle_services/app_services.rs.html @@ -0,0 +1,3407 @@ +app_services.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+762
+763
+764
+765
+766
+767
+768
+769
+770
+771
+772
+773
+774
+775
+776
+777
+778
+779
+780
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+794
+795
+796
+797
+798
+799
+800
+801
+802
+803
+804
+805
+806
+807
+808
+809
+810
+811
+812
+813
+814
+815
+816
+817
+818
+819
+820
+821
+822
+823
+824
+825
+826
+827
+828
+829
+830
+831
+832
+833
+834
+835
+836
+837
+838
+839
+840
+841
+842
+843
+844
+845
+846
+847
+848
+849
+850
+851
+852
+853
+854
+855
+856
+857
+858
+859
+860
+861
+862
+863
+864
+865
+866
+867
+868
+869
+870
+871
+872
+873
+874
+875
+876
+877
+878
+879
+880
+881
+882
+883
+884
+885
+886
+887
+888
+889
+890
+891
+892
+893
+894
+895
+896
+897
+898
+899
+900
+901
+902
+903
+904
+905
+906
+907
+908
+909
+910
+911
+912
+913
+914
+915
+916
+917
+918
+919
+920
+921
+922
+923
+924
+925
+926
+927
+928
+929
+930
+931
+932
+933
+934
+935
+936
+937
+938
+939
+940
+941
+942
+943
+944
+945
+946
+947
+948
+949
+950
+951
+952
+953
+954
+955
+956
+957
+958
+959
+960
+961
+962
+963
+964
+965
+966
+967
+968
+969
+970
+971
+972
+973
+974
+975
+976
+977
+978
+979
+980
+981
+982
+983
+984
+985
+986
+987
+988
+989
+990
+991
+992
+993
+994
+995
+996
+997
+998
+999
+1000
+1001
+1002
+1003
+1004
+1005
+1006
+1007
+1008
+1009
+1010
+1011
+1012
+1013
+1014
+1015
+1016
+1017
+1018
+1019
+1020
+1021
+1022
+1023
+1024
+1025
+1026
+1027
+1028
+1029
+1030
+1031
+1032
+1033
+1034
+1035
+1036
+1037
+1038
+1039
+1040
+1041
+1042
+1043
+1044
+1045
+1046
+1047
+1048
+1049
+1050
+1051
+1052
+1053
+1054
+1055
+1056
+1057
+1058
+1059
+1060
+1061
+1062
+1063
+1064
+1065
+1066
+1067
+1068
+1069
+1070
+1071
+1072
+1073
+1074
+1075
+1076
+1077
+1078
+1079
+1080
+1081
+1082
+1083
+1084
+1085
+1086
+1087
+1088
+1089
+1090
+1091
+1092
+1093
+1094
+1095
+1096
+1097
+1098
+1099
+1100
+1101
+1102
+1103
+1104
+1105
+1106
+1107
+1108
+1109
+1110
+1111
+1112
+1113
+1114
+1115
+1116
+1117
+1118
+1119
+1120
+1121
+1122
+1123
+1124
+1125
+1126
+1127
+1128
+1129
+1130
+1131
+1132
+1133
+1134
+1135
+1136
+1137
+1138
+1139
+1140
+1141
+1142
+1143
+1144
+1145
+1146
+1147
+1148
+1149
+1150
+1151
+1152
+1153
+1154
+1155
+1156
+1157
+1158
+1159
+1160
+1161
+1162
+1163
+1164
+1165
+1166
+1167
+1168
+1169
+1170
+1171
+1172
+1173
+1174
+1175
+1176
+1177
+1178
+1179
+1180
+1181
+1182
+1183
+1184
+1185
+1186
+1187
+1188
+1189
+1190
+1191
+1192
+1193
+1194
+1195
+1196
+1197
+1198
+1199
+1200
+1201
+1202
+1203
+1204
+1205
+1206
+1207
+1208
+1209
+1210
+1211
+1212
+1213
+1214
+1215
+1216
+1217
+1218
+1219
+1220
+1221
+1222
+1223
+1224
+1225
+1226
+1227
+1228
+1229
+1230
+1231
+1232
+1233
+1234
+1235
+1236
+1237
+1238
+1239
+1240
+1241
+1242
+1243
+1244
+1245
+1246
+1247
+1248
+1249
+1250
+1251
+1252
+1253
+1254
+1255
+1256
+1257
+1258
+1259
+1260
+1261
+1262
+1263
+1264
+1265
+1266
+1267
+1268
+1269
+1270
+1271
+1272
+1273
+1274
+1275
+1276
+1277
+1278
+1279
+1280
+1281
+1282
+1283
+1284
+1285
+1286
+1287
+1288
+1289
+1290
+1291
+1292
+1293
+1294
+1295
+1296
+1297
+1298
+1299
+1300
+1301
+1302
+1303
+1304
+1305
+1306
+1307
+1308
+1309
+1310
+1311
+1312
+1313
+1314
+1315
+1316
+1317
+1318
+1319
+1320
+1321
+1322
+1323
+1324
+1325
+1326
+1327
+1328
+1329
+1330
+1331
+1332
+1333
+1334
+1335
+1336
+1337
+1338
+1339
+1340
+1341
+1342
+1343
+1344
+1345
+1346
+1347
+1348
+1349
+1350
+1351
+1352
+1353
+1354
+1355
+1356
+1357
+1358
+1359
+1360
+1361
+1362
+1363
+1364
+1365
+1366
+1367
+1368
+1369
+1370
+1371
+1372
+1373
+1374
+1375
+1376
+1377
+1378
+1379
+1380
+1381
+1382
+1383
+1384
+1385
+1386
+1387
+1388
+1389
+1390
+1391
+1392
+1393
+1394
+1395
+1396
+1397
+1398
+1399
+1400
+1401
+1402
+1403
+1404
+1405
+1406
+1407
+1408
+1409
+1410
+1411
+1412
+1413
+1414
+1415
+1416
+1417
+1418
+1419
+1420
+1421
+1422
+1423
+1424
+1425
+1426
+1427
+1428
+1429
+1430
+1431
+1432
+1433
+1434
+1435
+1436
+1437
+1438
+1439
+1440
+1441
+1442
+1443
+1444
+1445
+1446
+1447
+1448
+1449
+1450
+1451
+1452
+1453
+1454
+1455
+1456
+1457
+1458
+1459
+1460
+1461
+1462
+1463
+1464
+1465
+1466
+1467
+1468
+1469
+1470
+1471
+1472
+1473
+1474
+1475
+1476
+1477
+1478
+1479
+1480
+1481
+1482
+1483
+1484
+1485
+1486
+1487
+1488
+1489
+1490
+1491
+1492
+1493
+1494
+1495
+1496
+1497
+1498
+1499
+1500
+1501
+1502
+1503
+1504
+1505
+1506
+1507
+1508
+1509
+1510
+1511
+1512
+1513
+1514
+1515
+1516
+1517
+1518
+1519
+1520
+1521
+1522
+1523
+1524
+1525
+1526
+1527
+1528
+1529
+1530
+1531
+1532
+1533
+1534
+1535
+1536
+1537
+1538
+1539
+1540
+1541
+1542
+1543
+1544
+1545
+1546
+1547
+1548
+1549
+1550
+1551
+1552
+1553
+1554
+1555
+1556
+1557
+1558
+1559
+1560
+1561
+1562
+1563
+1564
+1565
+1566
+1567
+1568
+1569
+1570
+1571
+1572
+1573
+1574
+1575
+1576
+1577
+1578
+1579
+1580
+1581
+1582
+1583
+1584
+1585
+1586
+1587
+1588
+1589
+1590
+1591
+1592
+1593
+1594
+1595
+1596
+1597
+1598
+1599
+1600
+1601
+1602
+1603
+1604
+1605
+1606
+1607
+1608
+1609
+1610
+1611
+1612
+1613
+1614
+1615
+1616
+1617
+1618
+1619
+1620
+1621
+1622
+1623
+1624
+1625
+1626
+1627
+1628
+1629
+1630
+1631
+1632
+1633
+1634
+1635
+1636
+1637
+1638
+1639
+1640
+1641
+1642
+1643
+1644
+1645
+1646
+1647
+1648
+1649
+1650
+1651
+1652
+1653
+1654
+1655
+1656
+1657
+1658
+1659
+1660
+1661
+1662
+1663
+1664
+1665
+1666
+1667
+1668
+1669
+1670
+1671
+1672
+1673
+1674
+1675
+1676
+1677
+1678
+1679
+1680
+1681
+1682
+1683
+1684
+1685
+1686
+1687
+1688
+1689
+1690
+1691
+1692
+1693
+1694
+1695
+1696
+1697
+1698
+1699
+1700
+1701
+1702
+1703
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+use std::ops::Deref;
+use std::path::Path;
+use std::time::{Duration, Instant};
+use std::{collections::HashMap, sync::Arc};
+
+use derivative::Derivative;
+use fluence_app_service::{
+    AppService, AppServiceConfig, AppServiceError, AppServiceFactory, CallParameters, EpochTicker,
+    MarineConfig, MarineError, MarineWASIConfig, ModuleDescriptor, SecurityTetraplet,
+    ServiceInterface, WasmtimeConfig,
+};
+use futures::{stream, StreamExt};
+use humantime_serde::re::humantime::format_duration as pretty;
+use serde::{Deserialize, Serialize};
+use serde_json::{json, Value as JValue};
+use tokio::runtime::Handle;
+use tokio_stream::wrappers::IntervalStream;
+use tokio_util::context::TokioContext;
+
+use fluence_libp2p::PeerId;
+use health::HealthCheckRegistry;
+use now_millis::now_ms;
+use particle_args::{Args, JError};
+use particle_execution::{FunctionOutcome, ParticleParams, ParticleVault};
+use particle_modules::ModuleRepository;
+use peer_metrics::{
+    ServiceCallStats, ServiceMemoryStat, ServiceType as MetricServiceType, ServicesMetrics,
+    ServicesMetricsBuiltin,
+};
+use types::peer_scope::PeerScope;
+use uuid_utils::uuid;
+use workers::{PeerScopes, WorkerId, Workers};
+
+use crate::error::ServiceError;
+use crate::error::ServiceError::{AliasAsServiceId, Forbidden, NoSuchAlias};
+use crate::health::PersistedServiceHealth;
+use crate::persistence::{load_persisted_services, remove_persisted_service, PersistedService};
+use crate::ParticleAppServicesConfig;
+use crate::ServiceError::{
+    FailedToCreateDirectory, ForbiddenAlias, ForbiddenAliasRoot, ForbiddenAliasWorker,
+    InternalError, NoSuchService,
+};
+
+type ServiceId = String;
+type ServiceAlias = String;
+
+#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
+#[serde(rename_all = "lowercase")]
+pub enum ServiceType {
+    Service,
+    Spell,
+}
+
+impl ServiceType {
+    pub fn is_spell(&self) -> bool {
+        matches!(self, ServiceType::Spell)
+    }
+}
+
+#[derive(Debug)]
+pub struct ServiceInfo {
+    pub id: String,
+    pub blueprint_id: String,
+    pub service_type: ServiceType,
+    pub owner_id: PeerId,
+    pub aliases: Vec<ServiceAlias>,
+    pub peer_scope: PeerScope,
+}
+
+#[derive(Derivative)]
+#[derivative(Debug)]
+pub struct Service {
+    #[derivative(Debug(format_with = "fmt_service"))]
+    pub service: tokio::sync::Mutex<AppService>,
+    pub service_id: String,
+    pub blueprint_id: String,
+    pub service_type: ServiceType,
+    pub owner_id: PeerId,
+    pub aliases: tokio::sync::RwLock<Vec<ServiceAlias>>,
+    pub peer_scope: PeerScope,
+}
+
+impl Service {
+    pub fn new(
+        service: tokio::sync::Mutex<AppService>,
+        service_id: String,
+        blueprint_id: String,
+        service_type: ServiceType,
+        owner_id: PeerId,
+        aliases: Vec<ServiceAlias>,
+        peer_scope: PeerScope,
+    ) -> Self {
+        Self {
+            service,
+            service_id,
+            blueprint_id,
+            service_type,
+            owner_id,
+            aliases: tokio::sync::RwLock::new(aliases),
+            peer_scope,
+        }
+    }
+
+    pub async fn remove_alias(&self, alias: &str) {
+        let mut aliases = self.aliases.write().await;
+        if let Some(pos) = aliases.iter().position(|x| *x == alias) {
+            aliases.remove(pos);
+        }
+    }
+
+    pub async fn add_alias(&self, alias: String) {
+        self.aliases.write().await.push(alias);
+    }
+
+    pub async fn get_info(&self, id: &str) -> ServiceInfo {
+        ServiceInfo {
+            id: id.to_string(),
+            blueprint_id: self.blueprint_id.clone(),
+            service_type: self.service_type.clone(),
+            owner_id: self.owner_id,
+            aliases: self.aliases.read().await.clone(),
+            peer_scope: self.peer_scope,
+        }
+    }
+}
+
+impl Deref for Service {
+    type Target = tokio::sync::Mutex<AppService>;
+
+    fn deref(&self) -> &Self::Target {
+        &self.service
+    }
+}
+
+fn fmt_service(
+    _: &tokio::sync::Mutex<AppService>,
+    f: &mut std::fmt::Formatter<'_>,
+) -> Result<(), std::fmt::Error> {
+    f.debug_struct("Mutex<AppService>").finish()
+}
+
+#[derive(Serialize)]
+pub struct VmDescriptor<'a> {
+    interface: ServiceInterface,
+    blueprint_id: &'a str,
+    service_id: &'a str,
+    owner_id: &'a str,
+}
+
+#[derive(Derivative)]
+#[derivative(Debug, Clone, Default)]
+struct Services {
+    services: Arc<tokio::sync::RwLock<HashMap<ServiceId, Arc<Service>>>>,
+    aliases: Arc<tokio::sync::RwLock<HashMap<ServiceAlias, ServiceId>>>,
+}
+
+#[derive(Derivative)]
+#[derivative(Debug, Clone)]
+pub struct ParticleAppServices {
+    config: ParticleAppServicesConfig,
+    // TODO: move vault to Plumber or Actor
+    pub vault: ParticleVault,
+    root_services: Services,
+    #[derivative(Debug = "ignore")]
+    root_runtime_handle: Handle,
+    worker_services: Arc<tokio::sync::RwLock<HashMap<WorkerId, Services>>>,
+    modules: ModuleRepository,
+    #[derivative(Debug = "ignore")]
+    workers: Arc<Workers>,
+    #[derivative(Debug = "ignore")]
+    scopes: PeerScopes,
+    pub metrics: Option<ServicesMetrics>,
+    health: Option<PersistedServiceHealth>,
+    #[derivative(Debug = "ignore")]
+    app_service_factory: AppServiceFactory,
+    #[derivative(Debug = "ignore")]
+    app_service_epoch_ticker: EpochTicker,
+}
+
+async fn resolve_alias(
+    services: &Services,
+    alias: &String,
+    particle_id: &str,
+) -> Option<ServiceId> {
+    if alias == "spell" || alias == "self" {
+        if let Some(spell_id) = ParticleParams::get_spell_id(particle_id) {
+            return Some(spell_id);
+        }
+    }
+
+    services.aliases.read().await.get(alias).cloned()
+}
+
+fn get_service(
+    services: &HashMap<ServiceId, Arc<Service>>,
+    peer_scope: PeerScope,
+    service_id: ServiceId,
+) -> Result<Arc<Service>, ServiceError> {
+    let service = services
+        .get(&service_id)
+        .ok_or(NoSuchService(service_id.to_string(), peer_scope))?;
+
+    Ok(service.clone())
+}
+
+impl ParticleAppServices {
+    pub fn new(
+        config: ParticleAppServicesConfig,
+        modules: ModuleRepository,
+        metrics: Option<ServicesMetrics>,
+        health_registry: Option<&mut HealthCheckRegistry>,
+        workers: Arc<Workers>,
+        scope: PeerScopes,
+    ) -> Result<Self, ServiceError> {
+        let vault = ParticleVault::new(config.particles_vault_dir.clone());
+        let root_runtime_handle = Handle::current();
+
+        let health = health_registry.map(|registry| {
+            let persisted_services = PersistedServiceHealth::new();
+            registry.register("persisted_services", persisted_services.clone());
+            persisted_services
+        });
+
+        let wasmtime_config: WasmtimeConfig = config.wasm_backend_config.clone().into();
+
+        let (app_service_factory, epoch_ticker) =
+            AppServiceFactory::new(wasmtime_config).map_err(ServiceError::Engine)?;
+
+        // TODO: make a setting for that
+        let stream = IntervalStream::new(tokio::time::interval(Duration::from_secs(1)));
+        let ticket = epoch_ticker.clone();
+        tokio::task::spawn(async move {
+            stream
+                .for_each(|_| async {
+                    ticket.increment_epoch();
+                })
+                .await;
+        });
+
+        Ok(Self {
+            config,
+            vault,
+            root_services: <_>::default(),
+            root_runtime_handle,
+            worker_services: <_>::default(),
+            modules,
+            workers,
+            scopes: scope,
+            metrics,
+            health,
+            app_service_factory,
+            app_service_epoch_ticker: epoch_ticker,
+        })
+    }
+
+    pub async fn create_service(
+        &self,
+        peer_scope: PeerScope,
+        service_type: ServiceType,
+        blueprint_id: String,
+        owner_id: PeerId,
+    ) -> Result<String, ServiceError> {
+        let service_id = uuid::Uuid::new_v4().to_string();
+
+        let runtime_handle = match peer_scope {
+            PeerScope::WorkerId(worker_id) => self
+                .workers
+                .get_runtime_handle(worker_id)
+                .ok_or(ServiceError::WorkerNotFound { worker_id })?,
+            PeerScope::Host => self.root_runtime_handle.clone(),
+        };
+
+        let fut = async {
+            self.create_service_inner(
+                service_type,
+                blueprint_id,
+                owner_id,
+                peer_scope,
+                service_id.clone(),
+                vec![],
+            )
+            .await
+        };
+
+        TokioContext::new(fut, runtime_handle).await?;
+
+        Ok(service_id)
+    }
+
+    pub async fn service_exists(&self, peer_scope: &PeerScope, service_id: &str) -> bool {
+        let services = self.get_services(peer_scope).await;
+        match services {
+            Ok(services) => services.services.read().await.get(service_id).is_some(),
+            Err(_) => false,
+        }
+    }
+
+    pub async fn get_service_info(
+        &self,
+        peer_scope: PeerScope,
+        service_id_or_alias: String,
+        particle_id: &str,
+    ) -> Result<ServiceInfo, ServiceError> {
+        let (service, service_id) = self
+            .get_service(peer_scope, service_id_or_alias, particle_id)
+            .await?;
+
+        Ok(service.get_info(&service_id).await)
+    }
+
+    pub async fn remove_services(&self, peer_scope: PeerScope) -> Result<(), ServiceError> {
+        let services = self.get_services(&peer_scope).await?;
+        let service_ids: Vec<ServiceId> = services.services.read().await.keys().cloned().collect();
+
+        for srv_id in service_ids {
+            // TODO: can be parallelized
+            if let Err(err) =
+                remove_persisted_service(&self.config.services_dir, srv_id.clone()).await
+            {
+                tracing::warn!(
+                    "Error while removing persisted service for {service_id}: {:?}",
+                    err,
+                    service_id = srv_id,
+                )
+            }
+        }
+        let services = self.get_services(&peer_scope).await?;
+
+        let mut aliases = services.aliases.write().await;
+        let mut services = services.services.write().await;
+
+        aliases.clear();
+        services.clear();
+
+        Ok(())
+    }
+
+    pub async fn remove_service(
+        &self,
+        peer_scope: PeerScope,
+        particle_id: &str,
+        service_id_or_alias: &str,
+        init_peer_id: PeerId,
+        allow_remove_spell: bool,
+    ) -> Result<(), ServiceError> {
+        let removal_start_time = Instant::now();
+        let service_id = {
+            let (service, service_id) = self
+                .get_service(peer_scope, service_id_or_alias.to_string(), particle_id)
+                .await?;
+
+            // tmp hack to forbid spell removal via srv.remove
+            if service.service_type.is_spell() && !allow_remove_spell {
+                return Err(Forbidden {
+                    user: init_peer_id,
+                    function: "remove_service",
+                    reason: "cannot remove a spell",
+                });
+            } else if !service.service_type.is_spell() && allow_remove_spell {
+                return Err(Forbidden {
+                    user: init_peer_id,
+                    function: "remove_spell",
+                    reason: "the service isn't a spell",
+                });
+            }
+
+            // TODO: HACK:
+            //  What a mess.
+            //  service.owner_id has created the service, so can remove. that's OK.
+            //  management_peer_id is the node admin, can remove any service. that's OK.
+            //  service.worker_id is the worker itself, so can remove. that's OK.
+
+            let service_worker_id: PeerId = self.scopes.to_peer_id(peer_scope);
+
+            if service_worker_id != init_peer_id
+                && service.owner_id != init_peer_id
+                && !self.scopes.is_management(init_peer_id)
+            {
+                return Err(Forbidden {
+                    user: init_peer_id,
+                    function: "remove_service",
+                    reason: "only creator can remove service",
+                });
+            }
+
+            service_id
+        };
+
+        if let Err(err) =
+            remove_persisted_service(&self.config.services_dir, service_id.clone()).await
+        {
+            tracing::warn!(
+                "Error while removing persisted service for {}: {:?}",
+                service_id,
+                err
+            )
+        }
+        let services = self.get_services(&peer_scope).await?;
+        let mut aliases = services.aliases.write().await;
+        let mut services = services.services.write().await;
+        let service = services.remove(service_id.as_str()).unwrap();
+        let service_aliases = service.aliases.read().await;
+        for alias in service_aliases.iter() {
+            aliases.remove(alias.as_str());
+        }
+        let service_type = self.get_service_type(&service, &service.peer_scope).await;
+
+        let removal_end_time = removal_start_time.elapsed().as_secs();
+        if let Some(metrics) = self.metrics.as_ref() {
+            metrics.observe_removed(service_type, removal_end_time as f64);
+        }
+
+        Ok(())
+    }
+
+    pub async fn call_service(
+        &self,
+        function_args: Args,
+        particle: ParticleParams,
+        create_vault: bool,
+    ) -> FunctionOutcome {
+        let peer_scope = particle.peer_scope;
+        let timestamp = particle.timestamp;
+
+        let service = self
+            .get_service(peer_scope, function_args.service_id.clone(), &particle.id)
+            .await;
+
+        let (service, service_id) = match service {
+            Ok(found) => found,
+            // If service is not found, report it
+            Err(_err) => {
+                return FunctionOutcome::NotDefined {
+                    args: function_args,
+                    params: particle,
+                };
+            }
+        };
+
+        // TODO: figure out how to check for builtins (like registry, aqua-ipfs)
+        // if service.worker_id != worker_id {
+        //     return FunctionOutcome::Err(JError::from(
+        //         ServiceError::CallServiceFailedWrongWorker {
+        //             service_id,
+        //             worker_id,
+        //         },
+        //     ));
+        // }
+        // Metrics collection are enables for services with aliases which are installed on root worker or worker spells.
+        let service_type = self.get_service_type(service.as_ref(), &peer_scope).await;
+
+        // TODO: move particle vault creation to aquamarine::particle_functions
+        if create_vault {
+            self.vault.create(
+                self.scopes.to_peer_id(particle.peer_scope),
+                &particle.id,
+                &particle.token,
+            )?;
+        }
+
+        let call_parameters_worker_id = self.scopes.to_peer_id(peer_scope);
+
+        let params = CallParameters {
+            particle: particle.to_particle_parameters(),
+            service_id: service_id.clone(),
+            service_creator_peer_id: service.owner_id.to_string(),
+            host_id: self.scopes.get_host_peer_id().to_string(),
+            worker_id: call_parameters_worker_id.to_string(),
+            tetraplets: function_args
+                .tetraplets
+                .into_iter()
+                .map(|sts| {
+                    sts.into_iter()
+                        .map(|st| SecurityTetraplet {
+                            peer_pk: st.peer_pk,
+                            service_id: st.service_id,
+                            function_name: st.function_name,
+                            lens: st.lens,
+                        })
+                        .collect()
+                })
+                .collect(),
+        };
+        let function_name = function_args.function_name;
+
+        let lock_acquire_start = Instant::now();
+        let mut service = service.lock().await;
+        let old_memory = service.module_memory_stats();
+        let old_mem_usage = ServicesMetricsBuiltin::get_used_memory(&old_memory);
+        // TODO async-marine: set execution timeout https://github.com/fluencelabs/fluence/issues/1212
+        let call_time_start = Instant::now();
+
+        let result = service
+            .call_async(
+                function_name.clone(),
+                JValue::Array(function_args.function_args),
+                params,
+            )
+            .await;
+
+        let result = result.map_err(|e| {
+            if let Some(metrics) = self.metrics.as_ref() {
+                let stats = ServiceCallStats::Fail { timestamp };
+                // If the called function is unknown we don't want to save info
+                // about it in a separate entry.
+                let function_name = if is_unknown_function(&e) {
+                    None
+                } else {
+                    Some(function_name.clone())
+                };
+                metrics.observe_service_state_failed(
+                    service_id.clone(),
+                    function_name,
+                    service_type.clone(),
+                    stats,
+                );
+            }
+            ServiceError::Engine(e)
+        })?;
+
+        if let Some(metrics) = self.metrics.as_ref() {
+            let call_time_sec = call_time_start.elapsed().as_secs_f64();
+            let lock_wait_time_sec = lock_acquire_start.elapsed().as_secs_f64();
+            let new_memory = service.module_memory_stats();
+            let new_memory_usage = ServicesMetricsBuiltin::get_used_memory(&new_memory);
+
+            let memory_delta_bytes = new_memory_usage - old_mem_usage;
+            let stats = ServiceCallStats::Success {
+                memory_delta_bytes: memory_delta_bytes as f64,
+                call_time_sec,
+                lock_wait_time_sec,
+                timestamp,
+            };
+
+            metrics.observe_service_state(
+                service_id,
+                function_name,
+                service_type,
+                ServiceMemoryStat::new(&new_memory),
+                stats,
+            );
+        }
+
+        FunctionOutcome::Ok(result)
+    }
+
+    // TODO: is it safe?
+    #[allow(clippy::too_many_arguments)]
+    pub async fn call_function(
+        &self,
+        peer_scope: PeerScope,
+        service_id: &str,
+        function_name: &str,
+        function_args: Vec<JValue>,
+        particle_id: Option<String>,
+        init_peer_id: PeerId,
+        particle_ttl: Duration,
+    ) -> FunctionOutcome {
+        let args = Args {
+            service_id: service_id.to_string(),
+            function_name: function_name.to_string(),
+            function_args,
+            tetraplets: vec![],
+        };
+
+        let particle = ParticleParams {
+            id: particle_id.unwrap_or(uuid()),
+            init_peer_id,
+            peer_scope,
+            timestamp: now_ms() as u64,
+            ttl: particle_ttl.as_millis() as u32,
+            script: "".to_string(),
+            signature: vec![],
+            // TODO: Is it safe?
+            token: "host_call".to_string(),
+        };
+
+        self.call_service(args, particle, false).await
+    }
+
+    async fn add_alias_inner(
+        &self,
+        alias: String,
+        peer_scope: PeerScope,
+        service_id: ServiceId,
+    ) -> Result<(), ServiceError> {
+        let service = {
+            let services = self.get_or_create_services(peer_scope).await;
+            let mut aliases_service_id_mapping = services.aliases.write().await;
+            let services_id_mapping = services.services.write().await;
+
+            let service = get_service(&services_id_mapping, peer_scope, service_id.clone())?;
+            service.add_alias(alias.clone()).await;
+            aliases_service_id_mapping.insert(alias, service_id);
+            PersistedService::from_service(service.as_ref()).await
+        };
+
+        service.persist(&self.config.services_dir).await
+    }
+
+    async fn get_or_create_services(&self, peer_scope: PeerScope) -> Services {
+        match peer_scope {
+            PeerScope::WorkerId(worker_id) => self.get_or_create_worker_services(worker_id).await,
+            PeerScope::Host => self.root_services.clone(),
+        }
+    }
+
+    async fn get_services(&self, peer_scope: &PeerScope) -> Result<Services, ServiceError> {
+        match peer_scope {
+            PeerScope::WorkerId(worker_id) => {
+                let worker_services = self.worker_services.read().await;
+                let services =
+                    worker_services
+                        .get(worker_id)
+                        .ok_or(ServiceError::WorkerNotFound {
+                            worker_id: *worker_id,
+                        })?;
+                Ok(services.clone())
+            }
+            PeerScope::Host => Ok(self.root_services.clone()),
+        }
+    }
+
+    pub async fn get_service(
+        &self,
+        peer_scope: PeerScope,
+        id_or_alias: String,
+        particle_id: &str,
+    ) -> Result<(Arc<Service>, String), ServiceError> {
+        let services = self.get_services(&peer_scope).await?;
+        let services_id_mapping = services.services.read().await;
+
+        // retrieve service by service id
+        let service = get_service(&services_id_mapping, peer_scope, id_or_alias.clone()).ok();
+
+        if let Some(service) = service {
+            return Ok((service, id_or_alias));
+        }
+
+        // retrieve service by alias
+        let resolved_id = resolve_alias(&services, &id_or_alias, particle_id)
+            .await
+            .ok_or(NoSuchService(id_or_alias.clone(), peer_scope))?;
+
+        let service = get_service(&services_id_mapping, peer_scope, resolved_id.clone())?;
+
+        Ok((service, resolved_id))
+    }
+
+    async fn get_service_id(&self, peer_scope: PeerScope, alias: &str) -> Option<ServiceId> {
+        let services = self.get_services(&peer_scope).await;
+        match services {
+            Ok(services) => services.aliases.read().await.get(alias).cloned(),
+            Err(_) => None,
+        }
+    }
+
+    async fn remove_alias(
+        &self,
+        alias: String,
+        peer_scope: PeerScope,
+        service_id: &str,
+    ) -> Result<(), ServiceError> {
+        let service = {
+            let services = self.get_or_create_services(peer_scope).await;
+            let services_id_mapping = services.services.write().await;
+            let service = get_service(&services_id_mapping, peer_scope, service_id.to_string())?;
+            service.remove_alias(&alias).await;
+            PersistedService::from_service(service.as_ref()).await
+        };
+
+        service.persist(&self.config.services_dir).await
+    }
+
+    pub async fn add_alias(
+        &self,
+        peer_scope: PeerScope,
+        alias: String,
+        service_id: String,
+        init_peer_id: PeerId,
+    ) -> Result<(), ServiceError> {
+        let is_management = self.scopes.is_management(init_peer_id);
+
+        if !is_management {
+            match peer_scope {
+                PeerScope::WorkerId(worker_id) => {
+                    let worker_creator = self
+                        .workers
+                        .get_worker_creator(worker_id)
+                        .map_err(|e| InternalError(format!("{e:?}")))?;
+
+                    if init_peer_id != worker_creator && init_peer_id != worker_id.into() {
+                        return Err(ForbiddenAliasWorker(init_peer_id));
+                    }
+                }
+                PeerScope::Host => {
+                    if init_peer_id != self.scopes.get_host_peer_id() {
+                        return Err(ForbiddenAliasRoot(init_peer_id));
+                    }
+                }
+            }
+        }
+
+        // alias can't be equal to any existent service id
+        if self.service_exists(&peer_scope, &alias).await {
+            return Err(AliasAsServiceId(alias));
+        }
+
+        if alias == "spell" || alias == "self" {
+            return Err(ForbiddenAlias(alias));
+        }
+
+        // Allow only HOST add alias "worker-spell"
+        if alias == "worker-spell" && !self.scopes.is_host(init_peer_id) && !is_management {
+            return Err(ForbiddenAlias(alias));
+        }
+
+        if !self.service_exists(&peer_scope, &service_id).await {
+            return Err(NoSuchService(service_id, peer_scope));
+        }
+
+        let prev_srv_id = self.get_service_id(peer_scope, &alias).await;
+        if let Some(srv_id) = prev_srv_id {
+            self.remove_alias(alias.clone(), peer_scope, &srv_id)
+                .await?;
+        }
+
+        self.add_alias_inner(alias.clone(), peer_scope, service_id.clone())
+            .await?;
+
+        Ok(())
+    }
+
+    pub async fn resolve_alias(
+        &self,
+        peer_scope: PeerScope,
+        alias: String,
+        particle_id: &str,
+    ) -> Result<String, ServiceError> {
+        let services = self.get_or_create_services(peer_scope).await;
+        resolve_alias(&services, &alias, particle_id)
+            .await
+            .ok_or_else(|| NoSuchAlias(alias, peer_scope))
+    }
+
+    pub async fn to_service_id(
+        &self,
+        peer_scope: PeerScope,
+        service_id_or_alias: String,
+        particle_id: &str,
+    ) -> Result<String, ServiceError> {
+        let (_, service_id) = self
+            .get_service(peer_scope, service_id_or_alias, particle_id)
+            .await?;
+        Ok(service_id)
+    }
+
+    pub async fn get_service_owner(
+        &self,
+        peer_scope: PeerScope,
+        id_or_alias: String,
+        particle_id: &str,
+    ) -> Result<PeerId, ServiceError> {
+        let (service, _) = self
+            .get_service(peer_scope, id_or_alias, particle_id)
+            .await?;
+
+        Ok(service.owner_id)
+    }
+
+    pub async fn check_service_worker_id(
+        &self,
+        peer_scope: PeerScope,
+        id_or_alias: String,
+        particle_id: &str,
+    ) -> Result<(), ServiceError> {
+        let (service, _) = self
+            .get_service(peer_scope, id_or_alias.clone(), particle_id)
+            .await?;
+
+        if service.peer_scope != peer_scope {
+            Err(ServiceError::CallServiceFailedWrongWorker {
+                service_id: id_or_alias,
+                peer_scope,
+            })
+        } else {
+            Ok(())
+        }
+    }
+
+    pub async fn get_interface(
+        &self,
+        peer_scope: PeerScope,
+        service_id: String,
+        particle_id: &str,
+    ) -> Result<JValue, ServiceError> {
+        let (service, _) = self
+            .get_service(peer_scope, service_id, particle_id)
+            .await?;
+
+        Ok(self.modules.get_facade_interface(&service.blueprint_id)?)
+    }
+
+    pub async fn list_services_all(&self) -> Vec<ServiceInfo> {
+        let root_services = self.root_services.services.read().await;
+
+        let root_info: Vec<ServiceInfo> = stream::iter(root_services.iter())
+            .then(|(id, service)| async { service.get_info(id).await })
+            .collect()
+            .await;
+
+        drop(root_services);
+
+        let worker_services = self.worker_services.read().await;
+
+        let mut result: Vec<ServiceInfo> = futures::stream::iter(worker_services.iter())
+            .then(|(_, services)| async {
+                let services = services.services.read().await;
+                let services: Vec<ServiceInfo> = futures::stream::iter(services.iter())
+                    .then(|(id, service)| {
+                        let id = id.clone();
+                        let service = service.clone();
+                        async move { service.get_info(id.as_str()).await }
+                    })
+                    .collect()
+                    .await;
+
+                services
+            })
+            .fold(Vec::new(), |mut acc, item| async {
+                acc.extend(item);
+                acc
+            })
+            .await;
+        result.extend(root_info);
+        result
+    }
+
+    pub async fn list_services(&self, peer_scope: PeerScope) -> Vec<ServiceInfo> {
+        let services = self.get_services(&peer_scope).await;
+        match services {
+            Ok(services) => {
+                let services = services.services.read().await;
+
+                futures::stream::iter(services.iter())
+                    .then(|(id, srv)| {
+                        let srv = srv.clone();
+                        let id = id.clone();
+                        async move { srv.get_info(&id).await }
+                    })
+                    .collect()
+                    .await
+            }
+            Err(_) => {
+                vec![]
+            }
+        }
+    }
+
+    pub async fn get_service_mem_stats(
+        &self,
+        peer_scope: PeerScope,
+        service_id: String,
+        particle_id: &str,
+    ) -> Result<Vec<JValue>, JError> {
+        let (service, _) = self
+            .get_service(peer_scope, service_id, particle_id)
+            .await?;
+
+        let lock = service.service.lock().await;
+        let stats = lock.module_memory_stats();
+        let stats = stats
+            .modules
+            .into_iter()
+            .map(|stat| {
+                json!({
+                    "name": stat.name,
+                    "memory_size_bytes": stat.memory_size,
+                })
+            })
+            .collect();
+
+        // TODO: report service memory limit
+        // TODO: report allocation rejects (cleared after each call, optional value but always Some on wasmtime)
+        Ok(stats)
+    }
+
+    pub async fn create_persisted_services(&mut self) -> eyre::Result<()> {
+        let services = load_persisted_services(&self.config.services_dir).await?;
+        let loaded_service_count = services.len();
+        if let Some(h) = self.health.as_mut() {
+            h.start_creation()
+        }
+
+        let mut created_service_count = 0;
+        for (service, _) in services {
+            let start = Instant::now();
+            // If the service_type doesn't set in PersistedService, will try to find out if it's a spell by blueprint name
+            // This is mostly done for migration from the old detection method to the new.
+            let service_type = service.service_type.unwrap_or_else(|| {
+                let is_spell: Option<_> = try {
+                    let blueprint_name = self
+                        .modules
+                        .get_blueprint_from_cache(&service.blueprint_id)
+                        .ok()?
+                        .name;
+                    blueprint_name == "spell"
+                };
+                if is_spell.unwrap_or(false) {
+                    ServiceType::Spell
+                } else {
+                    ServiceType::Service
+                }
+            });
+            let result = self
+                .create_service_inner(
+                    service_type,
+                    service.blueprint_id,
+                    service.owner_id,
+                    service.peer_scope,
+                    service.service_id.clone(),
+                    service.aliases.clone(),
+                )
+                .await;
+            let replaced = match result {
+                Ok(replaced) => replaced,
+                Err(err) => {
+                    #[rustfmt::skip]
+                    tracing::warn!("Error creating service for persisted service {}: {:#?}", service.service_id, err);
+                    continue;
+                }
+            };
+
+            match service.peer_scope {
+                PeerScope::WorkerId(worker_id) => {
+                    let services = self.get_or_create_worker_services(worker_id).await;
+                    let mut aliases = services.aliases.write().await;
+                    for alias in service.aliases.iter() {
+                        let old = aliases.insert(alias.clone(), service.service_id.clone());
+                        if let Some(old) = old {
+                            tracing::warn!(
+                                "Alias `{}` is the same for {} and {}",
+                                alias,
+                                old,
+                                service.service_id
+                            );
+                        }
+                    }
+                }
+                PeerScope::Host => {
+                    let mut aliases = self.root_services.aliases.write().await;
+                    for alias in service.aliases.iter() {
+                        let old = aliases.insert(alias.clone(), service.service_id.clone());
+                        if let Some(old) = old {
+                            tracing::warn!(
+                                "Alias `{}` is the same for {} and {}",
+                                alias,
+                                old,
+                                service.service_id
+                            );
+                        }
+                    }
+                }
+            };
+
+            debug_assert!(
+                replaced.is_none(),
+                "shouldn't replace any existing services"
+            );
+            created_service_count += 1;
+            tracing::info!(
+                "Persisted service {} created in {}, aliases: {:?}",
+                service.service_id,
+                pretty(start.elapsed()),
+                service.aliases
+            );
+        }
+        if created_service_count == loaded_service_count {
+            if let Some(h) = self.health.as_mut() {
+                h.finish_creation()
+            }
+        };
+        Ok(())
+    }
+
+    async fn create_service_inner(
+        &self,
+        service_type: ServiceType,
+        blueprint_id: String,
+        owner_id: PeerId,
+        peer_scope: PeerScope,
+        service_id: String,
+        aliases: Vec<String>,
+    ) -> Result<Option<Arc<Service>>, ServiceError> {
+        let creation_start_time = Instant::now();
+        let service = self
+            .create_app_service(
+                self.scopes.to_peer_id(peer_scope),
+                blueprint_id.clone(),
+                service_id.clone(),
+            )
+            .await
+            .inspect_err(|_| {
+                if let Some(metrics) = self.metrics.as_ref() {
+                    metrics.observe_created_failed();
+                }
+            })?;
+        let stats = service.module_memory_stats();
+        let stats = ServiceMemoryStat::new(&stats);
+
+        let service = Service::new(
+            tokio::sync::Mutex::new(service),
+            service_id.clone(),
+            blueprint_id,
+            service_type,
+            owner_id,
+            aliases,
+            peer_scope,
+        );
+        let service = Arc::new(service);
+        // Save created service to disk, so it is recreated on restart
+        let persisted_service = PersistedService::from_service(&service).await;
+        persisted_service.persist(&self.config.services_dir).await?;
+        let service_type = self.get_service_type(&service, &peer_scope).await;
+        let services = self.get_or_create_services(peer_scope).await;
+        let replaced = services
+            .services
+            .write()
+            .await
+            .insert(service_id.clone(), service);
+
+        if let Some(m) = self.metrics.as_ref() {
+            let creation_end_time = creation_start_time.elapsed().as_secs();
+            m.observe_created(service_id, service_type, stats, creation_end_time as f64);
+        }
+
+        Ok(replaced)
+    }
+
+    async fn get_or_create_worker_services(&self, worker_id: WorkerId) -> Services {
+        let lock = self.worker_services.read().await;
+        let worker_services = lock.get(&worker_id);
+        match worker_services {
+            None => {
+                drop(lock);
+                let mut workers_services = self.worker_services.write().await;
+                //we double check it, because it can be created in another thread
+                let services = workers_services.get(&worker_id);
+                match services {
+                    None => {
+                        let services = Services::default();
+                        workers_services.insert(worker_id, services.clone());
+                        services
+                    }
+                    Some(services) => services.clone(),
+                }
+            }
+            Some(services) => services.clone(),
+        }
+    }
+
+    fn inject_default_wasi(&self, module: &mut ModuleDescriptor) {
+        let wasi = &mut module.config.wasi;
+        if wasi.is_none() {
+            *wasi = Some(MarineWASIConfig::default());
+        }
+    }
+
+    async fn inject_persistent_dirs(
+        &self,
+        module: &mut ModuleDescriptor,
+        persistent_dir: &Path,
+    ) -> Result<(), ServiceError> {
+        let module_dir = persistent_dir.join(&module.import_name);
+        tokio::fs::create_dir_all(&module_dir)
+            .await
+            .map_err(|err| FailedToCreateDirectory {
+                path: module_dir.clone(),
+                err,
+            })?;
+
+        let wasi = module.config.wasi.as_mut().ok_or(InternalError(
+            "Could not inject persistent dirs into empty WASI config".to_string(),
+        ))?;
+        wasi.mapped_dirs
+            .insert("/storage".into(), persistent_dir.to_path_buf());
+        wasi.mapped_dirs
+            .insert("/storage/module".into(), module_dir);
+        Ok(())
+    }
+
+    async fn inject_ephemeral_dirs(
+        &self,
+        module: &mut ModuleDescriptor,
+        ephemeral_dir: &Path,
+    ) -> Result<(), ServiceError> {
+        let module_dir = ephemeral_dir.join(&module.import_name);
+        tokio::fs::create_dir_all(&module_dir)
+            .await
+            .map_err(|err| FailedToCreateDirectory {
+                path: module_dir.clone(),
+                err,
+            })?;
+
+        let wasi = module.config.wasi.as_mut().ok_or(InternalError(
+            "Could not inject ephemeral dirs into empty WASI config".to_string(),
+        ))?;
+        wasi.mapped_dirs
+            .insert("/tmp".into(), ephemeral_dir.to_path_buf());
+        wasi.mapped_dirs.insert("/tmp/module".into(), module_dir);
+        Ok(())
+    }
+
+    async fn create_app_service(
+        &self,
+        current_peer_id: PeerId,
+        blueprint_id: String,
+        service_id: String,
+    ) -> Result<AppService, ServiceError> {
+        let persistent_dir = self.config.persistent_work_dir.join(&service_id);
+        let ephemeral_dir = self.config.ephemeral_work_dir.join(&service_id);
+
+        // TODO: introduce separate errors
+        tokio::fs::create_dir_all(&persistent_dir)
+            .await
+            .map_err(|err| FailedToCreateDirectory {
+                path: persistent_dir.clone(),
+                err,
+            })?;
+        tokio::fs::create_dir_all(&ephemeral_dir)
+            .await
+            .map_err(|err| FailedToCreateDirectory {
+                path: ephemeral_dir.clone(),
+                err,
+            })?;
+
+        let mut modules_config = self.modules.resolve_blueprint(&blueprint_id)?;
+
+        // Create Particle File Vault for Worker
+        self.vault.initialize_worker(current_peer_id)?;
+
+        for module in modules_config.iter_mut() {
+            self.inject_default_wasi(module);
+            // SAFETY: set wasi to Some in the code before calling inject_vault
+            self.vault.inject_vault(current_peer_id, module).unwrap();
+            self.inject_persistent_dirs(module, persistent_dir.as_path())
+                .await?;
+            self.inject_ephemeral_dirs(module, ephemeral_dir.as_path())
+                .await?;
+        }
+
+        let app_config = AppServiceConfig {
+            service_working_dir: persistent_dir,
+            marine_config: MarineConfig {
+                // TODO: add an option to set individual per-service limit
+                total_memory_limit: self
+                    .config
+                    .default_service_memory_limit
+                    .map(|bytes| bytes.as_u64()),
+                modules_dir: Some(self.modules.modules_dir.clone()),
+                modules_config,
+                default_modules_config: None,
+            },
+        };
+
+        tracing::debug!(
+            "Creating service {}, envs: {:?}",
+            service_id,
+            self.config.envs
+        );
+
+        self.app_service_factory
+            .new_app_service(app_config, service_id, self.config.envs.clone())
+            .await
+            .map_err(ServiceError::Engine)
+    }
+
+    async fn get_service_type(
+        &self,
+        service: &Service,
+        peer_scope: &PeerScope,
+    ) -> MetricServiceType {
+        let allowed_alias = match peer_scope {
+            PeerScope::Host => service.aliases.read().await.first().cloned(),
+            _ => {
+                if service
+                    .aliases
+                    .read()
+                    .await
+                    .first()
+                    .map(|alias| alias == "worker-spell")
+                    .unwrap_or(false)
+                {
+                    Some("worker-spell".to_string())
+                } else {
+                    None
+                }
+            }
+        };
+
+        if service.service_type.is_spell() {
+            MetricServiceType::Spell(allowed_alias)
+        } else {
+            MetricServiceType::Service(allowed_alias)
+        }
+    }
+}
+
+fn is_unknown_function(err: &AppServiceError) -> bool {
+    matches!(
+        err,
+        AppServiceError::MarineError(MarineError::MissingFunctionError(_))
+    )
+}
+
+#[cfg(test)]
+mod tests {
+    use std::collections::HashMap;
+    use std::path::PathBuf;
+    use std::sync::Arc;
+
+    use base64::{engine::general_purpose::STANDARD as base64, Engine};
+    use fluence_app_service::{TomlMarineModuleConfig, TomlMarineNamedModuleConfig};
+    use fluence_keypair::KeyPair;
+    use libp2p_identity::{Keypair, PeerId};
+    use tempdir::TempDir;
+
+    use config_utils::modules_dir;
+    use core_distributor::dummy::DummyCoreDistibutor;
+    use fluence_libp2p::RandomPeerId;
+    use fs_utils::create_dirs;
+    use particle_modules::{AddBlueprint, ModuleRepository};
+    use service_modules::load_module;
+    use service_modules::Hash;
+    use types::peer_scope::PeerScope;
+    use workers::{KeyStorage, PeerScopes, Workers, WorkersConfig};
+
+    use crate::app_services::{ServiceAlias, ServiceType};
+    use crate::persistence::load_persisted_services;
+    use crate::{ParticleAppServices, ParticleAppServicesConfig, ServiceError, WasmBackendConfig};
+
+    fn create_pid() -> PeerId {
+        let keypair = Keypair::generate_ed25519();
+
+        PeerId::from(keypair.public())
+    }
+
+    async fn create_pas(
+        root_keypair: Keypair,
+        management_pid: PeerId,
+        base_dir: PathBuf,
+    ) -> ParticleAppServices {
+        let persistent_dir = base_dir.join("persistent");
+        let ephemeral_dir = base_dir.join("ephemeral");
+        create_dirs(&[&persistent_dir, &ephemeral_dir]).unwrap();
+
+        let vault_dir = ephemeral_dir.join("vault");
+        let keypairs_dir = persistent_dir.join("keypairs");
+        let workers_dir = persistent_dir.join("workers");
+        let modules_dir = persistent_dir.join("modules");
+        let blueprints_dir = persistent_dir.join("blueprints");
+        let service_memory_limit = bytesize::ByteSize::b(bytesize::gib(4_u64) - 1);
+        let key_storage = KeyStorage::from_path(keypairs_dir.clone(), root_keypair.clone().into())
+            .await
+            .expect("Could not load key storage");
+
+        create_dirs(&[&modules_dir, &blueprints_dir, &workers_dir]).unwrap();
+
+        let key_storage = Arc::new(key_storage);
+
+        let root_key_pair: KeyPair = root_keypair.clone().into();
+
+        let core_distributor = Arc::new(DummyCoreDistibutor::new());
+        let thread_pinner = Arc::new(test_utils::pinning::DUMMY);
+
+        let scope = PeerScopes::new(
+            root_key_pair.get_peer_id(),
+            management_pid,
+            root_key_pair.get_peer_id(),
+            key_storage.clone(),
+        );
+
+        let workers_config = WorkersConfig::new(32, None);
+
+        let (workers, _worker_events) = Workers::from_path(
+            workers_config,
+            workers_dir.clone(),
+            key_storage,
+            core_distributor,
+            thread_pinner,
+        )
+        .await
+        .expect("Could not load worker registry");
+
+        let workers = Arc::new(workers);
+        let wasm_backend_config = WasmBackendConfig::default();
+
+        let config = ParticleAppServicesConfig::new(
+            PeerId::from(root_keypair.public()),
+            persistent_dir,
+            ephemeral_dir,
+            vault_dir,
+            HashMap::new(),
+            management_pid,
+            root_key_pair.get_peer_id(),
+            Some(service_memory_limit),
+            wasm_backend_config,
+        )
+        .unwrap();
+
+        let repo = ModuleRepository::new(&modules_dir, &blueprints_dir, Default::default());
+
+        ParticleAppServices::new(config, repo, None, None, workers, scope)
+            .expect("Could not create ParticleAppServices")
+    }
+
+    async fn call_add_alias_raw(
+        as_manager: bool,
+        alias: String,
+        service_id: String,
+    ) -> Result<(), ServiceError> {
+        let base_dir = TempDir::new("test3").unwrap();
+        let root_keypair = Keypair::generate_ed25519();
+        let management_pid = create_pid();
+        let pas = create_pas(root_keypair, management_pid, base_dir.into_path()).await;
+
+        let client_pid = if as_manager {
+            management_pid
+        } else {
+            create_pid()
+        };
+
+        pas.add_alias(PeerScope::Host, alias, service_id, client_pid)
+            .await
+    }
+
+    async fn call_add_alias(alias: String, service_id: String) -> Result<(), ServiceError> {
+        call_add_alias_raw(true, alias, service_id).await
+    }
+
+    async fn create_service(
+        pas: &ParticleAppServices,
+        module_name: String,
+        module: &str,
+        peer_scope: PeerScope,
+    ) -> Result<String, String> {
+        let dep = Hash::from_string(module).unwrap();
+        let bp = pas
+            .modules
+            .add_blueprint(AddBlueprint::new(module_name, vec![dep]))
+            .unwrap();
+
+        pas.create_service(peer_scope, ServiceType::Service, bp, RandomPeerId::random())
+            .await
+            .map_err(|e| e.to_string())
+    }
+
+    #[tokio::test]
+    async fn test_add_alias_forbidden() {
+        let resp = call_add_alias_raw(false, "1".to_string(), "2".to_string()).await;
+        assert!(resp.is_err());
+        assert!(matches!(
+            resp.err().unwrap(),
+            ServiceError::ForbiddenAliasRoot { .. }
+        ))
+    }
+
+    #[tokio::test]
+    async fn test_add_alias_no_service() {
+        let resp = call_add_alias("1".to_string(), "2".to_string()).await;
+        assert!(resp.is_err());
+        assert!(matches!(
+            resp.err().unwrap(),
+            ServiceError::NoSuchService(..)
+        ));
+    }
+
+    #[tokio::test]
+    async fn test_get_interface_cache() {
+        let root_keypair = Keypair::generate_ed25519();
+        let management_pid = create_pid();
+        let base_dir = TempDir::new("test").unwrap();
+        let pas = create_pas(root_keypair, management_pid, base_dir.path().into()).await;
+
+        let module = load_module(
+            "../crates/nox-tests/tests/tetraplets/artifacts",
+            "tetraplets",
+        )
+        .expect("load module");
+
+        let module_name = "tetra".to_string();
+        let config: TomlMarineNamedModuleConfig = TomlMarineNamedModuleConfig {
+            name: module_name.clone(),
+            file_name: None,
+            load_from: None,
+            config: TomlMarineModuleConfig {
+                logger_enabled: None,
+                wasi: None,
+                mounted_binaries: None,
+                logging_mask: None,
+            },
+        };
+        let m_hash = pas
+            .modules
+            .add_module_base64(base64.encode(module), config)
+            .unwrap();
+        let service_id1 = create_service(&pas, module_name.clone(), &m_hash, PeerScope::Host)
+            .await
+            .unwrap();
+        let service_id2 = create_service(&pas, module_name.clone(), &m_hash, PeerScope::Host)
+            .await
+            .unwrap();
+        let service_id3 = create_service(&pas, module_name, &m_hash, PeerScope::Host)
+            .await
+            .unwrap();
+
+        let inter1 = pas
+            .get_interface(PeerScope::Host, service_id1, "")
+            .await
+            .unwrap();
+
+        // delete module and check that interfaces will be returned anyway
+        let dir = modules_dir(&base_dir.path().to_path_buf().join("persistent"));
+        let module_file = dir.join(format!("{m_hash}.wasm"));
+        tokio::fs::remove_file(module_file.clone()).await.unwrap();
+
+        let inter2 = pas
+            .get_interface(PeerScope::Host, service_id2, "")
+            .await
+            .unwrap();
+        let inter3 = pas
+            .get_interface(PeerScope::Host, service_id3, "")
+            .await
+            .unwrap();
+
+        assert!(!module_file.exists());
+        assert_eq!(inter1, inter2);
+        assert_eq!(inter3, inter2);
+    }
+
+    fn upload_tetra_service(pas: &ParticleAppServices, module_name: String) -> String {
+        let module = load_module(
+            "../crates/nox-tests/tests/tetraplets/artifacts",
+            "tetraplets",
+        )
+        .expect("load module");
+
+        let config: TomlMarineNamedModuleConfig = TomlMarineNamedModuleConfig {
+            name: module_name,
+            file_name: None,
+            load_from: None,
+            config: TomlMarineModuleConfig {
+                logger_enabled: None,
+                wasi: None,
+                mounted_binaries: None,
+                logging_mask: None,
+            },
+        };
+        pas.modules
+            .add_module_base64(base64.encode(module), config)
+            .unwrap()
+    }
+
+    #[tokio::test]
+    async fn test_add_alias() {
+        let base_dir = TempDir::new("test4").unwrap();
+        let root_keypair = Keypair::generate_ed25519();
+        let management_pid = create_pid();
+        let pas = create_pas(root_keypair, management_pid, base_dir.into_path()).await;
+
+        let module_name = "tetra".to_string();
+        let m_hash = upload_tetra_service(&pas, module_name.clone());
+        let service_id1 = create_service(&pas, module_name, &m_hash, PeerScope::Host)
+            .await
+            .unwrap();
+
+        let alias = "alias";
+        let result = pas
+            .add_alias(
+                PeerScope::Host,
+                alias.to_string(),
+                service_id1.clone(),
+                management_pid,
+            )
+            .await;
+        // result of the add_alias call must be ok
+        assert!(result.is_ok(), "{}", result.unwrap_err());
+
+        let (service_1, _) = pas
+            .get_service(PeerScope::Host, service_id1.clone(), "")
+            .await
+            .unwrap();
+        let service_1_aliases: Vec<ServiceAlias> = service_1.aliases.read().await.clone();
+        // the service's alias list must contain the alias
+        assert_eq!(service_1_aliases, vec![alias.to_string()]);
+
+        let (persisted_service_1, _) = load_persisted_services(&pas.config.services_dir)
+            .await
+            .unwrap()
+            .into_iter()
+            .find(|(s, _)| s.service_id == service_id1)
+            .unwrap();
+
+        // the persisted service's alias list must contain the alias
+        assert_eq!(persisted_service_1.aliases, vec![alias.to_string()]);
+    }
+
+    #[tokio::test]
+    async fn test_add_alias_repeated() {
+        let base_dir = TempDir::new("test4").unwrap();
+        let root_keypair = Keypair::generate_ed25519();
+        let management_pid = create_pid();
+        let pas = create_pas(root_keypair, management_pid, base_dir.into_path()).await;
+
+        let module_name = "tetra".to_string();
+        let m_hash = upload_tetra_service(&pas, module_name.clone());
+
+        let service_id1 = create_service(&pas, module_name.clone(), &m_hash, PeerScope::Host)
+            .await
+            .unwrap();
+        let service_id2 = create_service(&pas, module_name, &m_hash, PeerScope::Host)
+            .await
+            .unwrap();
+
+        let alias = "alias";
+        // add an alias to a service
+        pas.add_alias(
+            PeerScope::Host,
+            alias.to_string(),
+            service_id1.clone(),
+            management_pid,
+        )
+        .await
+        .unwrap();
+        // give the alias to another service
+        pas.add_alias(
+            PeerScope::Host,
+            alias.to_string(),
+            service_id2.clone(),
+            management_pid,
+        )
+        .await
+        .unwrap();
+
+        let (service_1, _) = pas
+            .get_service(PeerScope::Host, service_id1.clone(), "")
+            .await
+            .unwrap();
+        let (service_2, _) = pas
+            .get_service(PeerScope::Host, service_id2.clone(), "")
+            .await
+            .unwrap();
+        let service_aliases_1 = service_1.aliases.read().await.clone();
+        let service_aliases_2 = service_2.aliases.read().await.clone();
+        // the first service's alias list must not contain the alias
+        assert_eq!(service_aliases_1, Vec::<String>::new());
+        // the second service's alias list must contain the alias
+        assert_eq!(service_aliases_2, vec![alias.to_string()]);
+
+        let persisted_services: Vec<_> = load_persisted_services(&pas.config.services_dir)
+            .await
+            .unwrap()
+            .into_iter()
+            .collect();
+        let (persisted_service_1, _) = persisted_services
+            .iter()
+            .find(|(service, _)| service.service_id == service_id1)
+            .unwrap();
+        let (persisted_service_2, _) = persisted_services
+            .iter()
+            .find(|(service, _)| service.service_id == service_id2)
+            .unwrap();
+        // the first persisted service's alias list must not contain the alias
+        assert_eq!(persisted_service_1.aliases, Vec::<String>::new());
+        // the second persisted service's alias list must contain the alias
+        assert_eq!(persisted_service_2.aliases, vec![alias.to_string()]);
+    }
+
+    #[tokio::test]
+    async fn test_add_alias_twice() {
+        let base_dir = TempDir::new("test4").unwrap();
+        let root_keypair = Keypair::generate_ed25519();
+        let management_pid = create_pid();
+        let pas = create_pas(root_keypair, management_pid, base_dir.into_path()).await;
+
+        let module_name = "tetra".to_string();
+        let m_hash = upload_tetra_service(&pas, module_name.clone());
+
+        let service_id = create_service(&pas, module_name.clone(), &m_hash, PeerScope::Host)
+            .await
+            .unwrap();
+
+        let alias = "alias";
+        // add an alias to a service
+        pas.add_alias(
+            PeerScope::Host,
+            alias.to_string(),
+            service_id.clone(),
+            management_pid,
+        )
+        .await
+        .unwrap();
+        // give the alias to service again
+        pas.add_alias(
+            PeerScope::Host,
+            alias.to_string(),
+            service_id.clone(),
+            management_pid,
+        )
+        .await
+        .unwrap();
+
+        let (service, _) = pas
+            .get_service(PeerScope::Host, service_id.clone(), "")
+            .await
+            .unwrap();
+        let service_aliases = service.aliases.read().await.clone();
+        // the service's alias list must contain only 1 alias
+        assert_eq!(service_aliases, vec![alias.to_string()]);
+
+        let persisted_services: Vec<_> = load_persisted_services(&pas.config.services_dir)
+            .await
+            .unwrap()
+            .into_iter()
+            .collect();
+        let (persisted_service, _) = persisted_services
+            .iter()
+            .find(|(s, _)| s.service_id == service_id)
+            .unwrap();
+
+        // the persisted service's alias list must contain only one alias
+        assert_eq!(persisted_service.aliases, vec![alias.to_string()]);
+    }
+
+    #[tokio::test]
+    async fn test_persisted_service() {
+        let base_dir = TempDir::new("test4").unwrap();
+        let root_keypair = Keypair::generate_ed25519();
+        let management_pid = create_pid();
+        let pas = create_pas(root_keypair, management_pid, base_dir.into_path()).await;
+
+        let module_name = "tetra".to_string();
+        let alias = "alias".to_string();
+        let m_hash = upload_tetra_service(&pas, module_name.clone());
+
+        let service_id1 = create_service(&pas, module_name, &m_hash, PeerScope::Host)
+            .await
+            .unwrap();
+        pas.add_alias(
+            PeerScope::Host,
+            alias.clone(),
+            service_id1.clone(),
+            management_pid,
+        )
+        .await
+        .unwrap();
+        let (service_1, _) = pas
+            .get_service(PeerScope::Host, service_id1.clone(), "")
+            .await
+            .unwrap();
+        let service_aliases_1 = service_1.aliases.read().await.clone();
+        assert_eq!(service_aliases_1.len(), 1);
+        assert_eq!(service_aliases_1[0], alias);
+
+        let persisted_services: Vec<_> = load_persisted_services(&pas.config.services_dir)
+            .await
+            .unwrap()
+            .into_iter()
+            .collect();
+        let (persisted_service_1, _) = persisted_services.first().unwrap();
+        assert_eq!(service_aliases_1, persisted_service_1.aliases);
+        assert_eq!(service_aliases_1, persisted_service_1.aliases);
+        assert_eq!(service_1.blueprint_id, persisted_service_1.blueprint_id);
+        assert_eq!(service_id1, persisted_service_1.service_id);
+        assert_eq!(service_1.owner_id, persisted_service_1.owner_id);
+    }
+
+    // TODO: add more tests
+    //       - add alias success & fail with service collision & test on rewriting alias
+    //       - create_service success & fail
+    //       - get_modules success & fail
+    //       - get_interface
+    //       - list_services
+    //       - test on service persisting
+}
+
\ No newline at end of file diff --git a/src/particle_services/config.rs.html b/src/particle_services/config.rs.html new file mode 100644 index 0000000000..b5c9b9ea1c --- /dev/null +++ b/src/particle_services/config.rs.html @@ -0,0 +1,271 @@ +config.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use fs_utils::{create_dirs, set_write_only, to_abs_path};
+
+use bytesize::ByteSize;
+use fluence_app_service::WasmtimeConfig;
+use libp2p_identity::PeerId;
+use std::collections::HashMap;
+use std::path::PathBuf;
+use std::time::Duration;
+
+#[derive(Debug, Clone)]
+pub struct ParticleAppServicesConfig {
+    /// Peer id of the current node
+    pub local_peer_id: PeerId,
+    /// Opaque environment variables to be passed on each service creation
+    /// TODO: isolate envs of different modules (i.e., module A shouldn't access envs of module B)
+    pub envs: HashMap<String, String>,
+    /// Persistent working dir for services
+    pub persistent_work_dir: PathBuf,
+    /// Ephemeral working dir for services
+    pub ephemeral_work_dir: PathBuf,
+    /// Dir to persist info about running services
+    pub services_dir: PathBuf,
+    /// Dir to store directories shared between services
+    /// in the span of a single particle execution  
+    pub particles_vault_dir: PathBuf,
+    /// key that could manage services
+    pub management_peer_id: PeerId,
+    /// key to manage builtins services initialization
+    pub builtins_management_peer_id: PeerId,
+    /// Default heap size in bytes available for the module unless otherwise specified.
+    pub default_service_memory_limit: Option<ByteSize>,
+    /// config for the wasmtime backend
+    pub wasm_backend_config: WasmBackendConfig,
+}
+
+impl ParticleAppServicesConfig {
+    #[allow(clippy::too_many_arguments)]
+    pub fn new(
+        local_peer_id: PeerId,
+        persistent_dir: PathBuf,
+        ephemeral_dir: PathBuf,
+        particles_vault_dir: PathBuf,
+        envs: HashMap<String, String>,
+        management_peer_id: PeerId,
+        builtins_management_peer_id: PeerId,
+        default_service_memory_limit: Option<ByteSize>,
+        wasm_backend_config: WasmBackendConfig,
+    ) -> Result<Self, std::io::Error> {
+        let persistent_dir = to_abs_path(persistent_dir);
+        let ephemeral_dir = to_abs_path(ephemeral_dir);
+
+        let this = Self {
+            local_peer_id,
+            persistent_work_dir: config_utils::workdir(&persistent_dir),
+            ephemeral_work_dir: config_utils::workdir(&ephemeral_dir),
+
+            services_dir: config_utils::services_dir(&persistent_dir),
+            particles_vault_dir,
+            envs,
+            management_peer_id,
+            builtins_management_peer_id,
+            default_service_memory_limit,
+            wasm_backend_config,
+        };
+
+        create_dirs(&[
+            &this.persistent_work_dir,
+            &this.ephemeral_work_dir,
+            &this.services_dir,
+            &this.particles_vault_dir,
+        ])?;
+
+        set_write_only(&this.particles_vault_dir)?;
+
+        Ok(this)
+    }
+}
+
+#[derive(Debug, Clone)]
+pub struct WasmBackendConfig {
+    /// Configures whether DWARF debug information will be emitted during compilation.
+    pub debug_info: bool,
+    /// Configures whether the errors from the VM should collect the wasm backtrace and parse debug info.
+    pub wasm_backtrace: bool,
+    /// Configures the size of the stacks used for asynchronous execution.
+    pub async_wasm_stack: usize,
+    /// Configures the maximum amount of stack space available for executing WebAssembly code.
+    pub max_wasm_stack: usize,
+    /// Enables the epoch interruption mechanism.
+    pub epoch_interruption_duration: Option<Duration>,
+}
+
+impl From<WasmBackendConfig> for WasmtimeConfig {
+    fn from(value: WasmBackendConfig) -> Self {
+        let mut config = WasmtimeConfig::default();
+        config
+            .debug_info(value.debug_info)
+            .wasm_backtrace(value.wasm_backtrace)
+            .epoch_interruption(true)
+            .async_wasm_stack(value.async_wasm_stack)
+            .max_wasm_stack(value.max_wasm_stack);
+        config
+    }
+}
+
+impl Default for WasmBackendConfig {
+    fn default() -> Self {
+        Self {
+            debug_info: true,
+            wasm_backtrace: true,
+            async_wasm_stack: 4 * 1024 * 1024,
+            max_wasm_stack: 2 * 1024 * 1024,
+            epoch_interruption_duration: Some(Duration::from_secs(1)),
+        }
+    }
+}
+
\ No newline at end of file diff --git a/src/particle_services/error.rs.html b/src/particle_services/error.rs.html new file mode 100644 index 0000000000..ba2cee7581 --- /dev/null +++ b/src/particle_services/error.rs.html @@ -0,0 +1,285 @@ +error.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use std::fmt::Debug;
+use std::path::PathBuf;
+
+use fluence_app_service::AppServiceError;
+use serde_json::Value as JValue;
+use thiserror::Error;
+
+use fluence_libp2p::PeerId;
+use json_utils::err_as_value;
+use particle_args::ArgsError;
+use particle_execution::VaultError;
+use particle_modules::ModuleError;
+use types::peer_scope::{PeerScope, WorkerId};
+
+#[derive(Debug, Error)]
+pub enum ServiceError {
+    #[error("Service with id '{0}' not found on {1:?}")]
+    NoSuchService(String, PeerScope),
+    #[error("Service with id '{service}' not found (function {function})")]
+    NoSuchServiceWithFunction { service: String, function: String },
+    #[error("Service with id '{service_id}' is deployed on another worker {peer_scope:?})")]
+    CallServiceFailedWrongWorker {
+        service_id: String,
+        peer_scope: PeerScope,
+    },
+    #[error("Service with alias '{0}' is not found on worker '{1:?}'")]
+    NoSuchAlias(String, PeerScope),
+    #[error("Forbidden. User id '{user}' cannot call function '{function}': {reason}")]
+    Forbidden {
+        user: PeerId,
+        function: &'static str,
+        reason: &'static str,
+    },
+    #[error("Forbidden. User id '{0}' cannot call function 'add_alias': only management peer id can add top-level aliases")]
+    ForbiddenAliasRoot(PeerId),
+    #[error("Forbidden. User id '{0}' cannot call function 'add_alias': only worker, worker creator and management peer id can add worker-level aliases")]
+    ForbiddenAliasWorker(PeerId),
+    #[error("Cannot add alias '{0}' because there is a service with that id")]
+    AliasAsServiceId(String),
+    #[error("Cannot add alias '{0}' because it is reserved")]
+    ForbiddenAlias(String),
+    #[error(transparent)]
+    Engine(AppServiceError),
+    #[error(transparent)]
+    ModuleError(ModuleError),
+    #[error("Error reading persisted service from {path:?}: {err}")]
+    ReadPersistedService {
+        path: PathBuf,
+        #[source]
+        err: std::io::Error,
+    },
+    #[error("Error deserializing persisted service from {path:?}: {err}")]
+    DeserializePersistedService {
+        path: PathBuf,
+        #[source]
+        err: toml::de::Error,
+    },
+    #[error("Error creating directory for persisted services {path:?}: {err}")]
+    CreateServicesDir {
+        path: PathBuf,
+        #[source]
+        err: std::io::Error,
+    },
+    #[error("CorruptedFaaSInterface: can't serialize interface to JSON: {0}")]
+    CorruptedFaaSInterface(#[source] serde_json::Error),
+    #[error("Error parsing arguments on call_service: {0}")]
+    ArgParseError(#[source] ArgsError),
+    #[error("Vault linking (service {particle_id}, particle {service_id}) failed: {err:?}")]
+    VaultLink {
+        #[source]
+        err: std::io::Error,
+        particle_id: String,
+        service_id: String,
+    },
+    #[error(transparent)]
+    VaultError(#[from] VaultError),
+    #[error("Error serializing persisted service config to toml: {err} {config:?}")]
+    SerializePersistedService {
+        #[source]
+        err: toml_edit::ser::Error,
+        config: Box<dyn Debug + Send + Sync>,
+    },
+    #[error("Error saving persisted service to {path:?}: {err}")]
+    WritePersistedService {
+        path: PathBuf,
+        #[source]
+        err: std::io::Error,
+    },
+    #[error("Internal error, smth bad happened: {0}")]
+    InternalError(String),
+    #[error("Worker {worker_id} not found")]
+    WorkerNotFound { worker_id: WorkerId },
+    #[error("Failed to create directory {path}: {err}")]
+    FailedToCreateDirectory {
+        path: PathBuf,
+        #[source]
+        err: std::io::Error,
+    },
+}
+
+impl From<AppServiceError> for ServiceError {
+    fn from(err: AppServiceError) -> Self {
+        ServiceError::Engine(err)
+    }
+}
+
+impl From<ArgsError> for ServiceError {
+    fn from(err: ArgsError) -> Self {
+        ServiceError::ArgParseError(err)
+    }
+}
+
+impl From<ModuleError> for ServiceError {
+    fn from(err: ModuleError) -> Self {
+        ServiceError::ModuleError(err)
+    }
+}
+
+impl From<ServiceError> for JValue {
+    fn from(err: ServiceError) -> Self {
+        err_as_value(err)
+    }
+}
+
\ No newline at end of file diff --git a/src/particle_services/health.rs.html b/src/particle_services/health.rs.html new file mode 100644 index 0000000000..5a3d9c4832 --- /dev/null +++ b/src/particle_services/health.rs.html @@ -0,0 +1,229 @@ +health.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use health::HealthCheck;
+use parking_lot::RwLock;
+use std::sync::Arc;
+
+#[derive(Debug, Clone)]
+pub struct PersistedServiceHealth {
+    started: Arc<RwLock<bool>>,
+    has_errors: Arc<RwLock<bool>>,
+}
+
+impl PersistedServiceHealth {
+    pub fn new() -> Self {
+        PersistedServiceHealth {
+            started: Arc::new(RwLock::new(false)),
+            has_errors: Arc::new(RwLock::new(true)), // this is true by default because we wont to show error while loading in progress
+        }
+    }
+
+    pub fn start_creation(&mut self) {
+        let mut guard = self.started.write();
+        *guard = true;
+    }
+
+    pub fn finish_creation(&mut self) {
+        let mut guard = self.has_errors.write();
+        *guard = false;
+    }
+}
+
+impl HealthCheck for PersistedServiceHealth {
+    fn status(&self) -> eyre::Result<()> {
+        let started_guard = self.started.read();
+        let errors_guard = self.has_errors.read();
+        let started = *started_guard;
+        if started {
+            let has_errors = *errors_guard;
+            if has_errors {
+                Err(eyre::eyre!("Persisted services loading failed"))
+            } else {
+                Ok(())
+            }
+        } else {
+            Err(eyre::eyre!(
+                "Persisted services creation hasn't started yet"
+            ))
+        }
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+    use std::thread;
+
+    #[test]
+    fn test_persisted_service_health_not_started() {
+        let health = PersistedServiceHealth::new();
+        let status = health.status();
+        assert!(status.is_err());
+    }
+
+    #[test]
+    fn test_persisted_service_health_started_with_errors() {
+        let mut health = PersistedServiceHealth::new();
+        health.start_creation();
+        let status = health.status();
+        assert!(status.is_err());
+    }
+
+    #[test]
+    fn test_persisted_service_health_started_without_errors() {
+        let mut health = PersistedServiceHealth::new();
+        health.start_creation();
+        health.finish_creation();
+        let status = health.status();
+        assert!(status.is_ok());
+    }
+
+    #[test]
+    fn persisted_service_health_concurrent_access() {
+        let persisted_health = Arc::new(RwLock::new(PersistedServiceHealth::new()));
+        let health_clone = persisted_health.clone();
+
+        let thread_handle = thread::spawn(move || {
+            let mut health = health_clone.write();
+            health.start_creation();
+            health.finish_creation();
+        });
+
+        thread_handle.join().unwrap();
+
+        let status = persisted_health.read().status();
+        assert!(status.is_ok());
+    }
+}
+
\ No newline at end of file diff --git a/src/particle_services/lib.rs.html b/src/particle_services/lib.rs.html new file mode 100644 index 0000000000..033e0369a6 --- /dev/null +++ b/src/particle_services/lib.rs.html @@ -0,0 +1,103 @@ +lib.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+#![feature(try_blocks)]
+#![feature(hash_extract_if)]
+#![feature(result_option_inspect)]
+#![warn(rust_2018_idioms)]
+#![deny(
+    dead_code,
+    nonstandard_style,
+    unused_imports,
+    unused_mut,
+    unused_variables,
+    unused_unsafe,
+    unreachable_patterns
+)]
+
+pub use fluence_app_service::{IType, IValue};
+
+pub use app_services::ParticleAppServices;
+pub use app_services::ServiceType;
+
+pub use crate::error::ServiceError;
+
+mod app_services;
+mod error;
+mod health;
+mod persistence;
+
+mod config;
+
+pub use app_services::ServiceInfo;
+pub use config::ParticleAppServicesConfig;
+pub use config::WasmBackendConfig;
+pub use types::peer_scope::PeerScope;
+
\ No newline at end of file diff --git a/src/particle_services/persistence.rs.html b/src/particle_services/persistence.rs.html new file mode 100644 index 0000000000..59f550b087 --- /dev/null +++ b/src/particle_services/persistence.rs.html @@ -0,0 +1,285 @@ +persistence.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use std::path::{Path, PathBuf};
+
+use serde::{Deserialize, Serialize};
+
+use crate::app_services::Service;
+use crate::error::ServiceError;
+use crate::ServiceError::{SerializePersistedService, WritePersistedService};
+use crate::ServiceType;
+use fluence_libp2p::PeerId;
+use service_modules::{is_service, service_file_name};
+use types::peer_id;
+use types::peer_scope::PeerScope;
+
+// TODO: all fields could be references, but I don't know how to achieve that
+#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
+pub struct PersistedService {
+    pub service_id: String,
+    pub service_type: Option<ServiceType>,
+    pub blueprint_id: String,
+    #[serde(default)]
+    // Old versions of PersistedService may omit `aliases` field, tolerate that
+    pub aliases: Vec<String>,
+    // Old versions of PersistedService may omit `owner` field, tolerate that via RandomPeerId::random
+    #[serde(
+        serialize_with = "peer_id::serde::serialize",
+        deserialize_with = "peer_id::serde::deserialize"
+    )]
+    pub owner_id: PeerId,
+    pub peer_scope: PeerScope,
+}
+
+impl PersistedService {
+    pub async fn from_service(service: &Service) -> Self {
+        PersistedService {
+            service_id: service.service_id.clone(),
+            service_type: Some(service.service_type.clone()),
+            blueprint_id: service.blueprint_id.clone(),
+            aliases: service.aliases.read().await.clone(),
+            owner_id: service.owner_id,
+            peer_scope: service.peer_scope,
+        }
+    }
+
+    /// Persist service info to disk, so it is recreated after restart
+    pub async fn persist(&self, services_dir: &Path) -> Result<(), ServiceError> {
+        let path = services_dir.join(service_file_name(&self.service_id));
+        let bytes = toml_edit::ser::to_vec(self).map_err(|err| SerializePersistedService {
+            err,
+            config: Box::new(self.clone()),
+        })?;
+        tokio::fs::write(&path, bytes)
+            .await
+            .map_err(|err| WritePersistedService { path, err })
+    }
+}
+
+/// Load info about persisted services from disk, and create `AppService` for each of them
+pub async fn load_persisted_services(
+    services_dir: &Path,
+) -> eyre::Result<Vec<(PersistedService, PathBuf)>> {
+    let services = fs_utils::load_persisted_data(services_dir, is_service, |bytes| {
+        toml_edit::de::from_slice(bytes).map_err(|e| e.into())
+    })
+    .await?;
+
+    Ok(services)
+}
+
+pub async fn remove_persisted_service(
+    services_dir: &Path,
+    service_id: String,
+) -> Result<(), std::io::Error> {
+    tokio::fs::remove_file(services_dir.join(service_file_name(&service_id))).await
+}
+
+#[cfg(test)]
+mod tests {
+    use crate::persistence::{load_persisted_services, PersistedService};
+    use fluence_libp2p::RandomPeerId;
+    use types::peer_scope::PeerScope;
+
+    #[tokio::test]
+    async fn test_persistence() {
+        let tmp_dir = tempfile::tempdir().expect("Could not get temp dir");
+        let owner_id = RandomPeerId::random();
+        let service_1 = PersistedService {
+            service_id: "service_id_1".to_string(),
+            service_type: None,
+            blueprint_id: "blueprint_id_1".to_string(),
+            aliases: vec!["alias_1".to_string()],
+            owner_id,
+            peer_scope: PeerScope::WorkerId(owner_id.into()),
+        };
+        service_1
+            .persist(tmp_dir.path())
+            .await
+            .expect("Could not persist service");
+
+        let service_2 = PersistedService {
+            service_id: "service_id_2".to_string(),
+            service_type: None,
+            blueprint_id: "blueprint_id_2".to_string(),
+            aliases: vec!["alias_2".to_string()],
+            owner_id,
+            peer_scope: PeerScope::Host,
+        };
+        service_2
+            .persist(tmp_dir.path())
+            .await
+            .expect("Could not persist service");
+
+        let result: Vec<PersistedService> = load_persisted_services(tmp_dir.path())
+            .await
+            .expect("Could not load persisted services")
+            .into_iter()
+            .map(|(s, _)| s)
+            .collect();
+
+        assert_eq!(result.len(), 2);
+        assert!(result.contains(&service_1));
+        assert!(result.contains(&service_2));
+    }
+}
+
\ No newline at end of file diff --git a/src/peer_metrics/chain_listener.rs.html b/src/peer_metrics/chain_listener.rs.html new file mode 100644 index 0000000000..23051dd90f --- /dev/null +++ b/src/peer_metrics/chain_listener.rs.html @@ -0,0 +1,377 @@ +chain_listener.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use crate::{execution_time_buckets, register};
+use prometheus_client::encoding::EncodeLabelSet;
+use prometheus_client::metrics::counter::Counter;
+use prometheus_client::metrics::exemplar::CounterWithExemplar;
+use prometheus_client::metrics::gauge::Gauge;
+use prometheus_client::metrics::histogram::Histogram;
+use prometheus_client::registry::Registry;
+
+#[derive(EncodeLabelSet, Hash, Clone, Eq, PartialEq, Debug)]
+struct TxLabel {
+    tx_hash: String,
+}
+
+#[derive(Clone)]
+pub struct ChainListenerMetrics {
+    // how many request Nox sends to ccp
+    ccp_requests_total: Counter,
+    // how many success replies Nox receives from ccp
+    // an error is either error from ccp or connection errors
+    ccp_replies_total: Counter,
+    // how long we wait for a reply from ccp
+    ccp_request_duration_msec: Histogram,
+    // how many proofs we submitted
+    ccp_proofs_submitted: Counter,
+    // how many proofs we failed to submit
+    ccp_proofs_submit_failed: Counter,
+    // how many proofs transaction are ok
+    ccp_proofs_tx_success: Counter,
+    // how many proofs transaction are failed
+    ccp_proofs_tx_failed: CounterWithExemplar<TxLabel>,
+    // How many blocks we have received from the newHead subscription
+    blocks_seen: Counter,
+    last_seen_block: Gauge,
+    // How many block we manage to process while processing the block
+    blocks_processed: Counter,
+    last_process_block: Gauge,
+}
+
+impl ChainListenerMetrics {
+    pub fn new(registry: &mut Registry) -> Self {
+        let sub_registry = registry.sub_registry_with_prefix("chain_listener");
+
+        let ccp_requests_total = register(
+            sub_registry,
+            Counter::default(),
+            "ccp_requests_total",
+            "Total number of requests sent to ccp",
+        );
+
+        let ccp_replies_total = register(
+            sub_registry,
+            Counter::default(),
+            "ccp_replies_total",
+            "Total number of successful replies from ccp",
+        );
+
+        let ccp_request_duration_msec = register(
+            sub_registry,
+            Histogram::new(execution_time_buckets()),
+            "ccp_request_duration",
+            "Duration of ccp requests",
+        );
+
+        let ccp_proofs_submitted = register(
+            sub_registry,
+            Counter::default(),
+            "cpp_proofs_submitted",
+            "Total number of proofs submitted to ccp",
+        );
+
+        let ccp_proofs_submit_failed = register(
+            sub_registry,
+            Counter::default(),
+            "cpp_proofs_submit_failed",
+            "Total number of proofs we failed to submit to ccp",
+        );
+
+        let ccp_proofs_tx_success = register(
+            sub_registry,
+            Counter::default(),
+            "ccp_proofs_tx_success",
+            "Total number of successfully processed proofs (transaction is ok)",
+        );
+
+        let ccp_proofs_tx_failed = register(
+            sub_registry,
+            CounterWithExemplar::default(),
+            "ccp_proofs_tx_failed",
+            "Total number of failed proofs (transaction isn't ok)",
+        );
+
+        let blocks_seen = register(
+            sub_registry,
+            Counter::default(),
+            "blocks_seen",
+            "Total number of blocks seen from the newHead subscription",
+        );
+
+        let blocks_processed = register(
+            sub_registry,
+            Counter::default(),
+            "blocks_processed",
+            "Total number of blocks processed",
+        );
+
+        let last_seen_block = register(
+            sub_registry,
+            Gauge::default(),
+            "last_seen_block",
+            "Last block seen from the newHead subscription",
+        );
+        let last_process_block = register(
+            sub_registry,
+            Gauge::default(),
+            "last_process_block",
+            "Last processed block from the newHead subscription",
+        );
+
+        Self {
+            ccp_requests_total,
+            ccp_replies_total,
+            ccp_request_duration_msec,
+            ccp_proofs_submitted,
+            ccp_proofs_submit_failed,
+            ccp_proofs_tx_success,
+            ccp_proofs_tx_failed,
+            blocks_seen,
+            last_seen_block,
+            blocks_processed,
+            last_process_block,
+        }
+    }
+
+    pub fn observe_ccp_request(&self) {
+        self.ccp_requests_total.inc();
+    }
+
+    pub fn observe_ccp_reply(&self, duration: f64) {
+        self.ccp_replies_total.inc();
+        self.ccp_request_duration_msec.observe(duration);
+    }
+
+    pub fn observe_proof_failed(&self) {
+        self.ccp_proofs_submit_failed.inc();
+    }
+
+    pub fn observe_proof_submitted(&self) {
+        self.ccp_proofs_submitted.inc();
+    }
+
+    pub fn observe_proof_tx_success(&self) {
+        self.ccp_proofs_tx_success.inc();
+    }
+
+    pub fn observe_proof_tx_failed(&self, tx_hash: String) {
+        self.ccp_proofs_tx_failed
+            .inc_by(1, Some(TxLabel { tx_hash }));
+    }
+
+    pub fn observe_new_block(&self, block_number: u64) {
+        self.blocks_seen.inc();
+        self.last_seen_block.set(block_number as i64);
+    }
+
+    pub fn observe_processed_block(&self, block_number: u64) {
+        self.blocks_processed.inc();
+        self.last_process_block.set(block_number as i64);
+    }
+}
+
\ No newline at end of file diff --git a/src/peer_metrics/connection_pool.rs.html b/src/peer_metrics/connection_pool.rs.html new file mode 100644 index 0000000000..8affdc64d2 --- /dev/null +++ b/src/peer_metrics/connection_pool.rs.html @@ -0,0 +1,175 @@ +connection_pool.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use crate::{ParticleLabel, ParticleType};
+use prometheus_client::metrics::counter::Counter;
+use prometheus_client::metrics::family::Family;
+use prometheus_client::metrics::gauge::Gauge;
+use prometheus_client::metrics::histogram::{exponential_buckets, Histogram};
+use prometheus_client::registry::Registry;
+
+#[derive(Clone)]
+pub struct ConnectionPoolMetrics {
+    pub received_particles: Family<ParticleLabel, Counter>,
+    pub particle_sizes: Family<ParticleLabel, Histogram>,
+    pub connected_peers: Gauge,
+    pub particle_queue_size: Gauge,
+}
+
+impl ConnectionPoolMetrics {
+    pub fn new(registry: &mut Registry) -> Self {
+        let sub_registry = registry.sub_registry_with_prefix("connection_pool");
+
+        let received_particles = Family::default();
+        sub_registry.register(
+            "received_particles",
+            "Number of particles received from the network (not unique)",
+            received_particles.clone(),
+        );
+
+        // from 100 bytes to 100 MB
+        let particle_sizes: Family<_, _> =
+            Family::new_with_constructor(|| Histogram::new(exponential_buckets(100.0, 10.0, 7)));
+        sub_registry.register(
+            "particle_sizes",
+            "Distribution of particle data sizes",
+            particle_sizes.clone(),
+        );
+
+        let connected_peers = Gauge::default();
+        sub_registry.register(
+            "connected_peers",
+            "Number of peers we have connections to at a given moment",
+            connected_peers.clone(),
+        );
+
+        let particle_queue_size = Gauge::default();
+        sub_registry.register(
+            "particle_queue_size",
+            "Size of a particle queue in connection pool",
+            particle_queue_size.clone(),
+        );
+
+        Self {
+            received_particles,
+            particle_sizes,
+            connected_peers,
+            particle_queue_size,
+        }
+    }
+
+    pub fn incoming_particle(&self, particle_id: &str, queue_len: i64, particle_len: f64) {
+        self.particle_queue_size.set(queue_len);
+        let label = ParticleLabel {
+            particle_type: ParticleType::from_particle(particle_id),
+        };
+        self.received_particles.get_or_create(&label).inc();
+        self.particle_sizes
+            .get_or_create(&label)
+            .observe(particle_len);
+    }
+}
+
\ No newline at end of file diff --git a/src/peer_metrics/connectivity.rs.html b/src/peer_metrics/connectivity.rs.html new file mode 100644 index 0000000000..6676a1294c --- /dev/null +++ b/src/peer_metrics/connectivity.rs.html @@ -0,0 +1,235 @@ +connectivity.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use crate::{ParticleLabel, ParticleType};
+use prometheus_client::encoding::{EncodeLabelSet, EncodeLabelValue};
+use prometheus_client::metrics::counter::Counter;
+use prometheus_client::metrics::family::Family;
+use prometheus_client::registry::Registry;
+
+#[derive(EncodeLabelValue, Hash, Clone, Eq, PartialEq, Debug)]
+pub enum Resolution {
+    Local,
+    Kademlia,
+    KademliaNotFound,
+    KademliaError,
+    ConnectionFailed,
+}
+#[derive(EncodeLabelSet, Hash, Clone, Eq, PartialEq, Debug)]
+pub struct ResolutionLabel {
+    action: Resolution,
+}
+
+#[derive(Clone)]
+pub struct ConnectivityMetrics {
+    contact_resolve: Family<ResolutionLabel, Counter>,
+    pub particle_send_success: Family<ParticleLabel, Counter>,
+    pub particle_send_failure: Family<ParticleLabel, Counter>,
+    pub bootstrap_disconnected: Counter,
+    pub bootstrap_connected: Counter,
+}
+
+impl ConnectivityMetrics {
+    pub fn new(registry: &mut Registry) -> Self {
+        let sub_registry = registry.sub_registry_with_prefix("connectivity");
+
+        let contact_resolve = Family::default();
+        sub_registry.register(
+            "contact_resolve",
+            "Counters regarding contact resolution in particle processing",
+            contact_resolve.clone(),
+        );
+
+        let particle_send_success = Family::default();
+        sub_registry.register(
+            "particle_send_success",
+            "Number of sent particles",
+            particle_send_success.clone(),
+        );
+
+        let particle_send_failure = Family::default();
+        sub_registry.register(
+            "particle_send_failure",
+            "Number of errors on particle sending",
+            particle_send_failure.clone(),
+        );
+
+        let bootstrap_disconnected = Counter::default();
+        sub_registry.register(
+            "bootstrap_disconnected",
+            "Number of times peer disconnected from bootstrap peers",
+            bootstrap_disconnected.clone(),
+        );
+
+        let bootstrap_connected = Counter::default();
+        sub_registry.register(
+            "bootstrap_connected",
+            "Number of times peer connected (or reconnected) to a bootstrap peer",
+            bootstrap_connected.clone(),
+        );
+
+        Self {
+            contact_resolve,
+            particle_send_success,
+            particle_send_failure,
+            bootstrap_disconnected,
+            bootstrap_connected,
+        }
+    }
+
+    pub fn count_resolution(&self, resolution: Resolution) {
+        self.contact_resolve
+            .get_or_create(&ResolutionLabel { action: resolution })
+            .inc();
+    }
+
+    pub fn send_particle_ok(&self, particle: &str) {
+        self.particle_send_success
+            .get_or_create(&ParticleLabel {
+                particle_type: ParticleType::from_particle(particle),
+            })
+            .inc();
+    }
+
+    pub fn send_particle_failed(&self, particle: &str) {
+        self.particle_send_failure
+            .get_or_create(&ParticleLabel {
+                particle_type: ParticleType::from_particle(particle),
+            })
+            .inc();
+    }
+}
+
\ No newline at end of file diff --git a/src/peer_metrics/dispatcher.rs.html b/src/peer_metrics/dispatcher.rs.html new file mode 100644 index 0000000000..8a6bd94989 --- /dev/null +++ b/src/peer_metrics/dispatcher.rs.html @@ -0,0 +1,129 @@ +dispatcher.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use crate::{ParticleLabel, ParticleType};
+use prometheus_client::metrics::counter::Counter;
+use prometheus_client::metrics::family::Family;
+use prometheus_client::registry::Registry;
+
+#[derive(Clone)]
+pub struct DispatcherMetrics {
+    pub expired_particles: Family<ParticleLabel, Counter>,
+}
+
+impl DispatcherMetrics {
+    pub fn new(registry: &mut Registry, _parallelism: Option<usize>) -> Self {
+        let sub_registry = registry.sub_registry_with_prefix("dispatcher");
+
+        // TODO: prometheus doesn't parse this Info metric. Find a way to make it work.
+        //       Gauge would work, but maybe it's possible to make Info work as well?
+        // // NOTE: it MUST by a Vec of (String, String) or it would generate gibberish!
+        // let parallelism: Info<Vec<(String, String)>> = Info::new(vec![(
+        //     "particle_parallelism".to_string(),
+        //     parallelism.map_or("unlimited".to_string(), |p| p.to_string()),
+        // )]);
+        // sub_registry.register(
+        //     "particle_parallelism",
+        //     "limit of simultaneously processed particles",
+        //     Box::new(parallelism),
+        // );
+
+        let expired_particles = Family::default();
+        sub_registry.register(
+            "particles_expired",
+            "Number of particles expired by TTL",
+            expired_particles.clone(),
+        );
+
+        DispatcherMetrics { expired_particles }
+    }
+
+    pub fn particle_expired(&self, particle_id: &str) {
+        self.expired_particles
+            .get_or_create(&ParticleLabel {
+                particle_type: ParticleType::from_particle(particle_id),
+            })
+            .inc();
+    }
+}
+
\ No newline at end of file diff --git a/src/peer_metrics/info.rs.html b/src/peer_metrics/info.rs.html new file mode 100644 index 0000000000..e48be77e2e --- /dev/null +++ b/src/peer_metrics/info.rs.html @@ -0,0 +1,73 @@ +info.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use prometheus_client::metrics::info::Info;
+use prometheus_client::registry::Registry;
+
+pub fn add_info_metrics(
+    registry: &mut Registry,
+    node_version: String,
+    air_version: String,
+    spell_version: String,
+) {
+    let sub_registry = registry.sub_registry_with_prefix("nox");
+    let info = Info::new(vec![
+        ("node_version", node_version),
+        ("air_version", air_version),
+        ("spell_version", spell_version),
+    ]);
+    sub_registry.register("build", "Nox Info", info);
+}
+
\ No newline at end of file diff --git a/src/peer_metrics/lib.rs.html b/src/peer_metrics/lib.rs.html new file mode 100644 index 0000000000..8ea780c68c --- /dev/null +++ b/src/peer_metrics/lib.rs.html @@ -0,0 +1,239 @@ +lib.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use std::fmt::Debug;
+
+use prometheus_client::encoding::{EncodeLabelSet, EncodeLabelValue, EncodeMetric};
+use prometheus_client::registry::Registry;
+
+pub use chain_listener::ChainListenerMetrics;
+pub use connection_pool::ConnectionPoolMetrics;
+pub use connectivity::ConnectivityMetrics;
+pub use connectivity::Resolution;
+pub use dispatcher::DispatcherMetrics;
+pub use info::add_info_metrics;
+use particle_execution::ParticleParams;
+pub use particle_executor::{FunctionKind, ParticleExecutorMetrics, WorkerLabel, WorkerType};
+pub use services_metrics::{
+    ServiceCallStats, ServiceMemoryStat, ServiceType, ServicesMetrics, ServicesMetricsBackend,
+    ServicesMetricsBuiltin, ServicesMetricsExternal,
+};
+pub use spell_metrics::SpellMetrics;
+pub use vm_pool::VmPoolMetrics;
+
+mod chain_listener;
+mod connection_pool;
+mod connectivity;
+mod dispatcher;
+mod info;
+mod particle_executor;
+mod services_metrics;
+mod spell_metrics;
+mod vm_pool;
+
+// TODO:
+// - service heap statistics
+// - interpreter heap histograms / summary
+// - individual actor mailbox size: max and histogram
+// - count 'Error processing inbound ProtocolMessage: unexpected end of file'
+// - number of scheduled script executions
+
+#[derive(EncodeLabelValue, Hash, Clone, Eq, PartialEq, Debug)]
+pub enum ParticleType {
+    Spell,
+    Common,
+}
+
+impl ParticleType {
+    fn from_particle(particle_id: &str) -> Self {
+        if ParticleParams::is_spell_particle(particle_id) {
+            ParticleType::Spell
+        } else {
+            ParticleType::Common
+        }
+    }
+}
+
+#[derive(EncodeLabelSet, Hash, Clone, Eq, PartialEq, Debug)]
+pub struct ParticleLabel {
+    particle_type: ParticleType,
+}
+
+/// from 100 microseconds to 120 seconds
+fn execution_time_buckets() -> std::vec::IntoIter<f64> {
+    vec![
+        0.0001, 0.001, 0.01, 0.05, 0.1, 0.25, 0.5, 1.0, 2.0, 4.0, 7.0, 15.0, 30.0, 60.0, 120.0,
+    ]
+    .into_iter()
+}
+
+/// 1mib, 5mib, 10mib, 25mib, 50mib, 100mib, 200mib, 500mib, 1gib
+fn mem_buckets() -> std::vec::IntoIter<f64> {
+    to_mib(vec![1, 5, 10, 25, 50, 100, 200, 500, 1024].into_iter())
+}
+
+/// 1mib, 5mib, 10mib, 25mib, 50mib, 100mib, 200mib, 500mib, 1gib, 2gib, 3gib, 4gib
+fn mem_buckets_4gib() -> std::vec::IntoIter<f64> {
+    to_mib(vec![1, 5, 10, 25, 50, 100, 200, 500, 1024, 2048, 3072, 4096].into_iter())
+}
+
+/// 1mib, 5mib, 10mib, 25mib, 50mib, 100mib, 200mib, 500mib, 1gib, 2gib, 3gib, 4gib, 8gib
+fn mem_buckets_8gib() -> std::vec::IntoIter<f64> {
+    to_mib(
+        vec![
+            1, 5, 10, 25, 50, 100, 200, 500, 1024, 2048, 3072, 4096, 8192,
+        ]
+        .into_iter(),
+    )
+}
+
+fn to_mib(values: std::vec::IntoIter<u64>) -> std::vec::IntoIter<f64> {
+    values
+        .map(|n| bytesize::mib(n) as f64)
+        .collect::<Vec<_>>()
+        .into_iter()
+}
+
+fn register<M>(registry: &mut Registry, metric: M, name: &str, help: &str) -> M
+where
+    M: 'static + EncodeMetric + Clone + Send + Sync + Debug,
+{
+    registry.register(name, help, metric.clone());
+    metric
+}
+
\ No newline at end of file diff --git a/src/peer_metrics/particle_executor.rs.html b/src/peer_metrics/particle_executor.rs.html new file mode 100644 index 0000000000..983baa2221 --- /dev/null +++ b/src/peer_metrics/particle_executor.rs.html @@ -0,0 +1,345 @@ +particle_executor.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use std::time::Duration;
+
+use prometheus_client::encoding::{EncodeLabelSet, EncodeLabelValue};
+use prometheus_client::metrics::counter::Counter;
+use prometheus_client::metrics::family::Family;
+use prometheus_client::metrics::gauge::Gauge;
+use prometheus_client::metrics::histogram::Histogram;
+use prometheus_client::registry::Registry;
+
+use crate::execution_time_buckets;
+
+#[derive(Copy, Clone, Debug, EncodeLabelValue, Hash, Eq, PartialEq)]
+pub enum FunctionKind {
+    Service,
+    ParticleFunction,
+    // Function call failed early
+    NotHappened,
+}
+
+#[derive(EncodeLabelSet, Hash, Clone, Eq, PartialEq, Debug)]
+pub struct FunctionKindLabel {
+    function_kind: FunctionKind,
+}
+
+#[derive(Clone)]
+pub struct ParticleExecutorMetrics {
+    pub interpretation_time_sec: Family<WorkerLabel, Histogram>,
+    pub interpretation_successes: Family<WorkerLabel, Counter>,
+    pub interpretation_failures: Family<WorkerLabel, Counter>,
+    pub total_actors_mailbox: Family<WorkerLabel, Gauge>,
+    pub alive_actors: Family<WorkerLabel, Gauge>,
+    service_call_time_sec: Family<FunctionKindLabel, Histogram>,
+    service_call_success: Family<FunctionKindLabel, Counter>,
+    service_call_failure: Family<FunctionKindLabel, Counter>,
+}
+
+#[derive(EncodeLabelSet, Debug, Clone, Hash, Eq, PartialEq)]
+pub struct WorkerLabel {
+    worker_type: WorkerType,
+    peer_id: String,
+}
+
+impl WorkerLabel {
+    pub fn new(worker_type: WorkerType, peer_id: String) -> Self {
+        Self {
+            worker_type,
+            peer_id,
+        }
+    }
+}
+
+#[derive(EncodeLabelValue, Debug, Clone, Copy, Hash, Eq, PartialEq)]
+pub enum WorkerType {
+    Worker,
+    Host,
+}
+
+impl ParticleExecutorMetrics {
+    pub fn new(registry: &mut Registry) -> Self {
+        let sub_registry = registry.sub_registry_with_prefix("particle_executor");
+
+        let interpretation_time_sec: Family<WorkerLabel, Histogram> =
+            Family::new_with_constructor(|| Histogram::new(execution_time_buckets()));
+        sub_registry.register(
+            "interpretation_time_sec",
+            "Distribution of time it took to run the interpreter once",
+            interpretation_time_sec.clone(),
+        );
+
+        let call_time_sec = Histogram::new(execution_time_buckets());
+        sub_registry.register(
+            "avm_call_time_sec",
+            "Distribution of time it took to run the avm call (interpretation + saving the particle on disk) once",
+            call_time_sec.clone(),
+        );
+
+        let interpretation_successes = Family::default();
+        sub_registry.register(
+            "interpretation_successes",
+            "Number successfully interpreted particles",
+            interpretation_successes.clone(),
+        );
+
+        let interpretation_failures = Family::default();
+        sub_registry.register(
+            "interpretation_failures",
+            "Number of failed particle interpretations",
+            interpretation_failures.clone(),
+        );
+
+        let total_actors_mailbox: Family<WorkerLabel, Gauge> =
+            Family::new_with_constructor(Gauge::default);
+        sub_registry.register(
+            "total_actors_mailbox",
+            "Cumulative sum of all actors' mailboxes",
+            total_actors_mailbox.clone(),
+        );
+        let alive_actors: Family<WorkerLabel, Gauge> = Family::new_with_constructor(Gauge::default);
+        sub_registry.register(
+            "alive_actors",
+            "Number of currently alive actors (1 particle id = 1 actor)",
+            alive_actors.clone(),
+        );
+
+        let service_call_time_sec: Family<_, _> =
+            Family::new_with_constructor(|| Histogram::new(execution_time_buckets()));
+        sub_registry.register(
+            "service_call_time_sec",
+            "Distribution of time it took to execute a single service or builtin call",
+            service_call_time_sec.clone(),
+        );
+        let service_call_success = Family::default();
+        sub_registry.register(
+            "service_call_success",
+            "Number of succeeded service calls",
+            service_call_success.clone(),
+        );
+        let service_call_failure = Family::default();
+        sub_registry.register(
+            "service_call_failure",
+            "Number of failed service calls",
+            service_call_failure.clone(),
+        );
+
+        Self {
+            interpretation_time_sec,
+            interpretation_successes,
+            interpretation_failures,
+            total_actors_mailbox,
+            alive_actors,
+            service_call_time_sec,
+            service_call_success,
+            service_call_failure,
+        }
+    }
+
+    pub fn service_call(&self, success: bool, kind: FunctionKind, run_time: Option<Duration>) {
+        let label = FunctionKindLabel {
+            function_kind: kind,
+        };
+
+        if success {
+            self.service_call_success.get_or_create(&label).inc();
+        } else {
+            self.service_call_failure.get_or_create(&label).inc();
+        }
+        if let Some(run_time) = run_time {
+            self.service_call_time_sec
+                .get_or_create(&label)
+                .observe(run_time.as_secs_f64())
+        }
+    }
+}
+
\ No newline at end of file diff --git a/src/peer_metrics/services_metrics/backend.rs.html b/src/peer_metrics/services_metrics/backend.rs.html new file mode 100644 index 0000000000..46199334af --- /dev/null +++ b/src/peer_metrics/services_metrics/backend.rs.html @@ -0,0 +1,451 @@ +backend.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use std::collections::HashMap;
+use std::time;
+
+use futures::stream::StreamExt;
+use tokio::select;
+use tokio::sync::mpsc;
+use tokio::task::{Builder, JoinHandle};
+use tokio::time::interval;
+use tokio_stream::wrappers::IntervalStream;
+
+use crate::services_metrics::builtin::ServicesMetricsBuiltin;
+use crate::services_metrics::external::{ServiceTypeLabel, ServicesMemoryMetrics};
+use crate::services_metrics::message::{ServiceMemoryStat, ServiceMetricsMsg};
+use crate::ServiceType;
+
+type ServiceId = String;
+
+/// Metrics that are meant to be written to an external metrics storage like Prometheus
+struct ExternalMetricsBackend {
+    /// How often to send memory data to prometheus
+    timer_resolution: time::Duration,
+    /// Collection of prometheus handlers
+    memory_metrics: ServicesMemoryMetrics,
+    /// Used memory per services
+    services_memory_stats: HashMap<ServiceId, (ServiceType, ServiceMemoryStat)>,
+}
+
+/// The backend creates a separate threads that processes
+/// requests from critical sections of code (where we can't afford to wait on locks)
+/// to store some metrics.
+pub struct ServicesMetricsBackend {
+    inlet: mpsc::UnboundedReceiver<ServiceMetricsMsg>,
+    external_metrics: Option<ExternalMetricsBackend>,
+    builtin_metrics: ServicesMetricsBuiltin,
+}
+
+impl ServicesMetricsBackend {
+    /// Create fully a functional backend for both external and builtin metrics.
+    pub fn with_external_metrics(
+        timer_resolution: time::Duration,
+        memory_metrics: ServicesMemoryMetrics,
+        builtin_metrics: ServicesMetricsBuiltin,
+        inlet: mpsc::UnboundedReceiver<ServiceMetricsMsg>,
+    ) -> Self {
+        let external_metrics = ExternalMetricsBackend {
+            timer_resolution,
+            memory_metrics,
+            services_memory_stats: HashMap::new(),
+        };
+        Self {
+            inlet,
+            external_metrics: Some(external_metrics),
+            builtin_metrics,
+        }
+    }
+
+    /// Create a backend with only builtin metrics gathering enabled.
+    pub fn new(
+        builtin_metrics: ServicesMetricsBuiltin,
+        inlet: mpsc::UnboundedReceiver<ServiceMetricsMsg>,
+    ) -> Self {
+        Self {
+            inlet,
+            external_metrics: None,
+            builtin_metrics,
+        }
+    }
+
+    pub fn start(self) -> JoinHandle<()> {
+        if let Some(external_metrics) = self.external_metrics {
+            Self::start_with_external(self.inlet, self.builtin_metrics, external_metrics)
+        } else {
+            Self::start_builtin_only(self.inlet, self.builtin_metrics)
+        }
+    }
+
+    fn start_with_external(
+        mut inlet: mpsc::UnboundedReceiver<ServiceMetricsMsg>,
+        builtin_metrics: ServicesMetricsBuiltin,
+        external_metrics: ExternalMetricsBackend,
+    ) -> JoinHandle<()> {
+        Builder::new().name("Metrics").spawn(async move {
+            let mut timer = IntervalStream::new(interval(external_metrics.timer_resolution));
+            let mut services_memory_stats = external_metrics.services_memory_stats;
+            let memory_metrics = external_metrics.memory_metrics;
+            loop {
+                select! {
+                    Some(msg) = inlet.recv() => {
+                        match msg {
+                            // save data to the map
+                            ServiceMetricsMsg::Memory { service_id, service_type, memory_stat } => {
+                                Self::observe_service_mem(&mut services_memory_stats, service_id, service_type, memory_stat);
+                            },
+                            ServiceMetricsMsg::CallStats { service_id, function_name, stats } => {
+                                builtin_metrics.update(service_id, function_name, stats);
+                            },
+                        }
+                    },
+                    _ = timer.next() => {
+                        // send data to prometheus
+                        Self::store_service_mem(&memory_metrics, &services_memory_stats);
+                    }
+                }
+            }
+        }).expect("Could not spawn task")
+    }
+
+    fn start_builtin_only(
+        mut inlet: mpsc::UnboundedReceiver<ServiceMetricsMsg>,
+        builtin_metrics: ServicesMetricsBuiltin,
+    ) -> JoinHandle<()> {
+        Builder::new().name("Metrics").spawn(async move {
+            loop {
+                select! {
+                    Some(msg) = inlet.recv() => {
+                        match msg {
+                            ServiceMetricsMsg::Memory{..} => {},
+                            ServiceMetricsMsg::CallStats { service_id, function_name, stats } => {
+                                builtin_metrics.update(service_id, function_name, stats);
+                            },
+                        }
+                    },
+                }
+            }
+        }).expect("Could not spawn task")
+    }
+
+    /// Collect the current service memory metrics including memory metrics of the modules
+    /// that belongs to the service.
+    fn observe_service_mem(
+        all_stats: &mut HashMap<ServiceId, (ServiceType, ServiceMemoryStat)>,
+        service_id: String,
+        service_type: ServiceType,
+        service_stat: ServiceMemoryStat,
+    ) {
+        all_stats.insert(service_id, (service_type, service_stat));
+    }
+
+    /// Actually send all collected memory memory_metrics to Prometheus.
+    fn store_service_mem(
+        memory_metrics: &ServicesMemoryMetrics,
+        all_stats: &HashMap<ServiceId, (ServiceType, ServiceMemoryStat)>,
+    ) {
+        let mut unaliased_service_total_memory = 0;
+        let mut unaliased_spells_total_memory = 0;
+        for (_, (service_type, service_stat)) in all_stats.iter() {
+            let service_type_label = ServiceTypeLabel {
+                service_type: service_type.clone(),
+            };
+            memory_metrics
+                .mem_used_bytes
+                .get_or_create(&service_type_label)
+                .observe(service_stat.used_mem as f64);
+            for stat in &service_stat.modules_stats {
+                memory_metrics
+                    .mem_used_per_module_bytes
+                    .get_or_create(&service_type_label)
+                    .observe(*stat.1 as f64)
+            }
+            match service_type {
+                ServiceType::Service(Some(_)) | ServiceType::Spell(Some(_)) => {
+                    let used_mem = i64::try_from(service_stat.used_mem);
+                    match used_mem {
+                        Ok(used_mem) => {
+                            memory_metrics
+                                .mem_used_total_bytes
+                                .get_or_create(&service_type_label)
+                                .set(used_mem);
+                        }
+                        Err(e) => log::warn!("Could not convert metric used_mem {}", e),
+                    }
+                }
+                ServiceType::Spell(_) => {
+                    unaliased_spells_total_memory += service_stat.used_mem;
+                }
+                _ => {
+                    unaliased_service_total_memory += service_stat.used_mem;
+                }
+            }
+        }
+
+        match i64::try_from(unaliased_service_total_memory) {
+            Ok(unaliased_service_total_memory) => {
+                memory_metrics
+                    .mem_used_total_bytes
+                    .get_or_create(&ServiceTypeLabel {
+                        service_type: ServiceType::Service(None),
+                    })
+                    .set(unaliased_service_total_memory);
+            }
+            _ => log::warn!("Could not convert metric unaliased_service_total_memory"),
+        }
+
+        match i64::try_from(unaliased_spells_total_memory) {
+            Ok(unaliased_spells_total_memory) => {
+                memory_metrics
+                    .mem_used_total_bytes
+                    .get_or_create(&ServiceTypeLabel {
+                        service_type: ServiceType::Spell(None),
+                    })
+                    .set(unaliased_spells_total_memory);
+            }
+            _ => log::warn!("Could not convert metric unaliased_service_total_memory"),
+        }
+    }
+}
+
\ No newline at end of file diff --git a/src/peer_metrics/services_metrics/builtin.rs.html b/src/peer_metrics/services_metrics/builtin.rs.html new file mode 100644 index 0000000000..4eec80e46c --- /dev/null +++ b/src/peer_metrics/services_metrics/builtin.rs.html @@ -0,0 +1,367 @@ +builtin.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use std::collections::{HashMap, VecDeque};
+use std::sync::Arc;
+
+use parking_lot::RwLock;
+use serde::{
+    ser::{SerializeSeq, Serializer},
+    Serialize,
+};
+use serde_json;
+
+use fluence_app_service::MemoryStats;
+
+use crate::services_metrics::message::ServiceCallStats;
+
+type ServiceId = String;
+type Name = String;
+
+/// Store a part of series of numeric observations and some parameters that describe the series.
+/// The number of stored observations is now a constant MAX_METRICS_STORAGE_SIZE.
+#[derive(Default, Debug, Clone, Serialize)]
+pub struct NumericSeriesStat {
+    /// Last N observations
+    pub series: VecDeque<f64>,
+    /// Sum of all observations
+    pub total: f64,
+    /// Average number of observations
+    pub avg: f64,
+}
+
+impl NumericSeriesStat {
+    /// Update the stat with new `value`.
+    /// `count` is a total number of obserations that is stored outside.
+    fn update(&mut self, max_metrics_storage_size: usize, value: f64, count: u64) {
+        let count = count as f64;
+        if self.series.len() >= max_metrics_storage_size {
+            self.series.pop_front();
+        }
+        self.series.push_back(value);
+        self.total += value;
+        self.avg = (self.avg * count + value) / (count + 1.0);
+    }
+}
+
+#[derive(Default, Debug, Clone, Serialize)]
+pub struct TimestampSeries {
+    #[serde(rename = "timestamps")]
+    pub series: VecDeque<u64>,
+}
+
+impl TimestampSeries {
+    fn update(&mut self, max_metrics_storage_size: usize, value: u64) {
+        if self.series.len() >= max_metrics_storage_size {
+            self.series.pop_front();
+        }
+        self.series.push_back(value);
+    }
+}
+
+/// All stats of the observed entity (service/function).
+#[derive(Default, Debug, Clone, Serialize)]
+pub struct Stats {
+    /// Count of sucessful requests to the entity
+    pub success_req_count: u64,
+    /// Count of failed requests
+    pub failed_req_count: u64,
+    /// Memory increasing rate
+    pub memory_deltas_bytes: NumericSeriesStat,
+    /// Call execution time
+    pub call_time_sec: NumericSeriesStat,
+    #[serde(flatten)]
+    /// Timestamps of last several calls
+    pub timestamps: TimestampSeries,
+}
+
+impl Stats {
+    fn update(&mut self, max_metrics_storage_size: usize, stats: &ServiceCallStats) {
+        match stats {
+            ServiceCallStats::Success {
+                memory_delta_bytes,
+                call_time_sec,
+                lock_wait_time_sec: _,
+                timestamp,
+            } => {
+                self.memory_deltas_bytes.update(
+                    max_metrics_storage_size,
+                    *memory_delta_bytes,
+                    self.success_req_count,
+                );
+                self.call_time_sec.update(
+                    max_metrics_storage_size,
+                    *call_time_sec,
+                    self.success_req_count,
+                );
+                self.success_req_count += 1;
+                self.timestamps.update(max_metrics_storage_size, *timestamp);
+            }
+            ServiceCallStats::Fail { timestamp } => {
+                self.timestamps.update(max_metrics_storage_size, *timestamp);
+                self.failed_req_count += 1;
+            }
+        }
+    }
+}
+
+#[derive(Default, Debug, Clone, Serialize)]
+pub struct ServiceStat {
+    /// Stats for the whole service
+    pub total_stats: Stats,
+    /// Stats for each interface function of the service.
+    #[serde(serialize_with = "function_stats_ser")]
+    pub functions_stats: HashMap<Name, Stats>,
+}
+
+fn function_stats_ser<S>(stats: &HashMap<Name, Stats>, serializer: S) -> Result<S::Ok, S::Error>
+where
+    S: Serializer,
+{
+    let mut seq = serializer.serialize_seq(Some(stats.len()))?;
+    for (k, v) in stats {
+        seq.serialize_element(&serde_json::json!({"name": k, "stats": v}))?;
+    }
+    seq.end()
+}
+
+#[derive(Clone)]
+pub struct ServicesMetricsBuiltin {
+    content: Arc<RwLock<HashMap<ServiceId, ServiceStat>>>,
+    max_metrics_storage_size: usize,
+}
+
+impl ServicesMetricsBuiltin {
+    pub fn new(max_metrics_storage_size: usize) -> Self {
+        ServicesMetricsBuiltin {
+            content: Arc::new(RwLock::new(HashMap::new())),
+            max_metrics_storage_size,
+        }
+    }
+
+    pub fn update(&self, service_id: ServiceId, function_name: Name, stats: ServiceCallStats) {
+        let mut content = self.content.write();
+        let service_stat = content.entry(service_id).or_default();
+        let function_stat = service_stat
+            .functions_stats
+            .entry(function_name)
+            .or_default();
+
+        function_stat.update(self.max_metrics_storage_size, &stats);
+        service_stat
+            .total_stats
+            .update(self.max_metrics_storage_size, &stats);
+    }
+
+    pub fn read(&self, service_id: &ServiceId) -> Option<ServiceStat> {
+        let content = self.content.read();
+        content.get(service_id).cloned()
+    }
+
+    pub fn get_used_memory(stats: &MemoryStats) -> u64 {
+        stats
+            .modules
+            .iter()
+            .fold(0, |acc, x| acc + x.memory_size as u64)
+    }
+}
+
\ No newline at end of file diff --git a/src/peer_metrics/services_metrics/external.rs.html b/src/peer_metrics/services_metrics/external.rs.html new file mode 100644 index 0000000000..4f0a8bfd7f --- /dev/null +++ b/src/peer_metrics/services_metrics/external.rs.html @@ -0,0 +1,501 @@ +external.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+/**
+ * Services metrics that are meant to be written to an external metrics storage like Prometheus
+ */
+use prometheus_client::metrics::counter::Counter;
+use prometheus_client::metrics::gauge::Gauge;
+use prometheus_client::metrics::histogram::{linear_buckets, Histogram};
+use prometheus_client::registry::Registry;
+use std::fmt::Write;
+
+use prometheus_client::encoding::{EncodeLabelSet, EncodeLabelValue, LabelValueEncoder};
+use prometheus_client::metrics::family::Family;
+
+use crate::{execution_time_buckets, mem_buckets_4gib, mem_buckets_8gib, register};
+
+#[derive(Hash, Clone, Eq, PartialEq, Debug)]
+pub enum ServiceType {
+    Builtin,
+    Spell(Option<String>),
+    Service(Option<String>),
+}
+
+impl EncodeLabelValue for ServiceType {
+    fn encode(&self, encoder: &mut LabelValueEncoder) -> Result<(), std::fmt::Error> {
+        let label = match self {
+            ServiceType::Builtin => "builtin",
+            ServiceType::Spell(Some(x)) => x,
+            ServiceType::Spell(_) => "spell",
+            ServiceType::Service(Some(x)) => x,
+            ServiceType::Service(_) => "non-aliased-services",
+        };
+        encoder.write_str(label)?;
+        Ok(())
+    }
+}
+
+#[derive(EncodeLabelSet, Hash, Clone, Eq, PartialEq, Debug)]
+pub struct ServiceTypeLabel {
+    pub service_type: ServiceType,
+}
+
+#[derive(Clone)]
+pub struct ServicesMemoryMetrics {
+    /// Actual memory used by a module
+    pub mem_max_per_module_bytes: Histogram,
+    /// Actual memory used by a service
+    pub mem_used_bytes: Family<ServiceTypeLabel, Histogram>,
+    /// Actual memory used by a module
+    pub mem_used_per_module_bytes: Family<ServiceTypeLabel, Histogram>,
+    /// Total memory used
+    pub mem_used_total_bytes: Family<ServiceTypeLabel, Gauge>,
+}
+
+#[derive(Clone)]
+pub struct ServicesMetricsExternal {
+    /// Number of currently running services
+    pub services_count: Family<ServiceTypeLabel, Gauge>,
+    /// How long it took to create a service
+    pub creation_time_msec: Family<ServiceTypeLabel, Histogram>,
+    /// How long it took to remove a service
+    pub removal_time_msec: Family<ServiceTypeLabel, Histogram>,
+    /// Number of (srv create) calls
+    pub creation_count: Family<ServiceTypeLabel, Counter>,
+    /// Number of (srv remove) calls
+    pub removal_count: Family<ServiceTypeLabel, Counter>,
+
+    /// Number of (srv create) failures
+    pub creation_failure_count: Counter,
+
+    /// How many modules a service includes.
+    pub modules_in_services_count: Histogram,
+
+    /// Service call time
+    pub call_time_sec: Family<ServiceTypeLabel, Histogram>,
+    pub lock_wait_time_sec: Family<ServiceTypeLabel, Histogram>,
+    pub call_success_count: Family<ServiceTypeLabel, Counter>,
+    pub call_failed_count: Family<ServiceTypeLabel, Counter>,
+
+    /// Memory metrics
+    pub memory_metrics: ServicesMemoryMetrics,
+}
+
+impl ServicesMetricsExternal {
+    pub fn new(registry: &mut Registry) -> Self {
+        let sub_registry = registry.sub_registry_with_prefix("services");
+
+        let services_count: Family<_, _> = register(
+            sub_registry,
+            Family::new_with_constructor(Gauge::default),
+            "services_count",
+            "number of currently running services",
+        );
+
+        let creation_time_msec: Family<_, _> = register(
+            sub_registry,
+            Family::new_with_constructor(|| Histogram::new(execution_time_buckets())),
+            "creation_time_msec",
+            "how long it took to create a service",
+        );
+
+        let removal_time_msec: Family<_, _> = register(
+            sub_registry,
+            Family::new_with_constructor(|| Histogram::new(execution_time_buckets())),
+            "removal_time_msec",
+            "how long it took to remove a service",
+        );
+
+        let creation_count: Family<_, _> = register(
+            sub_registry,
+            Family::new_with_constructor(Counter::default),
+            "creation_count",
+            "number of srv create calls",
+        );
+
+        let removal_count: Family<_, _> = register(
+            sub_registry,
+            Family::new_with_constructor(Counter::default),
+            "removal_count",
+            "number of srv remove calls",
+        );
+
+        let mem_max_per_module_bytes = register(
+            sub_registry,
+            Histogram::new(mem_buckets_4gib()),
+            "mem_max_per_module_bytes",
+            "maximum memory set in module config",
+        );
+
+        let mem_used_bytes: Family<_, _> = register(
+            sub_registry,
+            Family::new_with_constructor(|| Histogram::new(mem_buckets_8gib())),
+            "mem_used_bytes",
+            "actual memory used by a service",
+        );
+
+        let mem_used_per_module_bytes: Family<_, _> = register(
+            sub_registry,
+            Family::new_with_constructor(|| Histogram::new(mem_buckets_4gib())),
+            "mem_used_per_module_bytes",
+            "actual memory used by a service per module",
+        );
+
+        let mem_used_total_bytes = register(
+            sub_registry,
+            Family::default(),
+            "mem_used_total_bytes",
+            "total size of used memory by services",
+        );
+
+        let creation_failure_count = register(
+            sub_registry,
+            Counter::default(),
+            "creation_failure_count",
+            "number of srv remove calls",
+        );
+
+        let modules_in_services_count = register(
+            sub_registry,
+            Histogram::new(linear_buckets(1.0, 1.0, 10)),
+            "modules_in_services_count",
+            "number of modules per services",
+        );
+
+        let call_time_sec: Family<_, _> = register(
+            sub_registry,
+            Family::new_with_constructor(|| Histogram::new(execution_time_buckets())),
+            "call_time_msec",
+            "how long it took to execute a call",
+        );
+
+        let lock_wait_time_sec: Family<_, _> = register(
+            sub_registry,
+            Family::new_with_constructor(|| Histogram::new(execution_time_buckets())),
+            "lock_wait_time_sec",
+            "how long a service waited for Mutex",
+        );
+
+        let memory_metrics = ServicesMemoryMetrics {
+            mem_max_per_module_bytes,
+            mem_used_bytes,
+            mem_used_per_module_bytes,
+            mem_used_total_bytes,
+        };
+        let call_success_count = register(
+            sub_registry,
+            Family::default(),
+            "call_success_count",
+            "count of successfully executed calls",
+        );
+
+        let call_failed_count = register(
+            sub_registry,
+            Family::default(),
+            "call_failed_count",
+            "count of fails of calls execution",
+        );
+        Self {
+            services_count,
+            creation_time_msec,
+            removal_time_msec,
+            creation_count,
+            removal_count,
+            creation_failure_count,
+            modules_in_services_count,
+            call_time_sec,
+            lock_wait_time_sec,
+            call_success_count,
+            call_failed_count,
+            memory_metrics,
+        }
+    }
+
+    /// Collect all metrics that are relevant on service removal.
+    pub fn observe_removed(&self, service_type: ServiceType, removal_time: f64) {
+        let label = ServiceTypeLabel { service_type };
+        self.removal_count.get_or_create(&label).inc();
+        self.services_count.get_or_create(&label).dec();
+        self.removal_time_msec
+            .get_or_create(&label)
+            .observe(removal_time);
+    }
+
+    pub fn observe_created(&self, service_type: ServiceType, modules_num: f64, creation_time: f64) {
+        let label = ServiceTypeLabel { service_type };
+        self.services_count.get_or_create(&label).inc();
+        self.modules_in_services_count.observe(modules_num);
+        self.creation_count.get_or_create(&label).inc();
+        self.creation_time_msec
+            .get_or_create(&label)
+            .observe(creation_time);
+    }
+}
+
\ No newline at end of file diff --git a/src/peer_metrics/services_metrics/message.rs.html b/src/peer_metrics/services_metrics/message.rs.html new file mode 100644 index 0000000000..7054c686cc --- /dev/null +++ b/src/peer_metrics/services_metrics/message.rs.html @@ -0,0 +1,155 @@ +message.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use crate::ServiceType;
+use fluence_app_service::MemoryStats;
+use std::collections::HashMap;
+
+pub type ModuleName = String;
+pub type MemorySize = u64;
+
+/// Service function call stats to store in memory
+#[derive(Debug)]
+pub enum ServiceCallStats {
+    Success {
+        memory_delta_bytes: f64,
+        call_time_sec: f64,
+        lock_wait_time_sec: f64,
+        timestamp: u64,
+    },
+    Fail {
+        timestamp: u64,
+    },
+}
+
+/// Messages to the metrics backend
+#[derive(Debug)]
+pub enum ServiceMetricsMsg {
+    Memory {
+        service_id: String,
+        service_type: ServiceType,
+        memory_stat: ServiceMemoryStat,
+    },
+    CallStats {
+        service_id: String,
+        function_name: String,
+        stats: ServiceCallStats,
+    },
+}
+
+#[derive(Default, Debug)]
+pub struct ServiceMemoryStat {
+    /// Memory used by the service
+    pub used_mem: MemorySize,
+    /// Memory used by the modules that belongs to the service
+    pub modules_stats: HashMap<ModuleName, MemorySize>,
+}
+
+impl ServiceMemoryStat {
+    pub fn new(stats: &MemoryStats) -> ServiceMemoryStat {
+        let mut modules_stats = HashMap::new();
+        let mut used_mem: MemorySize = 0;
+        for stat in &stats.modules {
+            modules_stats.insert(stat.name.to_string(), stat.memory_size as MemorySize);
+            used_mem += stat.memory_size as MemorySize;
+        }
+        ServiceMemoryStat {
+            used_mem,
+            modules_stats,
+        }
+    }
+}
+
\ No newline at end of file diff --git a/src/peer_metrics/services_metrics/mod.rs.html b/src/peer_metrics/services_metrics/mod.rs.html new file mode 100644 index 0000000000..c80e722725 --- /dev/null +++ b/src/peer_metrics/services_metrics/mod.rs.html @@ -0,0 +1,455 @@ +mod.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+pub mod backend;
+pub mod builtin;
+pub mod external;
+pub mod message;
+
+use std::{fmt, time::Duration};
+
+pub use crate::services_metrics::backend::ServicesMetricsBackend;
+pub use crate::services_metrics::builtin::ServicesMetricsBuiltin;
+pub use crate::services_metrics::external::ServiceType;
+use crate::services_metrics::external::ServiceTypeLabel;
+pub use crate::services_metrics::external::ServicesMetricsExternal;
+pub use crate::services_metrics::message::{ServiceCallStats, ServiceMemoryStat};
+use crate::ServiceCallStats::Success;
+use prometheus_client::registry::Registry;
+use tokio::sync::mpsc;
+use tokio::sync::mpsc::unbounded_channel;
+
+use crate::services_metrics::message::ServiceMetricsMsg;
+
+#[derive(Clone)]
+pub struct ServicesMetrics {
+    pub external: Option<ServicesMetricsExternal>,
+    pub builtin: ServicesMetricsBuiltin,
+    metrics_backend_outlet: mpsc::UnboundedSender<ServiceMetricsMsg>,
+}
+
+impl fmt::Debug for ServicesMetrics {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        f.debug_struct("ServicesMetrics").finish()
+    }
+}
+
+impl ServicesMetrics {
+    pub fn new(
+        external: Option<ServicesMetricsExternal>,
+        metrics_backend_outlet: mpsc::UnboundedSender<ServiceMetricsMsg>,
+        max_builtin_storage_size: usize,
+    ) -> Self {
+        Self {
+            external,
+            builtin: ServicesMetricsBuiltin::new(max_builtin_storage_size),
+            metrics_backend_outlet,
+        }
+    }
+
+    pub fn with_external_backend(
+        timer_resolution: Duration,
+        max_builtin_storage_size: usize,
+        registry: &mut Registry,
+    ) -> (ServicesMetricsBackend, Self) {
+        let (outlet, inlet) = unbounded_channel();
+
+        let external = ServicesMetricsExternal::new(registry);
+        let memory_metrics = external.memory_metrics.clone();
+
+        let metrics = Self::new(Some(external), outlet, max_builtin_storage_size);
+        let backend = ServicesMetricsBackend::with_external_metrics(
+            timer_resolution,
+            memory_metrics,
+            metrics.builtin.clone(),
+            inlet,
+        );
+        (backend, metrics)
+    }
+
+    pub fn with_simple_backend(max_builtin_storage_size: usize) -> (ServicesMetricsBackend, Self) {
+        let (outlet, inlet) = unbounded_channel();
+        let metrics = Self::new(None, outlet, max_builtin_storage_size);
+        let backend = ServicesMetricsBackend::new(metrics.builtin.clone(), inlet);
+        (backend, metrics)
+    }
+
+    pub fn observe_builtins(&self, is_ok: bool, call_time: f64) {
+        self.observe_external(|external| {
+            let label = ServiceTypeLabel {
+                service_type: ServiceType::Builtin,
+            };
+            external
+                .call_time_sec
+                .get_or_create(&label)
+                .observe(call_time);
+            if is_ok {
+                external.call_success_count.get_or_create(&label).inc();
+            } else {
+                external.call_failed_count.get_or_create(&label).inc();
+            }
+        });
+    }
+
+    pub fn observe_service_state(
+        &self,
+        service_id: String,
+        function_name: String,
+        service_type: ServiceType,
+        memory: ServiceMemoryStat,
+        stats: ServiceCallStats,
+    ) {
+        self.observe_external(|external| {
+            let label = ServiceTypeLabel { service_type };
+            if let Success {
+                call_time_sec,
+                lock_wait_time_sec,
+                ..
+            } = &stats
+            {
+                let call_time_metric = external.call_time_sec.get_or_create(&label);
+                call_time_metric.observe(*call_time_sec);
+
+                let lock_time_metric = external.lock_wait_time_sec.get_or_create(&label);
+                lock_time_metric.observe(*lock_wait_time_sec);
+            }
+            external.call_success_count.get_or_create(&label).inc();
+            self.observe_service_mem(service_id.clone(), label.service_type, memory);
+        });
+        self.observe_service_call(service_id, Some(function_name), stats);
+    }
+
+    pub fn observe_service_state_failed(
+        &self,
+        service_id: String,
+        function_name: Option<String>,
+        service_type: ServiceType,
+        stats: ServiceCallStats,
+    ) {
+        self.observe_service_call(service_id, function_name, stats);
+        self.observe_external(|external| {
+            external
+                .call_failed_count
+                .get_or_create(&ServiceTypeLabel { service_type })
+                .inc();
+        });
+    }
+
+    fn observe_service_call(
+        &self,
+        service_id: String,
+        function_name: Option<String>,
+        stats: ServiceCallStats,
+    ) {
+        let function_name = function_name.unwrap_or("<unknown>".to_string());
+        self.send(ServiceMetricsMsg::CallStats {
+            service_id,
+            function_name,
+            stats,
+        });
+    }
+
+    /// Collect all metrics that are relevant on service creation.
+    pub fn observe_created(
+        &self,
+        service_id: String,
+        service_type: ServiceType,
+        stats: ServiceMemoryStat,
+        creation_time: f64,
+    ) {
+        self.observe_external(|external| {
+            external.observe_created(
+                service_type.clone(),
+                stats.modules_stats.len() as f64,
+                creation_time,
+            );
+            self.observe_service_mem(service_id, service_type, stats);
+        });
+    }
+
+    pub fn observe_created_failed(&self) {
+        self.observe_external(|external| {
+            external.creation_failure_count.inc();
+        });
+    }
+
+    pub fn observe_removed(&self, service_type: ServiceType, removal_time: f64) {
+        self.observe_external(|external| {
+            external.observe_removed(service_type, removal_time);
+        });
+    }
+
+    fn observe_external<F>(&self, callback: F)
+    where
+        F: FnOnce(&ServicesMetricsExternal),
+    {
+        if let Some(external) = self.external.as_ref() {
+            callback(external);
+        }
+    }
+
+    fn observe_service_mem(
+        &self,
+        service_id: String,
+        service_type: ServiceType,
+        stats: ServiceMemoryStat,
+    ) {
+        let msg = ServiceMetricsMsg::Memory {
+            service_id,
+            service_type,
+            memory_stat: stats,
+        };
+        self.send(msg);
+    }
+
+    fn send(&self, msg: ServiceMetricsMsg) {
+        let result = self.metrics_backend_outlet.send(msg);
+        if let Err(e) = result {
+            log::warn!("Can't save services' metrics: {:?}", e);
+        }
+    }
+}
+
\ No newline at end of file diff --git a/src/peer_metrics/spell_metrics.rs.html b/src/peer_metrics/spell_metrics.rs.html new file mode 100644 index 0000000000..3f11f84c58 --- /dev/null +++ b/src/peer_metrics/spell_metrics.rs.html @@ -0,0 +1,199 @@ +spell_metrics.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use crate::register;
+use prometheus_client::metrics::counter::Counter;
+use prometheus_client::metrics::gauge::Gauge;
+use prometheus_client::metrics::histogram::Histogram;
+use prometheus_client::registry::Registry;
+
+#[derive(Clone)]
+pub struct SpellMetrics {
+    // How much spell _particles_ were created by the node
+    spell_particles_created: Counter,
+    // How many spells are scheduled to run _now_
+    spell_scheduled_now: Gauge,
+    // Distribution of spell's scheduled periods
+    spell_periods: Histogram,
+}
+
+impl SpellMetrics {
+    pub fn new(registry: &mut Registry) -> Self {
+        let sub_registry = registry.sub_registry_with_prefix("spell");
+
+        let spell_particles_created = register(
+            sub_registry,
+            Counter::default(),
+            "particles_created",
+            "Number of spell particles created",
+        );
+
+        let spell_scheduled_now = register(
+            sub_registry,
+            Gauge::default(),
+            "scheduled_now",
+            "Number of spell particles scheduled to run now",
+        );
+
+        let spell_periods = register(
+            sub_registry,
+            Histogram::new(Self::periods_buckets()),
+            "periods",
+            "Spell particle periods",
+        );
+
+        Self {
+            spell_particles_created,
+            spell_scheduled_now,
+            spell_periods,
+        }
+    }
+
+    fn periods_buckets() -> std::vec::IntoIter<f64> {
+        // 0.0 sec, 1 sec, 30 sec, 1 min, 5 min, 10 min, 1 hour, 12 hours, 1 day, 1 week, 1 month
+        // 0 means that the spell is oneshot or reacts only on events
+        vec![
+            0.0,
+            1.0,
+            30.0,
+            60.0,
+            60.0 * 5.0,
+            60.0 * 10.0,
+            60.0 * 60.0,
+            60.0 * 60.0 * 12.0,
+            60.0 * 60.0 * 24.0,
+            60.0 * 60.0 * 24.0 * 7.0,
+            60.0 * 60.0 * 24.0 * 30.0,
+        ]
+        .into_iter()
+    }
+
+    pub fn observe_started_spell(&self, period: u32) {
+        self.spell_scheduled_now.inc();
+        self.spell_periods.observe(period as f64)
+    }
+
+    pub fn observe_finished_spell(&self) {
+        self.spell_scheduled_now.dec();
+    }
+
+    pub fn observe_spell_cast(&self) {
+        self.spell_particles_created.inc();
+    }
+}
+
\ No newline at end of file diff --git a/src/peer_metrics/vm_pool.rs.html b/src/peer_metrics/vm_pool.rs.html new file mode 100644 index 0000000000..528581ff10 --- /dev/null +++ b/src/peer_metrics/vm_pool.rs.html @@ -0,0 +1,443 @@ +vm_pool.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use std::cmp::{max, min};
+
+use prometheus_client::metrics::counter::Counter;
+use prometheus_client::metrics::gauge::Gauge;
+use prometheus_client::metrics::histogram::Histogram;
+use prometheus_client::registry::Registry;
+
+use crate::mem_buckets;
+
+#[derive(Clone)]
+pub struct VmPoolMetrics {
+    pool_size: Gauge,
+    pub free_vms: Gauge,
+    pub get_vm: Counter,
+    pub put_vm: Counter,
+    pub no_free_vm: Counter,
+
+    pub vm_mem_max_value: u64,
+    pub vm_mem_max: Gauge,
+    pub vm_mem_min_value: u64,
+    pub vm_mem_min: Gauge,
+    // store memory sizes for each vm
+    pub vm_mems: Vec<u64>,
+    pub vm_mem_total: Gauge,
+    // cumulative moving average
+    pub vm_mem_cma: u64,
+    pub vm_mem_measures: u64,
+    pub vm_mem_avg: Gauge,
+    // histogram
+    pub vm_mem_histo: Histogram,
+}
+
+impl VmPoolMetrics {
+    pub fn new(registry: &mut Registry) -> Self {
+        let sub_registry = registry.sub_registry_with_prefix("aqua_vm_pool");
+
+        let pool_size = Gauge::default();
+        sub_registry.register("pool_size", "Size of the AquaVM pool", pool_size.clone());
+
+        let free_vms = Gauge::default();
+        sub_registry.register(
+            "free_vms",
+            "Number of currently free AquaVMs",
+            free_vms.clone(),
+        );
+
+        let get_vm = Counter::default();
+        sub_registry.register(
+            "get_vm",
+            "Number of times an AquaVM has been taken from the pool",
+            get_vm.clone(),
+        );
+
+        let put_vm = Counter::default();
+        sub_registry.register(
+            "put_vm",
+            "Number of times an AquaVM has been put back to the pool",
+            put_vm.clone(),
+        );
+
+        let no_free_vm = Counter::default();
+        sub_registry.register(
+            "no_free_vm",
+            "Number of time when we tried to take an AquaVM from an empty pool",
+            no_free_vm.clone(),
+        );
+
+        let vm_mem_max = Gauge::default();
+        sub_registry.register(
+            "vm_mem_max",
+            "Maximum allocated memory among all interpreters (after first interpretation)",
+            vm_mem_max.clone(),
+        );
+        let vm_mem_min = Gauge::default();
+        sub_registry.register(
+            "vm_mem_min",
+            "Minumum allocated memory among all interpreters (after first interpretation)",
+            vm_mem_min.clone(),
+        );
+        let vm_mem_total = Gauge::default();
+        sub_registry.register(
+            "vm_mem_total",
+            "Total memory allocated by all interpreters on node",
+            vm_mem_total.clone(),
+        );
+        let vm_mem_avg = Gauge::default();
+        sub_registry.register(
+            "vm_mem_avg",
+            "Average allocated memory of an interpreter",
+            vm_mem_avg.clone(),
+        );
+        // 1mb, 5mb, 10mb, 25mb, 50mb, 100mb, 200mb
+        let vm_mem_histo = Histogram::new(mem_buckets());
+        sub_registry.register(
+            "vm_mem_histo",
+            "Interpreter memory size distribution",
+            vm_mem_histo.clone(),
+        );
+
+        Self {
+            pool_size,
+            free_vms,
+            get_vm,
+            put_vm,
+            no_free_vm,
+
+            vm_mem_max_value: 0,
+            vm_mem_max,
+            vm_mem_min_value: 0,
+            vm_mem_min,
+            vm_mems: vec![],
+            vm_mem_total,
+            vm_mem_cma: 0,
+            vm_mem_measures: 0,
+            vm_mem_avg,
+            vm_mem_histo,
+        }
+    }
+
+    pub fn set_pool_size(&mut self, size: usize) {
+        self.vm_mems.resize(size, 0);
+        self.pool_size.set(size as i64);
+    }
+
+    pub fn measure_memory(&mut self, idx: usize, memory_size: u64) {
+        // TODO: this is a HACK until we stop using `get_vm` for cleaning up Actor resources.
+        //       Until then, intentionally ignore memory measurements for AquaVMs that haven't
+        //       yet processed any particles.
+        if memory_size == 0 {
+            return;
+        }
+
+        // Histogram
+        self.vm_mem_histo.observe(memory_size as f64);
+
+        // Cumulative Moving Average
+        // cma_n+1 = cma_n + ((x_n+1 - cma_n) / (n + 1))
+        // https://en.wikipedia.org/wiki/Moving_average#Cumulative_moving_average
+        self.vm_mem_measures += 1;
+        let cma = self.vm_mem_cma as i64;
+        let next_cma = cma + ((memory_size as i64 - cma) / self.vm_mem_measures as i64);
+        self.vm_mem_cma = next_cma.unsigned_abs();
+        let vm_mem_cma = i64::try_from(self.vm_mem_cma);
+        match vm_mem_cma {
+            Ok(vm_mem_cma) => {
+                self.vm_mem_avg.set(vm_mem_cma);
+            }
+            Err(err) => {
+                log::warn!("Could not set vm_mem_cma metric {}", err);
+            }
+        }
+
+        // Max mem
+        self.vm_mem_max_value = max(self.vm_mem_max_value, memory_size);
+        let vm_mem_max_value = i64::try_from(self.vm_mem_max_value);
+        match vm_mem_max_value {
+            Ok(vm_mem_max_value) => {
+                self.vm_mem_max.set(vm_mem_max_value);
+            }
+            Err(err) => {
+                log::warn!("Could not set vm_mem_max_value metric {}", err);
+            }
+        }
+
+        // Min mem
+        self.vm_mem_min_value = min(self.vm_mem_min_value, memory_size);
+        let vm_mem_min_value = i64::try_from(self.vm_mem_min_value);
+        match vm_mem_min_value {
+            Ok(vm_mem_min_value) => {
+                self.vm_mem_min.set(vm_mem_min_value);
+            }
+            Err(err) => {
+                log::warn!("Could not set vm_mem_min_value metric {}", err);
+            }
+        }
+
+        // Total
+        debug_assert!(idx < self.vm_mems.len());
+        if let Some(prev) = self.vm_mems.get_mut(idx) {
+            if *prev != memory_size {
+                *prev = memory_size;
+                let total: u64 = self.vm_mems.iter().sum();
+
+                let total = i64::try_from(total);
+                match total {
+                    Ok(total) => {
+                        self.vm_mem_total.set(total);
+                    }
+                    Err(err) => {
+                        log::warn!("Could not set total metric {}", err);
+                    }
+                }
+            }
+        } else {
+            log::error!(
+                "unexpected: measure_memory idx {} is greater than pool size {}",
+                idx,
+                self.vm_mems.len()
+            );
+        }
+    }
+}
+
\ No newline at end of file diff --git a/src/server_config/args.rs.html b/src/server_config/args.rs.html new file mode 100644 index 0000000000..627a41d805 --- /dev/null +++ b/src/server_config/args.rs.html @@ -0,0 +1,967 @@ +args.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use crate::system_services_config::ServiceKey;
+use clap::error::ErrorKind;
+use clap::{Args, Parser};
+use config::{ConfigError, Map, Source, Value};
+use serde::ser::SerializeStruct;
+use serde::{Serialize, Serializer};
+use std::fmt::Debug;
+use std::path::PathBuf;
+
+#[derive(Args, Debug, Clone)]
+pub struct RootKeyPairArgs {
+    #[arg(
+        short('k'),
+        long("keypair-value"),
+        id = "ROOT_KEY_PAIR_VALUE",
+        help = "keypair in base64 (conflicts with --keypair-path)",
+        value_name = "BYTES",
+        help_heading = "Node keypair",
+        display_order = 10,
+        conflicts_with = "ROOT_KEY_PAIR_PATH",
+        conflicts_with = "SECRET_KEY"
+    )]
+    value: Option<String>,
+    #[arg(
+        short('p'),
+        long("keypair-path"),
+        id = "ROOT_KEY_PAIR_PATH",
+        help = "keypair path (conflicts with --keypair-value)",
+        help_heading = "Node keypair",
+        display_order = 11,
+        conflicts_with = "ROOT_KEY_PAIR_VALUE",
+        conflicts_with = "SECRET_KEY"
+    )]
+    path: Option<PathBuf>,
+    #[arg(
+        short('f'),
+        long("keypair-format"),
+        value_parser(["ed25519", "secp256k1", "rsa"]),
+        id = "ROOT_KEY_FORMAT",
+        help_heading = "Node keypair",
+        display_order = 12,
+    )]
+    format: Option<String>,
+
+    #[arg(
+        short('g'),
+        long("gen-keypair"),
+        value_parser = clap::value_parser ! (bool),
+        id = "ROOT_KEY_PAIR_GENERATE",
+        help_heading = "Node keypair",
+        display_order = 13,
+        action = clap::ArgAction::SetTrue
+    )]
+    generate_on_absence: Option<bool>,
+    #[arg(
+        short('y'),
+        long,
+        id = "SECRET_KEY",
+        help_heading = "Node keypair",
+        help = "Node secret key in base64 (usually 32 bytes)",
+        display_order = 14,
+        conflicts_with = "ROOT_KEY_PAIR_PATH",
+        conflicts_with = "ROOT_KEY_PAIR_VALUE"
+    )]
+    secret_key: Option<String>,
+}
+
+impl Serialize for RootKeyPairArgs {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        let mut struct_serializer = serializer.serialize_struct("KeypairConfig", 4)?;
+
+        if let Some(generate_on_absence) = &self.generate_on_absence {
+            struct_serializer.serialize_field("generate_on_absence", generate_on_absence)?;
+        }
+        if let Some(format) = &self.format {
+            struct_serializer.serialize_field("format", format)?;
+        }
+        if let Some(value) = &self.value {
+            struct_serializer.serialize_field("value", &value)?;
+        }
+        if let Some(value) = &self.path {
+            struct_serializer.serialize_field("path", &value)?;
+        }
+        if let Some(value) = &self.secret_key {
+            struct_serializer.serialize_field("secret_key", &value)?;
+        }
+        struct_serializer.end()
+    }
+}
+
+#[derive(Args, Debug, Clone, Serialize)]
+pub struct TracingArgs {
+    #[arg(
+        long("tracing-type"),
+        id = "TRACING_TYPE",
+        help = "Tracing type",
+        help_heading = "Node configuration",
+        display_order = 25,
+        value_enum
+    )]
+    #[serde(rename = "type")]
+    tpe: Option<TracingType>,
+
+    #[arg(
+        long("tracing-otlp-endpoint"),
+        id = "TRACING_OTLP_ENDPOINT",
+        value_name = "URL",
+        help = "oltp endpoint",
+        help_heading = "Node configuration",
+        display_order = 26
+    )]
+    pub endpoint: Option<String>,
+}
+
+#[derive(clap::ValueEnum, Debug, Clone, Serialize)]
+pub enum TracingType {
+    #[serde(rename = "disabled")]
+    Disabled,
+    #[serde(rename = "otlp")]
+    Otlp,
+}
+
+#[derive(Debug, Clone, Serialize)]
+pub enum EnabledSystemServices {
+    All,
+    Some(Vec<String>),
+    None,
+}
+
+// Parse either:
+// - "all" to EnabledSystemServices::All
+// - "none" to EnabledSystemServices::None
+// - "service1,service2" to EnabledSystemServices::Some(vec!["service1", "service2"])
+#[derive(Debug, Clone)]
+struct EnabledSystemServicesValueParser;
+
+impl clap::builder::TypedValueParser for EnabledSystemServicesValueParser {
+    type Value = EnabledSystemServices;
+    fn parse_ref(
+        &self,
+        _cmd: &clap::Command,
+        _arg: Option<&clap::Arg>,
+        value: &std::ffi::OsStr,
+    ) -> Result<Self::Value, clap::Error> {
+        let value = value
+            .to_str()
+            .ok_or_else(|| clap::Error::new(ErrorKind::InvalidUtf8))?;
+
+        match value {
+            "all" => Ok(EnabledSystemServices::All),
+            "none" => Ok(EnabledSystemServices::None),
+            _ => {
+                let services = value.split(',').map(|s| s.to_string()).collect::<Vec<_>>();
+                Ok(EnabledSystemServices::Some(services))
+            }
+        }
+    }
+}
+
+#[derive(Parser, Debug, Clone)]
+pub(crate) struct SystemServicesArgs {
+    // TODO: how to provide the list of available system services automatically
+    #[arg(
+        long,
+        id = "SERVICES",
+        help = "List of enabled system services. Can be: all, none or comma-separated list of services (serivce1,service2)",
+        help_heading = "System services configuration",
+        value_parser = EnabledSystemServicesValueParser
+    )]
+    enable_system_services: Option<EnabledSystemServices>,
+
+    #[arg(
+        long,
+        id = "WALLET_KEY",
+        help = "The private wallet key for signing transactions for joining deals",
+        help_heading = "System services configuration"
+    )]
+    wallet_key: Option<String>,
+}
+
+impl Serialize for SystemServicesArgs {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        let mut struct_serializer = serializer.serialize_struct("SystemServicesConfig", 5)?;
+
+        if let Some(enable_system_services) = &self.enable_system_services {
+            match enable_system_services {
+                EnabledSystemServices::All => {
+                    let all = ServiceKey::all_values();
+                    struct_serializer.serialize_field("enable", &all)?;
+                }
+                EnabledSystemServices::Some(services) => {
+                    let services: Vec<ServiceKey> = services
+                        .iter()
+                        .map(|service| match ServiceKey::from_string(service) {
+                            Some(service) => Ok(service),
+                            None => Err(serde::ser::Error::custom(format!(
+                                "unknown service: {}",
+                                service
+                            ))),
+                        })
+                        .collect::<Result<_, _>>()?;
+
+                    struct_serializer.serialize_field("enable", &services)?;
+                }
+                EnabledSystemServices::None => {
+                    struct_serializer.serialize_field::<Vec<ServiceKey>>("enable", &vec![])?;
+                }
+            }
+        }
+        if let Some(wallet_key) = &self.wallet_key {
+            #[derive(Serialize)]
+            struct DeciderConfig {
+                wallet_key: String,
+            }
+            struct_serializer.serialize_field(
+                "decider",
+                &DeciderConfig {
+                    wallet_key: wallet_key.clone(),
+                },
+            )?;
+        }
+
+        struct_serializer.end()
+    }
+}
+
+#[derive(Parser, Debug, Serialize, Clone)]
+pub(crate) struct DerivedArgs {
+    #[arg(
+        short,
+        long,
+        id = "TCP_PORT",
+        help = "tcp port",
+        help_heading = "Networking",
+        display_order = 1
+    )]
+    tcp_port: Option<u16>,
+    #[arg(
+        short,
+        long("ws-port"),
+        id = "WEBSOCKET_PORT",
+        help = "websocket port",
+        help_heading = "Networking",
+        display_order = 2
+    )]
+    websocket_port: Option<u16>,
+    #[arg(
+        short('s'),
+        long,
+        id = "HTTP_PORT",
+        help = "http port",
+        help_heading = "Networking",
+        display_order = 3
+    )]
+    http_port: Option<u16>,
+    #[arg(
+        short('x'),
+        long("external-ip"),
+        id = "EXTERNAL_ADDR",
+        help = "node external IP address to advertise to other peers",
+        value_name = "IP",
+        help_heading = "Networking",
+        display_order = 4
+    )]
+    external_address: Option<String>,
+    #[arg(
+        short('z'),
+        long("external-maddrs"),
+        id = "EXTERNAL_MULTIADDRS",
+        help = "external multiaddresses to advertize",
+        value_name = "MULTIADDR",
+        help_heading = "Networking",
+        display_order = 5,
+        action = clap::ArgAction::Append,
+        num_args = 1..
+    )]
+    external_multiaddresses: Option<Vec<String>>,
+    #[arg(
+        short('a'),
+        long("allow-private-ips"),
+        name = "ALLOW_PRIVATE_IPS",
+        help = "allow private IP addresses from other nodes",
+        help_heading = "Networking",
+        display_order = 6,
+        action = clap::ArgAction::SetTrue
+    )]
+    allow_local_addresses: Option<bool>,
+    #[arg(
+        short('b'),
+        long("bootstraps"),
+        id = "BOOTSTRAP_NODE",
+        help = "bootstrap nodes of the Fluence network",
+        value_name = "MULTIADDR",
+        help_heading = "Networking",
+        display_order = 7,
+        conflicts_with = "LOCAL",
+        action = clap::ArgAction::Append,
+        num_args = 1..
+    )]
+    bootstrap_nodes: Option<Vec<String>>,
+    #[arg(
+        short('q'),
+        long,
+        id = "BOOTSTRAP_FREQ",
+        help = "bootstrap kademlia each time N bootstraps (re)connect",
+        value_name = "N",
+        help_heading = "Networking",
+        display_order = 8
+    )]
+    bootstrap_frequency: Option<usize>,
+    #[arg(
+        short('l'),
+        long,
+        id = "LOCAL",
+        value_parser = clap::value_parser ! (bool),
+        help = "if passed, bootstrap nodes aren't used",
+        help_heading = "Networking",
+        display_order = 9,
+        action = clap::ArgAction::SetTrue
+    )]
+    local: Option<bool>,
+
+    #[command(flatten)]
+    root_key_pair: Option<RootKeyPairArgs>,
+
+    #[arg(
+        short('c'),
+        long("config"),
+        id = "CONFIG_FILE",
+        help_heading = "Node configuration",
+        help = "TOML configuration file",
+        long_help = "TOML configuration file. If not specified, the default configuration is used. \
+            If specified, the default configuration is merged with the specified one. \
+            The argument can by used multiple times. \
+            The last configuration overrides the previous ones.",
+        value_name = "PATH",
+        num_args(1..),
+        value_delimiter(','),
+        display_order = 15,
+    )]
+    pub(crate) configs: Option<Vec<PathBuf>>,
+    #[arg(
+        short('d'),
+        long,
+        id = "CERTIFICATE_DIR",
+        help_heading = "Node configuration",
+        help = "certificate dir",
+        value_name = "PATH",
+        display_order = 16
+    )]
+    certificate_dir: Option<PathBuf>,
+    #[arg(
+        short('m'),
+        long,
+        id = "MANAGEMENT_PEER_ID",
+        help_heading = "Node configuration",
+        help = "PeerId of the node's administrator",
+        value_name = "PEER ID",
+        display_order = 17
+    )]
+    management_key: Option<String>,
+
+    #[arg(
+        short('u'),
+        long,
+        id = "BLUEPRINT_DIR",
+        help_heading = "Services configuration",
+        help = "directory containing blueprints and wasm modules",
+        value_name = "PATH",
+        display_order = 19
+    )]
+    blueprint_dir: Option<PathBuf>,
+    #[arg(
+        short('r'),
+        long,
+        id = "SERVICES_WORKDIR",
+        help_heading = "Services configuration",
+        help = "directory where all services will store their data",
+        value_name = "PATH",
+        display_order = 20
+    )]
+    services_workdir: Option<PathBuf>,
+    #[arg(
+        long("aqua-pool-size"),
+        id = "AQUA_VM_POOL_SIZE",
+        help_heading = "AIR configuration",
+        help = "Number of AquaVM instances (particle script execution parallelism)",
+        value_name = "NUM",
+        display_order = 21
+    )]
+    aquavm_pool_size: Option<usize>,
+    #[arg(
+        long,
+        value_parser = clap::value_parser ! (bool),
+        id = "PRINT_CONFIG",
+        help = "Print applied config",
+        help_heading = "Node configuration",
+        display_order = 22,
+        action = clap::ArgAction::SetTrue
+    )]
+    pub(crate) print_config: Option<bool>,
+    #[arg(
+        long,
+        value_parser = clap::value_parser ! (bool),
+        id = "NO_BANNER",
+        help = "Disable banner",
+        help_heading = "Node configuration",
+        display_order = 23,
+        action = clap::ArgAction::SetTrue
+    )]
+    pub(crate) no_banner: Option<bool>,
+
+    #[command(flatten)]
+    system_services: Option<SystemServicesArgs>,
+
+    #[command(flatten)]
+    tracing: Option<TracingArgs>,
+
+    #[command(flatten)]
+    dev_mode: Option<DevModeArgs>,
+}
+
+impl Source for DerivedArgs {
+    fn clone_into_box(&self) -> Box<dyn Source + Send + Sync> {
+        Box::new(self.clone())
+    }
+
+    fn collect(&self) -> Result<Map<String, Value>, ConfigError> {
+        let source_str =
+            toml::to_string(&self).map_err(|e| config::ConfigError::Foreign(Box::new(e)))?;
+        let result = toml::de::from_str(&source_str)
+            .map_err(|e| config::ConfigError::Foreign(Box::new(e)))?;
+        Ok(result)
+    }
+}
+
+#[derive(Parser, Debug, Clone)]
+pub struct DevModeArgs {
+    #[arg(
+        long("dev-mode"),
+        value_parser = clap::value_parser!(bool),
+        id = "ENABLE_DEV_MODE",
+        help = "The private wallet key for signing transactions for joining deals",
+        help_heading = "System services configuration"
+    )]
+    enable: bool,
+}
+
+impl Serialize for DevModeArgs {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        let mut struct_serializer = serializer.serialize_struct("DevModeConfig", 5)?;
+        struct_serializer.serialize_field("enable", &self.enable)?;
+        struct_serializer.end()
+    }
+}
+
\ No newline at end of file diff --git a/src/server_config/avm_config.rs.html b/src/server_config/avm_config.rs.html new file mode 100644 index 0000000000..df33688d2e --- /dev/null +++ b/src/server_config/avm_config.rs.html @@ -0,0 +1,113 @@ +avm_config.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use crate::wasm_backend_config::WasmBackendConfig;
+use derivative::Derivative;
+use serde::{Deserialize, Serialize};
+use serde_with::serde_as;
+use serde_with::DisplayFromStr;
+
+#[serde_as]
+#[derive(Clone, Default, Deserialize, Serialize, Derivative)]
+#[derivative(Debug)]
+pub struct AVMConfig {
+    /// Maximum heap size in bytes available for an interpreter instance.
+    #[serde_as(as = "Option<DisplayFromStr>")]
+    #[serde(default)]
+    pub aquavm_heap_size_limit: Option<bytesize::ByteSize>,
+
+    /// Maximum AIR size in bytes that is used by the AquaVM limit check.
+    #[serde_as(as = "Option<DisplayFromStr>")]
+    #[serde(default)]
+    pub air_size_limit: Option<bytesize::ByteSize>,
+
+    /// Maximum particle size in bytes that is used by the AquaVM limit check.
+    #[serde_as(as = "Option<DisplayFromStr>")]
+    #[serde(default)]
+    pub particle_size_limit: Option<bytesize::ByteSize>,
+
+    /// Maximum service call result size in bytes that is used by the AquaVM limit check.
+    #[serde_as(as = "Option<DisplayFromStr>")]
+    #[serde(default)]
+    pub call_result_size_limit: Option<bytesize::ByteSize>,
+
+    /// Hard limit AquaVM behavior control knob.
+    #[serde(default)]
+    pub hard_limit_enabled: bool,
+
+    #[serde(default)]
+    pub wasm_backend: WasmBackendConfig,
+}
+
\ No newline at end of file diff --git a/src/server_config/bootstrap_config.rs.html b/src/server_config/bootstrap_config.rs.html new file mode 100644 index 0000000000..c186efe1c2 --- /dev/null +++ b/src/server_config/bootstrap_config.rs.html @@ -0,0 +1,111 @@ +bootstrap_config.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use serde::{Deserialize, Serialize};
+use std::time::Duration;
+
+#[derive(Debug, Clone, Serialize, Deserialize)]
+pub struct BootstrapConfig {
+    #[serde(with = "humantime_serde")]
+    pub reconnect_delay: Duration,
+    #[serde(with = "humantime_serde")]
+    pub bootstrap_delay: Duration,
+    #[serde(with = "humantime_serde")]
+    pub bootstrap_max_delay: Duration,
+}
+
+impl BootstrapConfig {
+    /// Creates config with all values to zero, so no delays. Useful for tests.
+    pub fn zero() -> BootstrapConfig {
+        BootstrapConfig {
+            reconnect_delay: <_>::default(),
+            bootstrap_delay: <_>::default(),
+            bootstrap_max_delay: <_>::default(),
+        }
+    }
+}
+
+impl Default for BootstrapConfig {
+    fn default() -> Self {
+        use rand::prelude::*;
+        let mut rng = rand::thread_rng();
+        BootstrapConfig {
+            // TODO: make it exponential
+            reconnect_delay: Duration::from_millis(1500 + rng.gen_range(0..500)),
+            bootstrap_delay: Duration::from_millis(30000 + rng.gen_range(0..2000)),
+            bootstrap_max_delay: Duration::from_secs(60),
+        }
+    }
+}
+
\ No newline at end of file diff --git a/src/server_config/defaults.rs.html b/src/server_config/defaults.rs.html new file mode 100644 index 0000000000..360235258a --- /dev/null +++ b/src/server_config/defaults.rs.html @@ -0,0 +1,595 @@ +defaults.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use std::collections::{BTreeMap, HashMap};
+use std::net::IpAddr;
+use std::path::{Path, PathBuf};
+use std::time::Duration;
+
+use core_distributor::CoreRange;
+use libp2p::core::Multiaddr;
+use libp2p::identity::ed25519::Keypair;
+use libp2p::identity::PublicKey;
+use libp2p::PeerId;
+use maplit::{btreemap, hashmap};
+
+use fluence_libp2p::Transport;
+
+use crate::node_config::PathOrValue;
+use crate::system_services_config::ServiceKey;
+
+const CONFIG_VERSION: usize = 1;
+
+pub fn default_transport() -> Transport {
+    Transport::Network
+}
+
+pub fn default_tcp_port() -> u16 {
+    7777
+}
+
+pub fn default_listen_ip() -> IpAddr {
+    "0.0.0.0".parse().unwrap()
+}
+
+pub fn default_socket_timeout() -> Duration {
+    Duration::from_secs(20)
+}
+
+pub fn default_connection_idle_timeout() -> Duration {
+    // 180 seconds makes sense because default Particle TTL is 120 sec, and it doesn't seem very efficient for hosts to reconnect while particle is still in flight
+    Duration::from_secs(180)
+}
+
+pub fn default_max_established_per_peer_limit() -> Option<u32> {
+    Some(5)
+}
+
+pub fn default_bootstrap_nodes() -> Vec<Multiaddr> {
+    vec![]
+}
+
+pub fn default_system_cpu_count() -> usize {
+    let total = num_cpus::get_physical();
+    match total {
+        x if x > 32 => 3,
+        x if x > 7 => 2,
+        _ => 1,
+    }
+}
+
+pub fn default_cpus_range() -> Option<CoreRange> {
+    let total = num_cpus::get_physical();
+    let left = match total {
+        // Leave 1 core to OS if there's 8+ cores
+        c if c >= 8 => 1,
+        _ => 0,
+    };
+    Some(
+        CoreRange::try_from(Vec::from_iter(left..total).as_slice())
+            .expect("Cpu range can't be empty"),
+    )
+}
+
+pub fn default_websocket_port() -> u16 {
+    9999
+}
+
+pub fn default_http_port() -> u16 {
+    18080
+}
+
+pub fn default_metrics_enabled() -> bool {
+    true
+}
+
+pub fn default_tokio_metrics_enabled() -> bool {
+    false
+}
+
+pub fn default_tokio_metrics_poll_histogram_enabled() -> bool {
+    false
+}
+
+pub fn default_health_check_enabled() -> bool {
+    true
+}
+
+pub fn default_services_metrics_timer_resolution() -> Duration {
+    Duration::from_secs(60)
+}
+
+pub fn default_base_dir() -> PathBuf {
+    format!(".fluence/v{CONFIG_VERSION}").into()
+}
+
+pub fn persistent_dir(base_dir: &Path) -> PathBuf {
+    base_dir.join("persistent")
+}
+
+pub fn ephemeral_dir(base_dir: &Path) -> PathBuf {
+    base_dir.join("ephemeral")
+}
+
+pub fn services_dir(base_dir: &Path) -> PathBuf {
+    base_dir.join("services")
+}
+
+pub fn avm_base_dir(base_dir: &Path) -> PathBuf {
+    base_dir.join("avm")
+}
+
+pub fn default_keypair_path(base_dir: &Path) -> PathOrValue {
+    PathOrValue::Path {
+        path: base_dir.join("secret_key.ed25519"),
+    }
+}
+
+pub fn default_builtins_keypair_path(persistent_base_dir: &Path) -> PathOrValue {
+    PathOrValue::Path {
+        path: persistent_base_dir.join("builtins_secret_key.ed25519"),
+    }
+}
+
+pub fn default_aquavm_pool_size() -> usize {
+    num_cpus::get() * 2
+}
+
+pub fn default_particle_queue_buffer_size() -> usize {
+    128
+}
+
+pub fn default_effects_queue_buffer_size() -> usize {
+    128
+}
+
+pub fn default_workers_queue_buffer_size() -> usize {
+    128
+}
+
+pub fn default_particle_processor_parallelism() -> Option<usize> {
+    Some(num_cpus::get() * 2)
+}
+
+pub fn default_max_spell_particle_ttl() -> Duration {
+    Duration::from_secs(120)
+}
+
+pub fn default_bootstrap_frequency() -> usize {
+    3
+}
+
+pub fn default_execution_timeout() -> Duration {
+    Duration::from_secs(20)
+}
+
+pub fn default_processing_timeout() -> Duration {
+    Duration::from_secs(120)
+}
+
+pub fn default_management_peer_id() -> PeerId {
+    use base64::{engine::general_purpose::STANDARD as base64, Engine};
+
+    let kp = Keypair::generate();
+    let public_key: PublicKey = PublicKey::from(kp.public()); //TODO: safe unwrap
+    let peer_id = PeerId::from(public_key);
+
+    log::info!(
+        "New management key generated. ed25519 private key in base64 = {}",
+        base64.encode(kp.secret()),
+    );
+    peer_id
+}
+
+pub fn default_key_format() -> String {
+    "ed25519".to_string()
+}
+
+pub fn default_service_memory_limit() -> bytesize::ByteSize {
+    bytesize::ByteSize::b(bytesize::gib(4_u64) - 1)
+}
+
+pub fn default_max_builtin_metrics_storage_size() -> usize {
+    5
+}
+
+pub fn default_allowed_binaries() -> Vec<String> {
+    vec!["/usr/bin/curl".to_string(), "/usr/bin/ipfs".to_string()]
+}
+
+pub fn default_system_services() -> Vec<ServiceKey> {
+    ServiceKey::all_values()
+}
+
+pub fn default_ipfs_multiaddr() -> String {
+    "/dns4/ipfs.fluence.dev/tcp/5001".to_string()
+}
+
+// 15 minutes
+pub fn default_worker_spell_period_sec() -> u32 {
+    900
+}
+
+// 2 minutes
+pub fn default_decider_spell_period_sec() -> u32 {
+    120
+}
+
+// 60 minutes
+// This is an interval setting for a spell in general.
+// should be the smallest common denominator of other intervals.
+pub fn default_registry_spell_period_sec() -> u32 {
+    3600
+}
+
+// 24 hours
+pub fn default_registry_expired_spell_period_sec() -> u32 {
+    86400
+}
+
+// 12 hours
+pub fn default_registry_renew_spell_period_sec() -> u32 {
+    43200
+}
+
+// 60 minutes
+pub fn default_registry_replicate_spell_period_sec() -> u32 {
+    3600
+}
+
+pub fn default_ipfs_binary_path() -> PathBuf {
+    "/usr/bin/ipfs".into()
+}
+
+pub fn default_curl_binary_path() -> PathBuf {
+    "/usr/bin/curl".into()
+}
+
+pub fn default_effectors() -> HashMap<String, (String, HashMap<String, PathBuf>)> {
+    hashmap! {
+        "curl".to_string() => ("bafkreids22lgia5bqs63uigw4mqwhsoxvtnkpfqxqy5uwyyerrldsr32ce".to_string(), hashmap! {
+            "curl".to_string() => default_curl_binary_path(),
+        })
+    }
+}
+
+pub fn default_binaries_mapping() -> BTreeMap<String, PathBuf> {
+    btreemap! {
+        "curl".to_string() => default_curl_binary_path(),
+        "ipfs".to_string() => default_ipfs_binary_path(),
+    }
+}
+
+pub fn default_proof_poll_period() -> Duration {
+    Duration::from_secs(60)
+}
+
+pub fn default_min_batch_count() -> usize {
+    1
+}
+
+pub fn default_max_batch_count() -> usize {
+    4
+}
+
+pub fn default_max_proof_batch_size() -> usize {
+    2
+}
+
+pub fn default_epoch_end_window() -> Duration {
+    Duration::from_secs(300)
+}
+
\ No newline at end of file diff --git a/src/server_config/dir_config.rs.html b/src/server_config/dir_config.rs.html new file mode 100644 index 0000000000..7ebecba3fc --- /dev/null +++ b/src/server_config/dir_config.rs.html @@ -0,0 +1,357 @@ +dir_config.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+use crate::defaults::{avm_base_dir, default_base_dir, services_dir};
+
+use air_interpreter_fs::air_interpreter_path;
+use fs_utils::{canonicalize, create_dirs, to_abs_path};
+
+use crate::{ephemeral_dir, persistent_dir};
+use eyre::WrapErr;
+use serde::{Deserialize, Serialize};
+use std::path::PathBuf;
+
+#[derive(Deserialize, Serialize, Clone, Debug)]
+pub struct UnresolvedDirConfig {
+    /// Parent directory for all other node's directory
+    #[serde(default = "default_base_dir")]
+    pub base_dir: PathBuf,
+
+    /// Base directory for persistent resources
+    pub persistent_base_dir: Option<PathBuf>,
+
+    /// Base directory for ephemeral resources
+    pub ephemeral_base_dir: Option<PathBuf>,
+
+    /// Base directory for persistent resources needed by application services
+    pub services_persistent_dir: Option<PathBuf>,
+
+    /// Base directory for ephemeral resources needed by application services
+    pub services_ephemeral_dir: Option<PathBuf>,
+
+    /// Base directory for resources needed by application services
+    pub avm_base_dir: Option<PathBuf>,
+
+    /// Path to AIR interpreter .wasm file (aquamarine.wasm)
+    pub air_interpreter_path: Option<PathBuf>,
+
+    /// Path to spell service files (wasms, configs)
+    pub spell_base_dir: Option<PathBuf>,
+
+    /// Path to persisted worker keypairs
+    pub keypairs_base_dir: Option<PathBuf>,
+
+    /// Path to persisted workers
+    pub workers_base_dir: Option<PathBuf>,
+
+    /// Path to stored cc events
+    pub cc_events_dir: Option<PathBuf>,
+
+    /// Path to stored core_state
+    pub core_state_path: Option<PathBuf>,
+}
+
+impl UnresolvedDirConfig {
+    pub fn resolve(self) -> eyre::Result<ResolvedDirConfig> {
+        let base_dir = to_abs_path(self.base_dir);
+
+        let ephemeral_base_dir = self.ephemeral_base_dir.unwrap_or(ephemeral_dir(&base_dir));
+        let persistent_base_dir = self
+            .persistent_base_dir
+            .unwrap_or(persistent_dir(&base_dir));
+
+        // ephemeral dirs
+        let services_ephemeral_dir = self
+            .services_ephemeral_dir
+            .unwrap_or(services_dir(&ephemeral_base_dir));
+        let avm_base_dir = self
+            .avm_base_dir
+            .unwrap_or(avm_base_dir(&ephemeral_base_dir));
+
+        // persistent dirs
+        let services_persistent_dir = self
+            .services_persistent_dir
+            .unwrap_or(services_dir(&persistent_base_dir));
+
+        let spell_base_dir = self
+            .spell_base_dir
+            .unwrap_or(persistent_base_dir.join("spell"));
+        let keypairs_base_dir = self
+            .keypairs_base_dir
+            .unwrap_or(persistent_base_dir.join("keypairs"));
+        let workers_base_dir = self
+            .workers_base_dir
+            .unwrap_or(persistent_base_dir.join("workers"));
+
+        let cc_events_dir = self
+            .cc_events_dir
+            .unwrap_or(persistent_base_dir.join("cc_events"));
+
+        create_dirs(&[
+            &base_dir,
+            // ephemeral dirs
+            &ephemeral_base_dir,
+            &services_ephemeral_dir,
+            &avm_base_dir,
+            // persistent dirs
+            &persistent_base_dir,
+            &services_persistent_dir,
+            &spell_base_dir,
+            &keypairs_base_dir,
+            &workers_base_dir,
+            // other
+            &cc_events_dir,
+        ])
+        .context("creating configured directories")?;
+
+        let base_dir = canonicalize(base_dir)?;
+        let ephemeral_base_dir = canonicalize(ephemeral_base_dir)?;
+        let persistent_base_dir = canonicalize(persistent_base_dir)?;
+        // ephemeral dirs
+        let avm_base_dir = canonicalize(avm_base_dir)?;
+        let services_ephemeral_dir = canonicalize(services_ephemeral_dir)?;
+
+        // persistent dirs
+        let services_persistent_dir = canonicalize(services_persistent_dir)?;
+        let spell_base_dir = canonicalize(spell_base_dir)?;
+        let keypairs_base_dir = canonicalize(keypairs_base_dir)?;
+        let workers_base_dir = canonicalize(workers_base_dir)?;
+
+        let cc_events_dir = canonicalize(cc_events_dir)?;
+
+        let air_interpreter_path = self
+            .air_interpreter_path
+            .unwrap_or(air_interpreter_path(&persistent_base_dir));
+        let core_state_path = self
+            .core_state_path
+            .clone()
+            .unwrap_or(persistent_base_dir.join("cores_state.toml"));
+
+        Ok(ResolvedDirConfig {
+            base_dir,
+            ephemeral_base_dir,
+            persistent_base_dir,
+            avm_base_dir,
+            services_ephemeral_dir,
+            services_persistent_dir,
+            air_interpreter_path,
+            spell_base_dir,
+            keypairs_base_dir,
+            workers_base_dir,
+            cc_events_dir,
+            core_state_path,
+        })
+    }
+}
+
+#[derive(Clone, Debug, Serialize, Deserialize)]
+pub struct ResolvedDirConfig {
+    pub base_dir: PathBuf,
+    pub ephemeral_base_dir: PathBuf,
+    pub persistent_base_dir: PathBuf,
+    /// Directory where particle's prev_data is stored
+    pub avm_base_dir: PathBuf,
+    pub services_ephemeral_dir: PathBuf,
+    pub services_persistent_dir: PathBuf,
+    /// Directory where interpreter's WASM module is stored
+    pub air_interpreter_path: PathBuf,
+    pub spell_base_dir: PathBuf,
+    pub keypairs_base_dir: PathBuf,
+    pub workers_base_dir: PathBuf,
+    pub cc_events_dir: PathBuf,
+    pub core_state_path: PathBuf,
+}
+
\ No newline at end of file diff --git a/src/server_config/kademlia_config.rs.html b/src/server_config/kademlia_config.rs.html new file mode 100644 index 0000000000..a2e08f8ae4 --- /dev/null +++ b/src/server_config/kademlia_config.rs.html @@ -0,0 +1,167 @@ +kademlia_config.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use libp2p::StreamProtocol;
+use std::time::Duration;
+
+use crate::Network;
+use serde::{Deserialize, Serialize};
+use serde_with::{serde_as, DisplayFromStr};
+
+/// see `libp2p_kad::KademliaConfig`
+#[derive(Debug, Clone, Deserialize, Serialize)]
+pub struct UnresolvedKademliaConfig {
+    pub max_packet_size: Option<usize>,
+    #[serde(with = "humantime_serde")]
+    pub query_timeout: Duration,
+    pub replication_factor: Option<usize>,
+    /// Number of times peer is failed to be discovered before it is banned
+    pub peer_fail_threshold: usize,
+    /// Period after which peer ban is lifted
+    #[serde(with = "humantime_serde")]
+    pub ban_cooldown: Duration,
+}
+
+impl UnresolvedKademliaConfig {
+    pub fn resolve(&self, network: &Network) -> eyre::Result<KademliaConfig> {
+        let protocol_name: StreamProtocol = network.try_into()?;
+
+        Ok(KademliaConfig {
+            max_packet_size: self.max_packet_size,
+            query_timeout: self.query_timeout,
+            replication_factor: self.replication_factor,
+            peer_fail_threshold: self.peer_fail_threshold,
+            ban_cooldown: self.ban_cooldown,
+            protocol_name,
+        })
+    }
+}
+
+/// see `libp2p_kad::KademliaConfig`
+#[serde_as]
+#[derive(Debug, Clone, Serialize)]
+pub struct KademliaConfig {
+    pub max_packet_size: Option<usize>,
+    #[serde(with = "humantime_serde")]
+    pub query_timeout: Duration,
+    pub replication_factor: Option<usize>,
+    /// Number of times peer is failed to be discovered before it is banned
+    pub peer_fail_threshold: usize,
+    /// Period after which peer ban is lifted
+    #[serde(with = "humantime_serde")]
+    pub ban_cooldown: Duration,
+    #[serde_as(as = "DisplayFromStr")]
+    pub protocol_name: StreamProtocol,
+}
+
+impl Default for UnresolvedKademliaConfig {
+    fn default() -> Self {
+        Self {
+            max_packet_size: Some(100 * 4096 * 4096), // 100Mb
+            query_timeout: Duration::from_secs(3),
+            replication_factor: None,
+            peer_fail_threshold: 3,
+            ban_cooldown: Duration::from_secs(60),
+        }
+    }
+}
+
\ No newline at end of file diff --git a/src/server_config/keys.rs.html b/src/server_config/keys.rs.html new file mode 100644 index 0000000000..1368f51750 --- /dev/null +++ b/src/server_config/keys.rs.html @@ -0,0 +1,345 @@ +keys.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+use std::path::PathBuf;
+use std::str::FromStr;
+use std::{
+    fs::{self, File},
+    io::{Error, ErrorKind, Write},
+    path::Path,
+};
+
+use base64::{engine::general_purpose::STANDARD as base64, Engine};
+use eyre::eyre;
+use fluence_keypair::{key_pair::KeyFormat, KeyPair};
+
+use fs_utils::create_dirs;
+
+/// Creates new key pair and store its secret key in a `key_path` file.
+fn create_new_key_pair(key_path: &Path, key_format: KeyFormat) -> Result<KeyPair, Error> {
+    let parents = key_path.parent();
+    if let Some(parent_path) = parents {
+        create_dirs(&[&parent_path])?
+    }
+
+    let key_pair = KeyPair::generate(key_format);
+    let secret_key = key_pair
+        .secret()
+        .expect("error getting secret key from keypair");
+    let encoded = base64.encode(secret_key);
+
+    let mut key_file = File::create(key_path).map_err(|err| {
+        std::io::Error::new(
+            err.kind(),
+            format!("error creating keypair file {key_path:?}: {err:?}"),
+        )
+    })?;
+    key_file.write_all(encoded.as_bytes()).map_err(|err| {
+        std::io::Error::new(
+            err.kind(),
+            format!("error writing keypair to {key_path:?}: {err:?}"),
+        )
+    })?;
+
+    Ok(key_pair)
+}
+
+pub fn decode_key(key_string: String, key_format: String) -> eyre::Result<KeyPair> {
+    let key_string = key_string.trim();
+
+    fn validate_length(v: Vec<u8>) -> eyre::Result<Vec<u8>> {
+        if v.len() == 64 || v.len() <= 32 {
+            Ok(v)
+        } else {
+            Err(eyre!(
+                "secret key length must be 32 (or 64 for keypair), was {}",
+                v.len()
+            ))
+        }
+    }
+
+    let bytes_from_base64 = base64
+        .decode(key_string)
+        .map_err(|err| eyre!("base64 decoding failed: {}", err))
+        .and_then(validate_length);
+
+    let bytes = match bytes_from_base64 {
+        Ok(bytes) => bytes,
+        Err(base64_err) => {
+            let bytes_from_base58 = bs58::decode(key_string)
+                .into_vec()
+                .map_err(|err| eyre!("base58 decoding failed: {}", err))
+                .and_then(validate_length);
+
+            match bytes_from_base58 {
+                Ok(bytes) => bytes,
+                Err(base58_err) => return Err(eyre!(
+                    "Tried to decode secret key as base64 and as base58 from string {}, but failed.\nbase64 decoding error:{}\nbase58 decoding error:{}",
+                    key_string, base64_err, base58_err
+                ))
+            }
+        }
+    };
+
+    // It seems that secp256k1 secret key length can be less than 32 byte
+    // so for everything longer than 32 we try decode keypair, and shorter – decode secret key
+    if bytes.len() > 32 {
+        decode_key_pair(bytes, key_format)
+    } else {
+        decode_secret_key(bytes, key_format)
+    }
+}
+
+/// read base64 secret key from file and generate key pair from it
+fn read_secret_key_from_file(key_path: &Path, key_format: String) -> eyre::Result<KeyPair> {
+    let key_string = fs::read_to_string(key_path).map_err(|e| {
+        eyre!(
+            "Error reading secret key from {}: {}",
+            key_path.display(),
+            e
+        )
+    })?;
+
+    decode_key(key_string, key_format).map_err(|err| {
+        eyre!(
+            "failed to decode key at path {}: {}",
+            key_path.display(),
+            err
+        )
+    })
+}
+
+pub fn decode_key_pair(key_pair: Vec<u8>, key_format: String) -> eyre::Result<KeyPair> {
+    KeyPair::from_vec(key_pair, KeyFormat::from_str(&key_format)?)
+        .map_err(|e| eyre!("Error decoding keypair of format {}: {:?}", key_format, e))
+}
+
+pub fn decode_secret_key(secret_key: Vec<u8>, key_format: String) -> eyre::Result<KeyPair> {
+    KeyPair::from_secret_key(secret_key, KeyFormat::from_str(&key_format)?).map_err(|e| {
+        eyre!(
+            "Error decoding secret key of format {}: {:?}",
+            key_format,
+            e
+        )
+    })
+}
+
+/// Read the file with a secret key if it exists, generate a new key pair and write it to file if not.
+pub fn load_key(
+    key_path: PathBuf,
+    key_format: String,
+    generate_on_absence: bool,
+) -> eyre::Result<KeyPair> {
+    if !key_path.exists() {
+        return if generate_on_absence {
+            log::info!("Generating a new key to {key_path:?}");
+            Ok(create_new_key_pair(
+                &key_path,
+                KeyFormat::from_str(&key_format)?,
+            )?)
+        } else {
+            Err(eyre!(
+                "Path to secret key does not exist {}",
+                key_path.display(),
+            ))
+        };
+    }
+
+    if !key_path.is_dir() {
+        read_secret_key_from_file(&key_path, key_format)
+    } else {
+        Err(Error::new(
+            ErrorKind::InvalidInput,
+            "Path to secret key is a directory.".to_string(),
+        )
+        .into())
+    }
+}
+
\ No newline at end of file diff --git a/src/server_config/lib.rs.html b/src/server_config/lib.rs.html new file mode 100644 index 0000000000..062ea70fed --- /dev/null +++ b/src/server_config/lib.rs.html @@ -0,0 +1,119 @@ +lib.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+#![feature(try_blocks)]
+#![feature(try_trait_v2)]
+#![recursion_limit = "512"]
+#![warn(rust_2018_idioms)]
+#![deny(
+    dead_code,
+    nonstandard_style,
+    unused_imports,
+    unused_mut,
+    unused_variables,
+    unused_unsafe,
+    unreachable_patterns
+)]
+
+pub mod args;
+mod avm_config;
+mod bootstrap_config;
+mod defaults;
+mod dir_config;
+mod kademlia_config;
+mod keys;
+mod network_config;
+mod node_config;
+mod resolved_config;
+mod services_config;
+pub mod system_services_config;
+mod wasm_backend_config;
+
+pub use defaults::*;
+pub use resolved_config::load_config;
+pub use resolved_config::load_config_with_args;
+pub use resolved_config::ConfigData;
+
+pub use bootstrap_config::BootstrapConfig;
+pub use kademlia_config::KademliaConfig;
+pub use network_config::NetworkConfig;
+pub use node_config::{ChainConfig, ChainListenerConfig, Network, NodeConfig, TransportConfig};
+pub use resolved_config::TracingConfig;
+pub use resolved_config::{ResolvedConfig, UnresolvedConfig};
+pub use system_services_config::{AquaIpfsConfig, DeciderConfig, SystemServicesConfig};
+
\ No newline at end of file diff --git a/src/server_config/network_config.rs.html b/src/server_config/network_config.rs.html new file mode 100644 index 0000000000..0d3f987298 --- /dev/null +++ b/src/server_config/network_config.rs.html @@ -0,0 +1,155 @@ +network_config.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use libp2p::{core::Multiaddr, identity::Keypair, PeerId};
+use libp2p_connection_limits::ConnectionLimits;
+use libp2p_metrics::Metrics;
+use std::sync::Arc;
+use std::time::Duration;
+
+use config_utils::to_peer_id;
+use particle_protocol::ProtocolConfig;
+use peer_metrics::{ConnectionPoolMetrics, ConnectivityMetrics};
+
+use crate::kademlia_config::KademliaConfig;
+use crate::{BootstrapConfig, ResolvedConfig};
+
+pub struct NetworkConfig {
+    pub key_pair: Keypair,
+    pub local_peer_id: PeerId,
+    pub node_version: &'static str,
+    pub bootstrap_nodes: Vec<Multiaddr>,
+    pub bootstrap: BootstrapConfig,
+    pub libp2p_metrics: Option<Arc<Metrics>>,
+    pub protocol_config: ProtocolConfig,
+    pub kademlia_config: KademliaConfig,
+    pub particle_queue_buffer: usize,
+    pub bootstrap_frequency: usize,
+    pub connectivity_metrics: Option<ConnectivityMetrics>,
+    pub connection_pool_metrics: Option<ConnectionPoolMetrics>,
+    pub connection_limits: ConnectionLimits,
+    pub connection_idle_timeout: Duration,
+}
+
+impl NetworkConfig {
+    pub fn new(
+        libp2p_metrics: Option<Arc<Metrics>>,
+        connectivity_metrics: Option<ConnectivityMetrics>,
+        connection_pool_metrics: Option<ConnectionPoolMetrics>,
+        key_pair: Keypair,
+        config: &ResolvedConfig,
+        node_version: &'static str,
+        connection_limits: ConnectionLimits,
+    ) -> Self {
+        Self {
+            node_version,
+            libp2p_metrics,
+            local_peer_id: to_peer_id(&key_pair),
+            key_pair,
+            bootstrap_nodes: config.bootstrap_nodes.clone(),
+            bootstrap: config.bootstrap_config.clone(),
+            protocol_config: config.protocol_config.clone(),
+            kademlia_config: config.kademlia.clone(),
+            particle_queue_buffer: config.particle_queue_buffer,
+            bootstrap_frequency: config.bootstrap_frequency,
+            connectivity_metrics,
+            connection_pool_metrics,
+            connection_limits,
+            connection_idle_timeout: config.node_config.transport_config.connection_idle_timeout,
+        }
+    }
+}
+
\ No newline at end of file diff --git a/src/server_config/node_config.rs.html b/src/server_config/node_config.rs.html new file mode 100644 index 0000000000..a5ece8f719 --- /dev/null +++ b/src/server_config/node_config.rs.html @@ -0,0 +1,1257 @@ +node_config.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use std::collections::{BTreeMap, HashMap};
+use std::net::IpAddr;
+use std::ops::Deref;
+use std::path::{Path, PathBuf};
+use std::time::Duration;
+
+use base64::{engine::general_purpose::STANDARD as base64, Engine};
+use cid_utils::Hash;
+use clarity::PrivateKey;
+use core_distributor::CoreRange;
+use derivative::Derivative;
+use eyre::eyre;
+use fluence_keypair::KeyPair;
+use libp2p::core::Multiaddr;
+use libp2p::swarm::InvalidProtocol;
+use libp2p::StreamProtocol;
+use serde::{Deserialize, Serialize};
+use serde_with::serde_as;
+use serde_with::DisplayFromStr;
+
+use fluence_libp2p::PeerId;
+use fluence_libp2p::Transport;
+use fs_utils::to_abs_path;
+use hex_utils::serde_as::Hex;
+use particle_protocol::ProtocolConfig;
+use types::peer_id;
+
+use crate::avm_config::AVMConfig;
+use crate::kademlia_config::{KademliaConfig, UnresolvedKademliaConfig};
+use crate::keys::{decode_key, decode_secret_key, load_key};
+use crate::services_config::ServicesConfig;
+use crate::system_services_config::SystemServicesConfig;
+use crate::BootstrapConfig;
+
+use super::defaults::*;
+
+#[serde_as]
+#[derive(Clone, Deserialize, Serialize, Derivative)]
+#[derivative(Debug)]
+pub struct UnresolvedNodeConfig {
+    #[serde(default = "default_cpus_range")]
+    pub cpus_range: Option<CoreRange>,
+
+    #[serde(default = "default_system_cpu_count")]
+    pub system_cpu_count: usize,
+
+    #[derivative(Debug = "ignore")]
+    pub root_key_pair: Option<KeypairConfig>,
+
+    #[derivative(Debug = "ignore")]
+    #[serde(default)]
+    pub builtins_key_pair: Option<KeypairConfig>,
+
+    #[serde(flatten)]
+    pub transport_config: TransportConfig,
+
+    #[serde(flatten)]
+    pub listen_config: ListenConfig,
+
+    #[serde(default)]
+    local: Option<bool>,
+    /// Bootstrap nodes to join to the Fluence network
+    #[serde(default = "default_bootstrap_nodes")]
+    pub bootstrap_nodes: Vec<Multiaddr>,
+
+    /// External address to advertise via identify protocol
+    pub external_address: Option<IpAddr>,
+
+    /// External multiaddresses to advertise; more flexible that IpAddr
+    #[serde(default)]
+    pub external_multiaddresses: Vec<Multiaddr>,
+
+    #[serde(flatten)]
+    pub metrics_config: MetricsConfig,
+
+    #[serde(flatten)]
+    pub health_config: HealthConfig,
+
+    #[serde(flatten)]
+    pub http_config: Option<HttpConfig>,
+
+    #[serde(default)]
+    pub bootstrap_config: BootstrapConfig,
+
+    #[serde(default)]
+    pub root_weights: HashMap<PeerIdSerializable, u32>,
+
+    #[serde(default)]
+    pub services_envs: HashMap<String, String>,
+
+    #[serde(default)]
+    pub protocol_config: ProtocolConfig,
+
+    /// These are the AquaVM limits that are used by the AquaVM limit check.
+    #[derivative(Debug = "ignore")]
+    pub avm_config: Option<AVMConfig>,
+
+    /// Number of AVMs to create. By default, `num_cpus::get() * 2` is used
+    #[serde(default = "default_aquavm_pool_size")]
+    pub aquavm_pool_size: usize,
+
+    /// Default heap size in bytes available for a WASM service unless otherwise specified.
+    #[serde_as(as = "Option<DisplayFromStr>")]
+    #[serde(default)]
+    pub default_service_memory_limit: Option<bytesize::ByteSize>,
+
+    #[serde(default)]
+    pub kademlia: UnresolvedKademliaConfig,
+
+    #[serde(default = "default_particle_queue_buffer_size")]
+    pub particle_queue_buffer: usize,
+
+    #[serde(default = "default_effects_queue_buffer_size")]
+    pub effects_queue_buffer: usize,
+
+    #[serde(default = "default_workers_queue_buffer_size")]
+    pub workers_queue_buffer: usize,
+
+    #[serde(default = "default_particle_processor_parallelism")]
+    pub particle_processor_parallelism: Option<usize>,
+
+    #[serde(default = "default_max_spell_particle_ttl")]
+    #[serde(with = "humantime_serde")]
+    pub max_spell_particle_ttl: Duration,
+
+    #[serde(default = "default_bootstrap_frequency")]
+    pub bootstrap_frequency: usize,
+
+    #[serde(default)]
+    pub allow_local_addresses: bool,
+
+    #[serde(default = "default_execution_timeout")]
+    #[serde(with = "humantime_serde")]
+    pub particle_execution_timeout: Duration,
+
+    #[serde(
+        serialize_with = "peer_id::serde::serialize",
+        deserialize_with = "peer_id::serde::deserialize"
+    )]
+    #[serde(default = "default_management_peer_id")]
+    pub management_peer_id: PeerId,
+
+    // TODO: leave for now to migrate
+    #[serde(default = "default_allowed_binaries")]
+    pub allowed_binaries: Vec<String>,
+
+    #[serde(default = "default_effectors_config")]
+    pub effectors: EffectorsConfig,
+
+    #[serde(default)]
+    pub system_services: SystemServicesConfig,
+
+    pub chain_config: Option<ChainConfig>,
+
+    pub chain_listener_config: Option<ChainListenerConfig>,
+
+    #[serde(default = "default_dev_mode_config")]
+    pub dev_mode: DevModeConfig,
+
+    #[serde(default)]
+    pub services: ServicesConfig,
+
+    #[serde(default)]
+    pub network: Network,
+
+    pub vm: Option<VmConfig>,
+}
+
+#[serde_as]
+#[derive(Clone, Deserialize, Serialize, Debug, Default, PartialEq)]
+#[serde(rename_all = "lowercase")]
+pub enum Network {
+    #[default]
+    Dar,
+    Stage,
+    Kras,
+    Custom(#[serde_as(as = "Hex")] [u8; 32]),
+}
+
+impl TryFrom<&Network> for StreamProtocol {
+    type Error = InvalidProtocol;
+
+    fn try_from(value: &Network) -> Result<Self, Self::Error> {
+        let id = match value {
+            Network::Dar => "dar".to_string(),
+            Network::Stage => "stage".to_string(),
+            Network::Kras => "kras".to_string(),
+            Network::Custom(bytes) => hex::encode(bytes).to_lowercase(),
+        };
+
+        let kad_protocol_name = format!("/fluence/kad/{}/1.0.0", id);
+        StreamProtocol::try_from_owned(kad_protocol_name.clone())
+    }
+}
+
+impl UnresolvedNodeConfig {
+    pub fn resolve(self, persistent_base_dir: &Path) -> eyre::Result<NodeConfig> {
+        let bootstrap_nodes = match self.local {
+            Some(true) => vec![],
+            _ => self.bootstrap_nodes,
+        };
+
+        let root_key_pair = self
+            .root_key_pair
+            .unwrap_or_default()
+            .get_keypair(default_keypair_path(persistent_base_dir))?;
+
+        let builtins_key_pair = self
+            .builtins_key_pair
+            .unwrap_or_default()
+            .get_keypair(default_builtins_keypair_path(persistent_base_dir))?;
+
+        let allowed_effectors = self
+            .effectors
+            .0
+            .into_values()
+            .map(|effector_config| {
+                let wasm_cid = effector_config.wasm_cid;
+                let allowed_binaries = effector_config.allowed_binaries;
+                (wasm_cid, allowed_binaries)
+            })
+            .collect::<_>();
+
+        let cpus_range = self.cpus_range.unwrap_or_default();
+
+        let kademlia = self.kademlia.resolve(&self.network)?;
+
+        let result = NodeConfig {
+            system_cpu_count: self.system_cpu_count,
+            cpus_range,
+            bootstrap_nodes,
+            root_key_pair,
+            builtins_key_pair,
+            external_address: self.external_address,
+            external_multiaddresses: self.external_multiaddresses,
+            metrics_config: self.metrics_config,
+            health_config: self.health_config,
+            bootstrap_config: self.bootstrap_config,
+            root_weights: self.root_weights,
+            services_envs: self.services_envs,
+            protocol_config: self.protocol_config,
+            aquavm_pool_size: self.aquavm_pool_size,
+            default_service_memory_limit: self.default_service_memory_limit,
+            avm_config: self.avm_config.unwrap_or_default(),
+            kademlia,
+            particle_queue_buffer: self.particle_queue_buffer,
+            effects_queue_buffer: self.effects_queue_buffer,
+            workers_queue_buffer: self.workers_queue_buffer,
+            particle_processor_parallelism: self.particle_processor_parallelism,
+            max_spell_particle_ttl: self.max_spell_particle_ttl,
+            bootstrap_frequency: self.bootstrap_frequency,
+            allow_local_addresses: self.allow_local_addresses,
+            particle_execution_timeout: self.particle_execution_timeout,
+            management_peer_id: self.management_peer_id,
+            transport_config: self.transport_config,
+            listen_config: self.listen_config,
+            allowed_effectors,
+            dev_mode_config: self.dev_mode,
+            system_services: self.system_services,
+            http_config: self.http_config,
+            chain_config: self.chain_config,
+            chain_listener_config: self.chain_listener_config,
+            services: self.services,
+            network: self.network,
+            vm: self.vm,
+        };
+
+        Ok(result)
+    }
+}
+
+#[derive(Clone, Derivative, Serialize)]
+#[derivative(Debug)]
+pub struct NodeConfig {
+    pub cpus_range: CoreRange,
+
+    pub system_cpu_count: usize,
+
+    #[derivative(Debug = "ignore")]
+    #[serde(skip)]
+    pub root_key_pair: KeyPair,
+
+    #[derivative(Debug = "ignore")]
+    #[serde(skip)]
+    pub builtins_key_pair: KeyPair,
+
+    pub transport_config: TransportConfig,
+
+    pub listen_config: ListenConfig,
+
+    /// Bootstrap nodes to join to the Fluence network
+    pub bootstrap_nodes: Vec<Multiaddr>,
+
+    /// External address to advertise via identify protocol
+    pub external_address: Option<IpAddr>,
+
+    /// External multiaddresses to advertise; more flexible that IpAddr
+    pub external_multiaddresses: Vec<Multiaddr>,
+
+    pub metrics_config: MetricsConfig,
+
+    pub health_config: HealthConfig,
+
+    pub bootstrap_config: BootstrapConfig,
+
+    pub root_weights: HashMap<PeerIdSerializable, u32>,
+
+    pub services_envs: HashMap<String, String>,
+
+    pub protocol_config: ProtocolConfig,
+
+    /// Number of AVMs to create. By default, `num_cpus::get() * 2` is used
+    pub aquavm_pool_size: usize,
+
+    /// Default heap size in bytes available for a WASM service unless otherwise specified.
+    pub default_service_memory_limit: Option<bytesize::ByteSize>,
+
+    /// These are the AquaVM limits that are used by the AquaVM limit check.
+    pub avm_config: AVMConfig,
+
+    pub kademlia: KademliaConfig,
+
+    pub particle_queue_buffer: usize,
+
+    pub effects_queue_buffer: usize,
+
+    pub workers_queue_buffer: usize,
+
+    pub particle_processor_parallelism: Option<usize>,
+
+    pub max_spell_particle_ttl: Duration,
+
+    pub bootstrap_frequency: usize,
+
+    pub allow_local_addresses: bool,
+
+    pub particle_execution_timeout: Duration,
+
+    #[serde(serialize_with = "peer_id::serde::serialize")]
+    pub management_peer_id: PeerId,
+
+    pub allowed_effectors: HashMap<Hash, HashMap<String, PathBuf>>,
+
+    pub dev_mode_config: DevModeConfig,
+
+    pub system_services: SystemServicesConfig,
+
+    pub http_config: Option<HttpConfig>,
+
+    pub chain_config: Option<ChainConfig>,
+
+    pub chain_listener_config: Option<ChainListenerConfig>,
+
+    pub services: ServicesConfig,
+
+    pub network: Network,
+
+    pub vm: Option<VmConfig>,
+}
+
+#[derive(Clone, Deserialize, Serialize, Derivative, Copy)]
+#[derivative(Debug)]
+pub struct TransportConfig {
+    #[serde(default = "default_transport")]
+    pub transport: Transport,
+
+    /// Socket timeout for main transport
+    #[serde(default = "default_socket_timeout")]
+    #[serde(with = "humantime_serde")]
+    pub socket_timeout: Duration,
+
+    pub max_pending_incoming: Option<u32>,
+
+    pub max_pending_outgoing: Option<u32>,
+
+    pub max_established_incoming: Option<u32>,
+
+    pub max_established_outgoing: Option<u32>,
+
+    #[serde(default = "default_max_established_per_peer_limit")]
+    pub max_established_per_peer: Option<u32>,
+
+    pub max_established: Option<u32>,
+
+    #[serde(with = "humantime_serde")]
+    #[serde(default = "default_connection_idle_timeout")]
+    pub connection_idle_timeout: Duration,
+}
+
+#[derive(Clone, Deserialize, Serialize, Derivative, Copy)]
+#[derivative(Debug)]
+pub struct HttpConfig {
+    #[serde(default = "default_http_port")]
+    pub http_port: u16,
+}
+
+#[derive(Clone, Deserialize, Serialize, Derivative)]
+#[derivative(Debug)]
+pub struct MetricsConfig {
+    #[serde(default = "default_metrics_enabled")]
+    pub metrics_enabled: bool,
+
+    #[serde(default = "default_services_metrics_timer_resolution")]
+    #[serde(with = "humantime_serde")]
+    pub metrics_timer_resolution: Duration,
+
+    #[serde(default = "default_max_builtin_metrics_storage_size")]
+    pub max_builtin_metrics_storage_size: usize,
+
+    #[serde(default = "default_tokio_metrics_enabled")]
+    pub tokio_metrics_enabled: bool,
+
+    #[serde(default = "default_tokio_metrics_poll_histogram_enabled")]
+    pub tokio_metrics_poll_histogram_enabled: bool,
+}
+
+#[derive(Clone, Deserialize, Serialize, Derivative)]
+#[derivative(Debug)]
+pub struct HealthConfig {
+    #[serde(default = "default_health_check_enabled")]
+    pub health_check_enabled: bool,
+}
+
+#[derive(Clone, Deserialize, Serialize, Derivative)]
+#[derivative(Debug)]
+pub struct ListenConfig {
+    /// For TCP connections
+    #[serde(default = "default_tcp_port")]
+    pub tcp_port: u16,
+
+    /// Local ip address to listen on
+    #[serde(default = "default_listen_ip")]
+    pub listen_ip: IpAddr,
+
+    /// For ws connections
+    #[serde(default = "default_websocket_port")]
+    pub websocket_port: u16,
+}
+
+#[derive(Clone, Deserialize, Serialize, Debug, Copy, Eq, Hash, Ord, PartialEq, PartialOrd)]
+#[repr(transparent)]
+pub struct PeerIdSerializable(
+    #[serde(
+        serialize_with = "peer_id::serde::serialize",
+        deserialize_with = "peer_id::serde::deserialize"
+    )]
+    PeerId,
+);
+
+impl Deref for PeerIdSerializable {
+    type Target = PeerId;
+
+    fn deref(&self) -> &Self::Target {
+        &self.0
+    }
+}
+
+#[derive(Deserialize, Serialize, Debug, Clone)]
+#[serde(untagged)]
+pub enum PathOrValue {
+    Value { value: String },
+    Path { path: PathBuf },
+}
+
+#[derive(Deserialize, Serialize, Debug, Clone)]
+pub struct KeypairConfig {
+    #[serde(default = "default_key_format")]
+    pub format: String,
+    #[serde(flatten)]
+    #[serde(default)]
+    pub keypair: Option<PathOrValue>,
+    #[serde(default)]
+    pub secret_key: Option<String>,
+    #[serde(default)]
+    pub generate_on_absence: bool,
+}
+
+impl Default for KeypairConfig {
+    fn default() -> Self {
+        Self {
+            format: default_key_format(),
+            keypair: None,
+            secret_key: None,
+            generate_on_absence: true,
+        }
+    }
+}
+
+impl KeypairConfig {
+    pub fn get_keypair(self, default: PathOrValue) -> Result<KeyPair, eyre::Report> {
+        use crate::node_config::PathOrValue::{Path, Value};
+
+        debug_assert!(
+            !(self.secret_key.is_some() && self.keypair.is_some()),
+            "shouldn't have both secret_key and keypair defined in KeypairConfig"
+        );
+
+        // first, try to load secret key
+        if let Some(secret_key) = self.secret_key {
+            let secret_key = base64
+                .decode(secret_key)
+                .map_err(|err| eyre!("base64 decoding failed: {}", err))?;
+            return decode_secret_key(secret_key.clone(), self.format.clone())
+                .map_err(|e| eyre!("Failed to decode secret key from {:?}: {}", secret_key, e));
+        }
+
+        // if there's no secret key, try to load keypair
+        match self.keypair.unwrap_or(default) {
+            Path { path } => {
+                let path = to_abs_path(path);
+                load_key(path.clone(), self.format.clone(), self.generate_on_absence)
+                    .map_err(|e| eyre!("Failed to load secret key from {:?}: {}", path, e))
+            }
+            Value { value } => decode_key(value, self.format),
+        }
+    }
+}
+
+#[derive(Clone, Deserialize, Serialize, Derivative)]
+#[derivative(Debug)]
+pub struct ChainConfig {
+    pub http_endpoint: String,
+    pub diamond_contract_address: String,
+    pub network_id: u64,
+    pub wallet_key: PrivateKey,
+    /// If none, comes from the chain
+    pub default_base_fee: Option<u64>,
+    /// If none, comes from the chain
+    pub default_priority_fee: Option<u64>,
+}
+
+#[derive(Clone, Deserialize, Serialize, Derivative)]
+#[derivative(Debug)]
+pub struct ChainListenerConfig {
+    pub ws_endpoint: String,
+    pub ccp_endpoint: Option<String>,
+    /// How often to poll proofs
+    #[serde(default = "default_proof_poll_period")]
+    #[serde(with = "humantime_serde")]
+    pub proof_poll_period: Duration, // TODO: must be >0
+    /// Min number of proofs in a batch for CU to be sent on chain
+    #[serde(default = "default_min_batch_count")]
+    pub min_batch_count: usize,
+    /// Max number of proofs in a batch for CU to be sent on chain
+    #[serde(default = "default_max_batch_count")]
+    pub max_batch_count: usize,
+    /// Max number of proofs batches to be sent on chain
+    #[serde(default = "default_max_proof_batch_size")]
+    pub max_proof_batch_size: usize,
+    /// Defined how much time before epoch end to send all found proofs in any batches
+    #[serde(default = "default_epoch_end_window")]
+    #[serde(with = "humantime_serde")]
+    pub epoch_end_window: Duration,
+}
+
+/// Name of the effector module
+/// Current is used only for users and is ignored by Nox
+type EffectorModuleName = String;
+
+#[derive(Clone, Deserialize, Serialize, Derivative)]
+#[derivative(Debug)]
+pub struct EffectorsConfig(HashMap<EffectorModuleName, EffectorConfig>);
+
+#[derive(Clone, Deserialize, Serialize, Derivative)]
+#[derivative(Debug)]
+pub struct EffectorConfig {
+    #[derivative(Debug(format_with = "std::fmt::Display::fmt"))]
+    wasm_cid: Hash,
+    allowed_binaries: HashMap<String, PathBuf>,
+}
+
+fn default_effectors_config() -> EffectorsConfig {
+    let config = default_effectors()
+        .into_iter()
+        .map(|(module_name, config)| {
+            (
+                module_name,
+                EffectorConfig {
+                    wasm_cid: Hash::from_string(&config.0).unwrap(),
+                    allowed_binaries: config.1,
+                },
+            )
+        })
+        .collect::<_>();
+    EffectorsConfig(config)
+}
+
+#[derive(Clone, Deserialize, Serialize, Derivative)]
+#[derivative(Debug)]
+pub struct DevModeConfig {
+    #[serde(default)]
+    pub enable: bool,
+    /// Mounted binaries mapping: binary name (used in the effector modules) to binary path
+    #[serde(default = "default_binaries_mapping")]
+    pub binaries: BTreeMap<String, PathBuf>,
+}
+
+#[derive(Clone, Deserialize, Serialize, Debug, PartialEq, Eq)]
+pub struct VmConfig {
+    pub libvirt_uri: String,
+    pub bridge_name: String,
+}
+
+fn default_dev_mode_config() -> DevModeConfig {
+    DevModeConfig {
+        enable: false,
+        binaries: default_binaries_mapping(),
+    }
+}
+
\ No newline at end of file diff --git a/src/server_config/resolved_config.rs.html b/src/server_config/resolved_config.rs.html new file mode 100644 index 0000000000..6e80877f87 --- /dev/null +++ b/src/server_config/resolved_config.rs.html @@ -0,0 +1,1761 @@ +resolved_config.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+762
+763
+764
+765
+766
+767
+768
+769
+770
+771
+772
+773
+774
+775
+776
+777
+778
+779
+780
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+794
+795
+796
+797
+798
+799
+800
+801
+802
+803
+804
+805
+806
+807
+808
+809
+810
+811
+812
+813
+814
+815
+816
+817
+818
+819
+820
+821
+822
+823
+824
+825
+826
+827
+828
+829
+830
+831
+832
+833
+834
+835
+836
+837
+838
+839
+840
+841
+842
+843
+844
+845
+846
+847
+848
+849
+850
+851
+852
+853
+854
+855
+856
+857
+858
+859
+860
+861
+862
+863
+864
+865
+866
+867
+868
+869
+870
+871
+872
+873
+874
+875
+876
+877
+878
+879
+880
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use std::ffi::OsString;
+use std::net::SocketAddr;
+use std::ops::{Deref, DerefMut};
+use std::path::PathBuf;
+
+use clap::{Args, Command, FromArgMatches};
+use config::{Config, Environment, File, FileFormat, FileSourceFile};
+use libp2p::core::{multiaddr::Protocol, Multiaddr};
+use serde::{Deserialize, Serialize};
+use url::Url;
+
+use crate::args;
+use crate::args::DerivedArgs;
+use crate::dir_config::{ResolvedDirConfig, UnresolvedDirConfig};
+use crate::node_config::{NodeConfig, UnresolvedNodeConfig};
+
+#[derive(Clone, Serialize, Deserialize, Debug)]
+pub struct UnresolvedConfig {
+    #[serde(flatten)]
+    dir_config: UnresolvedDirConfig,
+
+    #[serde(flatten)]
+    pub node_config: UnresolvedNodeConfig,
+
+    pub tracing: Option<TracingConfig>,
+
+    pub no_banner: Option<bool>,
+
+    pub print_config: Option<bool>,
+}
+
+impl UnresolvedConfig {
+    pub fn resolve(self) -> eyre::Result<ResolvedConfig> {
+        let dir_config = self.dir_config.resolve()?;
+        let node_config = self.node_config.resolve(&dir_config.persistent_base_dir)?;
+
+        Ok(ResolvedConfig {
+            dir_config,
+            node_config,
+        })
+    }
+}
+
+#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
+#[serde(tag = "type")]
+pub enum TracingConfig {
+    #[serde(rename = "disabled")]
+    Disabled,
+    #[serde(rename = "stdout")]
+    Stdout,
+    #[serde(rename = "otlp")]
+    Otlp {
+        endpoint: Url,
+        sample_ratio: Option<f64>,
+    },
+}
+
+#[derive(Clone, Debug, Serialize)]
+pub struct ResolvedConfig {
+    pub dir_config: ResolvedDirConfig,
+    pub node_config: NodeConfig,
+}
+
+impl Deref for ResolvedConfig {
+    type Target = NodeConfig;
+
+    fn deref(&self) -> &Self::Target {
+        &self.node_config
+    }
+}
+
+impl DerefMut for ResolvedConfig {
+    fn deref_mut(&mut self) -> &mut Self::Target {
+        &mut self.node_config
+    }
+}
+
+impl ResolvedConfig {
+    pub fn external_addresses(&self) -> Vec<Multiaddr> {
+        let mut addrs = if let Some(external_address) = self.external_address {
+            let external_tcp = {
+                let mut maddr = Multiaddr::from(external_address);
+                maddr.push(Protocol::Tcp(self.listen_config.tcp_port));
+                maddr
+            };
+
+            let external_ws = {
+                let mut maddr = Multiaddr::from(external_address);
+                maddr.push(Protocol::Tcp(self.listen_config.websocket_port));
+                maddr.push(Protocol::Ws("/".into()));
+                maddr
+            };
+
+            vec![external_tcp, external_ws]
+        } else {
+            vec![]
+        };
+
+        addrs.extend(self.external_multiaddresses.iter().cloned());
+
+        addrs
+    }
+
+    pub fn http_listen_addr(&self) -> Option<SocketAddr> {
+        self.http_config
+            .map(|config| SocketAddr::new(self.listen_config.listen_ip, config.http_port))
+    }
+
+    pub fn listen_multiaddrs(&self) -> Vec<Multiaddr> {
+        let config = &self.listen_config;
+
+        let mut tcp = Multiaddr::from(config.listen_ip);
+        tcp.push(Protocol::Tcp(config.tcp_port));
+
+        let mut ws = Multiaddr::from(config.listen_ip);
+        ws.push(Protocol::Tcp(config.websocket_port));
+        ws.push(Protocol::Ws("/".into()));
+
+        vec![tcp, ws]
+    }
+}
+
+pub struct ConfigData {
+    pub binary_name: String,
+    pub version: String,
+    pub authors: String,
+    pub description: String,
+}
+
+/// Hierarchically loads the configuration using args and envs.
+/// The source order is:
+///  - Load and parse Config.toml from cwd, if exists
+///  - Load and parse files provided by FLUENCE_CONFIG env var
+///  - Load and parse files provided by --config arg
+///  - Load config values from env vars
+///  - Load config values from args (throw error on conflicts with env vars)
+/// On each stage the values override the previous ones.
+///
+/// # Arguments
+///
+/// - `data`: Optional `ConfigData` to customize the configuration.
+///
+/// # Returns
+///
+/// Returns a Result containing the unresolved configuration or an Eyre error.
+///
+pub fn load_config(data: Option<ConfigData>) -> eyre::Result<UnresolvedConfig> {
+    let raw_args = std::env::args_os().collect::<Vec<_>>();
+    load_config_with_args(raw_args, data)
+}
+
+pub fn load_config_with_args(
+    raw_args: Vec<OsString>,
+    data: Option<ConfigData>,
+) -> eyre::Result<UnresolvedConfig> {
+    let arg_source = process_args(raw_args, data)?;
+
+    let arg_config_sources: Vec<File<FileSourceFile, FileFormat>> = arg_source
+        .configs
+        .iter()
+        .flat_map(|paths| {
+            paths
+                .iter()
+                .map(|path| File::from(path.clone()).format(FileFormat::Toml))
+                .collect::<Vec<File<FileSourceFile, FileFormat>>>()
+        })
+        .collect();
+
+    let env_source = Environment::with_prefix("FLUENCE")
+        .try_parsing(true)
+        .prefix_separator("_")
+        .separator("__")
+        .list_separator(",")
+        .with_list_parse_key("allowed_binaries")
+        .with_list_parse_key("external_multiaddresses")
+        .with_list_parse_key("bootstrap_nodes")
+        .with_list_parse_key("listen_config.listen_multiaddrs")
+        .with_list_parse_key("system_services.enable");
+
+    let env_config_sources: Vec<File<FileSourceFile, FileFormat>> =
+        std::env::var_os("FLUENCE_CONFIG")
+            .and_then(|str| str.into_string().ok())
+            .map(|str| {
+                str.trim()
+                    .split(',')
+                    .map(PathBuf::from)
+                    .map(|path| File::from(path.clone()).format(FileFormat::Toml))
+                    .collect()
+            })
+            .unwrap_or_default();
+
+    let mut config_builder = Config::builder().add_source(
+        File::with_name("Config.toml")
+            .required(false)
+            .format(FileFormat::Toml),
+    );
+
+    for source in env_config_sources {
+        config_builder = config_builder.add_source(source)
+    }
+
+    for source in arg_config_sources {
+        config_builder = config_builder.add_source(source)
+    }
+    config_builder = config_builder.add_source(env_source).add_source(arg_source);
+    let config = config_builder.build()?;
+
+    let config: UnresolvedConfig = config.try_deserialize()?;
+
+    Ok(config)
+}
+
+fn process_args(raw_args: Vec<OsString>, data: Option<ConfigData>) -> eyre::Result<DerivedArgs> {
+    let command = Command::new("Fluence peer");
+    let command = if let Some(data) = data {
+        command
+            .version(&data.version)
+            .author(&data.authors)
+            .about(data.description)
+            .override_usage(format!("{} [FLAGS] [OPTIONS]", data.binary_name))
+    } else {
+        command
+    };
+
+    let raw_cli_config = args::DerivedArgs::augment_args(command);
+    let matches = raw_cli_config.get_matches_from(raw_args);
+    let arg_source = args::DerivedArgs::from_arg_matches(&matches)?;
+    Ok(arg_source)
+}
+
+#[cfg(test)]
+mod tests {
+    use std::io::Write;
+    use std::time::Duration;
+
+    use base64::{engine::general_purpose::STANDARD as base64, Engine};
+    use fluence_keypair::KeyPair;
+    use tempfile::{tempdir, NamedTempFile};
+
+    use super::*;
+    use crate::node_config::VmConfig;
+    use crate::Network;
+
+    #[test]
+    fn load_allowed_binaries_with_env() {
+        temp_env::with_var(
+            "FLUENCE_ALLOWED_BINARIES",
+            Some("/bin/sh,/bin/bash"),
+            || {
+                let config = load_config_with_args(vec![], None).expect("Could not load config");
+                assert_eq!(
+                    config.node_config.allowed_binaries,
+                    vec!("/bin/sh".to_string(), "/bin/bash".to_string())
+                );
+            },
+        )
+    }
+
+    #[test]
+    fn load_config_simple() {
+        let mut file = NamedTempFile::new().expect("Could not create temp file");
+        write!(
+            file,
+            r#"
+            root_key_pair.format = "ed25519"
+            root_key_pair.secret_key = "/XKBs1ydmfWGiTbh+e49GYw+14LHtu+v5BMFDIzHpvo="
+            builtins_key_pair.format = "ed25519"
+            builtins_key_pair.value = "Ek6l5zgX9P74MHRiRzK/FN6ftQIOD3prYdMh87nRXlEEuRX1QrdQI87MBRdphoc0url0cY5ZO58evCoGXty1zw=="
+
+            [root_weights]
+            12D3KooWB9P1xmV3c7ZPpBemovbwCiRRTKd3Kq2jsVPQN4ZukDfy = 1
+
+        "#).expect("Could not write in file");
+
+        let path = file.path().display().to_string();
+        temp_env::with_var("FLUENCE_CONFIG", Some(path), || {
+            let config = load_config_with_args(vec![], None).expect("Could not load config");
+            let config = config.resolve().unwrap();
+            let resolved_secret = encode_secret(&config);
+            assert!(!config.node_config.allow_local_addresses);
+            assert_eq!(
+                resolved_secret,
+                "/XKBs1ydmfWGiTbh+e49GYw+14LHtu+v5BMFDIzHpvo="
+            );
+        });
+    }
+
+    fn encode_secret(config: &ResolvedConfig) -> String {
+        match config.root_key_pair.clone() {
+            KeyPair::Ed25519(x) => base64.encode(x.secret().0),
+            KeyPair::Rsa(_) => "".to_string(),
+            KeyPair::Secp256k1(_) => "".to_string(),
+        }
+    }
+
+    #[test]
+    fn load_path_keypair_generate() {
+        let dir = tempdir().expect("Could not create temp dir");
+        let mut file = NamedTempFile::new_in(dir.path()).expect("Could not create temp file");
+
+        let key_path = dir.path().join("secret_key.ed25519");
+        let builtins_key_path = dir.path().join("builtins_secret_key.ed25519");
+        write!(
+            file,
+            r#"
+            root_key_pair.format = "ed25519"
+            root_key_pair.path = "{}"
+            root_key_pair.generate_on_absence = true
+            builtins_key_pair.format = "ed25519"
+            builtins_key_pair.path = "{}"
+            builtins_key_pair.generate_on_absence = true
+            "#,
+            key_path.to_string_lossy(),
+            builtins_key_path.to_string_lossy(),
+        )
+        .expect("Could not write in file");
+
+        assert!(!key_path.exists());
+        assert!(!builtins_key_path.exists());
+
+        let path = file.path().display().to_string();
+        temp_env::with_var("FLUENCE_CONFIG", Some(path), || {
+            let config = load_config_with_args(vec![], None).expect("Could not load config");
+            let config = config.resolve().unwrap();
+            let resolved_secret = encode_secret(&config);
+
+            assert!(key_path.exists());
+            assert!(builtins_key_path.exists());
+            assert!(!resolved_secret.is_empty());
+        });
+    }
+
+    #[test]
+    fn load_empty_keypair() {
+        let dir = tempdir().expect("Could not create temp dir");
+        let mut file = NamedTempFile::new_in(dir.path()).expect("Could not create temp file");
+
+        write!(
+            file,
+            r#"
+            root_key_pair.generate_on_absence = true
+            builtins_key_pair.generate_on_absence = true
+            "#
+        )
+        .expect("Could not write in file");
+
+        let path = file.path().display().to_string();
+        temp_env::with_var("FLUENCE_CONFIG", Some(path), || {
+            let _config = load_config_with_args(vec![], None).expect("Could not load config");
+        })
+    }
+
+    #[test]
+    fn load_empty_config() {
+        let _config = load_config_with_args(vec![], None).expect("Could not load config");
+    }
+
+    #[test]
+    fn load_base58_keypair() {
+        let dir = tempdir().expect("Could not create temp dir");
+        let mut file = NamedTempFile::new_in(dir.path()).expect("Could not create temp file");
+
+        let root_key_path = dir.path().join("secret_key.ed25519");
+        let builtins_key_path = dir.path().join("builtins_secret_key.ed25519");
+
+        write!(
+            file,
+            r#"
+            root_key_pair.format = "ed25519"
+            root_key_pair.path = "{}"
+            root_key_pair.generate_on_absence = false
+            builtins_key_pair.format = "ed25519"
+            builtins_key_pair.path = "{}"
+            builtins_key_pair.generate_on_absence = false
+            "#,
+            root_key_path.to_string_lossy(),
+            builtins_key_path.to_string_lossy()
+        )
+        .expect("Could not write in file");
+        let path = file.path().display().to_string();
+
+        temp_env::with_var("FLUENCE_CONFIG", Some(path), || {
+            let root_kp = KeyPair::generate_ed25519();
+            let builtins_kp = KeyPair::generate_secp256k1();
+            std::fs::write(&root_key_path, bs58::encode(root_kp.to_vec()).into_vec()).unwrap();
+            std::fs::write(
+                &builtins_key_path,
+                bs58::encode(builtins_kp.to_vec()).into_vec(),
+            )
+            .unwrap();
+            assert!(root_key_path.exists());
+            assert!(builtins_key_path.exists());
+
+            let config = load_config_with_args(vec![], None).expect("Could not load config");
+            let config = config.resolve().unwrap();
+
+            let resolved_secret = encode_secret(&config);
+            assert_eq!(resolved_secret, base64.encode(root_kp.secret().unwrap()));
+        });
+    }
+
+    #[test]
+    fn load_base64_keypair() {
+        let dir = tempdir().expect("Could not create temp dir");
+        let mut file = NamedTempFile::new_in(dir.path()).expect("Could not create temp file");
+
+        let root_key_path = dir.path().join("secret_key.ed25519");
+        let builtins_key_path = dir.path().join("builtins_secret_key.ed25519");
+
+        write!(
+            file,
+            r#"
+            root_key_pair.format = "ed25519"
+            root_key_pair.path = "{}"
+            root_key_pair.generate_on_absence = false
+            builtins_key_pair.format = "ed25519"
+            builtins_key_pair.path = "{}"
+            builtins_key_pair.generate_on_absence = false
+            "#,
+            root_key_path.to_string_lossy(),
+            builtins_key_path.to_string_lossy(),
+        )
+        .expect("Could not write in file");
+
+        let path = file.path().display().to_string();
+
+        temp_env::with_var("FLUENCE_CONFIG", Some(path), || {
+            let root_kp = KeyPair::generate_ed25519();
+            let builtins_kp = KeyPair::generate_secp256k1();
+            std::fs::write(&root_key_path, base64.encode(root_kp.to_vec())).unwrap();
+            std::fs::write(&builtins_key_path, base64.encode(builtins_kp.to_vec())).unwrap();
+            assert!(root_key_path.exists());
+            assert!(builtins_key_path.exists());
+
+            let _config = load_config_with_args(vec![], None).expect("Could not load config");
+        });
+    }
+
+    #[test]
+    fn load_base64_secret_key() {
+        let dir = tempdir().expect("Could not create temp dir");
+        let mut file = NamedTempFile::new_in(dir.path()).expect("Could not create temp file");
+
+        let root_key_path = dir.path().join("secret_key.ed25519");
+        let builtins_key_path = dir.path().join("builtins_secret_key.ed25519");
+
+        write!(
+            file,
+            r#"
+             root_key_pair.format = "ed25519"
+            root_key_pair.path = "{}"
+            root_key_pair.generate_on_absence = false
+            builtins_key_pair.format = "ed25519"
+            builtins_key_pair.path = "{}"
+            builtins_key_pair.generate_on_absence = false
+            "#,
+            root_key_path.to_string_lossy(),
+            builtins_key_path.to_string_lossy(),
+        )
+        .expect("Could not write in file");
+        let root_kp = KeyPair::generate_ed25519();
+        let path = file.path().display().to_string();
+
+        temp_env::with_var("FLUENCE_CONFIG", Some(path), || {
+            let builtins_kp = KeyPair::generate_secp256k1();
+            std::fs::write(&root_key_path, base64.encode(root_kp.secret().unwrap())).unwrap();
+            std::fs::write(
+                &builtins_key_path,
+                base64.encode(builtins_kp.secret().unwrap()),
+            )
+            .unwrap();
+            assert!(root_key_path.exists());
+            assert!(builtins_key_path.exists());
+
+            let _config = load_config_with_args(vec![], None).expect("Could not load config");
+        });
+    }
+
+    #[test]
+    fn load_base58_secret_key() {
+        let dir = tempdir().expect("Could not create temp dir");
+        let mut file = NamedTempFile::new_in(dir.path()).expect("Could not create temp file");
+
+        let root_key_path = dir.path().join("secret_key.ed25519");
+        let builtins_key_path = dir.path().join("builtins_secret_key.ed25519");
+
+        write!(
+            file,
+            r#"
+            root_key_pair.format = "ed25519"
+            root_key_pair.path = "{}"
+            root_key_pair.generate_on_absence = false
+            builtins_key_pair.format = "ed25519"
+            builtins_key_pair.path = "{}"
+            builtins_key_pair.generate_on_absence = false
+            "#,
+            root_key_path.to_string_lossy(),
+            builtins_key_path.to_string_lossy(),
+        )
+        .expect("Could not write in file");
+
+        let path = file.path().display().to_string();
+
+        temp_env::with_var("FLUENCE_CONFIG", Some(path), || {
+            let root_kp = KeyPair::generate_ed25519();
+            let builtins_kp = KeyPair::generate_secp256k1();
+            std::fs::write(
+                &root_key_path,
+                bs58::encode(root_kp.secret().unwrap().to_vec()).into_vec(),
+            )
+            .unwrap();
+            std::fs::write(
+                &builtins_key_path,
+                bs58::encode(builtins_kp.secret().unwrap().to_vec()).into_vec(),
+            )
+            .unwrap();
+            assert!(root_key_path.exists());
+            assert!(builtins_key_path.exists());
+
+            let _config = load_config_with_args(vec![], None).expect("Could not load config");
+        });
+    }
+
+    #[test]
+    fn load_allowed_binaries_with_file() {
+        let mut file = NamedTempFile::new().expect("Could not create temp file");
+        write!(
+            file,
+            r#"
+            allowed_binaries = ["/bin/sh"]
+            "#
+        )
+        .expect("Could not write in file");
+
+        let path = file.path().display().to_string();
+
+        temp_env::with_var("FLUENCE_CONFIG", Some(path), || {
+            let config = load_config_with_args(vec![], None).expect("Could not load config");
+            assert_eq!(
+                config.node_config.allowed_binaries,
+                vec!("/bin/sh".to_string())
+            );
+        });
+    }
+
+    #[test]
+    fn load_tracing_disabled_with_file() {
+        let mut file = NamedTempFile::new().expect("Could not create temp file");
+        write!(
+            file,
+            r#"
+            [tracing]
+            type = "disabled"
+            "#
+        )
+        .expect("Could not write in file");
+
+        let path = file.path().display().to_string();
+
+        temp_env::with_var("FLUENCE_CONFIG", Some(path), || {
+            let config = load_config_with_args(vec![], None).expect("Could not load config");
+            assert_eq!(config.tracing, Some(TracingConfig::Disabled));
+        });
+    }
+
+    #[test]
+    fn load_tracing_otlp_with_file() {
+        let mut file = NamedTempFile::new().expect("Could not create temp file");
+        write!(
+            file,
+            r#"
+            [tracing]
+            type = "otlp"
+            endpoint = "grpc://10.10.10.10:122"
+            sample_ratio = 0.1
+            "#
+        )
+        .expect("Could not write in file");
+
+        let path = file.path().display().to_string();
+
+        temp_env::with_var("FLUENCE_CONFIG", Some(path), || {
+            let config = load_config_with_args(vec![], None).expect("Could not load config");
+            assert_eq!(
+                config.tracing,
+                Some(TracingConfig::Otlp {
+                    endpoint: Url::parse("grpc://10.10.10.10:122").unwrap(),
+                    sample_ratio: Some(0.1)
+                })
+            );
+        });
+    }
+
+    #[test]
+    fn load_tracing_disabled_with_env() {
+        temp_env::with_var("FLUENCE_TRACING__TYPE", Some("disabled"), || {
+            let config = load_config_with_args(vec![], None).expect("Could not load config");
+            assert_eq!(config.tracing, Some(TracingConfig::Disabled));
+        });
+    }
+
+    #[test]
+    fn load_tracing_otlp_with_env() {
+        temp_env::with_vars(
+            [
+                ("FLUENCE_TRACING__TYPE", Some("otlp")),
+                ("FLUENCE_TRACING__ENDPOINT", Some("grpc://10.10.10.10:122")),
+            ],
+            || {
+                let config = load_config_with_args(vec![], None).expect("Could not load config");
+                assert_eq!(
+                    config.tracing,
+                    Some(TracingConfig::Otlp {
+                        endpoint: Url::parse("grpc://10.10.10.10:122").unwrap(),
+                        sample_ratio: None
+                    })
+                );
+            },
+        );
+    }
+
+    #[test]
+    fn load_tracing_disabled_with_args() {
+        temp_env::with_vars(
+            [
+                ("FLUENCE_TRACING__TYPE", Some("otlp")),
+                ("FLUENCE_TRACING__ENDPOINT", Some("test")),
+            ],
+            || {
+                let args = vec![
+                    OsString::from("nox"),
+                    OsString::from("--tracing-type"),
+                    OsString::from("disabled"),
+                ];
+                let config = load_config_with_args(args, None).expect("Could not load config");
+                assert_eq!(config.tracing, Some(TracingConfig::Disabled));
+            },
+        );
+    }
+
+    #[test]
+    fn load_tracing_otlp_with_args() {
+        temp_env::with_var("FLUENCE_TRACING__TYPE", Some("disabled"), || {
+            let args = vec![
+                OsString::from("nox"),
+                OsString::from("--tracing-type"),
+                OsString::from("otlp"),
+                OsString::from("--tracing-otlp-endpoint"),
+                OsString::from("grpc://10.10.10.10:122"),
+            ];
+            let config = load_config_with_args(args, None).expect("Could not load config");
+            assert_eq!(
+                config.tracing,
+                Some(TracingConfig::Otlp {
+                    endpoint: Url::parse("grpc://10.10.10.10:122").unwrap(),
+                    sample_ratio: None
+                })
+            );
+        });
+    }
+
+    #[test]
+    fn load_http_port_with_env() {
+        temp_env::with_vars([("FLUENCE_HTTP_PORT", Some("1234"))], || {
+            let config = load_config_with_args(vec![], None).expect("Could not load config");
+            assert_eq!(
+                config.node_config.http_config.map(|x| x.http_port),
+                Some(1234)
+            );
+        });
+    }
+
+    #[test]
+    fn load_http_port_with_args() {
+        temp_env::with_vars([("FLUENCE_HTTP_PORT", Some("1234"))], || {
+            let args = vec![
+                OsString::from("nox"),
+                OsString::from("--http-port"),
+                OsString::from("1001"),
+            ];
+            let config = load_config_with_args(args, None).expect("Could not load config");
+            assert_eq!(
+                config.node_config.http_config.map(|x| x.http_port),
+                Some(1001)
+            );
+        });
+    }
+
+    #[test]
+    fn load_env_upgrade_timeout() {
+        temp_env::with_vars(
+            [("FLUENCE_PROTOCOL_CONFIG__UPGRADE_TIMEOUT", Some("60s"))],
+            || {
+                let args = vec![];
+                let config = load_config_with_args(args, None).expect("Could not load config");
+                assert_eq!(
+                    config.node_config.protocol_config.upgrade_timeout,
+                    Duration::from_secs(60)
+                );
+            },
+        );
+    }
+
+    #[test]
+    fn load_file_upgrade_timeout() {
+        let mut file = NamedTempFile::new().expect("Could not create temp file");
+        write!(
+            file,
+            r#"
+            [protocol_config]
+            upgrade_timeout = "60s"
+            "#
+        )
+        .expect("Could not write in file");
+
+        let path = file.path().display().to_string();
+
+        temp_env::with_var("FLUENCE_CONFIG", Some(path), || {
+            let config = load_config_with_args(vec![], None).expect("Could not load config");
+            assert_eq!(
+                config.node_config.protocol_config.upgrade_timeout,
+                Duration::from_secs(60)
+            );
+        });
+    }
+
+    #[test]
+    fn load_multiple_configs() {
+        let mut file = NamedTempFile::new().expect("Could not create temp file");
+        write!(
+            file,
+            r#"
+            [protocol_config]
+            upgrade_timeout = "60s"
+            "#
+        )
+        .expect("Could not write in file");
+
+        let path = file.path().display().to_string();
+
+        let mut file2 = NamedTempFile::new().expect("Could not create temp file");
+        write!(
+            file2,
+            r#"
+            allowed_binaries = [
+                 "/usr/bin/curl",
+                 "/usr/bin/ipfs",
+                 "/usr/bin/glaze"
+            ]
+            websocket_port = 1234
+            "#
+        )
+        .expect("Could not write in file");
+
+        let path2 = file2.path().display().to_string();
+
+        let mut file3 = NamedTempFile::new().expect("Could not create temp file");
+        write!(
+            file3,
+            r#"
+            websocket_port = 666
+            "#
+        )
+        .expect("Could not write in file");
+
+        let path3 = file3.path().display().to_string();
+
+        let mut file4 = NamedTempFile::new().expect("Could not create temp file");
+        write!(
+            file4,
+            r#"
+           aquavm_pool_size = 160
+            "#
+        )
+        .expect("Could not write in file");
+
+        let path4 = file4.path().display().to_string();
+
+        let args = vec![
+            OsString::from("nox"),
+            OsString::from("--config"),
+            OsString::from(path3.to_string()),
+            OsString::from("--config"),
+            OsString::from(path4.to_string()),
+        ];
+
+        temp_env::with_var(
+            "FLUENCE_CONFIG",
+            Some(format!("{},{}", path, path2)),
+            || {
+                let config = load_config_with_args(args, None).expect("Could not load config");
+                assert_eq!(
+                    config.node_config.protocol_config.upgrade_timeout,
+                    Duration::from_secs(60)
+                );
+                assert_eq!(
+                    config.node_config.allowed_binaries,
+                    vec!["/usr/bin/curl", "/usr/bin/ipfs", "/usr/bin/glaze"]
+                );
+                assert_eq!(config.node_config.listen_config.websocket_port, 666);
+                assert_eq!(config.node_config.aquavm_pool_size, 160);
+            },
+        );
+    }
+
+    #[test]
+    fn load_file_with_custom_network() {
+        let mut file = NamedTempFile::new().expect("Could not create temp file");
+
+        write!(
+            file,
+            r#"
+            [network]
+            custom = "12458ae2e882cc71eaf2de71101c76a77a54ee89cae8897b231a8a1cb4e90f80"
+            "#
+        )
+        .expect("Could not write in file");
+
+        let path = file.path().display().to_string();
+
+        temp_env::with_var("FLUENCE_CONFIG", Some(path), || {
+            let config = load_config_with_args(vec![], None).expect("Could not load config");
+
+            let expected =
+                hex::decode("12458ae2e882cc71eaf2de71101c76a77a54ee89cae8897b231a8a1cb4e90f80")
+                    .unwrap();
+            let expected: [u8; 32] = expected.try_into().unwrap();
+
+            assert_eq!(config.node_config.network, Network::Custom(expected));
+        });
+    }
+
+    #[test]
+    fn load_file_with_vm_config() {
+        let mut file = NamedTempFile::new().expect("Could not create temp file");
+
+        write!(
+            file,
+            r#"
+            [vm]
+            libvirt_uri = "qemu:///system"
+            bridge_name = "br422442"
+            "#
+        )
+        .expect("Could not write in file");
+
+        let path = file.path().display().to_string();
+
+        temp_env::with_var("FLUENCE_CONFIG", Some(path), || {
+            let config = load_config_with_args(vec![], None).expect("Could not load config");
+
+            assert_eq!(
+                config.node_config.vm,
+                Some(VmConfig {
+                    libvirt_uri: "qemu:///system".to_string(),
+                    bridge_name: "br422442".to_string()
+                })
+            );
+        });
+    }
+}
+
\ No newline at end of file diff --git a/src/server_config/services_config.rs.html b/src/server_config/services_config.rs.html new file mode 100644 index 0000000000..3572eea064 --- /dev/null +++ b/src/server_config/services_config.rs.html @@ -0,0 +1,53 @@ +services_config.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use crate::wasm_backend_config::WasmBackendConfig;
+use serde::{Deserialize, Serialize};
+
+#[derive(Debug, Clone, Serialize, Deserialize, Default)]
+pub struct ServicesConfig {
+    pub wasm_backend: WasmBackendConfig,
+}
+
\ No newline at end of file diff --git a/src/server_config/system_services_config.rs.html b/src/server_config/system_services_config.rs.html new file mode 100644 index 0000000000..ea7e45e443 --- /dev/null +++ b/src/server_config/system_services_config.rs.html @@ -0,0 +1,335 @@ +system_services_config.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use super::defaults::*;
+use serde::{Deserialize, Serialize};
+use std::fmt::Formatter;
+use std::path::PathBuf;
+
+#[derive(Clone, Serialize, Deserialize, Debug, PartialEq, Eq, Hash)]
+#[serde(rename_all = "kebab-case")]
+pub enum ServiceKey {
+    AquaIpfs,
+    TrustGraph,
+    Registry,
+    Decider,
+}
+
+impl ServiceKey {
+    pub fn all_values() -> Vec<Self> {
+        vec![
+            Self::AquaIpfs,
+            Self::TrustGraph,
+            Self::Registry,
+            Self::Decider,
+        ]
+    }
+
+    pub fn from_string(name: &str) -> Option<ServiceKey> {
+        match name {
+            "aqua-ipfs" => Some(ServiceKey::AquaIpfs),
+            "trust-graph" => Some(ServiceKey::TrustGraph),
+            "registry" => Some(ServiceKey::Registry),
+            "decider" => Some(ServiceKey::Decider),
+            _ => None,
+        }
+    }
+}
+
+impl std::fmt::Display for ServiceKey {
+    fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
+        match self {
+            Self::AquaIpfs => write!(f, "aqua-ipfs"),
+            Self::TrustGraph => write!(f, "trust-graph"),
+            Self::Registry => write!(f, "registry"),
+            Self::Decider => write!(f, "decider"),
+        }
+    }
+}
+
+#[derive(Clone, Serialize, Deserialize, Debug)]
+pub struct SystemServicesConfig {
+    #[serde(default = "default_system_services")]
+    pub enable: Vec<ServiceKey>,
+    #[serde(default)]
+    pub aqua_ipfs: AquaIpfsConfig,
+    #[serde(default)]
+    pub decider: DeciderConfig,
+    #[serde(default)]
+    pub registry: RegistryConfig,
+    #[serde(default)]
+    pub connector: ConnectorConfig,
+}
+
+impl Default for SystemServicesConfig {
+    fn default() -> Self {
+        Self {
+            enable: default_system_services(),
+            aqua_ipfs: Default::default(),
+            decider: Default::default(),
+            registry: Default::default(),
+            connector: Default::default(),
+        }
+    }
+}
+
+#[derive(Clone, Serialize, Deserialize, Debug)]
+pub struct AquaIpfsConfig {
+    #[serde(default = "default_ipfs_multiaddr")]
+    pub external_api_multiaddr: String,
+    #[serde(default = "default_ipfs_multiaddr")]
+    pub local_api_multiaddr: String,
+    #[serde(default = "default_ipfs_binary_path")]
+    pub ipfs_binary_path: PathBuf,
+}
+
+impl Default for AquaIpfsConfig {
+    fn default() -> Self {
+        Self {
+            external_api_multiaddr: default_ipfs_multiaddr(),
+            local_api_multiaddr: default_ipfs_multiaddr(),
+            ipfs_binary_path: default_ipfs_binary_path(),
+        }
+    }
+}
+
+#[derive(Clone, Serialize, Deserialize, Debug)]
+pub struct ConnectorConfig {
+    #[serde(default = "default_curl_binary_path")]
+    pub curl_binary_path: PathBuf,
+}
+
+impl Default for ConnectorConfig {
+    fn default() -> Self {
+        Self {
+            curl_binary_path: default_curl_binary_path(),
+        }
+    }
+}
+
+#[derive(Clone, Serialize, Deserialize, Debug)]
+pub struct DeciderConfig {
+    #[serde(default = "default_decider_spell_period_sec")]
+    pub decider_period_sec: u32,
+    #[serde(default = "default_worker_spell_period_sec")]
+    pub worker_period_sec: u32,
+    #[serde(default = "default_ipfs_multiaddr")]
+    pub worker_ipfs_multiaddr: String,
+}
+
+impl Default for DeciderConfig {
+    fn default() -> Self {
+        Self {
+            decider_period_sec: default_decider_spell_period_sec(),
+            worker_period_sec: default_worker_spell_period_sec(),
+            worker_ipfs_multiaddr: default_ipfs_multiaddr(),
+        }
+    }
+}
+
+#[derive(Clone, Serialize, Deserialize, Debug)]
+pub struct RegistryConfig {
+    #[serde(default = "default_registry_spell_period_sec")]
+    pub registry_period_sec: u32,
+    #[serde(default = "default_registry_expired_spell_period_sec")]
+    pub expired_period_sec: u32,
+    #[serde(default = "default_registry_renew_spell_period_sec")]
+    pub renew_period_sec: u32,
+    #[serde(default = "default_registry_replicate_spell_period_sec")]
+    pub replicate_period_sec: u32,
+}
+
+impl Default for RegistryConfig {
+    fn default() -> Self {
+        Self {
+            registry_period_sec: default_registry_spell_period_sec(),
+            expired_period_sec: default_registry_expired_spell_period_sec(),
+            renew_period_sec: default_registry_renew_spell_period_sec(),
+            replicate_period_sec: default_registry_replicate_spell_period_sec(),
+        }
+    }
+}
+
\ No newline at end of file diff --git a/src/server_config/wasm_backend_config.rs.html b/src/server_config/wasm_backend_config.rs.html new file mode 100644 index 0000000000..414c2d8fcc --- /dev/null +++ b/src/server_config/wasm_backend_config.rs.html @@ -0,0 +1,97 @@ +wasm_backend_config.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use serde::{Deserialize, Serialize};
+use std::time::Duration;
+
+#[derive(Debug, Clone, Serialize, Deserialize)]
+pub struct WasmBackendConfig {
+    /// Configures whether DWARF debug information will be emitted during compilation.
+    pub debug_info: bool,
+    /// Configures whether the errors from the VM should collect the wasm backtrace and parse debug info.
+    pub wasm_backtrace: bool,
+    /// Configures the size of the stacks used for asynchronous execution.
+    pub async_wasm_stack: bytesize::ByteSize,
+    /// Configures the maximum amount of stack space available for executing WebAssembly code.
+    pub max_wasm_stack: bytesize::ByteSize,
+    /// Enables the epoch interruption mechanism
+    #[serde(with = "humantime_serde")]
+    pub epoch_interruption_duration: Option<Duration>,
+}
+
+impl Default for WasmBackendConfig {
+    fn default() -> Self {
+        Self {
+            debug_info: true,
+            wasm_backtrace: true,
+            async_wasm_stack: bytesize::ByteSize::mb(4),
+            max_wasm_stack: bytesize::ByteSize::mb(2),
+            epoch_interruption_duration: Some(Duration::from_secs(1)),
+        }
+    }
+}
+
\ No newline at end of file diff --git a/src/service_modules/lib.rs.html b/src/service_modules/lib.rs.html new file mode 100644 index 0000000000..7005c7ee65 --- /dev/null +++ b/src/service_modules/lib.rs.html @@ -0,0 +1,81 @@ +lib.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+#![feature(try_blocks)]
+#![warn(rust_2018_idioms)]
+#![deny(
+    dead_code,
+    nonstandard_style,
+    unused_imports,
+    unused_mut,
+    unused_variables,
+    unused_unsafe,
+    unreachable_patterns
+)]
+
+pub use cid_utils::Hash;
+pub use modules::blueprint::{AddBlueprint, Blueprint};
+pub use modules::file_names::*;
+pub use modules::fixture::{load_module, module_config};
+mod modules {
+    pub mod blueprint;
+    pub mod file_names;
+    pub mod fixture;
+}
+
\ No newline at end of file diff --git a/src/service_modules/modules/blueprint.rs.html b/src/service_modules/modules/blueprint.rs.html new file mode 100644 index 0000000000..0c8684d63f --- /dev/null +++ b/src/service_modules/modules/blueprint.rs.html @@ -0,0 +1,271 @@ +blueprint.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use cid_utils::Hash;
+use libipld::codec::Codec;
+use libipld::json::DagJsonCodec;
+use libipld::Ipld;
+use std::collections::BTreeMap;
+
+use serde::{Deserialize, Serialize};
+
+#[derive(Debug, Clone)]
+pub struct AddBlueprint {
+    pub name: String,
+    pub dependencies: Vec<Hash>,
+}
+
+impl AddBlueprint {
+    pub fn new(name: String, dependencies: Vec<Hash>) -> Self {
+        Self { name, dependencies }
+    }
+
+    pub fn get_ipld(&self) -> Ipld {
+        // BTreeMap is used internally by IPLD, so we use it here to avoid conversions
+        let mut map = BTreeMap::new();
+        map.insert("name".to_string(), Ipld::String(self.name.clone()));
+        map.insert(
+            "dependencies".to_string(),
+            Ipld::List(
+                self.dependencies
+                    .clone()
+                    .into_iter()
+                    .map(|h| Ipld::Link(h.0))
+                    .collect(),
+            ),
+        );
+
+        Ipld::Map(map)
+    }
+
+    /// encode IPLD object with DAG JSON codec
+    pub fn encode(&self) -> eyre::Result<Vec<u8>> {
+        DagJsonCodec
+            .encode(&self.get_ipld())
+            .map_err(|e| eyre::eyre!(e))
+    }
+
+    pub fn to_string(&self) -> eyre::Result<String> {
+        Ok(String::from_utf8(self.encode()?)?)
+    }
+
+    pub fn decode(data: &[u8]) -> eyre::Result<Self> {
+        let ipld: Ipld = DagJsonCodec.decode(data).map_err(|e| eyre::eyre!(e))?;
+        let name = ipld
+            .get("name")
+            .map_err(|_| eyre::eyre!("name field is missing"))?;
+        let dependencies = ipld
+            .get("dependencies")
+            .map_err(|_| eyre::eyre!("dependencies field is missing"))?;
+
+        let name = match name {
+            Ipld::String(s) => s.clone(),
+            _ => return Err(eyre::eyre!("name field is not a string")),
+        };
+
+        let dependencies = match dependencies {
+            Ipld::List(l) => l
+                .iter()
+                .map(|ipld| match ipld {
+                    Ipld::Link(h) => Ok(Hash(*h)),
+                    _ => Err(eyre::eyre!("dependency is not a link")),
+                })
+                .collect::<eyre::Result<Vec<_>>>()?,
+            _ => return Err(eyre::eyre!("dependencies field is not a list")),
+        };
+
+        Ok(Self { name, dependencies })
+    }
+}
+
+#[derive(Serialize, Deserialize, Debug, Clone)]
+pub struct Blueprint {
+    pub name: String,
+    pub id: String,
+    pub dependencies: Vec<Hash>,
+}
+
+impl Blueprint {
+    pub fn new(add_blueprint: AddBlueprint) -> eyre::Result<Self> {
+        let id = Hash::new(&add_blueprint.encode()?)?.to_string();
+
+        Ok(Self {
+            name: add_blueprint.name,
+            id,
+            dependencies: add_blueprint.dependencies,
+        })
+    }
+
+    pub fn get_facade_module(&self) -> Option<Hash> {
+        self.dependencies.last().cloned()
+    }
+}
+
+#[test]
+fn test_blueprint_hash() {
+    let cid1 =
+        Hash::from_string("bafybeiey4i2vtj7uu7tlvdoc2o52uuuwxa4ahcx5g4lpqzk4qtd5klniuq").unwrap();
+    let cid2 =
+        Hash::from_string("bafybeibuvzascfzi5ikyzhjxdkridgytg4z26ujtnx7xrejq7gxq54ssdm").unwrap();
+    let blueprint = Blueprint::new(AddBlueprint {
+        name: "trust-graph".to_string(),
+        dependencies: vec![cid1, cid2],
+    })
+    .unwrap();
+    assert_eq!(
+        blueprint.id.to_string(),
+        "bafkreifdehdwcppttfsqaju4kodgn5wgbefrarbzc72k4sore2bwpeq2fa"
+    );
+}
+
\ No newline at end of file diff --git a/src/service_modules/modules/file_names.rs.html b/src/service_modules/modules/file_names.rs.html new file mode 100644 index 0000000000..902c668177 --- /dev/null +++ b/src/service_modules/modules/file_names.rs.html @@ -0,0 +1,253 @@ +file_names.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use super::blueprint::Blueprint;
+use cid_utils::Hash;
+
+use std::path::Path;
+
+/// Calculates filename of the config for a wasm module, given a hash or name of the module.
+pub fn module_config_name_json(hash: &Hash) -> String {
+    format!("{hash}_config.json")
+}
+
+/// Calculates the name of a wasm module file, given a hash or name of the module.
+pub fn module_file_name(name: &str) -> String {
+    format!("{name}.wasm")
+}
+
+/// Calculates filename of the config for a wasm module
+pub fn module_config_name_hash(config_hash: &Hash) -> String {
+    format!("{config_hash}_config.toml")
+}
+
+/// Calculates the name of a wasm module file, given a hash of the module.
+pub fn module_file_name_hash(module_hash: &Hash) -> String {
+    format!("{module_hash}.wasm")
+}
+
+/// Calculates filename of the blueprint
+pub fn blueprint_file_name(blueprint: &Blueprint) -> String {
+    blueprint_fname(blueprint.id.as_str())
+}
+
+pub fn blueprint_fname(id: &str) -> String {
+    format!("{id}_blueprint.toml")
+}
+
+/// Returns true if file is named like a blueprint would be
+pub fn is_blueprint(name: &str) -> bool {
+    name.ends_with("_blueprint.toml")
+}
+
+/// Return file name with .wasm extension stripped. None if extension wasn't .wasm
+pub fn extract_module_file_name(path: &Path) -> Option<&str> {
+    // return None if extension isn't "wasm"
+    path.extension().filter(|ext| ext == &"wasm")?;
+    // strip extension
+    path.file_stem()?.to_str()
+}
+
+pub fn is_module_wasm(path: &Path) -> bool {
+    path.extension().map_or(false, |ext| ext == "wasm")
+}
+
+pub fn service_file_name(service_id: &str) -> String {
+    format!("{service_id}_service.toml")
+}
+
+pub fn is_service(path: &Path) -> bool {
+    path.file_name()
+        .and_then(|n| n.to_str())
+        .map_or(false, |n| n.ends_with("_service.toml"))
+}
+
+#[cfg(test)]
+mod tests {
+    use crate::is_service;
+    use crate::{extract_module_file_name, is_blueprint, is_module_wasm};
+
+    use std::path::Path;
+
+    #[test]
+    fn is_wasm() {
+        let path = Path::new("/.fluence/services/modules/facade_url_downloader.wasm");
+        assert!(is_module_wasm(path));
+
+        let path = Path::new("/.fluence/services/modules/facade_url_downloader_config.toml");
+        assert!(!is_module_wasm(path));
+    }
+
+    #[test]
+    fn is_bp() {
+        let path = "/.fluence/services/modules/facade_url_downloader_blueprint.toml";
+        assert!(is_blueprint(path));
+
+        let path = "/.fluence/services/modules/facade_url_downloader.wasm";
+        assert!(!is_blueprint(path));
+    }
+
+    #[test]
+    fn is_srvc() {
+        let path = Path::new("/.fluence/services/modules/facade_url_downloader_service.toml");
+        assert!(is_service(path));
+
+        let path = Path::new("/.fluence/services/modules/facade_url_downloader.wasm");
+        assert!(!is_service(path));
+    }
+
+    #[test]
+    fn module_fname() {
+        let path = Path::new("/.fluence/services/modules/facade_url_downloader.wasm");
+        assert_eq!(
+            extract_module_file_name(path),
+            Some("facade_url_downloader")
+        );
+
+        let path = Path::new("/.fluence/services/modules/facade_url_downloader_config.toml");
+        assert_eq!(extract_module_file_name(path), None);
+    }
+}
+
\ No newline at end of file diff --git a/src/service_modules/modules/fixture.rs.html b/src/service_modules/modules/fixture.rs.html new file mode 100644 index 0000000000..ed8ffdf0c2 --- /dev/null +++ b/src/service_modules/modules/fixture.rs.html @@ -0,0 +1,89 @@ +fixture.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use fs_utils::to_abs_path;
+
+use eyre::{Result, WrapErr};
+use serde_json::{json, Value as JValue};
+use std::path::PathBuf;
+
+pub fn load_module(path: &str, module_name: impl Into<String>) -> Result<Vec<u8>> {
+    let module_name = format!("{}.wasm", module_name.into());
+    let module = to_abs_path(PathBuf::from(path).join(module_name));
+    std::fs::read(&module).wrap_err(format!("failed to load module {module:?}"))
+}
+
+pub fn module_config(import_name: &str) -> JValue {
+    json!(
+    {
+        "name": import_name,
+        "mem_pages_count": 100,
+        "logger_enabled": true,
+        "preopened_files": vec!["/tmp"],
+        "wasi": {
+            "envs": json!({}),
+            "mapped_dirs": json!({}),
+        }
+    })
+}
+
\ No newline at end of file diff --git a/src/sorcerer/error.rs.html b/src/sorcerer/error.rs.html new file mode 100644 index 0000000000..28db5f6ff4 --- /dev/null +++ b/src/sorcerer/error.rs.html @@ -0,0 +1,73 @@ +error.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+use particle_protocol::ParticleError;
+use particle_services::PeerScope;
+use thiserror::Error;
+
+#[derive(Debug, Error)]
+pub enum SorcererError {
+    #[error("Failed to sign particle for spell {spell_id} : {err}")]
+    ParticleSigningFailed {
+        #[source]
+        err: ParticleError,
+        spell_id: String,
+    },
+    #[error("Keypair for spell {spell_id}:{peer_scope:?} is missing")]
+    ScopeKeypairMissing {
+        spell_id: String,
+        peer_scope: PeerScope,
+    },
+}
+
\ No newline at end of file diff --git a/src/sorcerer/lib.rs.html b/src/sorcerer/lib.rs.html new file mode 100644 index 0000000000..5556800fb1 --- /dev/null +++ b/src/sorcerer/lib.rs.html @@ -0,0 +1,67 @@ +lib.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+#![feature(try_blocks)]
+#![feature(extend_one)]
+pub use sorcerer::Sorcerer;
+pub use spell_builtins::{get_spell_info, install_spell, remove_spell, SpellInfo};
+
+#[macro_use]
+extern crate fstrings;
+
+mod error;
+mod script_executor;
+mod sorcerer;
+mod spell_builtins;
+mod utils;
+mod worker_builins;
+
\ No newline at end of file diff --git a/src/sorcerer/script_executor.rs.html b/src/sorcerer/script_executor.rs.html new file mode 100644 index 0000000000..3f9a27f120 --- /dev/null +++ b/src/sorcerer/script_executor.rs.html @@ -0,0 +1,357 @@ +script_executor.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+use std::sync::Arc;
+use tracing::{instrument, Span};
+
+use crate::error::SorcererError::{ParticleSigningFailed, ScopeKeypairMissing};
+use crate::Sorcerer;
+use fluence_libp2p::PeerId;
+use now_millis::now_ms;
+use particle_args::JError;
+use particle_protocol::{ExtendedParticle, Particle};
+use particle_services::PeerScope;
+use spell_event_bus::api::{TriggerEvent, TriggerInfoAqua};
+use spell_service_api::CallParams;
+
+impl Sorcerer {
+    async fn get_spell_counter(
+        &self,
+        peer_scope: PeerScope,
+        spell_id: String,
+    ) -> Result<u32, JError> {
+        let init_peer_id = self.scopes.to_peer_id(peer_scope);
+        let params = CallParams::local(
+            peer_scope,
+            spell_id,
+            init_peer_id,
+            self.spell_script_particle_ttl,
+        );
+        let counter = self.spell_service_api.get_counter(params).await?;
+        // If the counter does not exist, consider it to be 0.
+        // It will be incremented afterwards to 1 anyway.
+        Ok(counter.unwrap_or(0u32))
+    }
+
+    async fn set_spell_next_counter(
+        &self,
+        peer_scope: PeerScope,
+        spell_id: String,
+        next_counter: u32,
+    ) -> Result<(), JError> {
+        let init_peer_id = self.scopes.to_peer_id(peer_scope);
+        let params = CallParams::local(
+            peer_scope,
+            spell_id,
+            init_peer_id,
+            self.spell_script_particle_ttl,
+        );
+        self.spell_service_api
+            .set_counter(params, next_counter)
+            .await
+            .map_err(|e| JError::new(e.to_string()))
+    }
+
+    async fn get_spell_script(
+        &self,
+        peer_scope: PeerScope,
+        spell_id: String,
+    ) -> Result<String, JError> {
+        let init_peer_id = self.scopes.to_peer_id(peer_scope);
+        let params = CallParams::local(
+            peer_scope,
+            spell_id,
+            init_peer_id,
+            self.spell_script_particle_ttl,
+        );
+        self.spell_service_api
+            .get_script(params)
+            .await
+            .map_err(|e| JError::new(e.to_string()))
+    }
+
+    #[instrument(level = tracing::Level::INFO, skip_all)]
+    pub(crate) async fn make_spell_particle(
+        &self,
+        peer_scope: PeerScope,
+        spell_id: String,
+    ) -> Result<Particle, JError> {
+        let spell_keypair =
+            self.key_storage
+                .get_keypair(peer_scope)
+                .ok_or(ScopeKeypairMissing {
+                    spell_id: spell_id.clone(),
+                    peer_scope,
+                })?;
+
+        let spell_counter = self.get_spell_counter(peer_scope, spell_id.clone()).await?;
+        self.set_spell_next_counter(peer_scope, spell_id.clone(), spell_counter + 1)
+            .await?;
+        let spell_script = self.get_spell_script(peer_scope, spell_id.clone()).await?;
+        let init_peer_id: PeerId = match peer_scope {
+            PeerScope::WorkerId(worker_id) => worker_id.into(),
+            PeerScope::Host => self.scopes.get_host_peer_id(),
+        };
+
+        let mut particle = Particle {
+            id: f!("spell_{spell_id}_{spell_counter}"),
+            init_peer_id,
+            timestamp: now_ms() as u64,
+            ttl: self.spell_script_particle_ttl.as_millis() as u32,
+            script: spell_script,
+            signature: vec![],
+            data: vec![],
+        };
+        particle
+            .sign(&spell_keypair)
+            .map_err(|err| ParticleSigningFailed { err, spell_id })?;
+
+        Ok(particle)
+    }
+
+    pub(crate) async fn store_trigger(
+        &self,
+        event: TriggerEvent,
+        peer_scope: PeerScope,
+    ) -> Result<(), JError> {
+        let init_peer_id = self.scopes.to_peer_id(peer_scope);
+        let serialized_event = serde_json::to_string(&TriggerInfoAqua::from(event.info))?;
+        let params = CallParams::local(
+            peer_scope,
+            event.spell_id,
+            init_peer_id,
+            self.spell_script_particle_ttl,
+        );
+        self.spell_service_api
+            .set_trigger_event(params, serialized_event)
+            .await
+            .map_err(|e| JError::new(e.to_string()))
+    }
+
+    #[instrument(level = tracing::Level::INFO, skip_all)]
+    pub async fn execute_script(&self, event: TriggerEvent, span: Arc<Span>) {
+        let error: Result<(), JError> = try {
+            let peer_scope = self
+                .spell_storage
+                .get_scope(event.spell_id.clone())
+                .expect("Scope not found");
+
+            let particle = self
+                .make_spell_particle(peer_scope, event.spell_id.clone())
+                .await?;
+
+            self.store_trigger(event.clone(), peer_scope).await?;
+            if let Some(m) = &self.spell_metrics {
+                m.observe_spell_cast();
+            }
+
+            self.aquamarine
+                .clone()
+                .execute(ExtendedParticle::linked(particle, span), None)
+                .await?;
+        };
+
+        if let Err(err) = error {
+            log::warn!(
+                "Failed to execute spell script id: {spell_id}, event: {:?}, error: {:?}",
+                event.info,
+                err,
+                spell_id = event.spell_id.to_string(),
+            );
+        }
+    }
+}
+
\ No newline at end of file diff --git a/src/sorcerer/sorcerer.rs.html b/src/sorcerer/sorcerer.rs.html new file mode 100644 index 0000000000..5a9f3b7268 --- /dev/null +++ b/src/sorcerer/sorcerer.rs.html @@ -0,0 +1,999 @@ +sorcerer.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use std::collections::HashMap;
+use std::sync::Arc;
+use std::time::Duration;
+
+use futures::{FutureExt, StreamExt};
+use tokio::sync::mpsc;
+use tokio::task::JoinHandle;
+use tokio_stream::wrappers::UnboundedReceiverStream;
+
+use crate::spell_builtins::{
+    get_spell_arg, get_spell_id, spell_install, spell_list, spell_remove, spell_update_config,
+    store_error, store_response,
+};
+use crate::worker_builins::{
+    activate_deal, create_worker, deactivate_deal, get_worker_peer_id, is_deal_active,
+    remove_worker, worker_list,
+};
+use aquamarine::AquamarineApi;
+use particle_args::JError;
+use particle_builtins::{wrap, wrap_unit, CustomService};
+use particle_execution::ServiceFunction;
+use particle_modules::ModuleRepository;
+use particle_services::ParticleAppServices;
+use peer_metrics::SpellMetrics;
+use serde_json::Value;
+use server_config::ResolvedConfig;
+use spell_event_bus::api::{from_user_config, SpellEventBusApi, TriggerEvent};
+use spell_service_api::{CallParams, SpellServiceApi};
+use spell_storage::SpellStorage;
+use tracing::Instrument;
+use workers::{KeyStorage, PeerScopes, Workers};
+
+#[derive(Clone)]
+pub struct Sorcerer {
+    pub aquamarine: AquamarineApi,
+    pub services: ParticleAppServices,
+    pub spell_storage: SpellStorage,
+    pub spell_event_bus_api: SpellEventBusApi,
+    pub spell_script_particle_ttl: Duration,
+    pub workers: Arc<Workers>,
+    pub key_storage: Arc<KeyStorage>,
+    pub scopes: PeerScopes,
+    pub spell_service_api: SpellServiceApi,
+    pub spell_metrics: Option<SpellMetrics>,
+    pub worker_period_sec: u32,
+}
+
+impl Sorcerer {
+    #[allow(clippy::too_many_arguments)]
+    pub async fn new(
+        services: ParticleAppServices,
+        modules: ModuleRepository,
+        aquamarine: AquamarineApi,
+        config: ResolvedConfig,
+        spell_event_bus_api: SpellEventBusApi,
+        workers: Arc<Workers>,
+        key_storage: Arc<KeyStorage>,
+        scope: PeerScopes,
+        spell_service_api: SpellServiceApi,
+        spell_metrics: Option<SpellMetrics>,
+    ) -> (Self, HashMap<String, CustomService>, String) {
+        let (spell_storage, spell_version) =
+            SpellStorage::create(&config.dir_config.spell_base_dir, &services, &modules)
+                .await
+                .expect("Spell storage creation");
+
+        let sorcerer = Self {
+            aquamarine,
+            services,
+            spell_storage,
+            spell_event_bus_api,
+            spell_script_particle_ttl: config.max_spell_particle_ttl,
+            workers,
+            key_storage,
+            scopes: scope,
+            spell_service_api,
+            spell_metrics,
+            worker_period_sec: config.system_services.decider.worker_period_sec,
+        };
+
+        let mut builtin_functions = sorcerer.make_spell_builtins();
+        builtin_functions.extend_one(sorcerer.make_worker_builtin());
+
+        (sorcerer, builtin_functions, spell_version)
+    }
+
+    async fn resubscribe_spells(&self) {
+        for (peer_scope, spells) in self.spell_storage.get_registered_spells() {
+            for spell_id in spells {
+                log::info!("Rescheduling spell {} on {:?} peer", spell_id, peer_scope);
+                let result: Result<(), JError> = try {
+                    let spell_owner = self
+                        .services
+                        .get_service_owner(peer_scope, spell_id.clone(), "")
+                        .await?;
+                    let params = CallParams::local(
+                        peer_scope,
+                        spell_id.clone(),
+                        spell_owner,
+                        self.spell_script_particle_ttl,
+                    );
+                    let config = self.spell_service_api.get_trigger_config(params).await?;
+                    let period = config.clock.period_sec;
+                    let config = from_user_config(&config)?;
+                    if let Some(config) = config.and_then(|c| c.into_rescheduled()) {
+                        self.spell_event_bus_api
+                            .subscribe(spell_id.clone(), config)
+                            .await?;
+                        if let Some(m) = &self.spell_metrics {
+                            m.observe_started_spell(period);
+                        }
+                    } else {
+                        log::warn!("Spell {spell_id} is not rescheduled since its config is either not found or not reschedulable");
+                    }
+                };
+                if let Err(e) = result {
+                    // 1. We do not remove the spell we aren't able to reschedule. Users should be able to rerun it manually when updating trigger config.
+                    // 2. Maybe we should somehow register which spell are running and which are not and notify user about it.
+                    log::warn!("Failed to reschedule spell {}: {}.", spell_id, e);
+                }
+            }
+        }
+    }
+
+    pub fn start(
+        self,
+        spell_events_receiver: mpsc::UnboundedReceiver<TriggerEvent>,
+    ) -> JoinHandle<()> {
+        tokio::task::Builder::new()
+            .name("sorcerer")
+            .spawn(async {
+                self.resubscribe_spells().await;
+                let spell_events_stream = UnboundedReceiverStream::new(spell_events_receiver);
+                spell_events_stream
+                    .for_each_concurrent(None, move |spell_event| {
+                        let root_span = tracing::info_span!(
+                            "Sorcerer::task::for_each",
+                            spell_id = spell_event.spell_id.to_string()
+                        );
+                        let root_span = Arc::new(root_span);
+                        let async_span = tracing::info_span!(parent: root_span.as_ref(),
+                            "Sorcerer::task::execute_script",
+                            spell_id = spell_event.spell_id.to_string());
+
+                        let sorcerer = self.clone();
+                        // Note that the event that triggered the spell is in `spell_event.event`
+                        async move {
+                            sorcerer
+                                .execute_script(spell_event, root_span)
+                                .in_current_span()
+                                .await;
+                        }
+                        .instrument(async_span)
+                    })
+                    .await;
+            })
+            .expect("Could not spawn task")
+    }
+
+    fn make_spell_builtins(&self) -> HashMap<String, CustomService> {
+        let mut spell_builtins: HashMap<String, CustomService> = HashMap::new();
+
+        spell_builtins.insert(
+            "spell".to_string(),
+            CustomService::new(
+                vec![
+                    ("install", self.make_spell_install_closure()),
+                    ("remove", self.make_spell_remove_closure()),
+                    ("list", self.make_spell_list_closure()),
+                    (
+                        "update_trigger_config",
+                        self.make_spell_update_config_closure(),
+                    ),
+                ],
+                None,
+            ),
+        );
+
+        spell_builtins.insert(
+            "getDataSrv".to_string(),
+            CustomService::new(
+                vec![
+                    ("spell_id", self.make_get_spell_id_closure()),
+                    ("-relay-", self.make_get_relay_closure()),
+                ],
+                Some(self.make_get_spell_arg_closure()),
+            ),
+        );
+
+        spell_builtins.insert(
+            "errorHandlingSrv".to_string(),
+            CustomService::new(vec![("error", self.make_error_handler_closure())], None),
+        );
+
+        spell_builtins.insert(
+            "callbackSrv".to_string(),
+            CustomService::new(
+                vec![("response", self.make_response_handler_closure())],
+                None,
+            ),
+        );
+
+        spell_builtins
+    }
+
+    fn make_worker_builtin(&self) -> (String, CustomService) {
+        (
+            "worker".to_string(),
+            CustomService::new(
+                vec![
+                    ("create", self.make_worker_create_closure()),
+                    ("get_worker_id", self.make_worker_get_worker_id_closure()),
+                    ("remove", self.make_worker_remove_closure()),
+                    ("list", self.make_worker_list_closure()),
+                    ("activate", self.make_activate_deal_closure()),
+                    ("deactivate", self.make_deactivate_deal_closure()),
+                    ("is_active", self.make_is_deal_active_closure()),
+                ],
+                None,
+            ),
+        )
+    }
+
+    fn make_spell_install_closure(&self) -> ServiceFunction {
+        let services = self.services.clone();
+        let storage = self.spell_storage.clone();
+        let spell_event_bus = self.spell_event_bus_api.clone();
+        let workers = self.workers.clone();
+        let spell_service_api = self.spell_service_api.clone();
+        let scope = self.scopes.clone();
+        ServiceFunction::Immut(Box::new(move |args, params| {
+            let storage = storage.clone();
+            let services = services.clone();
+            let spell_event_bus_api = spell_event_bus.clone();
+            let spell_service_api = spell_service_api.clone();
+            let workers = workers.clone();
+            let scope = scope.clone();
+            async move {
+                wrap(
+                    spell_install(
+                        args,
+                        params,
+                        storage,
+                        services,
+                        spell_event_bus_api,
+                        spell_service_api,
+                        workers,
+                        scope,
+                    )
+                    .await,
+                )
+            }
+            .boxed()
+        }))
+    }
+
+    fn make_spell_remove_closure(&self) -> ServiceFunction {
+        let services = self.services.clone();
+        let storage = self.spell_storage.clone();
+        let spell_event_bus_api = self.spell_event_bus_api.clone();
+        let workers = self.workers.clone();
+        let scopes = self.scopes.clone();
+
+        ServiceFunction::Immut(Box::new(move |args, params| {
+            let storage = storage.clone();
+            let services = services.clone();
+            let api = spell_event_bus_api.clone();
+            let workers = workers.clone();
+            let scopes = scopes.clone();
+            async move {
+                let result =
+                    spell_remove(args, params, storage, services, api, workers, scopes).await;
+                wrap_unit(result)
+            }
+            .boxed()
+        }))
+    }
+
+    fn make_spell_list_closure(&self) -> ServiceFunction {
+        let storage = self.spell_storage.clone();
+        ServiceFunction::Immut(Box::new(move |_, params| {
+            let storage = storage.clone();
+            async move { wrap(spell_list(params, storage)) }.boxed()
+        }))
+    }
+
+    fn make_spell_update_config_closure(&self) -> ServiceFunction {
+        let spell_event_bus_api = self.spell_event_bus_api.clone();
+        let services = self.services.clone();
+        let workers = self.workers.clone();
+        let scope = self.scopes.clone();
+        let spell_service_api = self.spell_service_api.clone();
+        ServiceFunction::Immut(Box::new(move |args, params| {
+            let spell_event_bus_api = spell_event_bus_api.clone();
+            let services = services.clone();
+            let spell_service_api = spell_service_api.clone();
+            let workers = workers.clone();
+            let scopes = scope.clone();
+            async move {
+                wrap_unit(
+                    spell_update_config(
+                        args,
+                        params,
+                        services,
+                        spell_event_bus_api,
+                        spell_service_api,
+                        workers,
+                        scopes,
+                    )
+                    .await,
+                )
+            }
+            .boxed()
+        }))
+    }
+
+    fn make_get_spell_id_closure(&self) -> ServiceFunction {
+        ServiceFunction::Immut(Box::new(move |_, params| {
+            async move { wrap(get_spell_id(params)) }.boxed()
+        }))
+    }
+
+    fn make_get_relay_closure(&self) -> ServiceFunction {
+        let relay_peer_id = self.scopes.get_host_peer_id().to_base58();
+        ServiceFunction::Immut(Box::new(move |_, _| {
+            let relay = relay_peer_id.clone();
+            async move { wrap(Ok(Value::String(relay))) }.boxed()
+        }))
+    }
+
+    fn make_get_spell_arg_closure(&self) -> ServiceFunction {
+        let spell_service_api = self.spell_service_api.clone();
+        ServiceFunction::Immut(Box::new(move |args, params| {
+            let spell_service_api = spell_service_api.clone();
+            async move { wrap(get_spell_arg(args, params, spell_service_api).await) }.boxed()
+        }))
+    }
+
+    fn make_error_handler_closure(&self) -> ServiceFunction {
+        let spell_service_api = self.spell_service_api.clone();
+        ServiceFunction::Immut(Box::new(move |args, params| {
+            let spell_service_api = spell_service_api.clone();
+            async move { wrap_unit(store_error(args, params, spell_service_api).await) }.boxed()
+        }))
+    }
+
+    fn make_response_handler_closure(&self) -> ServiceFunction {
+        let spell_service_api = self.spell_service_api.clone();
+        ServiceFunction::Immut(Box::new(move |args, params| {
+            let spell_service_api = spell_service_api.clone();
+            async move { wrap_unit(store_response(args, params, spell_service_api).await) }.boxed()
+        }))
+    }
+
+    fn make_worker_create_closure(&self) -> ServiceFunction {
+        let workers = self.workers.clone();
+        let scopes = self.scopes.clone();
+        ServiceFunction::Immut(Box::new(move |args, params| {
+            let workers = workers.clone();
+            let scopes = scopes.clone();
+            async move {
+                let res: Result<Value, JError> = create_worker(args, params, scopes, workers).await;
+                wrap(res)
+            }
+            .boxed()
+        }))
+    }
+
+    fn make_worker_get_worker_id_closure(&self) -> ServiceFunction {
+        let workers = self.workers.clone();
+        ServiceFunction::Immut(Box::new(move |args, _| {
+            let workers = workers.clone();
+            async move { wrap(get_worker_peer_id(args, workers)) }.boxed()
+        }))
+    }
+
+    fn make_worker_list_closure(&self) -> ServiceFunction {
+        let workers = self.workers.clone();
+        ServiceFunction::Immut(Box::new(move |_, _| {
+            let workers = workers.clone();
+            async move { wrap(worker_list(workers)) }.boxed()
+        }))
+    }
+
+    fn make_worker_remove_closure(&self) -> ServiceFunction {
+        let services = self.services.clone();
+        let storage = self.spell_storage.clone();
+        let spell_event_bus_api = self.spell_event_bus_api.clone();
+        let workers = self.workers.clone();
+        let scopes = self.scopes.clone();
+
+        ServiceFunction::Immut(Box::new(move |args, params| {
+            let storage = storage.clone();
+            let services = services.clone();
+            let api = spell_event_bus_api.clone();
+            let workers = workers.clone();
+            let scopes = scopes.clone();
+            async move {
+                let res =
+                    remove_worker(args, params, workers, services, storage, api, scopes).await;
+                wrap_unit(res)
+            }
+            .boxed()
+        }))
+    }
+
+    fn make_activate_deal_closure(&self) -> ServiceFunction {
+        let workers = self.workers.clone();
+        let scope = self.scopes.clone();
+        let services = self.services.clone();
+        let spell_event_bus_api = self.spell_event_bus_api.clone();
+        let spells_api = self.spell_service_api.clone();
+        let worker_period_sec = self.worker_period_sec;
+        ServiceFunction::Immut(Box::new(move |args, params| {
+            let services = services.clone();
+            let spell_event_bus_api = spell_event_bus_api.clone();
+            let spells_api = spells_api.clone();
+            let workers = workers.clone();
+            let scope = scope.clone();
+
+            async move {
+                let res = activate_deal(
+                    args,
+                    params,
+                    workers,
+                    scope,
+                    services,
+                    spell_event_bus_api,
+                    spells_api,
+                    worker_period_sec,
+                )
+                .await;
+                wrap_unit(res)
+            }
+            .boxed()
+        }))
+    }
+
+    fn make_deactivate_deal_closure(&self) -> ServiceFunction {
+        let workers = self.workers.clone();
+        let scope = self.scopes.clone();
+        let spell_storage = self.spell_storage.clone();
+        let spell_event_bus_api = self.spell_event_bus_api.clone();
+        let spells_api = self.spell_service_api.clone();
+
+        ServiceFunction::Immut(Box::new(move |args, params| {
+            let spells_api = spells_api.clone();
+            let spell_storage = spell_storage.clone();
+            let spell_event_bus_api = spell_event_bus_api.clone();
+            let workers = workers.clone();
+            let scope = scope.clone();
+
+            async move {
+                let res = deactivate_deal(
+                    args,
+                    params,
+                    workers,
+                    scope,
+                    spell_storage,
+                    spell_event_bus_api,
+                    spells_api,
+                )
+                .await;
+                wrap_unit(res)
+            }
+            .boxed()
+        }))
+    }
+
+    fn make_is_deal_active_closure(&self) -> ServiceFunction {
+        let workers = self.workers.clone();
+        ServiceFunction::Immut(Box::new(move |args, _| {
+            let workers = workers.clone();
+            async move {
+                tokio::task::spawn_blocking(move || wrap(is_deal_active(args, workers))).await?
+            }
+            .boxed()
+        }))
+    }
+}
+
\ No newline at end of file diff --git a/src/sorcerer/spell_builtins.rs.html b/src/sorcerer/spell_builtins.rs.html new file mode 100644 index 0000000000..42cbb3a489 --- /dev/null +++ b/src/sorcerer/spell_builtins.rs.html @@ -0,0 +1,929 @@ +spell_builtins.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+use serde_json::{json, Value as JValue, Value, Value::Array};
+use std::sync::Arc;
+
+use crate::utils::parse_spell_id_from;
+use fluence_spell_dtos::trigger_config::TriggerConfig;
+use libp2p::PeerId;
+use particle_args::{Args, JError};
+use particle_execution::ParticleParams;
+use particle_services::{ParticleAppServices, PeerScope, ServiceType};
+use spell_event_bus::api::EventBusError;
+use spell_event_bus::{api, api::SpellEventBusApi};
+use spell_service_api::{CallParams, SpellServiceApi};
+use spell_storage::SpellStorage;
+use std::time::Duration;
+use workers::{PeerScopes, Workers};
+
+pub async fn remove_spell(
+    particle_id: &str,
+    spell_storage: &SpellStorage,
+    services: &ParticleAppServices,
+    spell_event_bus_api: &SpellEventBusApi,
+    spell_id: &str,
+    peer_scope: PeerScope,
+    init_peer_id: PeerId,
+) -> Result<(), JError> {
+    if let Err(err) = spell_event_bus_api.unsubscribe(spell_id.to_string()).await {
+        log::warn!(
+            "can't unsubscribe a spell {spell_id} from its triggers via spell-event-bus-api: {err}"
+        );
+        return Err(JError::new(format!(
+            "can't remove a spell {spell_id} due to an internal error while unsubscribing from the triggers: {err}"
+        )));
+    }
+
+    spell_storage.unregister_spell(peer_scope, spell_id);
+    services
+        .remove_service(peer_scope, particle_id, spell_id, init_peer_id, true)
+        .await?;
+    Ok(())
+}
+
+#[allow(clippy::too_many_arguments)]
+pub async fn install_spell(
+    services: &ParticleAppServices,
+    spell_storage: &SpellStorage,
+    spell_event_bus_api: &SpellEventBusApi,
+    spell_service_api: &SpellServiceApi,
+    peer_scope: PeerScope,
+    particle_id: String,
+    ttl: Duration,
+    user_config: TriggerConfig,
+    script: String,
+    init_data: Value,
+    owner_id: PeerId,
+) -> Result<String, JError> {
+    let config = api::from_user_config(&user_config)?;
+
+    let spell_id = services
+        .create_service(
+            peer_scope,
+            ServiceType::Spell,
+            spell_storage.get_blueprint(),
+            owner_id,
+        )
+        .await?;
+    spell_storage.register_spell(peer_scope, spell_id.clone());
+
+    let params = CallParams::local(peer_scope, spell_id.clone(), owner_id, ttl);
+    // Save the script to the spell
+    spell_service_api.set_script(params.clone(), script).await?;
+    // Save init_data to the spell's KV
+    let self_particle_id = format!("spell_{spell_id}_0");
+    let self_params = CallParams::new(
+        owner_id,
+        peer_scope,
+        spell_id.clone(),
+        Some(self_particle_id),
+        ttl,
+    );
+    spell_service_api
+        .update_kv(self_params.clone(), init_data)
+        .await?;
+    // Save trigger config
+    spell_service_api
+        .set_trigger_config(params, user_config)
+        .await?;
+
+    if let Some(config) = config {
+        // Scheduling the spell
+        if let Err(err) = spell_event_bus_api
+            .subscribe(spell_id.clone(), config.clone())
+            .await
+        {
+            log::warn!("can't subscribe a spell {} to triggers {:?} via spell-event-bus-api: {}. Removing created spell service...", spell_id, config, err);
+
+            spell_storage.unregister_spell(peer_scope, &spell_id);
+            services
+                .remove_service(peer_scope, &particle_id, &spell_id, owner_id, true)
+                .await?;
+
+            return Err(JError::new(format!(
+                "can't install a spell due to an internal error while subscribing to the triggers: {err}"
+            )));
+        }
+    } else {
+        tracing::trace!(
+            particle_id = particle_id,
+            "empty config given for spell {}",
+            spell_id
+        );
+    }
+
+    Ok(spell_id)
+}
+
+#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
+pub struct SpellInfo {
+    pub script: String,
+    pub trigger_config: TriggerConfig,
+}
+
+pub async fn get_spell_info(
+    spell_service_api: &SpellServiceApi,
+    peer_scope: PeerScope,
+    ttl: Duration,
+    spell_id: String,
+    init_peer_id: PeerId,
+) -> Result<SpellInfo, JError> {
+    let params = CallParams::local(peer_scope, spell_id.clone(), init_peer_id, ttl);
+    let trigger_config = spell_service_api
+        .get_trigger_config(params.clone())
+        .await
+        .map_err(|e| JError::new(f!("Failed to get trigger_config for spell {spell_id}: {e}")))?;
+
+    let script = spell_service_api
+        .get_script(params)
+        .await
+        .map_err(|e| JError::new(f!("Failed to get trigger_config for spell {spell_id}: {e}")))?;
+    Ok(SpellInfo {
+        script,
+        trigger_config,
+    })
+}
+
+pub(crate) async fn spell_install(
+    sargs: Args,
+    params: ParticleParams,
+    spell_storage: SpellStorage,
+    services: ParticleAppServices,
+    spell_event_bus_api: SpellEventBusApi,
+    spell_service_api: SpellServiceApi,
+    workers: Arc<Workers>,
+    scopes: PeerScopes,
+) -> Result<JValue, JError> {
+    let mut args = sargs.function_args.clone().into_iter();
+    let script: String = Args::next("script", &mut args)?;
+    let init_data: JValue = Args::next("data", &mut args)?;
+    let trigger_config: TriggerConfig = Args::next("trigger_config", &mut args)?;
+    let alias: Option<String> = Args::next_opt("alias", &mut args)?;
+
+    let init_peer_id = params.init_peer_id;
+
+    let is_management = scopes.is_management(init_peer_id);
+
+    let owner_id = match params.peer_scope {
+        PeerScope::WorkerId(worker_id) => {
+            let is_worker = init_peer_id == worker_id.into();
+            let worker_creator = workers.get_worker_creator(worker_id)?;
+            let is_worker_creator = init_peer_id == worker_creator;
+            if !is_management && !is_worker && !is_worker_creator {
+                return Err(JError::new(format!("Failed to install spell on {worker_id:?}, spell can be installed by worker creator {worker_creator}, worker itself {worker_id} or peer manager; init_peer_id={init_peer_id}")));
+            }
+            worker_id.into()
+        }
+        PeerScope::Host => {
+            if !is_management {
+                return Err(JError::new("Failed to install spell in the root scope, only management peer id can install top-level spells"));
+            }
+            scopes.get_host_peer_id()
+        }
+    };
+
+    let spell_id = install_spell(
+        &services,
+        &spell_storage,
+        &spell_event_bus_api,
+        &spell_service_api,
+        params.peer_scope,
+        params.id.clone(),
+        Duration::from_millis(params.ttl as u64),
+        trigger_config,
+        script,
+        init_data,
+        owner_id,
+    )
+    .await?;
+
+    if let Some(alias) = alias {
+        if let Err(e) = services
+            .add_alias(
+                params.peer_scope,
+                alias.clone(),
+                spell_id.clone(),
+                init_peer_id,
+            )
+            .await
+        {
+            // Remove the spell if we failed to add an alias
+            remove_spell(
+                &params.id,
+                &spell_storage,
+                &services,
+                &spell_event_bus_api,
+                &spell_id,
+                params.peer_scope,
+                owner_id,
+            )
+            .await?;
+
+            return Err(JError::new(format!(
+                "Failed to add alias {} for spell {}: {:?}",
+                alias, spell_id, e
+            )));
+        }
+    }
+
+    Ok(JValue::String(spell_id))
+}
+
+pub(crate) fn spell_list(
+    params: ParticleParams,
+    spell_storage: SpellStorage,
+) -> Result<JValue, JError> {
+    Ok(Array(
+        spell_storage
+            .get_registered_spells_by(params.peer_scope)
+            .into_iter()
+            .map(JValue::String)
+            .collect(),
+    ))
+}
+
+pub(crate) async fn spell_remove(
+    args: Args,
+    params: ParticleParams,
+    spell_storage: SpellStorage,
+    services: ParticleAppServices,
+    spell_event_bus_api: SpellEventBusApi,
+    workers: Arc<Workers>,
+    scopes: PeerScopes,
+) -> Result<(), JError> {
+    let mut args = args.function_args.into_iter();
+    let spell_id: String = Args::next("spell_id", &mut args)?;
+
+    let peer_scope = params.peer_scope;
+    let init_peer_id = params.init_peer_id;
+
+    let owner_peer_id: PeerId = match peer_scope {
+        PeerScope::WorkerId(worker_id) => {
+            let worker_creator = workers.get_worker_creator(worker_id)?;
+            let is_worker_creator = init_peer_id == worker_creator;
+            let is_worker = init_peer_id == worker_id.into();
+            let is_management = scopes.is_management(init_peer_id);
+            if !is_worker_creator && !is_worker && !is_management {
+                return Err(JError::new(format!(
+                    "Failed to remove spell {spell_id}, spell can be removed by worker creator {worker_creator}, worker itself {worker_id} or peer manager"
+                )));
+            }
+            worker_id.into()
+        }
+        PeerScope::Host => {
+            let host_peer_id = scopes.get_host_peer_id();
+            let is_host = init_peer_id == host_peer_id;
+            let is_management = scopes.is_management(init_peer_id);
+            if !is_host && !is_management {
+                return Err(JError::new(format!(
+                    "Failed to remove spell {spell_id}, worker itself {host_peer_id} or peer manager"
+                )));
+            }
+            host_peer_id
+        }
+    };
+
+    let spell_id = services
+        .to_service_id(params.peer_scope, spell_id, &params.id)
+        .await?;
+
+    remove_spell(
+        &params.id,
+        &spell_storage,
+        &services,
+        &spell_event_bus_api,
+        &spell_id,
+        peer_scope,
+        owner_peer_id,
+    )
+    .await
+}
+
+pub(crate) async fn spell_update_config(
+    args: Args,
+    params: ParticleParams,
+    services: ParticleAppServices,
+    spell_event_bus_api: SpellEventBusApi,
+    spell_service_api: SpellServiceApi,
+    workers: Arc<Workers>,
+    scopes: PeerScopes,
+) -> Result<(), JError> {
+    let mut args = args.function_args.into_iter();
+    let spell_id_or_alias: String = Args::next("spell_id", &mut args)?;
+
+    let peer_scope = params.peer_scope;
+    let init_peer_id = params.init_peer_id;
+
+    match peer_scope {
+        PeerScope::WorkerId(worker_id) => {
+            let worker_creator = workers.get_worker_creator(worker_id)?;
+            let is_worker_creator = init_peer_id == worker_creator;
+            let is_worker = init_peer_id == worker_id.into();
+            let is_management = scopes.is_management(init_peer_id);
+            if !is_worker_creator && !is_worker && !is_management {
+                return Err(JError::new(format!(
+                    "Failed to update spell config {spell_id_or_alias}, spell config can be updated by worker creator {worker_creator}, worker itself {worker_id} or peer manager; init_peer_id={init_peer_id}"
+                )));
+            }
+        }
+        PeerScope::Host => {
+            let host_peer_id = scopes.get_host_peer_id();
+            let is_host = init_peer_id == host_peer_id;
+            let is_management = scopes.is_management(init_peer_id);
+            if !is_host && !is_management {
+                return Err(JError::new(format!(
+                    "Failed to update spell config {spell_id_or_alias}, spell config can be updated by worker itself {host_peer_id} or peer manager; init_peer_id={init_peer_id}"
+                )));
+            }
+        }
+    }
+
+    let spell_id = services
+        .to_service_id(peer_scope, spell_id_or_alias.clone(), &params.id)
+        .await?;
+
+    let user_config: TriggerConfig = Args::next("config", &mut args)?;
+    let config = api::from_user_config(&user_config)?;
+    let init_peer_id = scopes.to_peer_id(peer_scope);
+    let params = CallParams::local(
+        peer_scope,
+        spell_id.clone(),
+        init_peer_id,
+        Duration::from_millis(params.ttl as u64),
+    );
+    spell_service_api
+        .set_trigger_config(params, user_config)
+        .await?;
+
+    let result: Result<(), EventBusError> = try {
+        // we unsubscribe the spell from the current config anyway
+        spell_event_bus_api.unsubscribe(spell_id.clone()).await?;
+        if let Some(config) = config {
+            // and if the config isn't empty, we subscribe it to the new one
+            spell_event_bus_api
+                .subscribe(spell_id.clone(), config.clone())
+                .await?;
+        }
+    };
+
+    if let Err(err) = result {
+        log::warn!(
+            "can't update a spell {spell_id_or_alias} config via spell-event-bus-api: {err}"
+        );
+        return Err(JError::new(format!(
+            "can't update a spell {spell_id_or_alias} config due to an internal error while updating the triggers: {err}"
+        )));
+    }
+
+    Ok(())
+}
+
+pub(crate) fn get_spell_id(params: ParticleParams) -> Result<JValue, JError> {
+    Ok(json!(parse_spell_id_from(&params)?))
+}
+
+pub(crate) async fn get_spell_arg(
+    args: Args,
+    params: ParticleParams,
+    spell_service_api: SpellServiceApi,
+) -> Result<JValue, JError> {
+    let spell_id = parse_spell_id_from(&params)?;
+    let key = args.function_name;
+    let call_params = CallParams::from(spell_id.clone(), params);
+
+    let str_value = spell_service_api
+        .get_string(call_params, key.clone())
+        .await
+        .map_err(|e| JError::new(f!("Failed to get argument {key} for spell {spell_id}: {e}")))
+        .and_then(|value| value.ok_or_else(|| JError::new("value not found")))?;
+
+    serde_json::from_str(&str_value).map_err(|e| {
+        JError::new(f!(
+            "Failed to parse argument `{key} -> {str_value}` for spell {spell_id}: {e}"
+        ))
+    })
+}
+
+pub(crate) async fn store_error(
+    mut args: Args,
+    params: ParticleParams,
+    spell_service_api: SpellServiceApi,
+) -> Result<(), JError> {
+    let spell_id = parse_spell_id_from(&params)?;
+
+    args.function_args.push(json!(params.timestamp));
+    let call_params = CallParams::from(spell_id.clone(), params);
+    spell_service_api
+        .store_error(call_params, args.function_args.clone())
+        .await
+        .map_err(|e| {
+            JError::new(format!(
+                "Failed to store error {:?} for spell {}: {}",
+                args.function_args, spell_id, e
+            ))
+        })
+}
+
+pub(crate) async fn store_response(
+    args: Args,
+    params: ParticleParams,
+    spell_service_api: SpellServiceApi,
+) -> Result<(), JError> {
+    let spell_id = parse_spell_id_from(&params)?;
+    let response: Option<JValue> = Args::next_opt("response", &mut args.function_args.into_iter())?;
+
+    if let Some(response) = response {
+        let call_params = CallParams::from(spell_id.clone(), params);
+        spell_service_api
+            .update_kv(call_params, response.clone())
+            .await
+            .map_err(|err| {
+                JError::new(format!(
+                    "Failed to store response {response} for spell {spell_id}: {err}"
+                ))
+            })
+    } else {
+        Ok(())
+    }
+}
+
\ No newline at end of file diff --git a/src/sorcerer/utils.rs.html b/src/sorcerer/utils.rs.html new file mode 100644 index 0000000000..345a2b63c7 --- /dev/null +++ b/src/sorcerer/utils.rs.html @@ -0,0 +1,57 @@ +utils.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use particle_args::JError;
+use particle_execution::ParticleParams;
+
+pub(crate) fn parse_spell_id_from(particle: &ParticleParams) -> Result<String, JError> {
+    ParticleParams::get_spell_id(&particle.id).ok_or(JError::new(format!(
+        "Invalid particle id: expected 'spell_{{SPELL_ID}}_{{COUNTER}}', got {}",
+        particle.id
+    )))
+}
+
\ No newline at end of file diff --git a/src/sorcerer/worker_builins.rs.html b/src/sorcerer/worker_builins.rs.html new file mode 100644 index 0000000000..0b91678c8a --- /dev/null +++ b/src/sorcerer/worker_builins.rs.html @@ -0,0 +1,543 @@ +worker_builins.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+use fluence_libp2p::PeerId;
+use fluence_spell_dtos::trigger_config::TriggerConfig;
+use futures::TryFutureExt;
+use serde_json::Value as JValue;
+use std::str::FromStr;
+use std::sync::Arc;
+use std::time::Duration;
+
+use crate::spell_builtins::remove_spell;
+use particle_args::{Args, JError};
+use particle_execution::ParticleParams;
+use particle_services::{ParticleAppServices, PeerScope};
+use spell_event_bus::api::{from_user_config, SpellEventBusApi};
+use spell_service_api::{CallParams, SpellServiceApi};
+use spell_storage::SpellStorage;
+use workers::{PeerScopes, WorkerParams, Workers, CUID};
+
+pub(crate) async fn create_worker(
+    args: Args,
+    params: ParticleParams,
+    scopes: PeerScopes,
+    workers: Arc<Workers>,
+) -> Result<JValue, JError> {
+    let mut args = args.function_args.into_iter();
+    let deal_id: String = Args::next("deal_id", &mut args)?;
+    let cu_ids: Vec<CUID> = Args::next("cu_ids", &mut args)?;
+
+    if !scopes.is_management(params.init_peer_id) && !scopes.is_host(params.init_peer_id) {
+        return Err(JError::new(
+            "Only management or host peer can create worker",
+        ));
+    }
+
+    Ok(JValue::String(
+        workers
+            .create_worker(WorkerParams::new(
+                deal_id.into(),
+                params.init_peer_id,
+                cu_ids,
+            ))
+            .await?
+            .to_string(),
+    ))
+}
+
+pub(crate) fn get_worker_peer_id(args: Args, workers: Arc<Workers>) -> Result<JValue, JError> {
+    let mut args = args.function_args.into_iter();
+    let deal_id: String = Args::next("deal_id", &mut args)?;
+
+    Ok(JValue::Array(
+        workers
+            .get_worker_id(deal_id.into())
+            .map(|id| vec![JValue::String(id.to_string())])
+            .unwrap_or_default(),
+    ))
+}
+
+pub(crate) async fn remove_worker(
+    args: Args,
+    params: ParticleParams,
+    workers: Arc<Workers>,
+    services: ParticleAppServices,
+    spell_storage: SpellStorage,
+    spell_event_bus_api: SpellEventBusApi,
+    scopes: PeerScopes,
+) -> Result<(), JError> {
+    let mut args = args.function_args.into_iter();
+    let worker_id: String = Args::next("worker_id", &mut args)?;
+    let worker_peer_id = PeerId::from_str(&worker_id)?;
+    let peer_scope = scopes
+        .scope(worker_peer_id)
+        .map_err(|_| JError::new(format!("Worker {worker_id} not found")))?;
+
+    match peer_scope {
+        PeerScope::WorkerId(worker_id) => {
+            let worker_creator = workers.get_worker_creator(worker_id)?;
+            let is_worker_creator = params.init_peer_id == worker_creator;
+            if !is_worker_creator
+                && !scopes.is_host(params.init_peer_id)
+                && !scopes.is_management(params.init_peer_id)
+            {
+                return Err(JError::new(format!("Worker {worker_id} can be removed only by worker creator {worker_creator}, host or a host manager")));
+            }
+            workers.remove_worker(worker_id).await?;
+            let spells: Vec<_> = spell_storage.get_registered_spells_by(peer_scope);
+            for s in spells {
+                remove_spell(
+                    &params.id,
+                    &spell_storage,
+                    &services,
+                    &spell_event_bus_api,
+                    &s,
+                    peer_scope,
+                    worker_id.into(),
+                )
+                .map_err(|e| {
+                    JError::new(format!(
+                        "Worker removing failed due to spell removing failure: {e}"
+                    ))
+                })
+                .await?;
+            }
+            services.remove_services(peer_scope).await?;
+        }
+        PeerScope::Host => return Err(JError::new(format!("Worker {worker_id} can be removed"))),
+    };
+
+    Ok(())
+}
+
+pub(crate) fn worker_list(workers: Arc<Workers>) -> Result<JValue, JError> {
+    Ok(JValue::Array(
+        workers
+            .list_workers()
+            .into_iter()
+            .map(|p| JValue::String(p.to_string()))
+            .collect(),
+    ))
+}
+
+pub(crate) async fn deactivate_deal(
+    args: Args,
+    params: ParticleParams,
+    workers: Arc<Workers>,
+    scopes: PeerScopes,
+    spell_storage: SpellStorage,
+    spell_event_bus_api: SpellEventBusApi,
+    spell_service_api: SpellServiceApi,
+) -> Result<(), JError> {
+    let mut args = args.function_args.into_iter();
+    let deal_id: String = Args::next("deal_id", &mut args)?;
+
+    if !scopes.is_management(params.init_peer_id) && !scopes.is_host(params.init_peer_id) {
+        return Err(JError::new(
+            "Only management or host peer can deactivate deal",
+        ));
+    }
+
+    let worker_id = workers.get_worker_id(deal_id.into())?;
+
+    if !workers.is_worker_active(worker_id) {
+        return Err(JError::new("Deal has already been deactivated"));
+    }
+
+    let spells = spell_storage.get_registered_spells_by(PeerScope::WorkerId(worker_id));
+
+    for spell_id in spells.into_iter() {
+        spell_event_bus_api
+            .unsubscribe(spell_id.clone())
+            .map_err(|e| {
+                JError::new(format!(
+                    "Deal deactivation failed due to failure to stop spell {spell_id} : {e}"
+                ))
+            })
+            .await?;
+
+        spell_service_api
+            .set_trigger_config(
+                CallParams::local(
+                    PeerScope::WorkerId(worker_id),
+                    spell_id.clone(),
+                    worker_id.into(),
+                    Duration::from_millis(params.ttl as u64),
+                ),
+                TriggerConfig::default(),
+            )
+            .await
+            .map_err(|e| {
+                JError::new(format!(
+                    "Deal deactivation failed due to failure to stop spell {spell_id} : {e}"
+                ))
+            })?;
+    }
+
+    workers.deactivate_worker(worker_id).await?;
+
+    Ok(())
+}
+
+pub(crate) async fn activate_deal(
+    args: Args,
+    params: ParticleParams,
+    workers: Arc<Workers>,
+    scopes: PeerScopes,
+    services: ParticleAppServices,
+    spell_event_bus_api: SpellEventBusApi,
+    spell_service_api: SpellServiceApi,
+    worker_period_sec: u32,
+) -> Result<(), JError> {
+    let mut args = args.function_args.into_iter();
+    let deal_id: String = Args::next("deal_id", &mut args)?;
+
+    if !scopes.is_management(params.init_peer_id) && !scopes.is_host(params.init_peer_id) {
+        return Err(JError::new(
+            "Only management or host peer can activate deal",
+        ));
+    }
+
+    let worker_id = workers.get_worker_id(deal_id.into())?;
+
+    if workers.is_worker_active(worker_id) {
+        return Err(JError::new("Deal has already been activated"));
+    }
+
+    let installation_spell_id = services
+        .resolve_alias(
+            PeerScope::WorkerId(worker_id),
+            "worker-spell".to_string(),
+            &params.id,
+        )
+        .await?;
+
+    // same as in decider-distro
+    let mut worker_config = TriggerConfig::default();
+    worker_config.clock.start_sec = 1;
+    worker_config.clock.period_sec = worker_period_sec;
+
+    spell_service_api
+        .set_trigger_config(
+            CallParams::local(
+                PeerScope::WorkerId(worker_id),
+                installation_spell_id.clone(),
+                worker_id.into(),
+                Duration::from_millis(params.ttl as u64),
+            ),
+            worker_config.clone(),
+        )
+        .await?;
+
+    let trigger_config = from_user_config(&worker_config)?.ok_or(JError::new(
+        "Deal activation failed due to failure to parse trigger config",
+    ))?;
+
+    spell_event_bus_api
+        .subscribe(installation_spell_id, trigger_config)
+        .map_err(|e| {
+            JError::new(format!(
+                "Deal activation failed due to failure to start worker spell : {e}"
+            ))
+        })
+        .await?;
+
+    workers.activate_worker(worker_id).await?;
+    Ok(())
+}
+
+pub(crate) fn is_deal_active(args: Args, workers: Arc<Workers>) -> Result<JValue, JError> {
+    let mut args = args.function_args.into_iter();
+    let deal_id: String = Args::next("deal_id", &mut args)?;
+    let worker_id = workers.get_worker_id(deal_id.into())?;
+    let is_active = workers.is_worker_active(worker_id);
+    Ok(JValue::Bool(is_active))
+}
+
\ No newline at end of file diff --git a/src/spell_event_bus/api.rs.html b/src/spell_event_bus/api.rs.html new file mode 100644 index 0000000000..4f101c37ac --- /dev/null +++ b/src/spell_event_bus/api.rs.html @@ -0,0 +1,405 @@ +api.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use connection_pool::LifecycleEvent;
+use fluence_libp2p::PeerId;
+use serde::{Deserialize, Serialize};
+use std::pin::Pin;
+use thiserror::Error;
+use tokio::sync::{mpsc, oneshot};
+use types::peer_id;
+
+pub use crate::config::*;
+
+pub type SpellId = String;
+
+#[derive(Debug, Clone)]
+pub struct TriggerEvent {
+    pub spell_id: SpellId,
+    pub info: TriggerInfo,
+}
+
+#[derive(Clone, Debug)]
+pub enum TriggerInfo {
+    /// Event is triggered by timer.
+    Timer(TimerEvent),
+    /// Event is triggered by a peer event.
+    Peer(PeerEvent),
+}
+
+#[derive(Clone, Debug, Serialize, Deserialize)]
+pub struct TimerEvent {
+    pub timestamp: u64,
+}
+
+#[derive(Clone, Debug, Serialize, Deserialize)]
+/// Event is triggered by connection pool event
+pub struct PeerEvent {
+    #[serde(
+        serialize_with = "peer_id::serde::serialize",
+        deserialize_with = "peer_id::serde::deserialize"
+    )]
+    pub peer_id: PeerId,
+    pub connected: bool,
+}
+
+impl From<LifecycleEvent> for PeerEvent {
+    fn from(e: LifecycleEvent) -> Self {
+        match e {
+            LifecycleEvent::Connected(c) => Self {
+                peer_id: c.peer_id,
+                connected: true,
+            },
+            LifecycleEvent::Disconnected(c) => Self {
+                peer_id: c.peer_id,
+                connected: false,
+            },
+        }
+    }
+}
+
+impl PeerEvent {
+    pub(crate) fn get_type(&self) -> PeerEventType {
+        if self.connected {
+            PeerEventType::Connected
+        } else {
+            PeerEventType::Disconnected
+        }
+    }
+}
+
+/// Types of events that are available for subscription.
+#[derive(PartialEq, Eq, Hash, Debug, Clone)]
+pub enum PeerEventType {
+    Connected,
+    Disconnected,
+}
+
+#[derive(Debug, Serialize, Deserialize)]
+pub struct TriggerInfoAqua {
+    // Vec is a representation for Aqua optional values. This Vec always holds at most 1 element.
+    timer: Vec<TimerEvent>,
+    // Vec is a representation for Aqua optional values. This Vec always holds at most 1 element.
+    peer: Vec<PeerEvent>,
+}
+
+impl From<TriggerInfo> for TriggerInfoAqua {
+    fn from(i: TriggerInfo) -> Self {
+        match i {
+            TriggerInfo::Timer(t) => Self {
+                timer: vec![t],
+                peer: vec![], // Empty Vec corresponds to Aqua nil
+            },
+            TriggerInfo::Peer(p) => Self {
+                timer: vec![], // Empty Vec corresponds to Aqua nil
+                peer: vec![p],
+            },
+        }
+    }
+}
+
+impl From<TriggerInfoAqua> for TriggerInfo {
+    fn from(i: TriggerInfoAqua) -> Self {
+        match (i.timer.first(), i.peer.first()) {
+            (Some(t), None) => Self::Timer(t.clone()),
+            (None, Some(p)) => Self::Peer(p.clone()),
+            _ => unreachable!("TriggerInfoAqua should always have either timer or peer event"),
+        }
+    }
+}
+
+#[derive(Debug)]
+pub(crate) struct Command {
+    pub(crate) action: Action,
+    pub(crate) reply: oneshot::Sender<()>,
+}
+
+#[derive(Debug, Clone)]
+pub enum Action {
+    /// Subscribe a spell to a list of triggers
+    Subscribe(SpellId, SpellTriggerConfigs),
+    /// Remove all subscriptions of a spell
+    Unsubscribe(SpellId),
+    /// Actually start the scheduling
+    Start,
+}
+
+#[derive(Error, Debug)]
+pub enum EventBusError {
+    #[error("can't send a command `{action:?}` to spell-event-bus: {reason}")]
+    SendError {
+        action: Action,
+        reason: Pin<Box<dyn std::error::Error + Send>>,
+    },
+    #[error("can't receive a message from the bus on behalf of a command {0:?}: sending end is probably dropped")]
+    ReplyError(Action),
+}
+
+#[derive(Clone)]
+pub struct SpellEventBusApi {
+    pub(crate) send_cmd_channel: mpsc::UnboundedSender<Command>,
+}
+
+impl std::fmt::Debug for SpellEventBusApi {
+    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+        f.debug_struct("SpellEventBusApi").finish()
+    }
+}
+
+impl SpellEventBusApi {
+    async fn send(&self, action: Action) -> Result<(), EventBusError> {
+        let (send, recv) = oneshot::channel();
+        let command = Command {
+            action: action.clone(),
+            reply: send,
+        };
+        self.send_cmd_channel
+            .send(command)
+            .map_err(|e| EventBusError::SendError {
+                action: action.clone(),
+                reason: Box::pin(e),
+            })?;
+
+        recv.await.map_err(|_| EventBusError::ReplyError(action))?;
+        Ok(())
+    }
+
+    /// Subscribe a spell to a list of events
+    /// The spell can be subscribed multiple times to different events, but to only one timer.
+    /// Note that multiple subscriptions to the same event will result in multiple events of the same type being sent.
+    pub async fn subscribe(
+        &self,
+        spell_id: SpellId,
+        config: SpellTriggerConfigs,
+    ) -> Result<(), EventBusError> {
+        self.send(Action::Subscribe(spell_id, config)).await
+    }
+
+    /// Unsubscribe a spell from all events.
+    pub async fn unsubscribe(&self, spell_id: SpellId) -> Result<(), EventBusError> {
+        self.send(Action::Unsubscribe(spell_id)).await
+    }
+
+    pub async fn start_scheduling(&self) -> Result<(), EventBusError> {
+        self.send(Action::Start).await
+    }
+}
+
\ No newline at end of file diff --git a/src/spell_event_bus/bus.rs.html b/src/spell_event_bus/bus.rs.html new file mode 100644 index 0000000000..a3a15c92ff --- /dev/null +++ b/src/spell_event_bus/bus.rs.html @@ -0,0 +1,1393 @@ +bus.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use crate::api::*;
+use crate::config::{SpellTriggerConfigs, TriggerConfig};
+use futures::stream::BoxStream;
+use futures::StreamExt;
+use futures::{future, FutureExt};
+use peer_metrics::SpellMetrics;
+use std::cmp::Ordering;
+use std::collections::{BinaryHeap, HashMap, HashSet};
+use std::pin::Pin;
+use std::sync::Arc;
+use std::time::{Duration, Instant, SystemTime, UNIX_EPOCH};
+use thiserror::Error;
+use tokio::select;
+use tokio::sync::mpsc;
+use tokio::task;
+use tracing::Instrument;
+
+struct PeerEventSubscribers {
+    subscribers: HashMap<PeerEventType, Vec<Arc<SpellId>>>,
+}
+
+impl PeerEventSubscribers {
+    fn new() -> Self {
+        Self {
+            subscribers: HashMap::new(),
+        }
+    }
+
+    fn add(&mut self, spell_id: Arc<SpellId>, event_types: Vec<PeerEventType>) {
+        for event_type in event_types {
+            self.subscribers
+                .entry(event_type)
+                .or_default()
+                .push(spell_id.clone());
+        }
+    }
+
+    fn get(&self, event_type: &PeerEventType) -> impl Iterator<Item = &Arc<SpellId>> {
+        self.subscribers
+            .get(event_type)
+            .map(|x| x.iter())
+            .unwrap_or_else(|| [].iter())
+    }
+
+    /// Returns true if spell_id was removed from subscribers
+    fn remove(&mut self, spell_id: &SpellId) {
+        for subscribers in self.subscribers.values_mut() {
+            subscribers.retain(|sub_id| **sub_id != *spell_id);
+        }
+    }
+}
+
+#[derive(Debug, PartialEq, Eq)]
+struct Periodic {
+    id: Arc<SpellId>,
+    period: Duration,
+    end_at: Option<Instant>,
+}
+
+#[derive(Debug, PartialEq, Eq)]
+struct Scheduled {
+    data: Periodic,
+    /// the time after which we need to notify the subscriber
+    run_at: Instant,
+}
+
+impl Scheduled {
+    fn new(data: Periodic, run_at: Instant) -> Self {
+        Self { data, run_at }
+    }
+
+    /// Reschedule a spell to `now` + `period`.
+    /// Return `None` if the spell is supposed to end at the given time `end_at`.
+    fn at(data: Periodic, now: Instant) -> Option<Scheduled> {
+        // We do checked_add here only to avoid a mere possibility of internal panic.
+        let run_at = now.checked_add(data.period)?;
+        if data.end_at.map(|end_at| end_at <= run_at).unwrap_or(false) {
+            return None;
+        }
+
+        Some(Scheduled { data, run_at })
+    }
+}
+
+// Implement it this way for min heap
+impl Ord for Scheduled {
+    fn cmp(&self, other: &Self) -> Ordering {
+        other.run_at.cmp(&self.run_at)
+    }
+}
+
+impl PartialOrd for Scheduled {
+    fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
+        Some(self.cmp(other))
+    }
+}
+
+struct SubscribersState {
+    subscribers: PeerEventSubscribers,
+    scheduled: BinaryHeap<Scheduled>,
+    active: HashSet<Arc<SpellId>>,
+}
+
+impl SubscribersState {
+    fn new() -> Self {
+        Self {
+            subscribers: PeerEventSubscribers::new(),
+            scheduled: BinaryHeap::new(),
+            active: HashSet::new(),
+        }
+    }
+
+    fn subscribe(&mut self, spell_id: SpellId, config: &SpellTriggerConfigs) {
+        let spell_id = Arc::new(spell_id);
+        for config in &config.triggers {
+            match config {
+                TriggerConfig::Timer(config) => {
+                    let periodic = Periodic {
+                        id: spell_id.clone(),
+                        period: config.period,
+                        end_at: config.end_at,
+                    };
+                    let scheduled = Scheduled::new(periodic, config.start_at);
+                    self.scheduled.push(scheduled);
+                }
+                TriggerConfig::PeerEvent(config) => {
+                    self.subscribers
+                        .add(spell_id.clone(), config.events.clone());
+                }
+            }
+        }
+        self.active.insert(spell_id);
+    }
+
+    /// Returns true if spell_id was removed from subscribers
+    fn unsubscribe(&mut self, spell_id: &SpellId) {
+        self.active.remove(spell_id);
+        self.scheduled
+            .retain(|scheduled| *scheduled.data.id != *spell_id);
+        self.subscribers.remove(spell_id);
+    }
+
+    fn subscribers(&self, event_type: &PeerEventType) -> impl Iterator<Item = &Arc<SpellId>> {
+        self.subscribers.get(event_type)
+    }
+
+    fn next_scheduled_in(&self, now: Instant) -> Option<Duration> {
+        self.scheduled
+            .peek()
+            .map(|scheduled| scheduled.run_at.saturating_duration_since(now))
+    }
+}
+
+#[derive(Debug, Error)]
+enum BusInternalError {
+    // oneshot::Sender doesn't provide the reasons why it failed to send a message
+    #[error(
+        "failed to send a result of a command execution ({0:?}): receiving end probably dropped"
+    )]
+    Reply(Action),
+    #[error("failed to send notification about a peer event {1:?} to spell {0}: {2}")]
+    SendEvent(SpellId, TriggerInfo, Pin<Box<dyn std::error::Error>>),
+}
+
+pub struct SpellEventBus {
+    /// List of events producers.
+    sources: Vec<BoxStream<'static, PeerEvent>>,
+    /// API connections
+    recv_cmd_channel: mpsc::UnboundedReceiver<Command>,
+    /// Notify when trigger happened
+    send_events: mpsc::UnboundedSender<TriggerEvent>,
+    /// Spell metrics
+    spell_metrics: Option<SpellMetrics>,
+}
+
+impl SpellEventBus {
+    pub fn new(
+        spell_metrics: Option<SpellMetrics>,
+        sources: Vec<BoxStream<'static, PeerEvent>>,
+    ) -> (
+        Self,
+        SpellEventBusApi,
+        mpsc::UnboundedReceiver<TriggerEvent>,
+    ) {
+        let (send_cmd_channel, recv_cmd_channel) = mpsc::unbounded_channel();
+        let api = SpellEventBusApi { send_cmd_channel };
+
+        let (send_events, recv_events) = mpsc::unbounded_channel();
+
+        let this = Self {
+            sources,
+            recv_cmd_channel,
+            send_events,
+            spell_metrics,
+        };
+        (this, api, recv_events)
+    }
+
+    pub fn start(self) -> task::JoinHandle<()> {
+        task::Builder::new()
+            .name("spell-bus")
+            .spawn(self.run().in_current_span())
+            .expect("Could not spawn task")
+    }
+
+    async fn run(mut self) {
+        let send_events = self.send_events;
+
+        let sources = self
+            .sources
+            .into_iter()
+            .map(|source| source.fuse())
+            .collect::<Vec<_>>();
+        let mut sources_channel = futures::stream::select_all(sources);
+
+        let mut state = SubscribersState::new();
+        let mut is_started = false;
+        loop {
+            let now = Instant::now();
+
+            // Wait until the next spell should be awaken. If there are no spells wait for unreachable amount of time,
+            // which means that timer won't be triggered at all. We overwrite the timer each loop (aka after each event)
+            // to ensure that we don't miss newly scheduled spells.
+            let timer_task = {
+                let next_scheduled_in = state.next_scheduled_in(now);
+                if next_scheduled_in.is_some() {
+                    log::trace!("Next time trigger will execute in: {:?}", next_scheduled_in);
+                    log::trace!("Scheduled triggers: {:?}", state.scheduled);
+                }
+                next_scheduled_in
+                    .map(|duration| {
+                        if duration > Duration::ZERO {
+                            tokio::time::sleep(duration).boxed()
+                        } else {
+                            future::ready(()).boxed()
+                        }
+                    })
+                    .unwrap_or_else(|| future::pending::<()>().boxed())
+            };
+
+            let result: Result<(), BusInternalError> = try {
+                select! {
+                    Some(command) = self.recv_cmd_channel.recv() => {
+                        let Command { action, reply } = command;
+                        match &action {
+                            Action::Subscribe(spell_id, config) => {
+                                log::trace!("Subscribe {spell_id} to {:?}", config);
+                                if state.active.contains(spell_id) {
+                                    log::warn!(
+                                        "spell {spell_id} is already running; re-subscribe to the new configuration"
+                                    );
+                                    state.unsubscribe(spell_id);
+                                }
+
+                                state.subscribe(spell_id.clone(), config);
+                            },
+                            Action::Unsubscribe(spell_id) => {
+                                log::trace!("Unsubscribe {spell_id}");
+                                state.unsubscribe(spell_id);
+                            },
+                            Action::Start => {
+                                log::trace!("Start the bus");
+                                is_started = true;
+                            }
+                        };
+                        reply.send(()).map_err(|_| {
+                            BusInternalError::Reply(action)
+                        })?;
+                    },
+                    Some(event) = sources_channel.next(), if is_started => {
+                        for spell_id in state.subscribers(&event.get_type()) {
+                            let event = TriggerInfo::Peer(event.clone());
+                            Self::trigger_spell(&send_events, spell_id, event)?;
+                        }
+                    },
+                    _ = timer_task, if is_started => {
+                        // The timer is triggered only if there are some spells to be awaken.
+                        if let Some(scheduled_spell) = state.scheduled.pop() {
+                            log::trace!("Execute: {:?}", scheduled_spell);
+                            let timestamp = SystemTime::now().duration_since(UNIX_EPOCH).expect("Time went backwards").as_secs();
+                            let spell_id = scheduled_spell.data.id.clone();
+                            Self::trigger_spell(&send_events, &scheduled_spell.data.id, TriggerInfo::Timer(TimerEvent{ timestamp }))?;
+                            // Do not reschedule the spell otherwise.
+                            if let Some(rescheduled) = Scheduled::at(scheduled_spell.data, Instant::now()) {
+                                log::trace!("Reschedule: {:?}", rescheduled);
+                                state.scheduled.push(rescheduled);
+                            } else {
+                                state.active.remove(&spell_id);
+                                if let Some(m) = &self.spell_metrics {
+                                    m.observe_finished_spell();
+                                }
+                            }
+                        }
+                    },
+                }
+            };
+            if let Err(e) = result {
+                log::warn!("Error in spell event bus loop: {}", e);
+            }
+        }
+    }
+
+    #[allow(clippy::result_large_err)]
+    fn trigger_spell(
+        send_events: &mpsc::UnboundedSender<TriggerEvent>,
+        id: &Arc<SpellId>,
+        event: TriggerInfo,
+    ) -> Result<(), BusInternalError> {
+        send_events
+            .send(TriggerEvent {
+                spell_id: (**id).clone(),
+                info: event.clone(),
+            })
+            .map_err(|e| BusInternalError::SendEvent((**id).clone(), event, Box::pin(e)))?;
+        Ok(())
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use crate::bus::*;
+    use connection_pool::LifecycleEvent;
+    use futures::StreamExt;
+    use libp2p::PeerId;
+    use maplit::hashmap;
+    use particle_protocol::Contact;
+    use std::assert_matches::assert_matches;
+    use std::time::Duration;
+    use tokio::task::JoinHandle;
+    use tokio_stream::wrappers::UnboundedReceiverStream;
+
+    // Safely call teardown after test.
+    fn try_catch<T>(test: T, teardown: impl FnOnce())
+    where
+        T: FnOnce() + std::panic::UnwindSafe,
+    {
+        let err = std::panic::catch_unwind(test);
+
+        teardown();
+
+        if let Err(err) = err {
+            std::panic::resume_unwind(err);
+        }
+    }
+
+    fn send_connect_event(sender: &mpsc::UnboundedSender<PeerEvent>, peer_id: PeerId) {
+        sender
+            .send(PeerEvent::from(LifecycleEvent::Connected(Contact::new(
+                peer_id,
+                Vec::new(),
+            ))))
+            .unwrap();
+    }
+
+    fn emulate_connect(period: Duration) -> (mpsc::UnboundedReceiver<PeerEvent>, JoinHandle<()>) {
+        let (send, recv) = mpsc::unbounded_channel();
+        let hdl = task::Builder::new()
+            .name("emulate_connect")
+            .spawn(async move {
+                let mut task = Some(tokio::time::sleep(period).boxed());
+                loop {
+                    let task = task.as_mut().expect("Could not get task");
+                    select! {
+                        _ = task => {
+                            send_connect_event(&send, PeerId::random());
+                        }
+                    }
+                }
+            })
+            .expect("Could not spawn task");
+        (recv, hdl)
+    }
+
+    async fn subscribe_peer_event(
+        api: &SpellEventBusApi,
+        spell_id: SpellId,
+        events: Vec<PeerEventType>,
+    ) {
+        api.subscribe(
+            spell_id,
+            SpellTriggerConfigs {
+                triggers: vec![TriggerConfig::PeerEvent(PeerEventConfig { events })],
+            },
+        )
+        .await
+        .expect("Could not subscribe peer event");
+    }
+
+    async fn subscribe_timer(api: &SpellEventBusApi, spell_id: SpellId, config: TimerConfig) {
+        api.subscribe(
+            spell_id,
+            SpellTriggerConfigs {
+                triggers: vec![TriggerConfig::Timer(config)],
+            },
+        )
+        .await
+        .expect("Could not subscribe timer");
+    }
+
+    async fn subscribe_oneshot(api: &SpellEventBusApi, spell_id: SpellId) {
+        subscribe_timer(api, spell_id, TimerConfig::oneshot(Instant::now())).await;
+    }
+
+    async fn subscribe_periodic_endless(
+        api: &SpellEventBusApi,
+        spell_id: SpellId,
+        period: Duration,
+    ) {
+        subscribe_timer(
+            api,
+            spell_id,
+            TimerConfig::periodic(period, Instant::now(), None),
+        )
+        .await;
+    }
+
+    #[tokio::test]
+    async fn test_subscribe_one() {
+        let (bus, api, event_receiver) = SpellEventBus::new(None, vec![]);
+        let bus = bus.start();
+        let _ = api.start_scheduling().await;
+        let event_stream = UnboundedReceiverStream::new(event_receiver);
+
+        let spell1_id = "spell1".to_string();
+        subscribe_periodic_endless(&api, spell1_id.clone(), Duration::from_millis(5)).await;
+
+        let events = event_stream.take(5).collect::<Vec<TriggerEvent>>().await;
+        try_catch(
+            || {
+                assert_eq!(events.len(), 5);
+                for event in events.into_iter() {
+                    assert_eq!(event.spell_id, spell1_id.clone(),);
+                    assert_matches!(event.info, TriggerInfo::Timer(_));
+                }
+            },
+            || {
+                bus.abort();
+            },
+        );
+    }
+
+    #[tokio::test]
+    async fn test_subscribe_many() {
+        let (bus, api, event_receiver) = SpellEventBus::new(None, vec![]);
+        let bus = bus.start();
+        let _ = api.start_scheduling().await;
+        let event_stream = UnboundedReceiverStream::new(event_receiver);
+
+        let mut spell_ids = hashmap![
+            "spell1".to_string() => 0,
+            "spell2".to_string() => 0,
+            "spell3".to_string() => 0,
+        ];
+        for spell_id in spell_ids.keys() {
+            subscribe_periodic_endless(&api, spell_id.clone(), Duration::from_millis(5)).await;
+        }
+
+        let events = event_stream.take(10).collect::<Vec<TriggerEvent>>().await;
+        try_catch(
+            move || {
+                assert_eq!(events.len(), 10);
+                for event in events.into_iter() {
+                    spell_ids.entry(event.spell_id).and_modify(|e| *e += 1);
+                    assert_matches!(event.info, TriggerInfo::Timer(_));
+                }
+                for count in spell_ids.values() {
+                    assert_ne!(*count, 0);
+                }
+            },
+            || {
+                bus.abort();
+            },
+        );
+    }
+
+    #[tokio::test]
+    async fn test_subscribe_oneshot() {
+        let (bus, api, event_receiver) = SpellEventBus::new(None, vec![]);
+        let bus = bus.start();
+        let _ = api.start_scheduling().await;
+        let event_stream = UnboundedReceiverStream::new(event_receiver);
+        let spell1_id = "spell1".to_string();
+        subscribe_oneshot(&api, spell1_id.clone()).await;
+
+        let spell2_id = "spell2".to_string();
+        subscribe_periodic_endless(&api, spell2_id.clone(), Duration::from_millis(5)).await;
+
+        let events = event_stream.take(5).collect::<Vec<TriggerEvent>>().await;
+
+        let mut counts = HashMap::new();
+        counts.insert(spell1_id.clone(), 0);
+        counts.insert(spell2_id, 0);
+        for event in events.into_iter() {
+            counts.entry(event.spell_id).and_modify(|e| *e += 1);
+        }
+        try_catch(
+            || {
+                assert_eq!(*counts.get(&spell1_id).unwrap(), 1);
+            },
+            || {
+                bus.abort();
+            },
+        );
+    }
+
+    #[tokio::test]
+    async fn test_subscribe_connect() {
+        let (send, recv) = mpsc::unbounded_channel();
+        let recv = UnboundedReceiverStream::new(recv).boxed();
+        let (bus, api, event_receiver) = SpellEventBus::new(None, vec![recv]);
+        let mut event_stream = UnboundedReceiverStream::new(event_receiver);
+        let bus = bus.start();
+        let _ = api.start_scheduling().await;
+
+        let spell1_id = "spell1".to_string();
+        subscribe_peer_event(&api, spell1_id.clone(), vec![PeerEventType::Connected]).await;
+
+        let peer_id = PeerId::random();
+        send_connect_event(&send, peer_id);
+
+        let event = event_stream.next().await.unwrap();
+        try_catch(
+            || {
+                assert_eq!(event.spell_id, spell1_id.clone());
+                let expected = peer_id;
+                assert_matches!(
+                    event.info,
+                    TriggerInfo::Peer(p) if p.peer_id == expected
+                );
+            },
+            || {
+                bus.abort();
+            },
+        );
+    }
+
+    #[tokio::test]
+    async fn test_unsubscribe() {
+        let (send, recv) = mpsc::unbounded_channel();
+        let recv = UnboundedReceiverStream::new(recv).boxed();
+        let (bus, api, mut event_receiver) = SpellEventBus::new(None, vec![recv]);
+        let bus = bus.start();
+        let _ = api.start_scheduling().await;
+
+        let spell1_id = "spell1".to_string();
+        subscribe_peer_event(&api, spell1_id.clone(), vec![PeerEventType::Connected]).await;
+
+        let spell2_id = "spell2".to_string();
+        subscribe_peer_event(&api, spell2_id.clone(), vec![PeerEventType::Connected]).await;
+        send_connect_event(&send, PeerId::random());
+
+        let triggered_spell_a = event_receiver.recv().await.unwrap().spell_id;
+        let triggered_spell_b = event_receiver.recv().await.unwrap().spell_id;
+        let triggered = vec![triggered_spell_a, triggered_spell_b];
+        assert!(triggered.contains(&spell1_id), "spell_1 must be triggered");
+        assert!(triggered.contains(&spell2_id), "spell_2 must be triggered");
+
+        api.unsubscribe(spell2_id).await.unwrap();
+        send_connect_event(&send, PeerId::random());
+        let triggered_spell_1 = event_receiver.recv().await.unwrap().spell_id;
+        assert_eq!(spell1_id, triggered_spell_1);
+        let result = event_receiver.try_recv();
+        assert!(result.is_err(), "no other spells must be triggered");
+        bus.abort();
+    }
+
+    #[tokio::test]
+    async fn test_subscribe_many_spells_with_diff_event_types() {
+        let (recv, hdl) = emulate_connect(Duration::from_millis(10));
+        let recv = UnboundedReceiverStream::new(recv).boxed();
+        let (bus, api, event_receiver) = SpellEventBus::new(None, vec![recv]);
+        let event_stream = UnboundedReceiverStream::new(event_receiver);
+        let bus = bus.start();
+        let _ = api.start_scheduling().await;
+
+        let spell1_id = "spell1".to_string();
+        subscribe_peer_event(&api, spell1_id.clone(), vec![PeerEventType::Connected]).await;
+
+        let spell2_id = "spell2".to_string();
+        subscribe_periodic_endless(&api, spell2_id.clone(), Duration::from_millis(5)).await;
+
+        let events = event_stream.take(10).collect::<Vec<TriggerEvent>>().await;
+        try_catch(
+            || {
+                for event in events.into_iter() {
+                    assert!(event.spell_id == spell1_id || event.spell_id == spell2_id);
+                    if event.spell_id == spell1_id {
+                        assert_matches!(
+                            event.info,
+                           TriggerInfo::Peer(p) if p.connected
+                        );
+                    } else if event.spell_id == spell2_id {
+                        assert_matches!(event.info, TriggerInfo::Timer(_));
+                    }
+                }
+            },
+            || {
+                hdl.abort();
+                bus.abort();
+            },
+        );
+    }
+
+    #[tokio::test]
+    async fn test_double_subscribe_before_run() {
+        //log_utils::enable_logs();
+        let (bus, api, event_receiver) = SpellEventBus::new(None, vec![]);
+        let bus = bus.start();
+        let mut event_stream = UnboundedReceiverStream::new(event_receiver).fuse();
+        let spell1_id = "spell1".to_string();
+        subscribe_oneshot(&api, spell1_id.clone()).await;
+        subscribe_oneshot(&api, spell1_id.clone()).await;
+        let _ = api.start_scheduling().await;
+
+        let mut events = Vec::new();
+        // try to receive events twice, we should never receive the second event
+        for _ in 0..2 {
+            let timer = tokio::time::sleep(Duration::from_millis(10));
+            select! {
+                event = event_stream.select_next_some() => {
+                    events.push(event);
+                },
+                _ = timer => { break; }
+            }
+        }
+
+        try_catch(
+            || {
+                assert_eq!(
+                    events.len(),
+                    1,
+                    "double subscription of the same spell on the same event isn't allowed"
+                );
+                assert_eq!(events[0].spell_id, spell1_id.clone(),);
+                assert_matches!(events[0].info, TriggerInfo::Timer(_));
+            },
+            || {
+                bus.abort();
+            },
+        );
+    }
+
+    #[tokio::test]
+    async fn test_resubscribing_same_spell() {
+        let (bus, api, mut event_receiver) = SpellEventBus::new(None, vec![]);
+        let bus = bus.start();
+        let _ = api.start_scheduling().await;
+        let spell1_id = "spell1".to_string();
+        subscribe_oneshot(&api, spell1_id.clone()).await;
+        let event1 = event_receiver.recv().await.unwrap();
+        subscribe_oneshot(&api, spell1_id.clone()).await;
+        let event2 = tokio::time::timeout(Duration::from_millis(10), event_receiver.recv()).await;
+
+        try_catch(
+            || {
+                assert_eq!(
+                    event1.spell_id,
+                    spell1_id.clone(),
+                    "first subscription isn't correct"
+                );
+                let event2 = event2.ok().flatten();
+                assert!(
+                    event2.is_some(),
+                    "the second subscription of the same spell is ignored"
+                );
+                assert_eq!(
+                    event2.unwrap().spell_id,
+                    spell1_id,
+                    "the second subscription isn't correct"
+                );
+            },
+            || {
+                bus.abort();
+            },
+        );
+    }
+}
+
\ No newline at end of file diff --git a/src/spell_event_bus/config.rs.html b/src/spell_event_bus/config.rs.html new file mode 100644 index 0000000000..9716b2c313 --- /dev/null +++ b/src/spell_event_bus/config.rs.html @@ -0,0 +1,719 @@ +config.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use crate::api::PeerEventType;
+use fluence_spell_dtos::trigger_config::{
+    ClockConfig, ConnectionPoolConfig, TriggerConfig as UserTriggerConfig,
+};
+use std::time::{Duration, Instant, SystemTime, UNIX_EPOCH};
+use thiserror::Error;
+
+const MAX_PERIOD_YEAR: u32 = 100;
+
+/// Max period is 100 years in secs: 60 sec * 60 min * 24 hours * 365 days * 100 years
+pub const MAX_PERIOD_SEC: u32 = 60 * 60 * 24 * 365 * MAX_PERIOD_YEAR;
+
+#[derive(Debug, Error)]
+pub enum ConfigError {
+    #[error(
+        "invalid config: period is too big. Max period is {} years (or approx {} seconds)",
+        MAX_PERIOD_YEAR,
+        MAX_PERIOD_SEC
+    )]
+    InvalidPeriod,
+    #[error("invalid config: end_sec is less than start_sec or in the past")]
+    InvalidEndSec,
+}
+
+/// Convert timestamp to std::time::Instant.
+/// Fails if the timestamp is in the past or overflow occurred which actually shouldn't happen.
+fn to_instant(timestamp: u64) -> Option<Instant> {
+    let target_time = UNIX_EPOCH.checked_add(Duration::from_secs(timestamp))?;
+    let duration = target_time.duration_since(SystemTime::now()).ok()?;
+    Instant::now().checked_add(duration)
+}
+
+/// Convert user-friendly config to event-bus-friendly config, validating it in the process.
+pub fn from_user_config(
+    user_config: &UserTriggerConfig,
+) -> Result<Option<SpellTriggerConfigs>, ConfigError> {
+    let mut triggers = Vec::new();
+
+    // ClockConfig is considered empty if `start_sec` is zero. In this case the content of other fields are ignored.
+    if user_config.clock.start_sec != 0 {
+        let timer_config = from_clock_config(&user_config.clock)?;
+        triggers.push(TriggerConfig::Timer(timer_config));
+    }
+
+    if let Some(peer_event_config) = from_connection_config(&user_config.connections) {
+        triggers.push(TriggerConfig::PeerEvent(peer_event_config));
+    }
+
+    let cfg = if !triggers.is_empty() {
+        Some(SpellTriggerConfigs { triggers })
+    } else {
+        None
+    };
+    Ok(cfg)
+}
+
+fn from_connection_config(connection_config: &ConnectionPoolConfig) -> Option<PeerEventConfig> {
+    let mut pool_events = Vec::with_capacity(2);
+    if connection_config.connect {
+        pool_events.push(PeerEventType::Connected);
+    }
+    if connection_config.disconnect {
+        pool_events.push(PeerEventType::Disconnected);
+    }
+    if pool_events.is_empty() {
+        None
+    } else {
+        Some(PeerEventConfig {
+            events: pool_events,
+        })
+    }
+}
+
+fn from_clock_config(clock: &ClockConfig) -> Result<TimerConfig, ConfigError> {
+    // Check the upper bound of period.
+    if clock.period_sec > MAX_PERIOD_SEC {
+        return Err(ConfigError::InvalidPeriod);
+    }
+
+    let end_at = if clock.end_sec == 0 {
+        // If `end_sec` is 0 then the spell will be triggered forever.
+        None
+    } else if clock.end_sec < clock.start_sec {
+        // The config is invalid `end_sec` is less than `start_sec`
+        return Err(ConfigError::InvalidEndSec);
+    } else {
+        // If conversion fails that means that `end_sec` is in the past.
+        match to_instant(clock.end_sec as u64) {
+            Some(end_at) => Some(end_at),
+            None => return Err(ConfigError::InvalidEndSec),
+        }
+    };
+
+    // Start now if the start time is in the past
+    let start_at = to_instant(clock.start_sec as u64).unwrap_or_else(Instant::now);
+
+    // If period is 0 then the timer will be triggered only once at start_sec and then stopped.
+    let config = if clock.period_sec == 0 {
+        // Should we ignore checking end_sec if period is 0?
+        TimerConfig::oneshot(start_at)
+    } else {
+        TimerConfig::periodic(
+            Duration::from_secs(clock.period_sec as u64),
+            start_at,
+            end_at,
+        )
+    };
+
+    Ok(config)
+}
+
+#[derive(Debug, Clone)]
+pub struct SpellTriggerConfigs {
+    pub(crate) triggers: Vec<TriggerConfig>,
+}
+
+impl SpellTriggerConfigs {
+    pub fn into_rescheduled(self) -> Option<Self> {
+        let new_triggers: Vec<TriggerConfig> = self
+            .triggers
+            .into_iter()
+            .filter_map(|trigger| trigger.into_rescheduled())
+            .collect::<_>();
+        if new_triggers.is_empty() {
+            None
+        } else {
+            Some(SpellTriggerConfigs {
+                triggers: new_triggers,
+            })
+        }
+    }
+}
+
+#[derive(Debug, Clone)]
+pub(crate) enum TriggerConfig {
+    Timer(TimerConfig),
+    PeerEvent(PeerEventConfig),
+}
+
+impl TriggerConfig {
+    pub fn into_rescheduled(self) -> Option<TriggerConfig> {
+        if let TriggerConfig::Timer(c) = self {
+            c.into_rescheduled().map(TriggerConfig::Timer)
+        } else {
+            // Peer events can't stop being relevant
+            Some(self)
+        }
+    }
+}
+
+#[derive(Debug, Clone)]
+pub(crate) struct TimerConfig {
+    pub(crate) period: Duration,
+    pub(crate) start_at: Instant,
+    pub(crate) end_at: Option<Instant>,
+}
+
+impl TimerConfig {
+    pub(crate) fn periodic(period: Duration, start_at: Instant, end_at: Option<Instant>) -> Self {
+        Self {
+            period,
+            start_at,
+            end_at,
+        }
+    }
+
+    pub(crate) fn oneshot(start_at: Instant) -> Self {
+        // We set `end_at` to `start_at` to make sure that on rescheduling the spell will be stopped.
+        // I'm not sure maybe it's better to move this piece of code inside the bus module.
+        Self {
+            period: Duration::ZERO,
+            start_at,
+            end_at: Some(start_at),
+        }
+    }
+
+    pub fn into_rescheduled(self) -> Option<TimerConfig> {
+        let now = std::time::Instant::now();
+        // Check that the spell is ended
+        if self.end_at.map(|end_at| end_at <= now).unwrap_or(false) {
+            return None;
+        }
+        // Check that the spell is oneshot and is ended
+        if self.period == Duration::ZERO && self.start_at < now {
+            return None;
+        }
+        Some(self)
+    }
+}
+
+#[derive(Debug, Clone)]
+pub(crate) struct PeerEventConfig {
+    pub(crate) events: Vec<PeerEventType>,
+}
+
+#[cfg(test)]
+mod trigger_config_tests {
+    use crate::api::PeerEventType;
+    use crate::config::{PeerEventConfig, SpellTriggerConfigs, TimerConfig, TriggerConfig};
+    use std::assert_matches::assert_matches;
+    use std::time::{Duration, Instant};
+
+    #[test]
+    fn test_reschedule_ok_periodic() {
+        let now = Instant::now();
+        // start in the past
+        let start_at = now - Duration::from_secs(120);
+        let timer_config = TimerConfig::periodic(Duration::from_secs(1), start_at, None);
+
+        let rescheduled = timer_config.into_rescheduled();
+        assert!(
+            rescheduled.is_some(),
+            "should be rescheduled since the config is periodic"
+        );
+    }
+
+    #[test]
+    fn test_reschedule_ok_periodic_end_future() {
+        let now = Instant::now();
+        // start in the past
+        let start_at = now - Duration::from_secs(120);
+        let end_at = now + Duration::from_secs(120);
+        let timer_config = TimerConfig::periodic(Duration::from_secs(1), start_at, Some(end_at));
+
+        let rescheduled = timer_config.into_rescheduled();
+        assert!(
+            rescheduled.is_some(),
+            "should be rescheduled since the config is periodic and doesn't end soon"
+        );
+    }
+
+    #[test]
+    fn test_reschedule_ok_oneshot_start_future() {
+        let now = Instant::now();
+        // start in the past
+        let start_at = now + Duration::from_secs(120);
+        let timer_config = TimerConfig::oneshot(start_at);
+
+        let rescheduled = timer_config.into_rescheduled();
+        assert!(
+            rescheduled.is_some(),
+            "should be rescheduled since the oneshot config start in the future"
+        );
+    }
+
+    #[test]
+    fn test_reschedule_fail_ended() {
+        let now = Instant::now();
+        // start in the past
+        let start_at = now - Duration::from_secs(120);
+        let timer_config = TimerConfig::oneshot(start_at);
+
+        let rescheduled = timer_config.into_rescheduled();
+        assert!(
+            rescheduled.is_none(),
+            "shouldn't be rescheduled since the config is ended"
+        );
+    }
+
+    #[test]
+    fn test_reschedule_fail_oneshot_executed() {
+        let now = Instant::now();
+        // start in the past
+        let start_at = now - Duration::from_secs(120);
+        let mut timer_config = TimerConfig::oneshot(start_at);
+        // oneshot config that ends in the future (not in use bth)
+        timer_config.end_at = Some(now + Duration::from_secs(120));
+
+        let rescheduled = timer_config.into_rescheduled();
+        assert!(
+            rescheduled.is_none(),
+            "shouldn't be rescheduled since the oneshot config already shot"
+        );
+    }
+
+    #[test]
+    fn test_peer_events() {
+        let peer_events = vec![PeerEventType::Connected, PeerEventType::Disconnected];
+        let peer_event_config = PeerEventConfig {
+            events: peer_events,
+        };
+        let trigger_config = TriggerConfig::PeerEvent(peer_event_config);
+        let rescheduled = trigger_config.into_rescheduled();
+        assert!(
+            rescheduled.is_some(),
+            "should be rescheduled since the config is periodic"
+        );
+    }
+
+    // Test that ended configs are filtered out after rescheduling
+    #[test]
+    fn test_both_types_ended() {
+        let peer_events = vec![PeerEventType::Connected, PeerEventType::Disconnected];
+        let peer_event_config = PeerEventConfig {
+            events: peer_events,
+        };
+        let peer_trigger_config = TriggerConfig::PeerEvent(peer_event_config);
+        let timer_config = TriggerConfig::Timer(TimerConfig::oneshot(
+            Instant::now() - Duration::from_secs(120),
+        ));
+        let spell_trigger_config = SpellTriggerConfigs {
+            triggers: vec![peer_trigger_config, timer_config],
+        };
+        let rescheduled = spell_trigger_config.into_rescheduled();
+        assert!(
+            rescheduled.is_some(),
+            "should be rescheduled since the config is periodic"
+        );
+        assert_matches!(
+            rescheduled.unwrap().triggers[..],
+            [TriggerConfig::PeerEvent(_)]
+        );
+    }
+
+    #[test]
+    fn test_both_types_ok() {
+        let peer_events = vec![PeerEventType::Connected, PeerEventType::Disconnected];
+        let peer_event_config = PeerEventConfig {
+            events: peer_events,
+        };
+        let peer_trigger_config = TriggerConfig::PeerEvent(peer_event_config);
+        let timer_config = TriggerConfig::Timer(TimerConfig::periodic(
+            Duration::from_secs(1),
+            Instant::now(),
+            None,
+        ));
+        let spell_trigger_config = SpellTriggerConfigs {
+            triggers: vec![peer_trigger_config, timer_config],
+        };
+        let rescheduled = spell_trigger_config.into_rescheduled();
+        assert!(
+            rescheduled.is_some(),
+            "should be rescheduled since the config is periodic"
+        );
+        assert_matches!(
+            rescheduled.unwrap().triggers[..],
+            [TriggerConfig::PeerEvent(_), TriggerConfig::Timer(_)]
+        );
+    }
+}
+
\ No newline at end of file diff --git a/src/spell_event_bus/lib.rs.html b/src/spell_event_bus/lib.rs.html new file mode 100644 index 0000000000..dde73e2bf0 --- /dev/null +++ b/src/spell_event_bus/lib.rs.html @@ -0,0 +1,51 @@ +lib.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+#![feature(assert_matches)]
+#![feature(try_blocks)]
+
+pub mod api;
+pub mod bus;
+mod config;
+
\ No newline at end of file diff --git a/src/spell_service_api/lib.rs.html b/src/spell_service_api/lib.rs.html new file mode 100644 index 0000000000..26afccd891 --- /dev/null +++ b/src/spell_service_api/lib.rs.html @@ -0,0 +1,1163 @@ +lib.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use fluence_libp2p::PeerId;
+use fluence_spell_dtos::trigger_config::{TriggerConfig, TriggerConfigValue};
+use fluence_spell_dtos::value::{ScriptValue, SpellValueT, StringValue, U32Value, UnitValue};
+use particle_execution::{FunctionOutcome, ParticleParams};
+use particle_services::{ParticleAppServices, PeerScope};
+use serde::de::DeserializeOwned;
+use serde_json::{json, Value};
+use std::time::Duration;
+
+#[derive(Debug, thiserror::Error)]
+pub enum CallError {
+    #[error("Spell {spell_id} not found (function {function_name})")]
+    ServiceNotFound {
+        spell_id: String,
+        function_name: String,
+    },
+    #[error("Call {spell_id}.{function_name} didn't return any result")]
+    EmptyResult {
+        spell_id: String,
+        function_name: String,
+    },
+    #[error("Error while calling {spell_id}.{function_name}: {reason}")]
+    OtherError {
+        spell_id: String,
+        function_name: String,
+        reason: String,
+    },
+    #[error("Result of the call {spell_id}.{function_name} cannot be parsed to the {target_type} type: {reason}")]
+    ResultParseError {
+        spell_id: String,
+        function_name: String,
+        target_type: &'static str,
+        reason: String,
+    },
+    #[error("Call {spell_id}.{function_name} executed with the error: {reason}")]
+    ExecutionError {
+        spell_id: String,
+        function_name: String,
+        reason: String,
+    },
+}
+
+struct Function {
+    name: &'static str,
+    args: Vec<Value>,
+}
+
+#[derive(Clone)]
+pub struct CallParams {
+    // Who initiated the call
+    init_peer_id: PeerId,
+    // Worker ID where the spell is installed
+    peer_scope: PeerScope,
+    // Spell ID
+    spell_id: String,
+    //
+    particle_id: Option<String>,
+    // Timeout for spell execution
+    ttl: Duration,
+}
+
+impl CallParams {
+    pub fn new(
+        init_peer_id: PeerId,
+        peer_scope: PeerScope,
+        spell_id: String,
+        particle_id: Option<String>,
+        ttl: Duration,
+    ) -> Self {
+        Self {
+            init_peer_id,
+            peer_scope,
+            spell_id,
+            particle_id,
+            ttl,
+        }
+    }
+    pub fn from(spell_id: String, params: ParticleParams) -> Self {
+        Self {
+            init_peer_id: params.init_peer_id,
+            peer_scope: params.peer_scope,
+            spell_id,
+            particle_id: Some(params.id),
+            ttl: Duration::from_millis(params.ttl as u64),
+        }
+    }
+
+    pub fn local(
+        peer_scope: PeerScope,
+        spell_id: String,
+        init_peer_id: PeerId,
+        ttl: Duration,
+    ) -> Self {
+        Self {
+            init_peer_id,
+            peer_scope,
+            spell_id,
+            particle_id: None,
+            ttl,
+        }
+    }
+}
+
+#[derive(Clone, Debug)]
+pub struct SpellServiceApi {
+    services: ParticleAppServices,
+}
+
+impl SpellServiceApi {
+    pub fn new(services: ParticleAppServices) -> Self {
+        Self { services }
+    }
+
+    pub async fn set_script(&self, params: CallParams, script: String) -> Result<(), CallError> {
+        let function = Function {
+            name: "set_script",
+            args: vec![json!(script)],
+        };
+        let _ = self.call::<UnitValue>(params, function).await?;
+        Ok(())
+    }
+
+    pub async fn get_script(&self, params: CallParams) -> Result<String, CallError> {
+        let function = Function {
+            name: "get_script",
+            args: vec![],
+        };
+        let script_value = self.call::<ScriptValue>(params, function).await?;
+        Ok(script_value.value)
+    }
+    pub async fn set_trigger_config(
+        &self,
+        params: CallParams,
+        config: TriggerConfig,
+    ) -> Result<(), CallError> {
+        let function = Function {
+            name: "set_trigger_config",
+            args: vec![json!(config)],
+        };
+        let _ = self.call::<UnitValue>(params, function).await?;
+        Ok(())
+    }
+
+    pub async fn get_trigger_config(&self, params: CallParams) -> Result<TriggerConfig, CallError> {
+        let function = Function {
+            name: "get_trigger_config",
+            args: vec![],
+        };
+        let trigger_config_value = self.call::<TriggerConfigValue>(params, function).await?;
+        Ok(trigger_config_value.config)
+    }
+
+    // TODO: use `Map<String, Value>` for init_data instead of `Value`
+    pub async fn update_kv(&self, params: CallParams, kv_data: Value) -> Result<(), CallError> {
+        let function = Function {
+            name: "set_json_fields",
+            args: vec![json!(kv_data.to_string())],
+        };
+        let _ = self.call::<UnitValue>(params, function).await?;
+        Ok(())
+    }
+
+    pub async fn get_string(
+        &self,
+        params: CallParams,
+        key: String,
+    ) -> Result<Option<String>, CallError> {
+        let function = Function {
+            name: "get_string",
+            args: vec![json!(key)],
+        };
+        let result = self.call::<StringValue>(params, function).await?;
+        Ok((!result.absent).then_some(result.value))
+    }
+
+    pub async fn set_string(
+        &self,
+        params: CallParams,
+        key: String,
+        value: String,
+    ) -> Result<(), CallError> {
+        let function = Function {
+            name: "set_string",
+            args: vec![json!(key), json!(value)],
+        };
+        let _ = self.call::<UnitValue>(params, function).await?;
+        Ok(())
+    }
+
+    /// Load the counter (how many times the spell was run)
+    pub async fn get_counter(&self, params: CallParams) -> Result<Option<u32>, CallError> {
+        let function = Function {
+            name: "get_u32",
+            args: vec![json!("hw_counter")],
+        };
+        let result = self.call::<U32Value>(params, function).await?;
+        Ok((!result.absent).then_some(result.value))
+    }
+
+    /// Update the counter (how many times the spell was run)
+    /// TODO: permission check here or not?
+    pub async fn set_counter(&self, params: CallParams, counter: u32) -> Result<(), CallError> {
+        let function = Function {
+            name: "set_u32",
+            args: vec![json!("hw_counter"), json!(counter)],
+        };
+        let _ = self.call::<UnitValue>(params, function).await?;
+
+        Ok(())
+    }
+
+    pub async fn set_trigger_event(
+        &self,
+        params: CallParams,
+        event: String,
+    ) -> Result<(), CallError> {
+        self.set_string(params, "hw_trigger".to_string(), event)
+            .await
+    }
+
+    pub async fn store_error(&self, params: CallParams, args: Vec<Value>) -> Result<(), CallError> {
+        let function = Function {
+            name: "store_error",
+            args,
+        };
+        let _ = self.call::<UnitValue>(params, function).await?;
+        Ok(())
+    }
+
+    async fn call<T>(&self, params: CallParams, function: Function) -> Result<T, CallError>
+    where
+        T: DeserializeOwned + SpellValueT,
+    {
+        use CallError::*;
+        let spell_id = params.spell_id;
+        let result = self
+            .services
+            .call_function(
+                params.peer_scope,
+                &spell_id,
+                function.name,
+                function.args,
+                params.particle_id,
+                params.init_peer_id,
+                params.ttl,
+            )
+            .await;
+        match result {
+            FunctionOutcome::NotDefined { .. } => Err(ServiceNotFound {
+                spell_id,
+                function_name: function.name.to_string(),
+            }),
+            FunctionOutcome::Empty => Err(EmptyResult {
+                spell_id,
+                function_name: function.name.to_string(),
+            }),
+            FunctionOutcome::Err(err) => Err(OtherError {
+                spell_id,
+                function_name: function.name.to_string(),
+                reason: err.to_string(),
+            }),
+            FunctionOutcome::Ok(value) => match serde_json::from_value::<T>(value) {
+                Ok(result) if result.is_success() => Ok(result),
+                Ok(result) => Err(ExecutionError {
+                    spell_id,
+                    function_name: function.name.to_string(),
+                    reason: result.take_error(),
+                }),
+                Err(e) => Err(ResultParseError {
+                    spell_id,
+                    function_name: function.name.to_string(),
+                    target_type: std::any::type_name::<T>(),
+                    reason: e.to_string(),
+                }),
+            },
+        }
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use std::collections::HashMap;
+    use std::path::{Path, PathBuf};
+    use std::sync::Arc;
+
+    use particle_services::{
+        ParticleAppServices, ParticleAppServicesConfig, PeerScope, ServiceType, WasmBackendConfig,
+    };
+
+    use fluence_libp2p::PeerId;
+    use libp2p_identity::Keypair;
+    use tempdir::TempDir;
+
+    use particle_modules::ModuleRepository;
+
+    use core_distributor::dummy::DummyCoreDistibutor;
+    use fluence_keypair::KeyPair;
+    use fluence_spell_dtos::trigger_config::TriggerConfig;
+    use fluence_spell_dtos::value::*;
+    use fs_utils::create_dirs;
+    use maplit::hashmap;
+    use serde_json::json;
+    use std::time::Duration;
+    use workers::{KeyStorage, PeerScopes, Workers, WorkersConfig};
+
+    use crate::{CallParams, SpellServiceApi};
+
+    const TTL: Duration = Duration::from_millis(100000);
+
+    fn create_pid() -> PeerId {
+        let keypair = Keypair::generate_ed25519();
+
+        PeerId::from(keypair.public())
+    }
+
+    async fn create_pas(
+        management_pid: PeerId,
+        base_dir: PathBuf,
+    ) -> (ParticleAppServices, ModuleRepository, PeerId) {
+        let persistent_dir = base_dir.join("persistent");
+        let ephemeral_dir = base_dir.join("ephemeral");
+
+        create_dirs(&[&persistent_dir, &ephemeral_dir]).unwrap();
+
+        let root_key_pair = Keypair::generate_ed25519();
+        let vault_dir = ephemeral_dir.join("vault");
+        let keypairs_dir = persistent_dir.join("keypairs");
+        let workers_dir = persistent_dir.join("workers");
+        let blueprint_dir = persistent_dir.join("blueprint");
+        let modules_dir = persistent_dir.join("modules");
+
+        create_dirs(&[&blueprint_dir, &modules_dir, &workers_dir]).unwrap();
+
+        let root_key_pair: KeyPair = root_key_pair.clone().into();
+
+        let key_storage = KeyStorage::from_path(keypairs_dir.clone(), root_key_pair.clone())
+            .await
+            .expect("Could not load key storage");
+
+        let key_storage = Arc::new(key_storage);
+
+        let core_distributor = DummyCoreDistibutor::new();
+        let core_distributor = Arc::new(core_distributor);
+
+        let thread_pinner = Arc::new(test_utils::pinning::DUMMY);
+
+        let scope = PeerScopes::new(
+            root_key_pair.get_peer_id(),
+            management_pid,
+            root_key_pair.get_peer_id(),
+            key_storage.clone(),
+        );
+        let workers_config = WorkersConfig::new(32, None);
+
+        let (workers, _worker_events) = Workers::from_path(
+            workers_config,
+            workers_dir.clone(),
+            key_storage,
+            core_distributor,
+            thread_pinner,
+        )
+        .await
+        .expect("Could not load worker registry");
+
+        let workers = Arc::new(workers);
+
+        let service_memory_limit = server_config::default_service_memory_limit();
+        let wasm_backend_config = WasmBackendConfig::default();
+        let config = ParticleAppServicesConfig::new(
+            root_key_pair.get_peer_id(),
+            persistent_dir,
+            ephemeral_dir,
+            vault_dir,
+            HashMap::new(),
+            management_pid,
+            root_key_pair.get_peer_id(),
+            Some(service_memory_limit),
+            wasm_backend_config,
+        )
+        .unwrap();
+
+        let repo = ModuleRepository::new(&modules_dir, &blueprint_dir, Default::default());
+
+        let pas = ParticleAppServices::new(
+            config,
+            repo.clone(),
+            None,
+            None,
+            workers.clone(),
+            scope.clone(),
+        )
+        .expect("Unable to create ParticleAppServices");
+
+        (pas, repo, root_key_pair.get_peer_id())
+    }
+
+    async fn create_spell(
+        pas: &ParticleAppServices,
+        blueprint_id: String,
+        owner_id: PeerId,
+    ) -> Result<String, String> {
+        pas.create_service(PeerScope::Host, ServiceType::Spell, blueprint_id, owner_id)
+            .await
+            .map_err(|e| e.to_string())
+    }
+
+    async fn setup() -> (SpellServiceApi, CallParams) {
+        let base_dir = TempDir::new("test3").unwrap();
+        let management_pid = create_pid();
+        let (pas, repo, local_pid) = create_pas(management_pid, base_dir.into_path()).await;
+
+        let api = SpellServiceApi::new(pas.clone());
+        let (storage, _) = spell_storage::SpellStorage::create(Path::new(""), &pas, &repo)
+            .await
+            .unwrap();
+        let spell_service_blueprint_id = storage.get_blueprint();
+        let spell_id = create_spell(&pas, spell_service_blueprint_id, local_pid)
+            .await
+            .unwrap();
+        let params = CallParams::local(PeerScope::Host, spell_id, local_pid, TTL);
+        (api, params)
+    }
+
+    #[tokio::test]
+    async fn test_counter() {
+        let (api, params) = setup().await;
+        let result1 = api.get_counter(params.clone()).await;
+        assert!(
+            result1.is_ok(),
+            "must be able to get a counter of an empty spell"
+        );
+        assert_eq!(
+            result1.unwrap(),
+            None,
+            "the counter of an empty spell must be zero"
+        );
+        let new_counter = 7;
+        let result2 = api.set_counter(params.clone(), new_counter).await;
+        assert!(
+            result2.is_ok(),
+            "must be able to set a counter of an empty spell: {:?}",
+            result2.unwrap_err()
+        );
+        let result3 = api.get_counter(params).await;
+        assert!(
+            result3.is_ok(),
+            "must be able to get a counter of an empty spell again"
+        );
+        assert_eq!(
+            result3.unwrap(),
+            Some(new_counter),
+            "must be able to load an updated counter"
+        );
+    }
+
+    #[tokio::test]
+    async fn test_script() {
+        let (api, params) = setup().await;
+        let script_original = "(noop)".to_string();
+        let result1 = api
+            .set_script(params.clone(), script_original.clone())
+            .await;
+        assert!(result1.is_ok(), "must be able to update script");
+        let script = api.get_script(params).await;
+        assert!(script.is_ok(), "must be able to load script");
+        assert_eq!(script.unwrap(), script_original, "scripts must be equal");
+    }
+
+    #[tokio::test]
+    async fn test_trigger_config() {
+        let (api, params) = setup().await;
+        let trigger_config_original = TriggerConfig::default();
+        let result1 = api
+            .set_trigger_config(params.clone(), trigger_config_original.clone())
+            .await;
+        assert!(result1.is_ok(), "must be able to set trigger config");
+        let result2 = api.get_trigger_config(params).await;
+        assert!(result2.is_ok(), "must be able to get trigger config");
+        assert_eq!(
+            result2.unwrap(),
+            trigger_config_original,
+            "trigger configs must be equal"
+        );
+    }
+
+    #[tokio::test]
+    async fn test_kv() {
+        let (api, host_params) = setup().await;
+        let init_data = hashmap! {
+            "a1" => json!(1),
+            "b1" => json!("test"),
+        };
+        let result1 = api.update_kv(host_params.clone(), json!(init_data)).await;
+        assert!(
+            result1.is_err(),
+            "must NOT be able to update kv without h/hw key prefixes calling from host"
+        );
+
+        let params = CallParams::new(
+            host_params.init_peer_id,
+            PeerScope::Host,
+            host_params.spell_id.clone(),
+            Some(format!("spell_{}_0", host_params.spell_id)),
+            host_params.ttl,
+        );
+
+        let result1 = api.update_kv(params.clone(), json!(init_data)).await;
+        assert!(
+            result1.is_ok(),
+            "must be able to update kv calling as a spell"
+        );
+
+        let result = api.get_string(params.clone(), "a1".to_string()).await;
+        assert!(result.is_ok(), "must be able to add get_string");
+        assert_eq!(
+            result.unwrap().unwrap(),
+            "1",
+            "must be able to add get_string"
+        );
+
+        let result = api.get_string(params, "b1".to_string()).await;
+        assert!(result.is_ok(), "must be able to add get_string");
+        assert_eq!(
+            result.unwrap().unwrap(),
+            "\"test\"",
+            "must be able to add get_string"
+        );
+    }
+
+    #[tokio::test]
+    async fn test_trigger_event() {
+        let (api, params) = setup().await;
+        let trigger_event = json!({
+            "peer": json!([]),
+            "timer": vec![json!({
+                "timestamp": 1
+            })]
+        });
+        let result = api
+            .set_trigger_event(params.clone(), trigger_event.to_string())
+            .await;
+        assert!(result.is_ok(), "must be able to set trigger event");
+
+        let function = super::Function {
+            name: "get_string",
+            args: vec![json!("hw_trigger")],
+        };
+        let result = api.call::<StringValue>(params, function).await;
+        assert!(result.is_ok(), "must be able to add get_string");
+        let trigger_event_read: Result<serde_json::Value, _> =
+            serde_json::from_str(&result.unwrap().value);
+        assert!(
+            trigger_event_read.is_ok(),
+            "read trigger event must be parsable"
+        );
+        assert_eq!(
+            trigger_event_read.unwrap(),
+            trigger_event,
+            "read trigger event must be equal to the original one"
+        );
+    }
+}
+
\ No newline at end of file diff --git a/src/spell_storage/lib.rs.html b/src/spell_storage/lib.rs.html new file mode 100644 index 0000000000..8592940bed --- /dev/null +++ b/src/spell_storage/lib.rs.html @@ -0,0 +1,45 @@ +lib.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+mod storage;
+
+pub use crate::storage::SpellStorage;
+
\ No newline at end of file diff --git a/src/spell_storage/storage.rs.html b/src/spell_storage/storage.rs.html new file mode 100644 index 0000000000..28587b200d --- /dev/null +++ b/src/spell_storage/storage.rs.html @@ -0,0 +1,379 @@ +storage.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use std::collections::HashMap;
+use std::path::{Path, PathBuf};
+use std::sync::Arc;
+
+use derivative::Derivative;
+use eyre::eyre;
+use eyre::WrapErr;
+use fluence_app_service::TomlMarineConfig;
+use parking_lot::RwLock;
+
+use particle_modules::{load_module_by_path, AddBlueprint, ModuleRepository};
+use particle_services::{ParticleAppServices, PeerScope};
+use service_modules::module_file_name;
+
+type SpellId = String;
+
+#[derive(Derivative)]
+#[derivative(Debug, Clone)]
+pub struct SpellStorage {
+    // The blueprint for the latest spell service. It's used to create new spells
+    spell_blueprint_id: String,
+    // All currently existing spells
+    registered_spells: Arc<RwLock<HashMap<PeerScope, Vec<SpellId>>>>,
+    scope_mapping: Arc<RwLock<HashMap<SpellId, PeerScope>>>,
+}
+
+impl SpellStorage {
+    pub async fn create(
+        spells_base_dir: &Path,
+        services: &ParticleAppServices,
+        modules: &ModuleRepository,
+    ) -> eyre::Result<(Self, String)> {
+        let spell_config_path = spell_config_path(spells_base_dir);
+        let (spell_blueprint_id, spell_version) = if spell_config_path.exists() {
+            let cfg = TomlMarineConfig::load(spell_config_path)?;
+            Self::load_spell_service(cfg, spells_base_dir, modules)?
+        } else {
+            Self::load_spell_service_from_crate(modules)?
+        };
+        let (registered_spells, scope_mapping) = Self::restore_spells(services).await;
+
+        Ok((
+            Self {
+                spell_blueprint_id,
+                registered_spells: Arc::new(RwLock::new(registered_spells)),
+                scope_mapping: Arc::new(RwLock::new(scope_mapping)),
+            },
+            spell_version,
+        ))
+    }
+
+    fn load_spell_service_from_crate(modules: &ModuleRepository) -> eyre::Result<(String, String)> {
+        use fluence_spell_distro::{modules as spell_modules, CONFIG};
+
+        log::info!(
+            "Spell service impl version: {}",
+            fluence_spell_distro::VERSION
+        );
+
+        let spell_modules = spell_modules();
+        let cfg: TomlMarineConfig = toml_edit::de::from_slice(CONFIG)?;
+        let mut hashes = Vec::new();
+        for config in cfg.module {
+            let name = config.name.clone();
+            let module = spell_modules.get(name.as_str()).ok_or(eyre!(format!(
+                "there's no module {} in the fluence_spell_distro::modules",
+                config.name
+            )))?;
+            let module_hash = modules
+                .add_module(config.name, module.to_vec())
+                .context(format!("adding spell module {name}"))?;
+            hashes.push(module_hash);
+        }
+
+        Ok((
+            modules.add_blueprint(AddBlueprint::new("spell".to_string(), hashes))?,
+            fluence_spell_distro::VERSION.to_string(),
+        ))
+    }
+
+    fn load_spell_service(
+        cfg: TomlMarineConfig,
+        spells_base_dir: &Path,
+        modules: &ModuleRepository,
+    ) -> eyre::Result<(String, String)> {
+        let mut hashes = Vec::new();
+        let mut versions = Vec::new();
+        for config in cfg.module {
+            let load_from = config
+                .load_from
+                .clone()
+                .unwrap_or(PathBuf::from(module_file_name(&config.name)));
+            let module_path = spells_base_dir.join(load_from);
+            let module = load_module_by_path(module_path.as_ref())?;
+            let module_hash = modules.add_module(config.name, module)?;
+            versions.push(String::from(&module_hash.to_string()[..8]));
+            hashes.push(module_hash);
+        }
+        let spell_disk_version = format!("wasm hashes {}", versions.join(" "));
+        Ok((
+            modules.add_blueprint(AddBlueprint::new("spell".to_string(), hashes))?,
+            spell_disk_version,
+        ))
+    }
+
+    async fn restore_spells(
+        services: &ParticleAppServices,
+    ) -> (
+        HashMap<PeerScope, Vec<SpellId>>,
+        HashMap<SpellId, PeerScope>,
+    ) {
+        let mut registered_spell: HashMap<PeerScope, Vec<SpellId>> = HashMap::new();
+        let mut scope_mapping: HashMap<SpellId, PeerScope> = HashMap::new();
+
+        let spell_services = services
+            .list_services_all()
+            .await
+            .into_iter()
+            .filter(|s| s.service_type.is_spell());
+
+        for service in spell_services {
+            let peer_scope = service.peer_scope;
+            let spell_id = service.id;
+            registered_spell
+                .entry(peer_scope)
+                .or_default()
+                .push(spell_id.clone());
+            scope_mapping.insert(spell_id, peer_scope);
+        }
+
+        (registered_spell, scope_mapping)
+    }
+
+    pub fn get_registered_spells(&self) -> HashMap<PeerScope, Vec<SpellId>> {
+        self.registered_spells.read().clone()
+    }
+
+    pub fn get_scope(&self, spell_id: SpellId) -> Option<PeerScope> {
+        self.scope_mapping.read().get(&spell_id).cloned()
+    }
+
+    pub fn get_registered_spells_by(&self, peer_scope: PeerScope) -> Vec<SpellId> {
+        self.registered_spells
+            .read()
+            .get(&peer_scope)
+            .cloned()
+            .unwrap_or_default()
+    }
+
+    pub fn get_blueprint(&self) -> String {
+        self.spell_blueprint_id.clone()
+    }
+
+    pub fn register_spell(&self, peer_scope: PeerScope, spell_id: String) {
+        let mut spells = self.registered_spells.write();
+        let mut scope_mapping = self.scope_mapping.write();
+        spells.entry(peer_scope).or_default().push(spell_id.clone());
+        scope_mapping.insert(spell_id, peer_scope);
+    }
+
+    pub fn unregister_spell(&self, peer_scope: PeerScope, spell_id: &str) {
+        if let Some(spells) = self.registered_spells.write().get_mut(&peer_scope) {
+            spells.retain(|sp_id| sp_id.ne(spell_id));
+        }
+    }
+}
+
+fn spell_config_path(spells_base_dir: &Path) -> PathBuf {
+    spells_base_dir.join("Config.toml")
+}
+
\ No newline at end of file diff --git a/src/system_services/deployer.rs.html b/src/system_services/deployer.rs.html new file mode 100644 index 0000000000..19e0c86547 --- /dev/null +++ b/src/system_services/deployer.rs.html @@ -0,0 +1,1011 @@ +deployer.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use crate::distro::*;
+use crate::{CallService, FunctionName, ServiceName};
+use crate::{Deployment, PackageDistro, ServiceDistro, ServiceStatus, SpellDistro};
+use async_trait::async_trait;
+use eyre::eyre;
+use futures::{FutureExt, StreamExt, TryStreamExt};
+use libp2p::PeerId;
+use particle_execution::FunctionOutcome;
+use particle_modules::{AddBlueprint, ModuleRepository};
+use particle_services::{ParticleAppServices, PeerScope, ServiceError, ServiceType};
+use serde_json::{json, Value as JValue};
+use sorcerer::{install_spell, remove_spell};
+use spell_event_bus::api::{SpellEventBusApi, SpellId};
+use spell_service_api::{CallParams, SpellServiceApi};
+use spell_storage::SpellStorage;
+use std::collections::HashMap;
+use std::thread::available_parallelism;
+use std::time::Duration;
+use uuid_utils::uuid;
+
+// default bound on the number of computations it can perform simultaneously
+const DEFAULT_PARALLELISM: usize = 2;
+
+const DEPLOYER_TTL: Duration = Duration::from_millis(60_000);
+
+const DEPLOYER_PARTICLE_ID: &str = "system-services-deployment";
+
+fn get_deployer_particle_id() -> String {
+    format!("{}_{}", DEPLOYER_PARTICLE_ID, uuid())
+}
+
+// Status of the service or spell before deployment
+#[derive(Clone, Debug)]
+enum ServiceUpdateStatus {
+    // A service is found and we need to update it
+    NeedUpdate(String),
+    // A service is found and it's up to date
+    NoUpdate(String),
+    // A service isn't found
+    NotFound,
+}
+
+#[derive(Clone, Debug)]
+pub struct Deployer {
+    // These fields are used for deploying system services
+    services: ParticleAppServices,
+    modules_repo: ModuleRepository,
+    // These fields are used for deploying system spells
+    spell_storage: SpellStorage,
+    spell_event_bus_api: SpellEventBusApi,
+    spells_api: SpellServiceApi,
+    // These fields are used for deploying services and spells from the node name
+    host_peer_id: PeerId,
+    management_id: PeerId,
+
+    system_service_distros: SystemServiceDistros,
+}
+
+impl Deployer {
+    #[allow(clippy::too_many_arguments)]
+    pub fn new(
+        services: ParticleAppServices,
+        modules_repo: ModuleRepository,
+        spell_storage: SpellStorage,
+        spell_event_bus_api: SpellEventBusApi,
+        spell_service_api: SpellServiceApi,
+        root_worker_id: PeerId,
+        management_id: PeerId,
+        system_service_distros: SystemServiceDistros,
+    ) -> Self {
+        Self {
+            services,
+            modules_repo,
+            spell_storage,
+            spell_event_bus_api,
+            spells_api: spell_service_api,
+            host_peer_id: root_worker_id,
+            management_id,
+
+            system_service_distros,
+        }
+    }
+    pub fn versions(&self) -> Versions {
+        self.system_service_distros.versions.clone()
+    }
+
+    pub async fn deploy_system_services(self) -> eyre::Result<()> {
+        // TODO: Can we do this without cloning?
+
+        let services = self.services.clone();
+        let root_worker_id = self.host_peer_id;
+        let call: &dyn CallService = &CallServiceParams {
+            services: &services,
+            peer_scope: PeerScope::Host,
+            init_peer_id: root_worker_id,
+        };
+        let parallelism = available_parallelism()
+            .map(|x| x.get())
+            .unwrap_or(DEFAULT_PARALLELISM);
+
+        futures::stream::iter(self.system_service_distros.distros.values())
+            .map(|distro| async { self.deploy_package(call, distro.clone()).await }.boxed())
+            .boxed()
+            .buffer_unordered(parallelism)
+            .try_collect::<Vec<_>>()
+            .await?;
+
+        Ok(())
+    }
+
+    async fn deploy_package(
+        &self,
+        call_service: &dyn CallService,
+        package: PackageDistro,
+    ) -> eyre::Result<()> {
+        let mut services = HashMap::new();
+        for service_distro in package.services {
+            let name = service_distro.name.clone();
+            let result = self.deploy_service_common(service_distro).await?;
+            services.insert(name, result);
+        }
+
+        let mut spells = HashMap::new();
+        for spell_distro in package.spells {
+            let name = spell_distro.name.clone();
+            let result = self.deploy_system_spell(spell_distro).await?;
+            spells.insert(name, result);
+        }
+        let status = Deployment { services, spells };
+
+        if let Some(init) = package.init {
+            init.init(call_service, status).await?;
+        }
+
+        Ok(())
+    }
+
+    async fn deploy_system_spell(&self, spell_distro: SpellDistro) -> eyre::Result<ServiceStatus> {
+        let spell_name = spell_distro.name.clone();
+        match self.find_same_spell(&spell_distro).await {
+            Some(spell_id) => {
+                tracing::debug!(
+                    spell_name,
+                    spell_id,
+                    "found existing spell that needs to be updated; will try to update script, trigger config and init data",
+                );
+                match self.update_spell(&spell_distro, &spell_id).await {
+                    Err(err) => {
+                        tracing::warn!(
+                            spell_id,
+                            spell_name,
+                            "can't update a spell (will redeploy it): {err}"
+                        );
+                        self.remove_old_spell(&spell_name, &spell_id).await?;
+
+                        let spell_id = self.deploy_spell_common(spell_distro).await?;
+                        tracing::info!(spell_name, spell_id, "redeployed a system spell",);
+                        Ok(ServiceStatus::Created(spell_id))
+                    }
+                    Ok(()) => {
+                        tracing::info!(spell_name, spell_id, "updated a system spell");
+                        Ok(ServiceStatus::Existing(spell_id))
+                    }
+                }
+            }
+
+            None => {
+                let spell_id = self.deploy_spell_common(spell_distro).await?;
+                tracing::info!(spell_name, spell_id, "deployed a system spell",);
+                Ok(ServiceStatus::Created(spell_id))
+            }
+        }
+    }
+
+    // Updating spell is:
+    // - updating script
+    // - updating trigger config
+    // - updating kv
+    async fn update_spell(&self, spell_distro: &SpellDistro, spell_id: &str) -> eyre::Result<()> {
+        // stop spell
+        let result = self
+            .spell_event_bus_api
+            .unsubscribe(spell_id.to_string())
+            .await;
+        if let Err(err) = result {
+            tracing::warn!(
+                spell_id,
+                "failed to unsubscribe spell (will try to update the spell nevertheless): {err}"
+            );
+        }
+
+        let trigger_config = spell_event_bus::api::from_user_config(&spell_distro.trigger_config)?;
+        let params = CallParams::new(
+            self.host_peer_id,
+            PeerScope::Host,
+            spell_id.to_string(),
+            Some(format!("spell_{spell_id}_0")),
+            DEPLOYER_TTL,
+        );
+        // update trigger config
+        let config = spell_distro.trigger_config.clone();
+        self.spells_api
+            .set_trigger_config(params.clone(), config)
+            .await?;
+        // update spell script
+        let air = spell_distro.air.to_string();
+        self.spells_api.set_script(params.clone(), air).await?;
+        // update init_data without affecting other keys
+        self.spells_api
+            .update_kv(params, json!(spell_distro.kv))
+            .await?;
+
+        // resubscribe spell
+        if let Some(trigger_config) = trigger_config {
+            let result = self
+                .spell_event_bus_api
+                .subscribe(spell_id.to_string(), trigger_config)
+                .await;
+            if let Err(err) = result {
+                return Err(eyre!("{err}"));
+            }
+        }
+        Ok(())
+    }
+
+    async fn remove_old_spell(&self, spell_name: &str, spell_id: &str) -> eyre::Result<()> {
+        remove_spell(
+            &get_deployer_particle_id(),
+            &self.spell_storage,
+            &self.services,
+            &self.spell_event_bus_api,
+            spell_id,
+            PeerScope::Host,
+            self.host_peer_id,
+        )
+        .await
+        .map_err(|err| {
+            tracing::error!(spell_name, spell_id, "couldn't remove the old spell: {err}",);
+            eyre!(err)
+        })
+    }
+
+    async fn deploy_spell_common(&self, spell_distro: SpellDistro) -> eyre::Result<String> {
+        let spell_id = install_spell(
+            &self.services,
+            &self.spell_storage,
+            &self.spell_event_bus_api,
+            &self.spells_api,
+            PeerScope::Host,
+            get_deployer_particle_id(),
+            DEPLOYER_TTL,
+            spell_distro.trigger_config,
+            spell_distro.air.to_string(),
+            json!(spell_distro.kv),
+            self.host_peer_id,
+        )
+        .await
+        .map_err(|e| eyre!(e))?;
+        self.services
+            .add_alias(
+                PeerScope::Host,
+                spell_distro.name.to_string(),
+                spell_id.clone(),
+                self.management_id,
+            )
+            .await?;
+        Ok(spell_id)
+    }
+
+    // Two spells are the same if they have the same alias
+    async fn find_same_spell(&self, new_spell: &SpellDistro) -> Option<SpellId> {
+        let existing_spell = self
+            .services
+            .get_service_info(PeerScope::Host, new_spell.name.to_string(), "")
+            .await;
+        match existing_spell {
+            Err(ServiceError::NoSuchService(_, _)) => {
+                log::debug!("no existing spell found for {}", new_spell.name);
+                None
+            }
+            Err(err) => {
+                log::error!(
+                    "can't obtain details on a spell `{}` (will create a new one): {err}",
+                    new_spell.name
+                );
+                None
+            }
+            Ok(spell) if spell.service_type != ServiceType::Spell => {
+                log::warn!(
+                "alias `{}` already used for a service [{}]; it will be used for a spell, the service won't be removed",
+                new_spell.name,
+                spell.id
+            );
+                None
+            }
+            Ok(spell) => Some(spell.id),
+        }
+    }
+
+    async fn deploy_service_common(
+        &self,
+        service_distro: ServiceDistro,
+    ) -> eyre::Result<ServiceStatus> {
+        let service_name = service_distro.name.clone();
+        let blueprint_id = self.add_modules(service_distro)?;
+
+        match self
+            .find_same_service(service_name.to_string(), &blueprint_id)
+            .await
+        {
+            ServiceUpdateStatus::NeedUpdate(service_id) => {
+                tracing::debug!(service_name, service_id, "found existing service that needs to be updated; will remove the old service and deploy a new one");
+                let result = self
+                    .services
+                    .remove_service(
+                        PeerScope::Host,
+                        &get_deployer_particle_id(),
+                        &service_id,
+                        self.host_peer_id,
+                        false,
+                    )
+                    .await;
+                if let Err(err) = result {
+                    tracing::error!(
+                        service_name, service_id,
+                        "couldn't remove the old service (will install new service nevertheless): {err}",
+                    );
+                }
+            }
+            ServiceUpdateStatus::NoUpdate(service_id) => {
+                tracing::debug!(
+                    service_name,
+                    service_id,
+                    "found existing service that doesn't need to be updated; will skip update"
+                );
+                return Ok(ServiceStatus::Existing(service_id));
+            }
+            ServiceUpdateStatus::NotFound => {}
+        }
+
+        let service_id = self
+            .services
+            .create_service(
+                PeerScope::Host,
+                ServiceType::Service,
+                blueprint_id,
+                self.host_peer_id,
+            )
+            .await?;
+        self.services
+            .add_alias(
+                PeerScope::Host,
+                service_name.to_string(),
+                service_id.clone(),
+                self.management_id,
+            )
+            .await?;
+        tracing::info!(service_name, service_id, "deployed a new service");
+        Ok(ServiceStatus::Created(service_id))
+    }
+
+    async fn find_same_service(
+        &self,
+        service_name: String,
+        blueprint_id: &str,
+    ) -> ServiceUpdateStatus {
+        // Check that the service exist and has the same blueprint.
+        // In this case, we don't create a new one.
+        let existing_service = self
+            .services
+            .get_service_info(PeerScope::Host, service_name.to_string(), "")
+            .await;
+        if let Ok(service) = existing_service {
+            if service.service_type == ServiceType::Spell {
+                log::warn!(
+                    "alias `{}` already used for a spell [{}]; it will be used for a new service, the spell won't be removed",
+                    service_name,
+                    service.id
+                );
+                return ServiceUpdateStatus::NotFound;
+            }
+
+            if service.blueprint_id == blueprint_id {
+                ServiceUpdateStatus::NoUpdate(service.id)
+            } else {
+                ServiceUpdateStatus::NeedUpdate(service.id)
+            }
+        } else {
+            ServiceUpdateStatus::NotFound
+        }
+    }
+
+    fn add_modules(&self, service_distro: ServiceDistro) -> eyre::Result<String> {
+        let mut hashes = Vec::new();
+        for config in service_distro.config.module {
+            let name = config.name.clone();
+            // TODO: introduce nice errors for this
+            let module = service_distro
+                .modules
+                .get(name.as_str())
+                .ok_or(eyre!(format!(
+                    "there's no module `{name}` in the given modules map for system service {}",
+                    service_distro.name
+                )))?;
+            let hash = self
+                .modules_repo
+                .add_system_module(module.to_vec(), config)
+                .map_err(|e| {
+                    eyre!(
+                        "error while adding module {name} of service `{}`: {:?}",
+                        service_distro.name,
+                        e
+                    )
+                })?;
+            hashes.push(hash)
+        }
+        let blueprint_id = self
+            .modules_repo
+            .add_blueprint(AddBlueprint::new(service_distro.name, hashes))?;
+        Ok(blueprint_id)
+    }
+}
+
+struct CallServiceParams<'a> {
+    services: &'a ParticleAppServices,
+    peer_scope: PeerScope,
+    init_peer_id: PeerId,
+}
+
+#[async_trait]
+impl<'a> CallService for CallServiceParams<'a> {
+    async fn call(
+        &self,
+        service_name: ServiceName,
+        function_name: FunctionName,
+        args: Vec<JValue>,
+    ) -> eyre::Result<()> {
+        let service_id = service_name;
+        let result = self
+            .services
+            .call_function(
+                self.peer_scope,
+                service_id.as_str(),
+                function_name.as_str(),
+                args,
+                None,
+                self.init_peer_id,
+                DEPLOYER_TTL,
+            )
+            .await;
+        // similar to process_func_outcome in sorcerer/src/utils.rs, but that func is
+        // to specialized to spell specific
+        match result {
+            FunctionOutcome::Ok(result) => {
+                let call_result: Option<Result<_, _>> = try {
+                    let result = result.as_object()?;
+                    let is_success = result["success"].as_bool()?;
+                    if !is_success {
+                        if let Some(error) = result["error"].as_str() {
+                            Err(eyre!(
+                                "Call {service_id}.{function_name} returned error: {}",
+                                error
+                            ))
+                        } else {
+                            Err(eyre!("Call {service_id}.{function_name} returned error"))
+                        }
+                    } else {
+                        Ok(())
+                    }
+                };
+                call_result.unwrap_or_else(|| {
+                    Err(eyre!(
+                        "Call {service_id}.{function_name} return invalid result: {result}"
+                    ))
+                })
+            }
+            FunctionOutcome::NotDefined { .. } => {
+                Err(eyre!("Service {service_id} ({function_name}) not found"))
+            }
+            FunctionOutcome::Empty => Err(eyre!(
+                "Call {service_id}.{function_name} didn't return any result"
+            )),
+            FunctionOutcome::Err(err) => Err(eyre!(err)),
+        }
+    }
+}
+
\ No newline at end of file diff --git a/src/system_services/distro.rs.html b/src/system_services/distro.rs.html new file mode 100644 index 0000000000..fb6aa5f5ff --- /dev/null +++ b/src/system_services/distro.rs.html @@ -0,0 +1,645 @@ +distro.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use async_trait::async_trait;
+use fluence_app_service::TomlMarineConfig;
+use fluence_spell_dtos::trigger_config::TriggerConfig;
+use serde_json::json;
+use server_config::system_services_config::{
+    AquaIpfsConfig, DeciderConfig, RegistryConfig, ServiceKey, ServiceKey::*, SystemServicesConfig,
+};
+use std::collections::HashMap;
+use std::sync::Arc;
+use trust_graph_distro::Certs;
+
+use crate::{
+    apply_binary_path_override, CallService, Deployment, InitService, PackageDistro, ServiceDistro,
+    ServiceStatus, SpellDistro,
+};
+
+#[derive(Debug, Clone)]
+pub struct Versions {
+    pub aqua_ipfs_version: &'static str,
+    pub trust_graph_version: &'static str,
+    pub registry_version: &'static str,
+    pub decider_version: &'static str,
+}
+
+#[derive(Clone, Debug)]
+pub struct SystemServiceDistros {
+    pub(crate) distros: HashMap<String, PackageDistro>,
+    pub(crate) versions: Versions,
+}
+
+impl SystemServiceDistros {
+    /// With overriding existing packages
+    pub fn extend(mut self, distros: Vec<PackageDistro>) -> Self {
+        for distro in distros {
+            self.distros.insert(distro.name.clone(), distro);
+        }
+        self
+    }
+
+    pub fn default_from(config: SystemServicesConfig) -> eyre::Result<Self> {
+        log::warn!("{:?}", config);
+        let distros: HashMap<String, PackageDistro> = config
+            .enable
+            .iter()
+            .map(move |key| {
+                let distro = match key {
+                    AquaIpfs => default_aqua_ipfs_distro(&config.aqua_ipfs),
+                    TrustGraph => default_trust_graph_distro(),
+                    Registry => default_registry_distro(&config.registry),
+                    Decider => default_decider_distro(&config.decider),
+                };
+                distro.map(move |d| (d.name.clone(), d))
+            })
+            .collect::<eyre::Result<_>>()?;
+
+        let versions = Self::versions_from(&distros);
+
+        Ok(SystemServiceDistros { distros, versions })
+    }
+
+    fn default_versions() -> Versions {
+        Versions {
+            aqua_ipfs_version: aqua_ipfs_distro::VERSION,
+            trust_graph_version: trust_graph_distro::VERSION,
+            registry_version: registry_distro::VERSION,
+            decider_version: decider_distro::VERSION,
+        }
+    }
+
+    fn versions_from(packages: &HashMap<String, PackageDistro>) -> Versions {
+        let mut versions = Self::default_versions();
+        for (name, package) in packages {
+            match ServiceKey::from_string(name) {
+                Some(AquaIpfs) => {
+                    versions.aqua_ipfs_version = package.version;
+                }
+                Some(Registry) => {
+                    versions.registry_version = package.version;
+                }
+                Some(TrustGraph) => {
+                    versions.trust_graph_version = package.version;
+                }
+                Some(Decider) => {
+                    versions.decider_version = package.version;
+                }
+                _ => {}
+            }
+        }
+
+        versions
+    }
+}
+
+struct TrustGraphInit<'a> {
+    name: String,
+    certs: &'a Certs,
+}
+
+#[async_trait]
+impl<'a> InitService for TrustGraphInit<'a> {
+    async fn init(
+        &self,
+        call_service: &dyn CallService,
+        deployment: Deployment,
+    ) -> eyre::Result<()> {
+        if let Some(ServiceStatus::Created(id)) = deployment.services.get(&self.name) {
+            call_service
+                .call(
+                    self.name.clone(),
+                    "set_root".to_string(),
+                    vec![
+                        json!(self.certs.root_node),
+                        json!(self.certs.max_chain_length),
+                    ],
+                )
+                .await?;
+
+            let timestamp = now_millis::now_sec();
+            for cert_chain in &self.certs.certs {
+                call_service
+                    .call(
+                        self.name.clone(),
+                        "insert_cert".to_string(),
+                        vec![json!(cert_chain), json!(timestamp)],
+                    )
+                    .await?;
+            }
+            tracing::info!(
+                service_id = id,
+                service_alias = self.name,
+                "initialized service"
+            );
+        }
+        Ok(()) as eyre::Result<()>
+    }
+}
+
+pub fn default_trust_graph_distro<'a>() -> eyre::Result<PackageDistro> {
+    use trust_graph_distro::*;
+
+    let config: TomlMarineConfig = toml_edit::de::from_slice(CONFIG)?;
+    let service_distro = ServiceDistro {
+        modules: modules(),
+        config,
+        name: TrustGraph.to_string(),
+    };
+    let certs: &'static Certs = &trust_graph_distro::KRAS_CERTS;
+    let init = TrustGraphInit {
+        name: TrustGraph.to_string(),
+        certs,
+    };
+    let package = PackageDistro {
+        name: TrustGraph.to_string(),
+        version: VERSION,
+        services: vec![service_distro],
+        spells: vec![],
+        init: Some(Arc::new(Box::new(init))),
+    };
+    Ok(package)
+}
+
+struct AquaIpfsConfigInit {
+    local_api_multiaddr: String,
+    external_api_multiaddr: String,
+    name: String,
+}
+
+#[async_trait]
+impl InitService for AquaIpfsConfigInit {
+    async fn init(
+        &self,
+        call_service: &dyn CallService,
+        deployment: Deployment,
+    ) -> eyre::Result<()> {
+        if let Some(ServiceStatus::Created(id) | ServiceStatus::Existing(id)) =
+            deployment.services.get(&self.name)
+        {
+            let set_local_result = call_service
+                .call(
+                    self.name.clone(),
+                    "set_local_api_multiaddr".to_string(),
+                    vec![json!(self.local_api_multiaddr)],
+                )
+                .await;
+
+            let set_external_result = call_service
+                .call(
+                    self.name.clone(),
+                    "set_external_api_multiaddr".to_string(),
+                    vec![json!(self.external_api_multiaddr)],
+                )
+                .await;
+
+            // try to set local and external api multiaddrs, and only then produce an error
+            set_local_result?;
+            set_external_result?;
+
+            tracing::info!(
+                service_id = id,
+                service_alias = self.name,
+                "initialized service"
+            );
+        }
+        Ok(())
+    }
+}
+
+pub fn default_aqua_ipfs_distro(config: &AquaIpfsConfig) -> eyre::Result<PackageDistro> {
+    use aqua_ipfs_distro::*;
+
+    let mut marine_config: TomlMarineConfig = toml_edit::de::from_slice(CONFIG)?;
+    apply_binary_path_override(
+        &mut marine_config,
+        "ipfs_effector",
+        "ipfs",
+        config.ipfs_binary_path.clone(),
+    );
+
+    let service_distro = ServiceDistro {
+        modules: modules(),
+        config: marine_config,
+        name: AquaIpfs.to_string(),
+    };
+
+    let local_api_multiaddr = config.local_api_multiaddr.clone();
+    let external_api_multiaddr = config.external_api_multiaddr.clone();
+
+    let init = AquaIpfsConfigInit {
+        local_api_multiaddr,
+        external_api_multiaddr,
+        name: AquaIpfs.to_string(),
+    };
+
+    let package = PackageDistro {
+        name: AquaIpfs.to_string(),
+        version: VERSION,
+        services: vec![service_distro],
+        spells: vec![],
+        init: Some(Arc::new(Box::new(init))),
+    };
+
+    Ok(package)
+}
+
+pub fn default_registry_distro(config: &RegistryConfig) -> eyre::Result<PackageDistro> {
+    let marine_config: TomlMarineConfig = toml_edit::de::from_slice(registry_distro::CONFIG)?;
+    let service_distro = ServiceDistro {
+        modules: registry_distro::modules(),
+        config: marine_config,
+        name: Registry.to_string(),
+    };
+
+    let registry_config = registry_distro::RegistryConfig {
+        expired_interval: config.expired_period_sec,
+        renew_interval: config.renew_period_sec,
+        replicate_interval: config.replicate_period_sec,
+    };
+    let spell_distro = registry_distro::registry_spell(registry_config);
+    let mut trigger_config = TriggerConfig::default();
+    trigger_config.clock.start_sec = 1;
+    trigger_config.clock.period_sec = config.registry_period_sec;
+    let spell_distro = SpellDistro {
+        name: "registry-spell".to_string(),
+        air: spell_distro.air,
+        kv: spell_distro.init_data,
+        trigger_config,
+    };
+    let package = PackageDistro {
+        name: Registry.to_string(),
+        version: registry_distro::VERSION,
+        services: vec![service_distro],
+        spells: vec![spell_distro],
+        init: None,
+    };
+    Ok(package)
+}
+
+pub fn default_decider_distro(decider_config: &DeciderConfig) -> eyre::Result<PackageDistro> {
+    // prepare decider
+    let decider_settings = decider_distro::DeciderConfig {
+        worker_period_sec: decider_config.worker_period_sec,
+        worker_ipfs_multiaddr: decider_config.worker_ipfs_multiaddr.clone(),
+    };
+    let decider_spell_distro = decider_distro::decider_spell(decider_settings);
+    let mut decider_trigger_config = TriggerConfig::default();
+    decider_trigger_config.clock.start_sec = 1;
+    decider_trigger_config.clock.period_sec = decider_config.decider_period_sec;
+    let spell_distro = SpellDistro {
+        name: Decider.to_string(),
+        air: decider_spell_distro.air,
+        kv: decider_spell_distro.kv,
+        trigger_config: decider_trigger_config,
+    };
+
+    let package = PackageDistro {
+        name: Decider.to_string(),
+        version: decider_distro::VERSION,
+        services: vec![],
+        spells: vec![spell_distro],
+        init: None,
+    };
+    Ok(package)
+}
+
\ No newline at end of file diff --git a/src/system_services/lib.rs.html b/src/system_services/lib.rs.html new file mode 100644 index 0000000000..44082584b8 --- /dev/null +++ b/src/system_services/lib.rs.html @@ -0,0 +1,377 @@ +lib.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+#![feature(try_blocks)]
+
+mod deployer;
+mod distro;
+
+use async_trait::async_trait;
+use std::collections::HashMap;
+use std::fmt;
+use std::path::PathBuf;
+use std::sync::Arc;
+
+pub use deployer::Deployer;
+pub use distro::SystemServiceDistros;
+pub use distro::Versions;
+
+use fluence_app_service::{TomlMarineConfig, TomlValue};
+use fluence_spell_dtos::trigger_config::TriggerConfig;
+use serde_json::Value;
+
+type ServiceName = String;
+type FunctionName = String;
+
+/// Status of package deployment for each services and spells of the package
+#[derive(Clone, Debug)]
+pub struct Deployment {
+    /// Statuses of spells deployment
+    pub spells: HashMap<String, ServiceStatus>,
+    /// Statuses of services deployment
+    pub services: HashMap<String, ServiceStatus>,
+}
+
+/// Call service functions. Accepts
+/// - service name
+/// - function name
+/// - function arguments
+///
+/// Restriction:
+/// The functions called via this callback must return a result with execution status in field `status: bool`
+/// and error message in the field `error: string`.
+/// Otherwise, the output will be consider invalid.
+#[async_trait]
+pub trait CallService: Send + Sync {
+    async fn call(
+        &self,
+        service_name: ServiceName,
+        function_name: FunctionName,
+        args: Vec<Value>,
+    ) -> eyre::Result<()>;
+}
+
+/// Initialization function to initialize services
+/// - accepts `DeploymentStatus` of services and spells to be able to update or initialize the services
+/// - accepts `CallService` to be able to call installed services for initialization.
+#[async_trait]
+pub trait InitService: Send + Sync {
+    async fn init(
+        &self,
+        call_service: &dyn CallService,
+        deployment: Deployment,
+    ) -> eyre::Result<()>;
+}
+
+/// Package distribution description
+/// Contains enough information about all services and spells used by the package for installation
+/// It's not the same thing as a worker since this kind of package doesn't require to be installed
+/// in a separate scope
+#[derive(Clone)]
+pub struct PackageDistro {
+    /// High-level name of the package.
+    /// For the system services the field is supposed to be a string of `ServiceKey` enum
+    pub name: String,
+    /// Version of the package, the field is used to display versions of used system services
+    pub version: &'static str,
+    /// List services needed by the package
+    pub services: Vec<ServiceDistro>,
+    /// List of spells needed by the package
+    pub spells: Vec<SpellDistro>,
+    /// Optionally, initialization function for the services.
+    pub init: Option<Arc<Box<dyn InitService>>>,
+}
+
+impl fmt::Debug for PackageDistro {
+    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+        f.debug_struct("PackageDistro")
+            .field("name", &self.name)
+            .field("version", &self.version)
+            .field("services", &self.services)
+            .field("spells", &self.spells)
+            .field("init", &"{...}".to_string())
+            .finish()
+    }
+}
+
+/// Service distribution description that provides enough information for the service installation.
+#[derive(Clone)]
+pub struct ServiceDistro {
+    /// WASM modules of the service by their names
+    pub modules: HashMap<&'static str, &'static [u8]>,
+    /// Marine config of the service
+    pub config: TomlMarineConfig,
+    /// High-level names of the service used as an alias
+    pub name: String,
+}
+
+impl fmt::Debug for ServiceDistro {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        f.debug_struct("ServiceDistro")
+            .field("modules", &self.modules.keys())
+            .field("config", &self.config)
+            .field("name", &self.name)
+            .finish()
+    }
+}
+
+/// Spell distribution description that provides enough information for the spell installation.
+#[derive(Clone)]
+pub struct SpellDistro {
+    /// The name of the spell which is also used as an alias for the spell
+    pub name: String,
+    /// The AIR script of the spell
+    pub air: &'static str,
+    /// Initial values for the KV storage of the spell
+    /// Note that these values are saved as JSON strings
+    pub kv: HashMap<&'static str, Value>,
+    /// The trigger config for the spell
+    pub trigger_config: TriggerConfig,
+}
+
+impl fmt::Debug for SpellDistro {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        f.debug_struct("SpellDistro")
+            .field("name", &self.name)
+            .field(
+                "air",
+                &format!("{}...", self.air.chars().take(20).collect::<String>()),
+            )
+            .field("kv", &self.kv.keys())
+            .field("trigger_config", &self.trigger_config)
+            .finish()
+    }
+}
+
+/// A status of a service/spell after deployment
+#[derive(Clone, Debug)]
+pub enum ServiceStatus {
+    /// Id of a newly created service
+    Created(String),
+    /// Id of a already existing service
+    Existing(String),
+}
+
+/// Override a binary path to a binary for a module in the service configuration
+fn apply_binary_path_override(
+    config: &mut TomlMarineConfig,
+    // Name of the module for which we override the path
+    module_name: &str,
+    // The name of the binary to override
+    binary_name: &str,
+    // Path to the binary to use instead
+    binary_path: PathBuf,
+) {
+    if let Some(module_config) = config.module.iter_mut().find(|p| p.name == module_name) {
+        if let Some(mounted_binaries) = &mut module_config.config.mounted_binaries {
+            if let Some(path) = mounted_binaries.get_mut(binary_name) {
+                *path = TomlValue::String(binary_path.display().to_string());
+            }
+        }
+    }
+}
+
\ No newline at end of file diff --git a/src/test_constants/lib.rs.html b/src/test_constants/lib.rs.html new file mode 100644 index 0000000000..699b9d6143 --- /dev/null +++ b/src/test_constants/lib.rs.html @@ -0,0 +1,87 @@ +lib.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+#![warn(rust_2018_idioms)]
+#![deny(
+    dead_code,
+    nonstandard_style,
+    unused_imports,
+    unused_mut,
+    unused_variables,
+    unused_unsafe,
+    unreachable_patterns,
+    unreachable_code
+)]
+
+use std::time::Duration;
+
+/// In debug, VM startup time is big, account for that
+#[cfg(debug_assertions)]
+pub static TIMEOUT: Duration = Duration::from_secs(150);
+#[cfg(not(debug_assertions))]
+pub static TIMEOUT: Duration = Duration::from_secs(15);
+
+pub static SHORT_TIMEOUT: Duration = Duration::from_millis(300);
+pub static TRANSPORT_TIMEOUT: Duration = Duration::from_millis(500);
+pub static IDLE_CONNECTION_TIMEOUT: Duration = Duration::from_secs(10);
+pub static EXECUTION_TIMEOUT: Duration = Duration::from_millis(5000);
+pub static PARTICLE_TTL: u32 = 20000;
+
\ No newline at end of file diff --git a/src/test_utils/lib.rs.html b/src/test_utils/lib.rs.html new file mode 100644 index 0000000000..a8755d518e --- /dev/null +++ b/src/test_utils/lib.rs.html @@ -0,0 +1,87 @@ +lib.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+#![warn(rust_2018_idioms)]
+#![deny(
+    dead_code,
+    nonstandard_style,
+    unused_imports,
+    unused_mut,
+    unused_variables,
+    unused_unsafe,
+    unreachable_patterns,
+    unreachable_code
+)]
+
+#[macro_use]
+extern crate fstrings;
+
+pub use service::*;
+pub use utils::*;
+
+pub use crate::misc::*;
+
+mod misc;
+pub mod pinning;
+mod service;
+mod utils;
+
\ No newline at end of file diff --git a/src/test_utils/misc.rs.html b/src/test_utils/misc.rs.html new file mode 100644 index 0000000000..955b8b8135 --- /dev/null +++ b/src/test_utils/misc.rs.html @@ -0,0 +1,63 @@ +misc.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use std::time::Duration;
+
+use eyre::WrapErr;
+
+pub async fn timeout<F, T>(dur: Duration, f: F) -> eyre::Result<T>
+where
+    F: std::future::Future<Output = T>,
+{
+    tokio::time::timeout(dur, f)
+        .await
+        .wrap_err(format!("timed out after {dur:?}"))
+}
+
\ No newline at end of file diff --git a/src/test_utils/pinning.rs.html b/src/test_utils/pinning.rs.html new file mode 100644 index 0000000000..bd1e508568 --- /dev/null +++ b/src/test_utils/pinning.rs.html @@ -0,0 +1,75 @@ +pinning.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use cpu_utils::pinning::ThreadPinner;
+use cpu_utils::LogicalCoreId;
+
+pub const DUMMY: DummyThreadPinner = DummyThreadPinner {};
+
+pub struct DummyThreadPinner;
+
+impl ThreadPinner for DummyThreadPinner {
+    #[inline]
+    fn pin_current_thread_to(&self, _core_id: LogicalCoreId) -> bool {
+        true
+    }
+
+    #[inline]
+    fn pin_current_thread_to_cpuset(&self, _core_ids: &[LogicalCoreId]) -> bool {
+        true
+    }
+}
+
\ No newline at end of file diff --git a/src/test_utils/service.rs.html b/src/test_utils/service.rs.html new file mode 100644 index 0000000000..92e160053d --- /dev/null +++ b/src/test_utils/service.rs.html @@ -0,0 +1,167 @@ +service.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use base64::{engine::general_purpose::STANDARD as base64, Engine};
+use maplit::hashmap;
+use serde_json::json;
+
+use connected_client::ConnectedClient;
+use service_modules::Hash;
+
+#[derive(Debug, Clone)]
+pub struct CreatedService {
+    pub id: String,
+}
+
+pub async fn create_service(
+    client: &mut ConnectedClient,
+    module_name: &str,
+    module_bytes: Vec<u8>,
+) -> CreatedService {
+    create_service_worker(client, module_name, module_bytes, client.node.to_string()).await
+}
+
+pub async fn create_service_worker(
+    client: &mut ConnectedClient,
+    module_name: &str,
+    module_bytes: Vec<u8>,
+    worker_id: String,
+) -> CreatedService {
+    let script = f!(r#"
+    (seq
+        (seq
+            (call relay ("dist" "default_module_config") [module_name] module_config)
+            (call relay ("dist" "add_module") [module_bytes module_config] module)
+        )
+        (seq
+            (seq
+                (call relay ("dist" "make_blueprint") [name dependencies] blueprint)
+                (call relay ("dist" "add_blueprint") [blueprint] blueprint_id)
+            )
+            (seq
+                (call worker_id ("srv" "create") [blueprint_id] service_id)
+                (call client ("return" "") [service_id] client_result)
+            )
+        )
+    )
+    "#);
+
+    let data = hashmap! {
+        "client" => json!(client.peer_id.to_string()),
+        "relay" => json!(client.node.to_string()),
+        "worker_id" => json!(worker_id),
+        "module_name" => json!(module_name),
+        "dependencies" => json!([Hash::new(&module_bytes).unwrap()]),
+        "module_bytes" => json!(base64.encode(module_bytes)),
+        "name" => json!("blueprint"),
+    };
+
+    let response = client.execute_particle(script, data).await.unwrap();
+
+    let service_id = response[0]
+        .as_str()
+        .expect("service_id is in response")
+        .to_string();
+
+    CreatedService { id: service_id }
+}
+
\ No newline at end of file diff --git a/src/test_utils/utils.rs.html b/src/test_utils/utils.rs.html new file mode 100644 index 0000000000..c5ea015a56 --- /dev/null +++ b/src/test_utils/utils.rs.html @@ -0,0 +1,163 @@ +utils.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+use clarity::PrivateKey;
+use ivalue_utils::IValue;
+use server_config::ChainConfig;
+use std::str::FromStr;
+
+#[derive(Debug, Clone)]
+pub struct RetStruct {
+    pub ret_code: u32,
+    pub error: String,
+    pub result: String,
+}
+
+pub fn response_to_return(resp: IValue) -> RetStruct {
+    match resp {
+        IValue::Record(r) => {
+            let ret_code = match r.first().unwrap() {
+                IValue::U32(u) => *u,
+                _ => panic!("unexpected, should be u32 ret_code"),
+            };
+            let msg = match r.get(1).unwrap() {
+                IValue::String(u) => u.to_string(),
+                _ => panic!("unexpected, should be string error message"),
+            };
+            if ret_code == 0 {
+                RetStruct {
+                    ret_code,
+                    result: msg,
+                    error: "".to_string(),
+                }
+            } else {
+                RetStruct {
+                    ret_code,
+                    error: msg,
+                    result: "".to_string(),
+                }
+            }
+        }
+        _ => panic!("unexpected, should be a record"),
+    }
+}
+
+pub fn string_result(ret: RetStruct) -> Result<String, String> {
+    if ret.ret_code == 0 {
+        let hash: String = serde_json::from_str(&ret.result).unwrap();
+        Ok(hash)
+    } else {
+        Err(ret.error)
+    }
+}
+
+pub fn get_default_chain_config(url: &str) -> ChainConfig {
+    ChainConfig {
+        http_endpoint: url.to_string(),
+        diamond_contract_address: "".to_string(),
+        network_id: 0,
+        wallet_key: PrivateKey::from_str(
+            "0x97a2456e78c4894c62eef6031972d1ca296ed40bf311ab54c231f13db59fc428",
+        )
+        .unwrap(),
+        default_base_fee: None,
+        default_priority_fee: None,
+    }
+}
+
\ No newline at end of file diff --git a/src/toml_utils/lib.rs.html b/src/toml_utils/lib.rs.html new file mode 100644 index 0000000000..054822ae20 --- /dev/null +++ b/src/toml_utils/lib.rs.html @@ -0,0 +1,79 @@ +lib.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+#![recursion_limit = "512"]
+#![warn(rust_2018_idioms)]
+#![deny(
+    dead_code,
+    nonstandard_style,
+    unused_imports,
+    unused_mut,
+    unused_variables,
+    unused_unsafe,
+    unreachable_patterns
+)]
+
+use marine::{TomlValue, TomlValueTable};
+
+pub fn table(tuples: Vec<(String, String)>) -> TomlValueTable {
+    tuples
+        .into_iter()
+        .map(|(k, v)| (k, TomlValue::String(v)))
+        .collect()
+}
+
\ No newline at end of file diff --git a/src/toy_vms/easy_vm.rs.html b/src/toy_vms/easy_vm.rs.html new file mode 100644 index 0000000000..27fd268d07 --- /dev/null +++ b/src/toy_vms/easy_vm.rs.html @@ -0,0 +1,235 @@ +easy_vm.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use async_trait::async_trait;
+use std::str::FromStr;
+use std::{convert::Infallible, task::Waker, time::Duration};
+
+use avm_server::avm_runner::RawAVMOutcome;
+use avm_server::SoftLimitsTriggering;
+use avm_server::{AVMMemoryStats, CallResults, ParticleParameters};
+use itertools::Itertools;
+
+use aquamarine::WasmtimeWasmBackend;
+use aquamarine::{AquaRuntime, ParticleEffects};
+use fluence_keypair::KeyPair;
+use fluence_libp2p::PeerId;
+
+pub struct EasyVM {
+    delay: Option<Duration>,
+}
+
+#[async_trait]
+impl AquaRuntime for EasyVM {
+    type Config = Option<Duration>;
+    type Error = Infallible;
+
+    fn create_runtime(
+        delay: Option<Duration>,
+        _backend: WasmtimeWasmBackend,
+        _: Waker,
+    ) -> Result<Self, Self::Error> {
+        Ok(EasyVM { delay })
+    }
+
+    fn into_effects(
+        outcome: Result<RawAVMOutcome, Self::Error>,
+        _particle_id: String,
+    ) -> ParticleEffects {
+        let outcome = outcome.unwrap();
+
+        ParticleEffects {
+            new_data: outcome.data,
+            next_peers: outcome
+                .next_peer_pks
+                .iter()
+                .map(|peer| PeerId::from_str(peer).expect("invalid peer id"))
+                .collect(),
+            call_requests: outcome.call_requests,
+        }
+    }
+
+    async fn call(
+        &mut self,
+        air: impl Into<String> + Send,
+        _prev_data: impl Into<Vec<u8>> + Send,
+        current_data: impl Into<Vec<u8>> + Send,
+        particle_params: ParticleParameters<'_>,
+        _call_results: CallResults,
+        _key_pair: &KeyPair,
+    ) -> Result<RawAVMOutcome, Self::Error> {
+        if let Some(delay) = self.delay {
+            std::thread::sleep(delay);
+        }
+
+        // if the script starts with '!', then emulate routing logic
+        // that allows to avoid using real AVM, but still
+        // describe complex topologies
+        let air = air.into();
+        let data = current_data.into();
+        let (next_peer, data) = if air.starts_with('!') {
+            // data contains peer ids separated by comma
+            let next_peers = String::from_utf8_lossy(&data);
+            let mut next_peers = next_peers.split(',');
+            // we pop the first one and keep others
+            let next_peer = String::from(next_peers.next().unwrap());
+
+            (next_peer, next_peers.join(",").into_bytes())
+        } else {
+            (particle_params.init_peer_id.to_string(), data)
+        };
+
+        println!("next peer = {next_peer}");
+        let soft_limits_triggering = SoftLimitsTriggering::default();
+        Ok(RawAVMOutcome {
+            ret_code: 0,
+            error_message: "".to_string(),
+            data,
+            call_requests: Default::default(),
+            next_peer_pks: vec![next_peer],
+            soft_limits_triggering,
+        })
+    }
+
+    fn memory_stats(&self) -> AVMMemoryStats {
+        AVMMemoryStats {
+            memory_size: 0,
+            total_memory_limit: None,
+            allocation_rejects: None,
+        }
+    }
+}
+
\ No newline at end of file diff --git a/src/toy_vms/lib.rs.html b/src/toy_vms/lib.rs.html new file mode 100644 index 0000000000..1f398f57b1 --- /dev/null +++ b/src/toy_vms/lib.rs.html @@ -0,0 +1,45 @@ +lib.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+mod easy_vm;
+
+pub use easy_vm::EasyVM;
+
\ No newline at end of file diff --git a/src/types/deal_id.rs.html b/src/types/deal_id.rs.html new file mode 100644 index 0000000000..56e1bc0cdb --- /dev/null +++ b/src/types/deal_id.rs.html @@ -0,0 +1,315 @@ +deal_id.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use serde::{Deserialize, Deserializer, Serialize, Serializer};
+use std::borrow::{Borrow, Cow};
+use std::fmt::Display;
+
+#[derive(Eq, Clone, Debug, Hash, PartialEq, PartialOrd, Ord)]
+pub struct DealId(String);
+
+impl DealId {
+    // TODO: always validate on creation
+    /// 40 hex chars + 2 for "0x" prefix; Deal ID is EVM contract address;
+    pub fn is_valid(&self) -> bool {
+        Self::normalize(&self.0).len() == 40
+    }
+
+    pub fn normalize(str: &str) -> String {
+        str.trim_start_matches("0x").to_ascii_lowercase()
+    }
+
+    pub fn get_contract_address(&self) -> String {
+        format!("0x{}", self.0)
+    }
+
+    pub fn to_address(&self) -> String {
+        format!("0x{}", self.0)
+    }
+
+    pub fn as_str(&self) -> &str {
+        &self.0
+    }
+}
+
+impl<'de> Deserialize<'de> for DealId {
+    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
+    where
+        D: Deserializer<'de>,
+    {
+        let s = <Cow<'de, str>>::deserialize(deserializer)?;
+        Ok(DealId::from(s.borrow()))
+    }
+}
+
+impl Serialize for DealId {
+    fn serialize<S>(&self, s: S) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
+    where
+        S: Serializer,
+    {
+        self.0.to_string().serialize(s)
+    }
+}
+
+impl PartialEq<&str> for DealId {
+    fn eq(&self, other: &&str) -> bool {
+        self.0 == DealId::normalize(other)
+    }
+}
+
+impl PartialEq<&str> for &DealId {
+    fn eq(&self, other: &&str) -> bool {
+        self.0 == DealId::normalize(other)
+    }
+}
+
+impl PartialEq<String> for DealId {
+    fn eq(&self, other: &String) -> bool {
+        self.0 == DealId::normalize(other)
+    }
+}
+
+impl PartialEq<String> for &DealId {
+    fn eq(&self, other: &String) -> bool {
+        self.0 == DealId::normalize(other)
+    }
+}
+
+impl From<DealId> for String {
+    fn from(deal_id: DealId) -> Self {
+        deal_id.0
+    }
+}
+
+impl From<String> for DealId {
+    fn from(deal_id: String) -> Self {
+        DealId(Self::normalize(&deal_id))
+    }
+}
+
+impl From<&DealId> for String {
+    fn from(deal_id: &DealId) -> Self {
+        deal_id.0.clone()
+    }
+}
+
+impl From<&str> for DealId {
+    fn from(deal_id: &str) -> Self {
+        DealId(Self::normalize(deal_id))
+    }
+}
+
+impl Display for DealId {
+    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+        write!(f, "{}", self.0)
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use crate::deal_id::DealId;
+
+    #[test]
+    fn deal_id() {
+        let deal_id_prefix_lowercase = "0x1234567890abcdef";
+        let deal_id_prefix_uppercase = "0x1234567890ABCDEF";
+        let deal_id_no_prefix_lowercase = "1234567890abcdef";
+        let deal_id_no_prefix_uppercase = "1234567890ABCDEF";
+        let deal_id_prefix_mixed_case = "0x1234567890AbCdEf";
+        let deal_id_no_prefix_mixed_case = "1234567890AbCdEf";
+
+        let deals = vec![
+            deal_id_prefix_lowercase,
+            deal_id_prefix_uppercase,
+            deal_id_no_prefix_lowercase,
+            deal_id_no_prefix_uppercase,
+            deal_id_prefix_mixed_case,
+            deal_id_no_prefix_mixed_case,
+        ];
+
+        let deals = deals.into_iter().map(DealId::from).collect::<Vec<_>>();
+
+        assert!(deals.iter().all(|deal| deal == deal_id_prefix_lowercase));
+        assert!(deals.iter().all(|deal| deal == deal_id_prefix_uppercase));
+        assert!(deals.iter().all(|deal| deal == deal_id_no_prefix_lowercase));
+        assert!(deals.iter().all(|deal| deal == deal_id_no_prefix_uppercase));
+        assert!(deals.iter().all(|deal| deal == deal_id_prefix_mixed_case));
+        assert!(deals
+            .iter()
+            .all(|deal| deal == deal_id_no_prefix_mixed_case));
+    }
+}
+
\ No newline at end of file diff --git a/src/types/lib.rs.html b/src/types/lib.rs.html new file mode 100644 index 0000000000..5aff72cc82 --- /dev/null +++ b/src/types/lib.rs.html @@ -0,0 +1,49 @@ +lib.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+mod deal_id;
+pub mod peer_id;
+pub mod peer_scope;
+
+pub use deal_id::DealId;
+
\ No newline at end of file diff --git a/src/types/peer_id.rs.html b/src/types/peer_id.rs.html new file mode 100644 index 0000000000..01b9615b5e --- /dev/null +++ b/src/types/peer_id.rs.html @@ -0,0 +1,179 @@ +peer_id.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+pub mod serde {
+    use libp2p_identity::PeerId;
+    use serde::{Deserialize, Deserializer, Serialize, Serializer};
+    use std::str::FromStr;
+
+    pub fn serialize<S>(value: &PeerId, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        value.to_base58().serialize(serializer)
+    }
+
+    pub fn deserialize<'de, D>(deserializer: D) -> Result<PeerId, D::Error>
+    where
+        D: Deserializer<'de>,
+    {
+        let str = String::deserialize(deserializer)?;
+        PeerId::from_str(&str).map_err(|e| {
+            serde::de::Error::custom(format!("peer id deserialization failed for {e:?}"))
+        })
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use crate::peer_id;
+    use libp2p_identity::{Keypair, PeerId};
+    use serde::{Deserialize, Serialize};
+    use std::str::FromStr;
+
+    #[test]
+    fn peerid() {
+        #[derive(Eq, PartialEq, Clone, Debug, Serialize, Deserialize)]
+        struct Test {
+            #[serde(
+                serialize_with = "peer_id::serde::serialize",
+                deserialize_with = "peer_id::serde::deserialize"
+            )]
+            peer_id_1: PeerId,
+            #[serde(
+                serialize_with = "peer_id::serde::serialize",
+                deserialize_with = "peer_id::serde::deserialize"
+            )]
+            peer_id_2: PeerId,
+        }
+
+        let peer_id_1 = Keypair::generate_ed25519().public().to_peer_id();
+        let peer_id_2 = PeerId::from_str("QmY28NSCefB532XbERtnKHadexGuNzAfYnh5fJk6qhLsSi").unwrap();
+
+        let test = Test {
+            peer_id_1,
+            peer_id_2,
+        };
+
+        let serialized_test = serde_json::to_value(test.clone());
+        assert!(
+            serialized_test.is_ok(),
+            "failed to serialize test struct: {}",
+            serialized_test.err().unwrap()
+        );
+
+        let deserialized_test = serde_json::from_value::<Test>(serialized_test.unwrap());
+        assert!(
+            deserialized_test.is_ok(),
+            "failed to deserialize test struct: {}",
+            deserialized_test.err().unwrap()
+        );
+        assert_eq!(deserialized_test.unwrap(), test);
+    }
+}
+
\ No newline at end of file diff --git a/src/types/peer_scope.rs.html b/src/types/peer_scope.rs.html new file mode 100644 index 0000000000..4f91ffcab8 --- /dev/null +++ b/src/types/peer_scope.rs.html @@ -0,0 +1,115 @@ +peer_scope.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use crate::peer_id;
+use libp2p_identity::PeerId;
+use serde::{Deserialize, Serialize};
+use std::fmt;
+
+#[derive(Clone, Copy, Eq, Hash, Ord, PartialEq, PartialOrd, Serialize, Deserialize, Debug)]
+#[serde(tag = "scope_type", content = "scope_value")]
+pub enum PeerScope {
+    WorkerId(WorkerId),
+    Host,
+}
+
+#[derive(Clone, Copy, Eq, Hash, Ord, PartialEq, PartialOrd, Debug, Serialize, Deserialize)]
+pub struct WorkerId(
+    #[serde(
+        serialize_with = "peer_id::serde::serialize",
+        deserialize_with = "peer_id::serde::deserialize"
+    )]
+    PeerId,
+);
+
+impl From<PeerId> for WorkerId {
+    fn from(value: PeerId) -> Self {
+        WorkerId(value)
+    }
+}
+
+impl From<WorkerId> for PeerId {
+    fn from(value: WorkerId) -> Self {
+        value.0
+    }
+}
+
+impl fmt::Display for WorkerId {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        self.0.to_base58().fmt(f)
+    }
+}
+
\ No newline at end of file diff --git a/src/uuid_utils/lib.rs.html b/src/uuid_utils/lib.rs.html new file mode 100644 index 0000000000..a045e245c7 --- /dev/null +++ b/src/uuid_utils/lib.rs.html @@ -0,0 +1,49 @@ +lib.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use uuid::Uuid;
+
+pub fn uuid() -> String {
+    Uuid::new_v4().to_string()
+}
+
\ No newline at end of file diff --git a/src/vm_utils/lib.rs.html b/src/vm_utils/lib.rs.html new file mode 100644 index 0000000000..d0a42a717d --- /dev/null +++ b/src/vm_utils/lib.rs.html @@ -0,0 +1,27 @@ +lib.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+
mod vm_utils;
+
+pub use nonempty::NonEmpty;
+pub use vm_utils::create_domain;
+pub use vm_utils::reboot_vm;
+pub use vm_utils::remove_domain;
+pub use vm_utils::reset_vm;
+pub use vm_utils::start_vm;
+pub use vm_utils::status_vm;
+pub use vm_utils::stop_vm;
+pub use vm_utils::CreateVMDomainParams;
+pub use vm_utils::VmError;
+pub use vm_utils::VmStatus;
+
\ No newline at end of file diff --git a/src/vm_utils/vm_utils.rs.html b/src/vm_utils/vm_utils.rs.html new file mode 100644 index 0000000000..bd3b56c168 --- /dev/null +++ b/src/vm_utils/vm_utils.rs.html @@ -0,0 +1,729 @@ +vm_utils.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+
use ccp_shared::types::LogicalCoreId;
+use mac_address::MacAddress;
+use nonempty::NonEmpty;
+use rand::Rng;
+use std::fmt::Display;
+use std::path::PathBuf;
+use thiserror::Error;
+use virt::connect::Connect;
+use virt::domain::Domain;
+use virt::sys::{VIR_DOMAIN_DEFINE_VALIDATE, VIR_DOMAIN_REBOOT_DEFAULT};
+
+const MAC_PREFIX: [u8; 3] = [0x52, 0x54, 0x00];
+
+#[derive(Debug)]
+pub struct CreateVMDomainParams {
+    name: String,
+    image: PathBuf,
+    cpus: NonEmpty<LogicalCoreId>,
+    bridge_name: String,
+}
+
+impl CreateVMDomainParams {
+    pub fn new(
+        name: String,
+        image: PathBuf,
+        cpus: NonEmpty<LogicalCoreId>,
+        bridge_name: String,
+    ) -> Self {
+        Self {
+            name,
+            image,
+            cpus,
+            bridge_name,
+        }
+    }
+}
+
+#[derive(Error, Debug)]
+pub enum VmError {
+    #[error("Failed to connect to the hypervisor: {err}")]
+    FailedToConnect {
+        #[source]
+        err: virt::error::Error,
+    },
+    #[error("Failed to create VM domain: {err}")]
+    FailedToCreateVMDomain {
+        #[source]
+        err: virt::error::Error,
+    },
+    #[error("Failed to remove VM domain {name}: {err}")]
+    FailedToRemoveVMDomain {
+        #[source]
+        err: virt::error::Error,
+        name: String,
+    },
+    #[error("Failed to run VM {name}: {err}")]
+    FailedToStartVM {
+        #[source]
+        err: virt::error::Error,
+        name: String,
+    },
+    #[error("Could not find VM with name {name}: {err}")]
+    VmNotFound {
+        name: String,
+        #[source]
+        err: virt::error::Error,
+    },
+    #[error("Failed to shutdown VM {name}: {err}")]
+    FailedToStopVM {
+        name: String,
+        #[source]
+        err: virt::error::Error,
+    },
+    #[error("Failed to get id for VM with name {name}")]
+    FailedToGetVMId { name: String },
+    #[error("Failed to reboot {name}: {err}")]
+    FailedToRebootVM {
+        err: virt::error::Error,
+        name: String,
+    },
+    #[error("Failed to reset {name}: {err}")]
+    FailedToResetVM {
+        err: virt::error::Error,
+        name: String,
+    },
+    #[error("Failed to get info for {name}: {err}")]
+    FailedToGetInfo {
+        err: virt::error::Error,
+        name: String,
+    },
+}
+
+// The list of states is taken from the libvirt documentation
+#[derive(Debug)]
+pub enum VmStatus {
+    NoState,
+    Running,
+    Blocked,
+    Paused,
+    Shutdown,
+    Shutoff,
+    Crashed,
+    PMSuspended,
+    UnknownState(u32),
+}
+
+impl Display for VmStatus {
+    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+        match self {
+            VmStatus::NoState => write!(f, "No state"),
+            VmStatus::Running => write!(f, "Running"),
+            VmStatus::Blocked => write!(f, "Blocked"),
+            VmStatus::Paused => write!(f, "Paused"),
+            VmStatus::Shutdown => write!(f, "Shutdown"),
+            VmStatus::Shutoff => write!(f, "Shutoff"),
+            VmStatus::Crashed => write!(f, "Crashed"),
+            VmStatus::PMSuspended => write!(f, "PMSuspended"),
+            VmStatus::UnknownState(value) => write!(f, "Unknown state ({})", value),
+        }
+    }
+}
+
+impl VmStatus {
+    pub fn from_u32(value: u32) -> Self {
+        match value {
+            virt::sys::VIR_DOMAIN_NOSTATE => VmStatus::NoState,
+            virt::sys::VIR_DOMAIN_RUNNING => VmStatus::Running,
+            virt::sys::VIR_DOMAIN_BLOCKED => VmStatus::Blocked,
+            virt::sys::VIR_DOMAIN_PAUSED => VmStatus::Paused,
+            virt::sys::VIR_DOMAIN_SHUTDOWN => VmStatus::Shutdown,
+            virt::sys::VIR_DOMAIN_SHUTOFF => VmStatus::Shutoff,
+            virt::sys::VIR_DOMAIN_CRASHED => VmStatus::Crashed,
+            virt::sys::VIR_DOMAIN_PMSUSPENDED => VmStatus::PMSuspended,
+            _ => VmStatus::UnknownState(value),
+        }
+    }
+}
+
+pub fn create_domain(uri: &str, params: &CreateVMDomainParams) -> Result<(), VmError> {
+    let conn = Connect::open(Some(uri)).map_err(|err| VmError::FailedToConnect { err })?;
+    let domain = Domain::lookup_by_name(&conn, params.name.as_str()).ok();
+
+    match domain {
+        None => {
+            tracing::info!(target: "vm-utils","Domain with name {} doesn't exists. Creating", params.name);
+            let mac = generate_random_mac();
+            let xml = prepare_xml(&params, mac.to_string().as_str());
+            Domain::define_xml_flags(&conn, xml.as_str(), VIR_DOMAIN_DEFINE_VALIDATE)
+                .map_err(|err| VmError::FailedToCreateVMDomain { err })?;
+        }
+        Some(_) => {
+            tracing::info!(target: "vm-utils","Domain with name {} already exists. Skipping", params.name);
+        }
+    };
+    Ok(())
+}
+
+pub fn remove_domain(uri: &str, name: &str) -> Result<(), VmError> {
+    tracing::info!(target: "vm-utils","Removing domain with name {}", name);
+    let conn = Connect::open(Some(uri)).map_err(|err| VmError::FailedToConnect { err })?;
+    let domain = Domain::lookup_by_name(&conn, name).map_err(|err| VmError::VmNotFound {
+        name: name.to_string(),
+        err,
+    })?;
+
+    domain
+        .destroy()
+        .map_err(|err| VmError::FailedToRemoveVMDomain {
+            err,
+            name: name.to_string(),
+        })?;
+
+    domain
+        .undefine()
+        .map_err(|err| VmError::FailedToRemoveVMDomain {
+            err,
+            name: name.to_string(),
+        })?;
+
+    Ok(())
+}
+pub fn start_vm(uri: &str, name: &str) -> Result<u32, VmError> {
+    tracing::info!(target: "vm-utils","Starting VM with name {name}");
+    let conn = Connect::open(Some(uri)).map_err(|err| VmError::FailedToConnect { err })?;
+    let domain = Domain::lookup_by_name(&conn, name).map_err(|err| VmError::VmNotFound {
+        name: name.to_string(),
+        err,
+    })?;
+    domain.create().map_err(|err| VmError::FailedToStartVM {
+        err,
+        name: name.to_string(),
+    })?;
+
+    let id = domain.get_id().ok_or(VmError::FailedToGetVMId {
+        name: name.to_string(),
+    })?;
+
+    Ok(id)
+}
+
+pub fn stop_vm(uri: &str, name: &str) -> Result<(), VmError> {
+    tracing::info!(target: "vm-utils","Stopping VM with name {name}");
+    let conn = Connect::open(Some(uri)).map_err(|err| VmError::FailedToConnect { err })?;
+    let domain = Domain::lookup_by_name(&conn, name).map_err(|err| VmError::VmNotFound {
+        name: name.to_string(),
+        err,
+    })?;
+    domain.shutdown().map_err(|err| VmError::FailedToStopVM {
+        name: name.to_string(),
+        err,
+    })?;
+
+    Ok(())
+}
+
+pub fn reboot_vm(uri: &str, name: &str) -> Result<(), VmError> {
+    tracing::info!(target: "vm-utils","Rebooting VM with name {name}");
+    let conn = Connect::open(Some(uri)).map_err(|err| VmError::FailedToConnect { err })?;
+    let domain = Domain::lookup_by_name(&conn, name).map_err(|err| VmError::VmNotFound {
+        name: name.to_string(),
+        err,
+    })?;
+    domain
+        .reboot(VIR_DOMAIN_REBOOT_DEFAULT)
+        .map_err(|err| VmError::FailedToRebootVM {
+            err,
+            name: name.to_string(),
+        })?;
+    Ok(())
+}
+
+pub fn reset_vm(uri: &str, name: &str) -> Result<(), VmError> {
+    tracing::info!(target: "vm-utils","Resetting VM with name {name}");
+    let conn = Connect::open(Some(uri)).map_err(|err| VmError::FailedToConnect { err })?;
+    let domain = Domain::lookup_by_name(&conn, name).map_err(|err| VmError::VmNotFound {
+        name: name.to_string(),
+        err,
+    })?;
+    domain.reset().map_err(|err| VmError::FailedToResetVM {
+        name: name.to_string(),
+        err,
+    })?;
+    Ok(())
+}
+
+pub fn status_vm(uri: &str, name: &str) -> Result<VmStatus, VmError> {
+    tracing::info!(target: "vm-utils","Getting info for VM with name {name}");
+    let conn = Connect::open(Some(uri)).map_err(|err| VmError::FailedToConnect { err })?;
+    let domain = Domain::lookup_by_name(&conn, name).map_err(|err| VmError::VmNotFound {
+        name: name.to_string(),
+        err,
+    })?;
+    let info = domain.get_info().map_err(|err| VmError::FailedToGetInfo {
+        name: name.to_string(),
+        err,
+    })?;
+
+    Ok(VmStatus::from_u32(info.state))
+}
+
+fn generate_random_mac() -> MacAddress {
+    let mut rng = rand::thread_rng();
+    let mut result = [0u8; 6];
+    result[..3].copy_from_slice(&MAC_PREFIX);
+    rng.fill(&mut result[3..]);
+    MacAddress::from(result)
+}
+
+fn prepare_xml(params: &CreateVMDomainParams, mac_address: &str) -> String {
+    let mut mapping = String::new();
+    for (index, logical_id) in params.cpus.iter().enumerate() {
+        if index > 0 {
+            mapping.push_str("\n        ");
+        }
+        mapping.push_str(format!("<vcpupin vcpu='{index}' cpuset='{logical_id}'/>").as_str());
+    }
+    let memory_in_kb = params.cpus.len() * 4 * 1024 * 1024; // 4Gbs per core
+    format!(
+        include_str!("template.xml"),
+        params.name,
+        memory_in_kb,
+        params.cpus.len(),
+        mapping,
+        params.image.display(),
+        mac_address,
+        params.bridge_name,
+    )
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+    use nonempty::nonempty;
+    use std::fs;
+    const DEFAULT_URI: &str = "test:///default";
+
+    fn list_defined() -> Result<Vec<String>, VmError> {
+        let conn =
+            Connect::open(Some(DEFAULT_URI)).map_err(|err| VmError::FailedToConnect { err })?;
+        Ok(conn.list_defined_domains().unwrap())
+    }
+
+    fn list() -> Result<Vec<u32>, VmError> {
+        let conn =
+            Connect::open(Some(DEFAULT_URI)).map_err(|err| VmError::FailedToConnect { err })?;
+        Ok(conn.list_domains().unwrap())
+    }
+
+    #[test]
+    fn test_prepare_xml() {
+        let xml = prepare_xml(
+            &CreateVMDomainParams {
+                name: "test-id".to_string(),
+                image: "test-image".into(),
+                cpus: nonempty![1.into(), 8.into()],
+                bridge_name: "br422442".to_string(),
+            },
+            "52:54:00:1e:af:64",
+        );
+        assert_eq!(xml, include_str!("../tests/expected_vm_config.xml"))
+    }
+
+    #[test]
+    fn test_vm_creation() {
+        log_utils::enable_logs();
+
+        let image: PathBuf = "./tests/alpine-virt-3.20.1-x86_64.qcow2".into();
+        let image = fs::canonicalize(image).unwrap();
+
+        let list_before_create = list().unwrap();
+        let list_defined_before_create = list_defined().unwrap();
+        assert!(list_defined_before_create.is_empty());
+
+        create_domain(
+            DEFAULT_URI,
+            &CreateVMDomainParams {
+                name: "test-id".to_string(),
+                image: image.clone(),
+                cpus: nonempty![1.into()],
+                bridge_name: "br422442".to_string(),
+            },
+        )
+        .unwrap();
+
+        let list_after_create = list().unwrap();
+        let list_defined_after_create = list_defined().unwrap();
+        assert_eq!(list_defined_after_create, vec!["test-id"]);
+        assert_eq!(list_after_create, list_before_create);
+
+        let id = start_vm(DEFAULT_URI, "test-id").unwrap();
+
+        let mut list_after_start = list().unwrap();
+        let list_defined_after_start = list_defined().unwrap();
+        let mut expected_list_after_start = Vec::new();
+        expected_list_after_start.push(id);
+        expected_list_after_start.extend(&list_before_create);
+
+        expected_list_after_start.sort();
+        list_after_start.sort();
+
+        assert!(list_defined_after_start.is_empty());
+        assert_eq!(list_after_start, expected_list_after_start);
+    }
+}
+
\ No newline at end of file diff --git a/src/workers/error.rs.html b/src/workers/error.rs.html new file mode 100644 index 0000000000..b4d66ab01d --- /dev/null +++ b/src/workers/error.rs.html @@ -0,0 +1,361 @@ +error.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use core_distributor::errors::AcquireError;
+use libp2p::PeerId;
+use std::path::PathBuf;
+use thiserror::Error;
+use types::peer_scope::WorkerId;
+use types::DealId;
+use vm_utils::VmError;
+
+#[derive(Debug, Error)]
+pub enum KeyStorageError {
+    #[error("Failed to persist keypair: RSA is not supported")]
+    CannotExtractRSASecretKey,
+    #[error("Error reading persisted keypair from {path:?}: {err}")]
+    ReadPersistedKeypair {
+        path: PathBuf,
+        #[source]
+        err: std::io::Error,
+    },
+    #[error("Error reading list of directory from {path:?}: {err}")]
+    DirectoryListError {
+        path: PathBuf,
+        #[source]
+        err: std::io::Error,
+    },
+    #[error("Error deserializing persisted keypair from {path:?}: {err}")]
+    DeserializePersistedKeypair {
+        path: PathBuf,
+        #[source]
+        err: toml::de::Error,
+    },
+    #[error("Failed to decode keypair {path}: {err}")]
+    PersistedKeypairDecodingError {
+        path: PathBuf,
+        #[source]
+        err: fluence_keypair::error::DecodingError,
+    },
+    #[error("Invalid key format {path}: {err}")]
+    PersistedKeypairInvalidKeyFormat {
+        path: PathBuf,
+        #[source]
+        err: fluence_keypair::error::Error,
+    },
+    #[error("Error serializing persisted keypair: {err}")]
+    SerializePersistedKeypair {
+        #[source]
+        err: toml_edit::ser::Error,
+    },
+    #[error("Error writing persisted keypair to {path:?}: {err}")]
+    WriteErrorPersistedKeypair {
+        path: PathBuf,
+        #[source]
+        err: std::io::Error,
+    },
+    #[error("Error removing persisted keypair {path:?} for worker {worker_id}: {err}")]
+    RemoveErrorPersistedKeypair {
+        path: PathBuf,
+        worker_id: WorkerId,
+        #[source]
+        err: std::io::Error,
+    },
+    #[error("Error creating directory for persisted keypairs {path:?}: {err}")]
+    CreateKeypairsDir {
+        path: PathBuf,
+        #[source]
+        err: std::io::Error,
+    },
+
+    #[error("Keypair for peer_id {0} not found")]
+    KeypairNotFound(PeerId),
+}
+
+#[derive(Debug, Error)]
+pub enum WorkersError {
+    #[error("Error creating directory for persisted workers {path:?}: {err}")]
+    CreateWorkersDir {
+        path: PathBuf,
+        #[source]
+        err: std::io::Error,
+    },
+    #[error("Error creating key pair for worker: {err}")]
+    CreateWorkerKeyPair {
+        #[source]
+        err: KeyStorageError,
+    },
+    #[error("Error removing key pair for worker: {err}")]
+    RemoveWorkerKeyPair {
+        #[source]
+        err: KeyStorageError,
+    },
+    #[error("Error reading persisted worker from {path:?}: {err}")]
+    ReadPersistedWorker {
+        path: PathBuf,
+        #[source]
+        err: std::io::Error,
+    },
+    #[error("Error deserializing persisted worker from {path:?}: {err}")]
+    DeserializePersistedWorker {
+        path: PathBuf,
+        #[source]
+        err: toml::de::Error,
+    },
+    #[error("Worker for {deal_id} already exists")]
+    WorkerAlreadyExists { deal_id: DealId },
+    #[error("Worker for deal_id {0} not found")]
+    WorkerNotFoundByDeal(DealId),
+    #[error("Worker {0} not found")]
+    WorkerNotFound(WorkerId),
+    #[error("Error serializing persisted worker: {err}")]
+    SerializePersistedWorker {
+        #[source]
+        err: toml_edit::ser::Error,
+    },
+    #[error("Error writing persisted worker to {path:?}: {err}")]
+    WriteErrorPersistedWorker {
+        path: PathBuf,
+        #[source]
+        err: std::io::Error,
+    },
+    #[error("Error creation of a persisted worker directory {path} for worker {worker_id}: {err}")]
+    WorkerStorageDirectory {
+        path: PathBuf,
+        worker_id: WorkerId,
+        #[source]
+        err: std::io::Error,
+    },
+    #[error("Error removing persisted worker {path:?} for worker {worker_id}: {err}")]
+    RemoveErrorPersistedWorker {
+        path: PathBuf,
+        worker_id: WorkerId,
+        #[source]
+        err: std::io::Error,
+    },
+    #[error("Keypair for peer_id {0} not found")]
+    KeypairNotFound(PeerId),
+    #[error("Failed to create runtime for worker {worker_id}: {err}")]
+    CreateRuntime {
+        worker_id: WorkerId,
+        #[source]
+        err: std::io::Error,
+    },
+    #[error("Failed to allocate cores for {worker_id}: {err}")]
+    FailedToAssignCores {
+        worker_id: WorkerId,
+        #[source]
+        err: AcquireError,
+    },
+    #[error("Failed to notify subsystem {worker_id}")]
+    FailedToNotifySubsystem { worker_id: WorkerId },
+    #[error("This feature is disabled")]
+    FeatureDisabled,
+    #[error("VM image {image} isn't file")]
+    VMImageNotFile { image: PathBuf },
+    #[error("Failed to copy {image} to the worker storage: {err}")]
+    FailedToCopyVMImage { image: PathBuf, err: std::io::Error },
+    #[error("Logical cores can't be empty")]
+    WrongAssignment,
+    #[error("VM for worker {0} not found")]
+    VmNotFound(WorkerId),
+    #[error(transparent)]
+    VmError(#[from] VmError),
+}
+
\ No newline at end of file diff --git a/src/workers/key_storage.rs.html b/src/workers/key_storage.rs.html new file mode 100644 index 0000000000..32d2a158f3 --- /dev/null +++ b/src/workers/key_storage.rs.html @@ -0,0 +1,477 @@ +key_storage.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use std::collections::HashMap;
+use std::path::PathBuf;
+use std::str::FromStr;
+
+use parking_lot::RwLock;
+
+use crate::persistence::{load_persisted_key_pairs, persist_keypair, remove_keypair};
+use crate::KeyStorageError;
+use fluence_keypair::{KeyFormat, KeyPair};
+use types::peer_scope::{PeerScope, WorkerId};
+
+pub struct KeyStorage {
+    /// worker_id -> worker_keypair
+    worker_key_pairs: RwLock<HashMap<WorkerId, KeyPair>>,
+    key_pairs_dir: PathBuf,
+    pub root_key_pair: KeyPair,
+}
+
+impl KeyStorage {
+    pub async fn from_path(key_pairs_dir: PathBuf, root_key_pair: KeyPair) -> eyre::Result<Self> {
+        let key_pairs = load_persisted_key_pairs(key_pairs_dir.as_path()).await?;
+
+        let mut worker_key_pairs = HashMap::with_capacity(key_pairs.len());
+        for (keypair, path) in key_pairs {
+            let format = KeyFormat::from_str(&keypair.key_format)
+                .map_err(|err| KeyStorageError::PersistedKeypairInvalidKeyFormat { err, path })?;
+            let keypair: KeyPair = KeyPair::from_secret_key(keypair.private_key_bytes, format)?;
+
+            let worker_id: WorkerId = keypair.get_peer_id().into();
+            worker_key_pairs.insert(worker_id, keypair);
+        }
+        Ok(Self {
+            worker_key_pairs: RwLock::new(worker_key_pairs),
+            key_pairs_dir,
+            root_key_pair,
+        })
+    }
+
+    pub fn get_keypair(&self, peer_scope: PeerScope) -> Option<KeyPair> {
+        match peer_scope {
+            PeerScope::WorkerId(worker_id) => self.get_worker_key_pair(worker_id),
+            PeerScope::Host => Some(self.root_key_pair.clone()),
+        }
+    }
+    pub fn get_worker_key_pair(&self, worker_id: WorkerId) -> Option<KeyPair> {
+        self.worker_key_pairs.read().get(&worker_id).cloned()
+    }
+
+    pub async fn create_key_pair(&self) -> Result<KeyPair, KeyStorageError> {
+        let keypair = KeyPair::generate_ed25519();
+        let worker_id: WorkerId = keypair.get_peer_id().into();
+        persist_keypair(&self.key_pairs_dir, worker_id, (&keypair).try_into()?).await?;
+        let mut guard = self.worker_key_pairs.write();
+        guard.insert(worker_id, keypair.clone());
+        Ok(keypair)
+    }
+
+    pub async fn remove_key_pair(&self, worker_id: WorkerId) -> Result<(), KeyStorageError> {
+        remove_keypair(&self.key_pairs_dir, worker_id).await?;
+        let mut guard = self.worker_key_pairs.write();
+        guard.remove(&worker_id);
+        Ok(())
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use crate::KeyStorage;
+    use tempfile::tempdir;
+
+    #[tokio::test]
+    async fn test_key_storage_creation() {
+        // Create a temporary directory for key storage
+        let temp_dir = tempdir().expect("Failed to create temporary directory");
+        let key_pairs_dir = temp_dir.path().to_path_buf();
+
+        let root_key_pair = fluence_keypair::KeyPair::generate_ed25519();
+
+        // Create a KeyStorage instance from a path
+        let loaded_key_storage =
+            KeyStorage::from_path(key_pairs_dir.clone(), root_key_pair.clone())
+                .await
+                .expect("Failed to create KeyStorage from path");
+
+        // Check that the loaded key storage has the correct initial state
+        assert_eq!(loaded_key_storage.worker_key_pairs.read().len(), 0);
+        assert_eq!(loaded_key_storage.key_pairs_dir, key_pairs_dir);
+        assert_eq!(
+            loaded_key_storage.root_key_pair.to_vec(),
+            root_key_pair.to_vec()
+        );
+    }
+
+    #[tokio::test]
+    async fn test_key_pair_creation_and_removal() {
+        // Create a temporary directory for key storage
+        let temp_dir = tempdir().expect("Failed to create temporary directory");
+        let key_pairs_dir = temp_dir.path().to_path_buf();
+
+        let root_key_pair = fluence_keypair::KeyPair::generate_ed25519();
+
+        // Create a KeyStorage instance from a path
+        let key_storage = KeyStorage::from_path(key_pairs_dir.clone(), root_key_pair.clone())
+            .await
+            .expect("Failed to create KeyStorage from path");
+
+        // Create a key pair and check that it is added to the storage
+        let key_pair_1 = key_storage
+            .create_key_pair()
+            .await
+            .expect("Failed to create key pair 1");
+        assert_eq!(
+            key_storage
+                .get_worker_key_pair(key_pair_1.get_peer_id().into())
+                .map(|k| k.to_vec()),
+            Some(key_pair_1.to_vec())
+        );
+
+        // Create another key pair and check that it is added to the storage
+        let key_pair_2 = key_storage
+            .create_key_pair()
+            .await
+            .expect("Failed to create key pair 2");
+        assert_eq!(
+            key_storage
+                .get_worker_key_pair(key_pair_2.get_peer_id().into())
+                .map(|k| k.to_vec()),
+            Some(key_pair_2.to_vec())
+        );
+
+        // Remove the first key pair and check that it is removed from the storage
+        key_storage
+            .remove_key_pair(key_pair_1.get_peer_id().into())
+            .await
+            .expect("Failed to remove key pair 1");
+        assert_eq!(
+            key_storage
+                .get_worker_key_pair(key_pair_1.get_peer_id().into())
+                .map(|k| k.to_vec()),
+            None
+        );
+
+        // Remove the second key pair and check that it is removed from the storage
+        key_storage
+            .remove_key_pair(key_pair_2.get_peer_id().into())
+            .await
+            .expect("Failed to remove key pair 2");
+        assert_eq!(
+            key_storage
+                .get_worker_key_pair(key_pair_2.get_peer_id().into())
+                .map(|k| k.to_vec()),
+            None
+        );
+    }
+
+    #[tokio::test]
+    async fn test_persistence() {
+        // Create a temporary directory for key storage
+        let temp_dir = tempdir().expect("Failed to create temporary directory");
+        let key_pairs_dir = temp_dir.path().to_path_buf();
+
+        let root_key_pair = fluence_keypair::KeyPair::generate_ed25519();
+
+        // Create a KeyStorage instance from a path
+        let key_storage_1 = KeyStorage::from_path(key_pairs_dir.clone(), root_key_pair.clone())
+            .await
+            .expect("Failed to create KeyStorage from path");
+
+        // Create a key pair and check that it is added to the storage
+        let key_pair_1 = key_storage_1
+            .create_key_pair()
+            .await
+            .expect("Failed to create key pair 1");
+        assert_eq!(
+            key_storage_1
+                .get_worker_key_pair(key_pair_1.get_peer_id().into())
+                .map(|k| k.to_vec()),
+            Some(key_pair_1.to_vec())
+        );
+        let key_pair_2 = key_storage_1
+            .create_key_pair()
+            .await
+            .expect("Failed to create key pair 2");
+        assert_eq!(
+            key_storage_1
+                .get_worker_key_pair(key_pair_2.get_peer_id().into())
+                .map(|k| k.to_vec()),
+            Some(key_pair_2.to_vec())
+        );
+        key_storage_1
+            .remove_key_pair(key_pair_2.get_peer_id().into())
+            .await
+            .expect("Failed to remove key pair 1");
+        assert_eq!(
+            key_storage_1
+                .get_worker_key_pair(key_pair_2.get_peer_id().into())
+                .map(|k| k.to_vec()),
+            None
+        );
+        drop(key_storage_1);
+
+        let key_storage_2 = KeyStorage::from_path(key_pairs_dir.clone(), root_key_pair.clone())
+            .await
+            .expect("Failed to create KeyStorage from path");
+
+        assert_eq!(
+            key_storage_2
+                .get_worker_key_pair(key_pair_1.get_peer_id().into())
+                .map(|k| k.to_vec()),
+            Some(key_pair_1.to_vec())
+        );
+        assert_eq!(
+            key_storage_2
+                .get_worker_key_pair(key_pair_2.get_peer_id().into())
+                .map(|k| k.to_vec()),
+            None
+        );
+    }
+}
+
\ No newline at end of file diff --git a/src/workers/lib.rs.html b/src/workers/lib.rs.html new file mode 100644 index 0000000000..748deb7404 --- /dev/null +++ b/src/workers/lib.rs.html @@ -0,0 +1,83 @@ +lib.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+#![feature(try_blocks)]
+
+mod error;
+mod key_storage;
+mod persistence;
+mod scope;
+mod workers;
+
+pub use core_distributor::CoreDistributor;
+pub use core_distributor::PersistentCoreDistributor;
+pub use core_distributor::CUID;
+pub use error::KeyStorageError;
+pub use error::WorkersError;
+pub use key_storage::KeyStorage;
+pub use scope::PeerScopes;
+pub use tokio::sync::mpsc::Receiver;
+pub use types::peer_scope::WorkerId;
+pub use workers::Event;
+pub use workers::VmConfig;
+pub use workers::WorkerParams;
+pub use workers::Workers;
+pub use workers::WorkersConfig;
+
\ No newline at end of file diff --git a/src/workers/persistence.rs.html b/src/workers/persistence.rs.html new file mode 100644 index 0000000000..0b9cc2f3df --- /dev/null +++ b/src/workers/persistence.rs.html @@ -0,0 +1,473 @@ +persistence.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+use libp2p::PeerId;
+use serde::{Deserialize, Serialize};
+use std::path::{Path, PathBuf};
+use std::thread::available_parallelism;
+
+use core_distributor::CUID;
+use fluence_keypair::KeyPair;
+use libp2p::futures::StreamExt;
+use tokio_stream::wrappers::ReadDirStream;
+use types::peer_id;
+use types::peer_scope::WorkerId;
+
+use crate::error::KeyStorageError::{
+    CannotExtractRSASecretKey, SerializePersistedKeypair, WriteErrorPersistedKeypair,
+};
+use crate::error::{KeyStorageError, WorkersError};
+use crate::workers::WorkerInfo;
+use crate::KeyStorageError::RemoveErrorPersistedKeypair;
+
+pub const fn default_bool<const V: bool>() -> bool {
+    V
+}
+
+pub const WORKER_INFO_FILE_NAME: &str = "info.toml";
+
+#[derive(Serialize, Deserialize, Debug, Clone)]
+pub struct PersistedKeypair {
+    pub private_key_bytes: Vec<u8>,
+    pub key_format: String,
+}
+
+#[derive(Serialize, Deserialize)]
+pub struct PersistedWorker {
+    pub worker_id: WorkerId,
+    #[serde(
+        serialize_with = "peer_id::serde::serialize",
+        deserialize_with = "peer_id::serde::deserialize"
+    )]
+    pub creator: PeerId,
+    #[serde(default)]
+    pub deal_id: String,
+    #[serde(default = "default_bool::<true>")]
+    pub active: bool,
+    pub cu_ids: Vec<CUID>,
+    pub vm_flag: bool,
+}
+
+impl From<PersistedWorker> for WorkerInfo {
+    fn from(val: PersistedWorker) -> Self {
+        WorkerInfo {
+            deal_id: val.deal_id.into(),
+            creator: val.creator,
+            active: val.active.into(),
+            cu_ids: val.cu_ids,
+            vm_flag: val.vm_flag.into(),
+        }
+    }
+}
+
+impl TryFrom<&KeyPair> for PersistedKeypair {
+    type Error = KeyStorageError;
+
+    fn try_from(keypair: &KeyPair) -> Result<Self, Self::Error> {
+        Ok(Self {
+            private_key_bytes: keypair.secret().map_err(|_| CannotExtractRSASecretKey)?,
+            key_format: keypair.public().get_key_format().into(),
+        })
+    }
+}
+
+pub fn keypair_file_name(worker_id: WorkerId) -> String {
+    format!("{}_keypair.toml", worker_id)
+}
+
+fn is_keypair(path: &Path) -> bool {
+    path.file_name()
+        .and_then(|n| n.to_str())
+        .map_or(false, |n| n.ends_with("_keypair.toml"))
+}
+
+/// Persist keypair info to disk, so it is recreated after restart
+pub(crate) async fn persist_keypair(
+    keypairs_dir: &Path,
+    worker_id: WorkerId,
+    persisted_keypair: PersistedKeypair,
+) -> Result<(), KeyStorageError> {
+    let path = keypairs_dir.join(keypair_file_name(worker_id));
+    let bytes = toml_edit::ser::to_vec(&persisted_keypair)
+        .map_err(|err| SerializePersistedKeypair { err })?;
+    tokio::fs::write(&path, bytes)
+        .await
+        .map_err(|err| WriteErrorPersistedKeypair { path, err })
+}
+
+pub(crate) async fn remove_keypair(
+    keypairs_dir: &Path,
+    worker_id: WorkerId,
+) -> Result<(), KeyStorageError> {
+    let path = keypairs_dir.join(keypair_file_name(worker_id));
+    tokio::fs::remove_file(path.as_path())
+        .await
+        .map_err(|err| RemoveErrorPersistedKeypair {
+            path,
+            worker_id,
+            err,
+        })?;
+    Ok(())
+}
+
+pub(crate) async fn persist_worker(
+    worker_dir: &Path,
+    worker: PersistedWorker,
+) -> Result<(), WorkersError> {
+    let path = worker_dir.join(WORKER_INFO_FILE_NAME);
+    let bytes = toml_edit::ser::to_vec(&worker)
+        .map_err(|err| WorkersError::SerializePersistedWorker { err })?;
+    tokio::fs::write(&path, bytes)
+        .await
+        .map_err(|err| WorkersError::WriteErrorPersistedWorker { path, err })
+}
+
+pub(crate) async fn remove_worker(
+    workers_dir: &Path,
+    worker_id: WorkerId,
+) -> Result<(), WorkersError> {
+    let path = workers_dir.join(worker_id.to_string());
+    tokio::fs::remove_dir_all(&path).await.map_err(|err| {
+        WorkersError::RemoveErrorPersistedWorker {
+            path,
+            worker_id,
+            err,
+        }
+    })?;
+    Ok(())
+}
+
+// default bound on the number of computations it can perform simultaneously
+const DEFAULT_PARALLELISM: usize = 2;
+
+/// Load info about persisted workers from disk in parallel
+pub(crate) async fn load_persisted_workers(
+    workers_dir: &Path,
+) -> eyre::Result<Vec<PersistedWorker>> {
+    let parallelism = available_parallelism()
+        .map(|x| x.get())
+        .unwrap_or(DEFAULT_PARALLELISM);
+
+    let directory_list = tokio::fs::read_dir(workers_dir).await?;
+    let directory_stream = ReadDirStream::new(directory_list);
+
+    let workers = directory_stream
+        .filter_map(|res| async move {
+            match res {
+                Ok(entry) => {
+                    let path = entry.path();
+                    if path.is_dir() {
+                        let info_path = path.join(WORKER_INFO_FILE_NAME);
+                        if info_path.is_file() {
+                            Some(read_worker_info(info_path.clone()))
+                        } else {
+                            tracing::warn!("File {} isn't file. Skipping...", info_path.display());
+                            None
+                        }
+                    } else {
+                        tracing::debug!("File {} isn't directory. Skipping...", path.display());
+                        None
+                    }
+                }
+                Err(err) => {
+                    tracing::warn!("Could not read worker directory: {err}");
+                    None
+                }
+            }
+        })
+        .buffer_unordered(parallelism)
+        .filter_map(|e| async { e })
+        //collect only loaded data and unwrap Option
+        .collect()
+        .await;
+
+    Ok(workers)
+}
+
+async fn read_worker_info(info_file: PathBuf) -> Option<PersistedWorker> {
+    let bytes = tokio::fs::read(&info_file).await;
+    match bytes {
+        Ok(bytes) => {
+            let result = toml_edit::de::from_slice::<PersistedWorker>(&bytes);
+            match result {
+                Ok(worker) => Some(worker),
+                Err(err) => {
+                    tracing::warn!(
+                        "Could not parse worker file {}: {}",
+                        info_file.display(),
+                        err
+                    );
+                    None
+                }
+            }
+        }
+        Err(err) => {
+            tracing::warn!("Could not read file {}: {}", info_file.display(), err);
+            None
+        }
+    }
+}
+
+/// Load info about persisted key pairs from disk in parallel
+pub(crate) async fn load_persisted_key_pairs(
+    key_pairs_dir: &Path,
+) -> eyre::Result<Vec<(PersistedKeypair, PathBuf)>> {
+    let key_pairs = fs_utils::load_persisted_data(key_pairs_dir, is_keypair, |bytes| {
+        toml_edit::de::from_slice(bytes).map_err(|e| e.into())
+    })
+    .await?;
+
+    Ok(key_pairs)
+}
+
\ No newline at end of file diff --git a/src/workers/scope.rs.html b/src/workers/scope.rs.html new file mode 100644 index 0000000000..809f1c123b --- /dev/null +++ b/src/workers/scope.rs.html @@ -0,0 +1,189 @@ +scope.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use crate::KeyStorage;
+use derivative::Derivative;
+use fluence_libp2p::PeerId;
+use std::sync::Arc;
+use thiserror::Error;
+use types::peer_scope::{PeerScope, WorkerId};
+
+/// Represents information about various peer IDs.
+#[derive(Clone, Derivative)]
+#[derivative(Debug)]
+pub struct PeerScopes {
+    host_peer_id: PeerId,
+    management_peer_id: PeerId,
+    builtins_management_peer_id: PeerId,
+    #[derivative(Debug = "ignore")]
+    key_storage: Arc<KeyStorage>,
+}
+
+#[derive(Debug, Error)]
+#[error("Scope for peer id {peer_id} not found")]
+pub struct ScopeNotFound {
+    peer_id: PeerId,
+}
+
+impl PeerScopes {
+    pub fn new(
+        host_peer_id: PeerId,
+        management_peer_id: PeerId,
+        builtins_management_peer_id: PeerId,
+        key_storage: Arc<KeyStorage>,
+    ) -> Self {
+        Self {
+            host_peer_id,
+            management_peer_id,
+            builtins_management_peer_id,
+            key_storage,
+        }
+    }
+
+    pub fn scope(&self, peer_id: PeerId) -> Result<PeerScope, ScopeNotFound> {
+        if self.host_peer_id == peer_id {
+            Ok(PeerScope::Host)
+        } else {
+            let worker_id: WorkerId = peer_id.into();
+            if self
+                .key_storage
+                .get_worker_key_pair(peer_id.into())
+                .is_some()
+            {
+                Ok(PeerScope::WorkerId(worker_id))
+            } else {
+                Err(ScopeNotFound { peer_id })
+            }
+        }
+    }
+
+    pub fn is_host(&self, peer_id: PeerId) -> bool {
+        self.host_peer_id == peer_id
+    }
+
+    pub fn is_management(&self, peer_id: PeerId) -> bool {
+        self.management_peer_id == peer_id || self.builtins_management_peer_id == peer_id
+    }
+
+    pub fn get_host_peer_id(&self) -> PeerId {
+        self.host_peer_id
+    }
+
+    pub fn to_peer_id(&self, peer_scope: PeerScope) -> PeerId {
+        match peer_scope {
+            PeerScope::WorkerId(worker_id) => worker_id.into(),
+            PeerScope::Host => self.get_host_peer_id(),
+        }
+    }
+}
+
\ No newline at end of file diff --git a/src/workers/workers.rs.html b/src/workers/workers.rs.html new file mode 100644 index 0000000000..3501da8422 --- /dev/null +++ b/src/workers/workers.rs.html @@ -0,0 +1,2539 @@ +workers.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+762
+763
+764
+765
+766
+767
+768
+769
+770
+771
+772
+773
+774
+775
+776
+777
+778
+779
+780
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+794
+795
+796
+797
+798
+799
+800
+801
+802
+803
+804
+805
+806
+807
+808
+809
+810
+811
+812
+813
+814
+815
+816
+817
+818
+819
+820
+821
+822
+823
+824
+825
+826
+827
+828
+829
+830
+831
+832
+833
+834
+835
+836
+837
+838
+839
+840
+841
+842
+843
+844
+845
+846
+847
+848
+849
+850
+851
+852
+853
+854
+855
+856
+857
+858
+859
+860
+861
+862
+863
+864
+865
+866
+867
+868
+869
+870
+871
+872
+873
+874
+875
+876
+877
+878
+879
+880
+881
+882
+883
+884
+885
+886
+887
+888
+889
+890
+891
+892
+893
+894
+895
+896
+897
+898
+899
+900
+901
+902
+903
+904
+905
+906
+907
+908
+909
+910
+911
+912
+913
+914
+915
+916
+917
+918
+919
+920
+921
+922
+923
+924
+925
+926
+927
+928
+929
+930
+931
+932
+933
+934
+935
+936
+937
+938
+939
+940
+941
+942
+943
+944
+945
+946
+947
+948
+949
+950
+951
+952
+953
+954
+955
+956
+957
+958
+959
+960
+961
+962
+963
+964
+965
+966
+967
+968
+969
+970
+971
+972
+973
+974
+975
+976
+977
+978
+979
+980
+981
+982
+983
+984
+985
+986
+987
+988
+989
+990
+991
+992
+993
+994
+995
+996
+997
+998
+999
+1000
+1001
+1002
+1003
+1004
+1005
+1006
+1007
+1008
+1009
+1010
+1011
+1012
+1013
+1014
+1015
+1016
+1017
+1018
+1019
+1020
+1021
+1022
+1023
+1024
+1025
+1026
+1027
+1028
+1029
+1030
+1031
+1032
+1033
+1034
+1035
+1036
+1037
+1038
+1039
+1040
+1041
+1042
+1043
+1044
+1045
+1046
+1047
+1048
+1049
+1050
+1051
+1052
+1053
+1054
+1055
+1056
+1057
+1058
+1059
+1060
+1061
+1062
+1063
+1064
+1065
+1066
+1067
+1068
+1069
+1070
+1071
+1072
+1073
+1074
+1075
+1076
+1077
+1078
+1079
+1080
+1081
+1082
+1083
+1084
+1085
+1086
+1087
+1088
+1089
+1090
+1091
+1092
+1093
+1094
+1095
+1096
+1097
+1098
+1099
+1100
+1101
+1102
+1103
+1104
+1105
+1106
+1107
+1108
+1109
+1110
+1111
+1112
+1113
+1114
+1115
+1116
+1117
+1118
+1119
+1120
+1121
+1122
+1123
+1124
+1125
+1126
+1127
+1128
+1129
+1130
+1131
+1132
+1133
+1134
+1135
+1136
+1137
+1138
+1139
+1140
+1141
+1142
+1143
+1144
+1145
+1146
+1147
+1148
+1149
+1150
+1151
+1152
+1153
+1154
+1155
+1156
+1157
+1158
+1159
+1160
+1161
+1162
+1163
+1164
+1165
+1166
+1167
+1168
+1169
+1170
+1171
+1172
+1173
+1174
+1175
+1176
+1177
+1178
+1179
+1180
+1181
+1182
+1183
+1184
+1185
+1186
+1187
+1188
+1189
+1190
+1191
+1192
+1193
+1194
+1195
+1196
+1197
+1198
+1199
+1200
+1201
+1202
+1203
+1204
+1205
+1206
+1207
+1208
+1209
+1210
+1211
+1212
+1213
+1214
+1215
+1216
+1217
+1218
+1219
+1220
+1221
+1222
+1223
+1224
+1225
+1226
+1227
+1228
+1229
+1230
+1231
+1232
+1233
+1234
+1235
+1236
+1237
+1238
+1239
+1240
+1241
+1242
+1243
+1244
+1245
+1246
+1247
+1248
+1249
+1250
+1251
+1252
+1253
+1254
+1255
+1256
+1257
+1258
+1259
+1260
+1261
+1262
+1263
+1264
+1265
+1266
+1267
+1268
+1269
+
/*
+ * Nox Fluence Peer
+ *
+ * Copyright (C) 2024 Fluence DAO
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation version 3 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+use std::collections::HashMap;
+use std::ops::Deref;
+use std::path::{Path, PathBuf};
+use std::sync::atomic::{AtomicU32, Ordering};
+use std::sync::Arc;
+
+use parking_lot::lock_api::RwLockUpgradableReadGuard;
+use parking_lot::RwLock;
+use tokio::runtime::{Handle, Runtime, UnhandledPanic};
+use tokio::sync::mpsc::{Receiver, Sender};
+
+use crate::error::WorkersError;
+use crate::persistence::{load_persisted_workers, persist_worker, remove_worker, PersistedWorker};
+use crate::KeyStorage;
+use core_distributor::types::{AcquireRequest, Assignment, WorkType};
+use core_distributor::{CoreDistributor, ThreadPinner, CUID};
+use fluence_libp2p::PeerId;
+use types::peer_scope::WorkerId;
+use types::DealId;
+use vm_utils::{CreateVMDomainParams, NonEmpty, VmStatus};
+
+const WORKER_DATA_DIR: &str = "data";
+
+/// Information about a worker.
+pub struct WorkerInfo {
+    /// The unique identifier for the deal associated with the worker.
+    pub deal_id: DealId,
+    /// The ID of the peer that created the worker.
+    pub creator: PeerId,
+    /// A read-write lock indicating whether the worker is active.
+    pub active: RwLock<bool>,
+    /// A count of compute units available for this worker.
+    pub cu_ids: Vec<CUID>,
+    /// A read-write lock indicating that worker has a VM.
+    pub vm_flag: RwLock<bool>,
+}
+
+pub struct WorkerParams {
+    deal_id: DealId,
+    creator: PeerId,
+    cu_ids: Vec<CUID>,
+}
+
+impl WorkerParams {
+    pub fn new(deal_id: DealId, creator: PeerId, cu_ids: Vec<CUID>) -> Self {
+        Self {
+            deal_id,
+            creator,
+            cu_ids,
+        }
+    }
+}
+
+/// Manages a collection of workers.
+pub struct Workers {
+    /// Manages a collection of workers.
+    worker_ids: RwLock<HashMap<DealId, WorkerId>>,
+    /// Mapping of worker IDs to worker information.
+    worker_infos: RwLock<HashMap<WorkerId, WorkerInfo>>,
+    /// Directory path where worker data is persisted.
+    workers_dir: PathBuf,
+    /// Key storage for managing worker key pairs.
+    key_storage: Arc<KeyStorage>,
+    /// Mapping of worker IDs to worker runtime.
+    runtimes: RwLock<HashMap<WorkerId, Runtime>>,
+    /// Core distributor for core assignment
+    core_distributor: Arc<dyn CoreDistributor>,
+    /// Core pinning helper
+    thread_pinner: Arc<dyn ThreadPinner>,
+    /// Number of created tokio runtimes
+    runtime_counter: Arc<AtomicU32>,
+
+    assignments: RwLock<HashMap<WorkerId, Assignment>>,
+
+    sender: Sender<Event>,
+
+    config: WorkersConfig,
+}
+
+#[derive(Debug)]
+pub enum Event {
+    WorkerCreated {
+        worker_id: WorkerId,
+        thread_count: usize,
+    },
+    WorkerRemoved {
+        worker_id: WorkerId,
+    },
+}
+
+pub struct WorkersConfig {
+    /// The notification channel size
+    channel_size: usize,
+    vm: Option<VmConfig>,
+}
+
+impl WorkersConfig {
+    pub fn new(channel_size: usize, vm: Option<VmConfig>) -> Self {
+        Self { channel_size, vm }
+    }
+}
+
+pub struct VmConfig {
+    /// Uri to the libvirt API
+    libvirt_uri: String,
+    bridge_name: String,
+}
+
+impl VmConfig {
+    pub fn new(libvirt_uri: String, bridge_name: String) -> Self {
+        Self {
+            libvirt_uri,
+            bridge_name,
+        }
+    }
+}
+
+impl Workers {
+    /// Creates a `Workers` instance by loading persisted worker data from the specified directory.
+    ///
+    /// # Arguments
+    ///
+    /// * `workers_dir` - The path to the directory containing persisted worker data.
+    /// * `key_storage` - An `Arc<KeyStorage>` instance for managing worker key pairs.
+    /// * `scope` - A `Scope` instance used to determine the host and manage key pairs.
+    ///
+    /// # Returns
+    ///
+    /// Returns `Result<Self, eyre::Error>` where:
+    /// - `Ok(workers)` if the `Workers` instance is successfully created.
+    /// - `Err(eyre::Error)` if an error occurs during the creation process.
+    ///
+    pub async fn from_path(
+        config: WorkersConfig,
+        workers_dir: PathBuf,
+        key_storage: Arc<KeyStorage>,
+        core_distributor: Arc<dyn CoreDistributor>,
+        thread_pinner: Arc<dyn ThreadPinner>,
+    ) -> eyre::Result<(Self, Receiver<Event>)> {
+        let workers = load_persisted_workers(workers_dir.as_path()).await?;
+        let mut worker_ids = HashMap::with_capacity(workers.len());
+        let mut worker_infos = HashMap::with_capacity(workers.len());
+        let mut runtimes = HashMap::with_capacity(workers.len());
+        let mut assignments = HashMap::with_capacity(workers.len());
+
+        let worker_counter = Arc::new(AtomicU32::new(0));
+        let (sender, receiver) = tokio::sync::mpsc::channel::<Event>(config.channel_size);
+
+        for w in workers {
+            let worker_id = w.worker_id;
+            let deal_id = w.deal_id.clone().into();
+            let cu_ids = w.cu_ids.clone();
+            worker_infos.insert(worker_id, w.into());
+            worker_ids.insert(deal_id, worker_id);
+
+            let (runtime, thread_count, assignment) = Self::build_runtime(
+                core_distributor.clone(),
+                thread_pinner.clone(),
+                worker_counter.clone(),
+                worker_id,
+                cu_ids,
+            )?;
+            assignments.insert(worker_id, assignment);
+            runtimes.insert(worker_id, runtime);
+            sender
+                .send(Event::WorkerCreated {
+                    worker_id,
+                    thread_count,
+                })
+                .await?
+        }
+        Ok((
+            Self {
+                worker_ids: worker_ids.into(),
+                worker_infos: worker_infos.into(),
+                workers_dir,
+                key_storage,
+                runtimes: RwLock::new(runtimes),
+                runtime_counter: worker_counter,
+                core_distributor,
+                thread_pinner,
+                sender,
+                assignments: assignments.into(),
+                config,
+            },
+            receiver,
+        ))
+    }
+
+    /// Retrieves the deal ID associated with the specified worker ID.
+    ///
+    /// # Arguments
+    ///
+    /// * `worker_id` - The `PeerId` of the worker for which the deal ID is requested.
+    ///
+    /// # Returns
+    ///
+    /// Returns `Result<DealId, WorkersError>` where:
+    /// - `Ok(deal_id)` if the deal ID is successfully retrieved.
+    /// - `Err(WorkersError)` if an error occurs, such as the worker not found.
+    ///
+    pub fn get_deal_id(&self, worker_id: WorkerId) -> Result<DealId, WorkersError> {
+        self.worker_infos
+            .read()
+            .get(&worker_id)
+            .ok_or(WorkersError::WorkerNotFound(worker_id))
+            .map(|info| info.deal_id.clone())
+    }
+
+    /// Creates a new worker with the given `deal_id` and initial peer ID.
+    ///
+    /// # Arguments
+    ///
+    /// * `deal_id` - A `String` representing the unique identifier for the deal associated with the worker.
+    /// * `init_peer_id` - The initial `PeerId` of the worker.
+    ///
+    /// # Returns
+    ///
+    /// Returns `Result<PeerId, WorkersError>` where:
+    /// - `Ok(worker_id)` if the worker is successfully created, returning the ID of the created worker.
+    /// - `Err(WorkersError)` if an error occurs, such as the worker already existing or key pair creation failure.
+    ///
+    pub async fn create_worker(&self, params: WorkerParams) -> Result<WorkerId, WorkersError> {
+        let deal_id = params.deal_id;
+        let init_peer_id = params.creator;
+        let cu_ids = params.cu_ids;
+
+        let worker_id = {
+            let guard = self.worker_ids.read();
+            guard.get(&deal_id).cloned()
+        };
+
+        match worker_id {
+            Some(_) => Err(WorkersError::WorkerAlreadyExists { deal_id }),
+            _ => {
+                let key_pair = self
+                    .key_storage
+                    .create_key_pair()
+                    .await
+                    .map_err(|err| WorkersError::CreateWorkerKeyPair { err })?;
+
+                let worker_id: WorkerId = key_pair.get_peer_id().into();
+
+                let worker_info = self
+                    .store_worker(worker_id, deal_id.clone(), init_peer_id, cu_ids.clone())
+                    .await;
+
+                match worker_info {
+                    Ok(worker_info) => {
+                        let result: Result<(), WorkersError> = try {
+                            let thread_count = {
+                                let lock = self.worker_ids.upgradable_read();
+                                let worker_ids = lock.deref();
+                                if worker_ids.contains_key(&deal_id) {
+                                    return Err(WorkersError::WorkerAlreadyExists { deal_id });
+                                }
+
+                                let (runtime, thread_count, assignment) = Self::build_runtime(
+                                    self.core_distributor.clone(),
+                                    self.thread_pinner.clone(),
+                                    self.runtime_counter.clone(),
+                                    worker_id,
+                                    cu_ids.clone(),
+                                )?;
+
+                                // Upgrade read lock to write lock
+                                let mut worker_ids = RwLockUpgradableReadGuard::upgrade(lock);
+                                let mut worker_infos = self.worker_infos.write();
+                                let mut runtimes = self.runtimes.write();
+                                let mut worker_assignments = self.assignments.write();
+
+                                worker_ids.insert(deal_id.clone(), worker_id);
+                                worker_infos.insert(worker_id, worker_info);
+                                runtimes.insert(worker_id, runtime);
+                                worker_assignments.insert(worker_id, assignment);
+
+                                thread_count
+                            };
+
+                            self.sender
+                                .send(Event::WorkerCreated {
+                                    worker_id,
+                                    thread_count,
+                                })
+                                .await
+                                .map_err(|_err| WorkersError::FailedToNotifySubsystem {
+                                    worker_id,
+                                })?
+                        };
+                        match result {
+                            Ok(_) => {
+                                tracing::info!(
+                                    target = "worker-registry",
+                                    worker_id = worker_id.to_string(),
+                                    "Worker created {worker_id}"
+                                );
+                                Ok(())
+                            }
+                            Err(err) => {
+                                tracing::error!(
+                                    target = "worker-registry",
+                                    worker_id = worker_id.to_string(),
+                                    "Failed to notify subsystem for {worker_id}: {}",
+                                    err
+                                );
+                                let mut worker_ids = self.worker_ids.write();
+                                let mut worker_infos = self.worker_infos.write();
+                                let mut runtimes = self.runtimes.write();
+
+                                worker_ids.remove(&deal_id);
+                                worker_infos.remove(&worker_id);
+                                runtimes.remove(&worker_id);
+
+                                self.core_distributor
+                                    .release_worker_cores(cu_ids.as_slice());
+
+                                Err(err)
+                            }
+                        }?
+                    }
+                    Err(err) => {
+                        tracing::warn!(
+                            target = "worker-registry",
+                            worker_id = worker_id.to_string(),
+                            "Failed to store worker info for {worker_id}: {}",
+                            err
+                        );
+                        self.key_storage
+                            .remove_key_pair(worker_id)
+                            .await
+                            .map_err(|err| WorkersError::RemoveWorkerKeyPair { err })?;
+
+                        return Err(err);
+                    }
+                }
+
+                Ok(worker_id)
+            }
+        }
+    }
+
+    /// Removes a worker with the specified `worker_id`.
+    ///
+    /// # Arguments
+    ///
+    /// * `worker_id` - The `PeerId` of the worker to be removed.
+    ///
+    /// # Returns
+    ///
+    /// Returns `Result<(), WorkersError>` where:
+    /// - `Ok(())` if the worker is successfully removed.
+    /// - `Err(WorkersError)` if an error occurs, such as the worker not found or key pair removal failure.
+    ///
+    pub async fn remove_worker(&self, worker_id: WorkerId) -> Result<(), WorkersError> {
+        let deal_id = self.get_deal_id(worker_id)?;
+        self.sender
+            .send(Event::WorkerRemoved { worker_id })
+            .await
+            .map_err(|_err| WorkersError::FailedToNotifySubsystem { worker_id })?;
+        remove_worker(&self.workers_dir, worker_id).await?;
+        self.key_storage
+            .remove_key_pair(worker_id)
+            .await
+            .map_err(|err| WorkersError::RemoveWorkerKeyPair { err })?;
+
+        let removed_runtime = {
+            let mut worker_ids = self.worker_ids.write();
+            let mut worker_infos = self.worker_infos.write();
+            let mut runtimes = self.runtimes.write();
+            let mut assignments = self.assignments.write();
+            let removed_worker_id = worker_ids.remove(&deal_id);
+            let removed_worker_info = worker_infos.remove(&worker_id);
+            let removed_runtime = runtimes.remove(&worker_id);
+            let removed_assignments = assignments.remove(&worker_id);
+
+            self.remove_vm(worker_id)?;
+
+            debug_assert!(removed_worker_id.is_some(), "worker_id does not exist");
+            debug_assert!(removed_worker_info.is_some(), "worker info does not exist");
+            debug_assert!(removed_runtime.is_some(), "worker runtime does not exist");
+            debug_assert!(
+                removed_assignments.is_some(),
+                "worker assignment does not exist"
+            );
+            removed_runtime
+        };
+
+        if let Some(runtime) = removed_runtime {
+            // we can't shutdown the runtime in the async context, shift it to the blocking pool
+            // also we don't wait the result
+            tokio::task::Builder::new()
+                .name(&format!("runtime-shutdown-{}", worker_id))
+                .spawn_blocking(move || runtime.shutdown_background())
+                .expect("Could not spawn task");
+        }
+
+        Ok(())
+    }
+
+    /// Activates the worker with the specified `worker_id`.
+    ///
+    /// The activation process sets the worker's status to `true`, indicating that the worker
+    /// is active. The updated status is persisted, and internal data structures are updated.
+    ///
+    /// # Arguments
+    ///
+    /// * `worker_id` - The `PeerId` of the worker to be activated.
+    ///
+    /// # Returns
+    ///
+    /// Returns `Result<(), WorkersError>` where:
+    /// - `Ok(())` if the activation is successful.
+    /// - `Err(WorkersError)` if an error occurs during the activation process.
+    ///
+    pub async fn activate_worker(&self, worker_id: WorkerId) -> Result<(), WorkersError> {
+        self.set_worker_status(worker_id, true).await?;
+        Ok(())
+    }
+
+    /// Deactivates the worker with the specified `worker_id`.
+    ///
+    /// The deactivation process sets the worker's status to `false`, indicating that the worker
+    /// is not active. The updated status is persisted, and internal data structures are updated.
+    ///
+    /// # Arguments
+    ///
+    /// * `worker_id` - The `PeerId` of the worker to be deactivated.
+    ///
+    /// # Returns
+    ///
+    /// Returns `Result<(), WorkersError>` where:
+    /// - `Ok(())` if the deactivation is successful.
+    /// - `Err(WorkersError)` if an error occurs during the deactivation process.
+    ///
+    pub async fn deactivate_worker(&self, worker_id: WorkerId) -> Result<(), WorkersError> {
+        self.set_worker_status(worker_id, false).await?;
+        Ok(())
+    }
+
+    pub fn get_runtime_handle(&self, worker_id: WorkerId) -> Option<Handle> {
+        self.runtimes
+            .read()
+            .get(&worker_id)
+            .map(|x| x.handle().clone())
+    }
+
+    /// Retrieves the creator `PeerId` associated with the specified worker `PeerId`.
+    ///
+    /// If the provided `worker_id` belongs to the host, the host's `PeerId` is returned.
+    /// Otherwise, the creator's `PeerId` associated with the worker is retrieved.
+    ///
+    /// # Arguments
+    ///
+    /// * `worker_id` - The `PeerId` of the worker for which the creator `PeerId` is requested.
+    ///
+    /// # Returns
+    ///
+    /// Returns `Result<PeerId, WorkersError>` where:
+    /// - `Ok(creator_peer_id)` if the creator `PeerId` is successfully retrieved.
+    /// - `Err(WorkersError)` if an error occurs, such as the worker not found.
+    ///
+    pub fn get_worker_creator(&self, worker_id: WorkerId) -> Result<PeerId, WorkersError> {
+        self.worker_infos
+            .read()
+            .get(&worker_id)
+            .map(|i| i.creator)
+            .ok_or(WorkersError::WorkerNotFound(worker_id))
+    }
+
+    /// Retrieves the worker ID associated with the specified `deal_id`.
+    ///
+    /// # Arguments
+    ///
+    /// * `deal_id` - The unique identifier (`String`) of the deal associated with the worker.
+    ///
+    /// # Returns
+    ///
+    /// Returns `Result<PeerId, WorkersError>` where:
+    /// - `Ok(worker_id)` if the worker ID is successfully retrieved.
+    /// - `Err(WorkersError)` if an error occurs, such as the worker not found.
+    ///
+    pub fn get_worker_id(&self, deal_id: DealId) -> Result<WorkerId, WorkersError> {
+        self.worker_ids
+            .read()
+            .get(&deal_id)
+            .cloned()
+            .ok_or(WorkersError::WorkerNotFoundByDeal(deal_id))
+    }
+
+    /// Checks the activation status of the worker with the specified `worker_id`.
+    ///
+    /// The activation status indicates whether the worker is currently active or not. If the
+    /// worker is the host, it is always considered active. Otherwise, the method checks the
+    /// internal data structures to determine the worker's status.
+    ///
+    /// # Arguments
+    ///
+    /// * `worker_id` - The `PeerId` of the worker to check for activation status.
+    ///
+    /// # Returns
+    ///
+    /// Returns `true` if the worker is active, and `false` otherwise. If the worker with the
+    /// specified `worker_id` is not found, a warning is logged, and `false` is returned.
+    ///
+    pub fn is_worker_active(&self, worker_id: WorkerId) -> bool {
+        let guard = self.worker_infos.read();
+        let worker_info = guard.get(&worker_id);
+
+        match worker_info {
+            Some(worker_info) => *worker_info.active.read(),
+            None => {
+                tracing::warn!(
+                    target = "worker-registry",
+                    worker_id = worker_id.to_string(),
+                    "Worker {worker_id} not found"
+                );
+                false
+            }
+        }
+    }
+
+    /// Retrieves a list of all worker IDs.
+    ///
+    /// # Returns
+    ///
+    /// Returns a `Vec<WorkerId>` representing a list of all worker IDs currently registered.
+    ///
+    pub fn list_workers(&self) -> Vec<WorkerId> {
+        self.worker_infos.read().keys().cloned().collect()
+    }
+
+    pub fn shutdown(&self) {
+        tracing::debug!("Shutdown worker runtimes");
+        let mut runtimes = self.runtimes.write();
+        let mut deleted_runtimes = Vec::with_capacity(runtimes.len());
+        let worker_ids: Vec<WorkerId> = runtimes.keys().cloned().collect();
+        for worker_id in worker_ids {
+            if let Some(runtime) = runtimes.remove(&worker_id) {
+                deleted_runtimes.push(runtime);
+            }
+        }
+
+        tokio::task::Builder::new()
+            .name("workers-shutdown")
+            .spawn_blocking(move || {
+                for runtime in deleted_runtimes {
+                    runtime.shutdown_background();
+                }
+            })
+            .expect("Could not spawn a task");
+    }
+
+    /// Persists worker information and updates internal data structures.
+    ///
+    /// This method stores information about the worker identified by `worker_id` and associates
+    /// it with the provided `deal_id` and `creator` PeerId. The worker's active status is set to `true`.
+    /// The information is persisted to the workers' storage directory, and the internal
+    /// `worker_ids` and `worker_infos` data structures are updated accordingly.
+    ///
+    /// # Arguments
+    ///
+    /// * `worker_id` - The `PeerId` of the worker to be stored.
+    /// * `deal_id` - The unique identifier (`String`) associated with the deal.
+    /// * `creator` - The `PeerId` of the creator of the worker.
+    ///
+    /// # Returns
+    ///
+    /// Returns `Result<WorkerInfo, WorkersError>` where:
+    /// - `Ok(worker_info)` if the worker information is successfully stored.
+    /// - `Err(WorkersError)` if an error occurs during the storage process.
+    ///
+    async fn store_worker(
+        &self,
+        worker_id: WorkerId,
+        deal_id: DealId,
+        creator: PeerId,
+        cu_ids: Vec<CUID>,
+    ) -> Result<WorkerInfo, WorkersError> {
+        let worker_path = self.workers_dir.join(worker_id.to_string());
+
+        tokio::fs::create_dir_all(&worker_path)
+            .await
+            .map_err(|err| WorkersError::WorkerStorageDirectory {
+                path: worker_path.clone(),
+                worker_id,
+                err,
+            })?;
+
+        let worker_data_path = worker_path.join(WORKER_DATA_DIR);
+
+        tokio::fs::create_dir_all(&worker_data_path)
+            .await
+            .map_err(|err| WorkersError::WorkerStorageDirectory {
+                path: worker_data_path,
+                worker_id,
+                err,
+            })?;
+
+        persist_worker(
+            &worker_path,
+            PersistedWorker {
+                worker_id,
+                creator,
+                deal_id: deal_id.clone().into(),
+                active: true,
+                cu_ids: cu_ids.clone(),
+                vm_flag: false,
+            },
+        )
+        .await?;
+        let worker_info = WorkerInfo {
+            deal_id,
+            creator,
+            active: RwLock::new(true),
+            cu_ids,
+            vm_flag: false.into(),
+        };
+        Ok(worker_info)
+    }
+
+    pub async fn create_vm(
+        &self,
+        worker_id: WorkerId,
+        image: &Path,
+    ) -> Result<String, WorkersError> {
+        match &self.config.vm {
+            None => Err(WorkersError::FeatureDisabled),
+            Some(vm_config) => {
+                let assignment = {
+                    let guard = self.assignments.read();
+                    let assignment = guard
+                        .get(&worker_id)
+                        .ok_or_else(|| WorkersError::WorkerNotFound(worker_id))?;
+
+                    NonEmpty::from_vec(assignment.logical_core_ids())
+                        .ok_or_else(|| WorkersError::WrongAssignment)?
+                };
+
+                let file_name = &image
+                    .file_name()
+                    .ok_or_else(|| WorkersError::VMImageNotFile {
+                        image: image.to_path_buf(),
+                    })?;
+
+                let vm_name = worker_id.to_string();
+
+                let worker_image = self
+                    .workers_dir
+                    .join(&vm_name)
+                    .join(WORKER_DATA_DIR)
+                    .join(file_name);
+
+                tokio::fs::copy(&image, &worker_image)
+                    .await
+                    .map_err(|err| WorkersError::FailedToCopyVMImage {
+                        image: image.to_path_buf(),
+                        err,
+                    })?;
+
+                let params = CreateVMDomainParams::new(
+                    vm_name.clone(),
+                    worker_image,
+                    assignment,
+                    vm_config.bridge_name.clone(),
+                );
+
+                vm_utils::create_domain(vm_config.libvirt_uri.clone().as_str(), &params)?;
+
+                self.set_vm_flag(worker_id, true).await?;
+
+                vm_utils::start_vm(vm_config.libvirt_uri.as_str(), vm_name.as_str())?;
+
+                Ok(vm_name)
+            }
+        }
+    }
+
+    fn remove_vm(&self, worker_id: WorkerId) -> Result<(), WorkersError> {
+        if let Some(vm_config) = &self.config.vm {
+            vm_utils::remove_domain(
+                vm_config.libvirt_uri.as_str(),
+                worker_id.to_string().as_str(),
+            )?;
+        }
+        Ok(())
+    }
+
+    pub fn start_vm(&self, worker_id: WorkerId) -> Result<(), WorkersError> {
+        if let Some(vm_config) = &self.config.vm {
+            if self.has_vm(worker_id)? {
+                vm_utils::start_vm(vm_config.libvirt_uri.as_str(), &worker_id.to_string())?;
+            } else {
+                return Err(WorkersError::VmNotFound(worker_id));
+            }
+        }
+        Ok(())
+    }
+
+    pub fn stop_vm(&self, worker_id: WorkerId) -> Result<(), WorkersError> {
+        self.on_vm(worker_id, vm_utils::stop_vm)
+    }
+
+    pub fn reboot_vm(&self, worker_id: WorkerId) -> Result<(), WorkersError> {
+        self.on_vm(worker_id, vm_utils::reboot_vm)
+    }
+
+    pub fn reset_vm(&self, worker_id: WorkerId) -> Result<(), WorkersError> {
+        self.on_vm(worker_id, vm_utils::reset_vm)
+    }
+
+    pub fn status_vm(&self, worker_id: WorkerId) -> Result<VmStatus, WorkersError> {
+        self.on_vm(worker_id, vm_utils::status_vm)
+    }
+
+    fn on_vm<F, R>(&self, worker_id: WorkerId, f: F) -> Result<R, WorkersError>
+    where
+        F: Fn(&str, &str) -> Result<R, vm_utils::VmError>,
+    {
+        match &self.config.vm {
+            Some(vm_config) => {
+                if self.has_vm(worker_id)? {
+                    let result = f(vm_config.libvirt_uri.as_str(), &worker_id.to_string())?;
+                    Ok(result)
+                } else {
+                    Err(WorkersError::VmNotFound(worker_id))
+                }
+            }
+            None => Err(WorkersError::FeatureDisabled),
+        }
+    }
+
+    fn has_vm(&self, worker_id: WorkerId) -> Result<bool, WorkersError> {
+        let guard = self.worker_infos.read();
+        let worker_info = guard
+            .get(&worker_id)
+            .ok_or_else(|| WorkersError::WorkerNotFound(worker_id))?;
+        let flag = *worker_info.vm_flag.read();
+        Ok(flag)
+    }
+
+    async fn set_worker_info<F>(&self, worker_id: WorkerId, modify: F) -> Result<(), WorkersError>
+    where
+        F: Fn(&WorkerInfo),
+    {
+        let persisted_worker = {
+            let guard = self.worker_infos.read();
+            let worker_info = guard
+                .get(&worker_id)
+                .ok_or_else(|| WorkersError::WorkerNotFound(worker_id))?;
+
+            modify(worker_info);
+
+            let active = worker_info.active.read();
+            let vm_flag = worker_info.vm_flag.read();
+
+            PersistedWorker {
+                worker_id,
+                creator: worker_info.creator,
+                deal_id: worker_info.deal_id.to_string(),
+                active: *active,
+                cu_ids: worker_info.cu_ids.clone(),
+                vm_flag: *vm_flag,
+            }
+        };
+        let worker_path = self.workers_dir.join(worker_id.to_string());
+        persist_worker(&worker_path, persisted_worker).await?;
+        Ok(())
+    }
+
+    async fn set_worker_status(
+        &self,
+        worker_id: WorkerId,
+        status: bool,
+    ) -> Result<(), WorkersError> {
+        self.set_worker_info(worker_id, |worker_info: &WorkerInfo| {
+            let mut active = worker_info.active.write();
+            *active = status;
+        })
+        .await?;
+        Ok(())
+    }
+
+    async fn set_vm_flag(&self, worker_id: WorkerId, value: bool) -> Result<(), WorkersError> {
+        self.set_worker_info(worker_id, |worker_info: &WorkerInfo| {
+            let mut vm_flag = worker_info.vm_flag.write();
+            *vm_flag = value;
+        })
+        .await?;
+        Ok(())
+    }
+
+    /// Retrieves the assignment associated with the specified worker `PeerId`.
+    ///
+    /// # Arguments
+    ///
+    /// * `worker_id` - The `PeerId` of the worker for which the creator `PeerId` is requested.
+    ///
+    /// # Returns
+    ///
+    /// Returns `Result<Assignment, WorkersError>` where:
+    /// - `Ok(assignment)` if the creator `PeerId` is successfully retrieved.
+    /// - `Err(WorkersError)` if an error occurs, such as the worker not found.
+    ///
+    pub fn get_worker_assignment(&self, worker_id: WorkerId) -> Result<Assignment, WorkersError> {
+        self.assignments
+            .read()
+            .get(&worker_id)
+            .cloned()
+            .ok_or(WorkersError::WorkerNotFound(worker_id))
+    }
+
+    fn build_runtime(
+        core_distributor: Arc<dyn CoreDistributor>,
+        thread_pinner: Arc<dyn ThreadPinner>,
+        worker_counter: Arc<AtomicU32>,
+        worker_id: WorkerId,
+        cu_ids: Vec<CUID>,
+    ) -> Result<(Runtime, usize, Assignment), WorkersError> {
+        // Creating a multi-threaded Tokio runtime with a total of cu_count * 2 threads.
+        // We assume cu_count threads per logical processor, aligning with the common practice.
+        let assignment = core_distributor
+            .acquire_worker_cores(AcquireRequest::new(cu_ids, WorkType::Deal))
+            .map_err(|err| WorkersError::FailedToAssignCores { worker_id, err })?;
+
+        let logical_cores = assignment.logical_core_ids();
+        let threads_count = logical_cores.len();
+
+        let id = worker_counter.fetch_add(1, Ordering::Acquire);
+
+        tracing::info!(target: "worker", "Creating runtime with id {} for worker id {}. Pinned to cores: {:?}", id, worker_id, logical_cores);
+
+        let runtime_assignment = assignment.clone();
+        let runtime = tokio::runtime::Builder::new_multi_thread()
+            .thread_name(format!("worker-pool-{}", id))
+            // Configuring worker threads for executing service calls and particles
+            .worker_threads(threads_count)
+            // Configuring blocking threads for handling I/O
+            .max_blocking_threads(threads_count)
+            .enable_time()
+            .enable_io()
+            .on_thread_start(move || {
+                runtime_assignment.pin_current_thread_with(thread_pinner.as_ref());
+            })
+            .unhandled_panic(UnhandledPanic::Ignore) // TODO: try to log panics after fix https://github.com/tokio-rs/tokio/issues/4516
+            .build()
+            .map_err(|err| WorkersError::CreateRuntime { worker_id, err })?;
+        Ok((runtime, threads_count, assignment))
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use crate::{KeyStorage, WorkerParams, Workers, WorkersConfig, CUID};
+    use core_distributor::dummy::DummyCoreDistibutor;
+    use fs_utils::create_dirs;
+    use hex::FromHex;
+    use libp2p::PeerId;
+    use std::sync::Arc;
+    use tempfile::tempdir;
+    use types::peer_scope::PeerScope;
+
+    #[tokio::test]
+    async fn test_workers_creation() {
+        // Create a temporary directory for worker storage
+        let temp_dir = tempdir().expect("Failed to create temporary directory");
+        let key_pairs_dir = temp_dir.path().join("key_pairs").to_path_buf();
+        let workers_dir = temp_dir.path().join("workers").to_path_buf();
+        let root_key_pair = fluence_keypair::KeyPair::generate_ed25519();
+        let core_distributor = DummyCoreDistibutor::new();
+        let core_distributor = Arc::new(core_distributor);
+
+        create_dirs(&[&workers_dir]).unwrap();
+
+        let thread_pinner = Arc::new(test_utils::pinning::DUMMY);
+
+        // Create a new KeyStorage instance
+        let key_storage = Arc::new(
+            KeyStorage::from_path(key_pairs_dir.clone(), root_key_pair.clone())
+                .await
+                .expect("Failed to create KeyStorage from path"),
+        );
+
+        let config = WorkersConfig::new(32, None);
+
+        // Create a new Workers instance
+        let (workers, _receiver) = Workers::from_path(
+            config,
+            workers_dir.clone(),
+            key_storage.clone(),
+            core_distributor,
+            thread_pinner,
+        )
+        .await
+        .expect("Failed to create Workers from path");
+
+        // Check that the workers instance has the correct initial state
+        assert_eq!(workers.worker_ids.read().len(), 0);
+        assert_eq!(workers.worker_infos.read().len(), 0);
+        assert_eq!(workers.workers_dir, workers_dir);
+    }
+
+    #[tokio::test]
+    async fn test_worker_creation() {
+        // Create a temporary directory for worker storage
+        let temp_dir = tempdir().expect("Failed to create temporary directory");
+        let key_pairs_dir = temp_dir.path().join("key_pairs").to_path_buf();
+        let workers_dir = temp_dir.path().join("workers").to_path_buf();
+        let root_key_pair = fluence_keypair::KeyPair::generate_ed25519();
+        let core_distributor = DummyCoreDistibutor::new();
+        let core_distributor = Arc::new(core_distributor);
+
+        create_dirs(&[&workers_dir]).unwrap();
+
+        let thread_pinner = Arc::new(test_utils::pinning::DUMMY);
+        // Create a new KeyStorage instance
+        let key_storage = Arc::new(
+            KeyStorage::from_path(key_pairs_dir.clone(), root_key_pair.clone())
+                .await
+                .expect("Failed to create KeyStorage from path"),
+        );
+
+        let config = WorkersConfig::new(32, None);
+
+        // Create a new Workers instance
+        let (workers, _receiver) = Workers::from_path(
+            config,
+            workers_dir.clone(),
+            key_storage.clone(),
+            core_distributor,
+            thread_pinner,
+        )
+        .await
+        .expect("Failed to create Workers from path");
+
+        let init_id_1 =
+            <CUID>::from_hex("54ae1b506c260367a054f80800a545f23e32c6bc4a8908c9a794cb8dad23e5ea")
+                .unwrap();
+        let unit_ids = vec![init_id_1];
+
+        let creator_peer_id = PeerId::random();
+        let worker_id = workers
+            .create_worker(WorkerParams::new(
+                "deal_id_1".into(),
+                creator_peer_id,
+                unit_ids,
+            ))
+            .await
+            .expect("Failed to create worker");
+
+        let deal_id = workers
+            .get_deal_id(worker_id)
+            .expect("Failed to get deal id");
+        assert_eq!(deal_id, "deal_id_1".to_string());
+        let key_pair_1 = key_storage.get_worker_key_pair(worker_id);
+        assert!(key_pair_1.is_some());
+        assert_eq!(key_pair_1.clone().unwrap().get_peer_id(), worker_id.into());
+
+        let key_pair_2 = key_storage
+            .get_keypair(PeerScope::WorkerId(worker_id))
+            .expect("Failed to get deal id");
+
+        assert_eq!(key_pair_1.unwrap().to_vec(), key_pair_2.to_vec());
+
+        let list_workers = workers.list_workers();
+        assert_eq!(list_workers, vec![worker_id]);
+
+        let creator = workers
+            .get_worker_creator(worker_id)
+            .expect("Failed to get worker creator");
+        assert_eq!(creator, creator_peer_id);
+
+        let worker_id_1 = workers
+            .get_worker_id("deal_id_1".into())
+            .expect("Failed to get worker id");
+        assert_eq!(worker_id_1, worker_id);
+        // tokio doesn't allow to drop runtimes in async context, so shifting workers drop to the blocking thread
+        tokio::task::spawn_blocking(|| drop(workers)).await.unwrap();
+    }
+
+    #[tokio::test]
+    async fn test_worker_creation_dupes() {
+        // Create a temporary directory for worker storage
+        let temp_dir = tempdir().expect("Failed to create temporary directory");
+        let key_pairs_dir = temp_dir.path().join("key_pairs").to_path_buf();
+        let workers_dir = temp_dir.path().join("workers").to_path_buf();
+        let root_key_pair = fluence_keypair::KeyPair::generate_ed25519();
+        let core_distributor = DummyCoreDistibutor::new();
+        let core_distributor = Arc::new(core_distributor);
+
+        create_dirs(&[&workers_dir]).unwrap();
+
+        let thread_pinner = Arc::new(test_utils::pinning::DUMMY);
+        // Create a new KeyStorage instance
+        let key_storage = Arc::new(
+            KeyStorage::from_path(key_pairs_dir.clone(), root_key_pair.clone())
+                .await
+                .expect("Failed to create KeyStorage from path"),
+        );
+        let config = WorkersConfig::new(32, None);
+
+        // Create a new Workers instance
+        let (workers, _receiver) = Workers::from_path(
+            config,
+            workers_dir.clone(),
+            key_storage.clone(),
+            core_distributor,
+            thread_pinner,
+        )
+        .await
+        .expect("Failed to create Workers from path");
+
+        let init_id_1 =
+            <CUID>::from_hex("54ae1b506c260367a054f80800a545f23e32c6bc4a8908c9a794cb8dad23e5ea")
+                .unwrap();
+        let unit_ids = vec![init_id_1];
+
+        let worker_id = workers
+            .create_worker(WorkerParams::new(
+                "deal_id_1".into(),
+                PeerId::random(),
+                unit_ids.clone(),
+            ))
+            .await
+            .expect("Failed to create worker");
+
+        let deal_id = workers
+            .get_deal_id(worker_id)
+            .expect("Failed to get deal id");
+        assert_eq!(deal_id, "deal_id_1".to_string());
+
+        let res = workers
+            .create_worker(WorkerParams::new(
+                "deal_id_1".into(),
+                PeerId::random(),
+                unit_ids,
+            ))
+            .await;
+
+        assert!(res.is_err());
+        assert_eq!(
+            res.err().unwrap().to_string(),
+            "Worker for deal_id_1 already exists"
+        );
+        // tokio doesn't allow to drop runtimes in async context, so shifting workers drop to the blocking thread
+        tokio::task::spawn_blocking(|| drop(workers)).await.unwrap();
+    }
+
+    #[tokio::test]
+    async fn test_worker_remove() {
+        // Create a temporary directory for worker storage
+        let temp_dir = tempdir().expect("Failed to create temporary directory");
+        let key_pairs_dir = temp_dir.path().join("key_pairs").to_path_buf();
+        let workers_dir = temp_dir.path().join("workers").to_path_buf();
+        let root_key_pair = fluence_keypair::KeyPair::generate_ed25519();
+        let core_distributor = DummyCoreDistibutor::new();
+        let core_distributor = Arc::new(core_distributor);
+
+        create_dirs(&[&workers_dir]).unwrap();
+
+        let thread_pinner = Arc::new(test_utils::pinning::DUMMY);
+        // Create a new KeyStorage instance
+        let key_storage = Arc::new(
+            KeyStorage::from_path(key_pairs_dir.clone(), root_key_pair.clone())
+                .await
+                .expect("Failed to create KeyStorage from path"),
+        );
+        let config = WorkersConfig::new(32, None);
+
+        // Create a new Workers instance
+        let (workers, _receiver) = Workers::from_path(
+            config,
+            workers_dir.clone(),
+            key_storage.clone(),
+            core_distributor,
+            thread_pinner,
+        )
+        .await
+        .expect("Failed to create Workers from path");
+
+        let init_id_1 =
+            <CUID>::from_hex("54ae1b506c260367a054f80800a545f23e32c6bc4a8908c9a794cb8dad23e5ea")
+                .unwrap();
+        let unit_ids = vec![init_id_1];
+
+        let worker_id_1 = workers
+            .create_worker(WorkerParams::new(
+                "deal_id_1".into(),
+                PeerId::random(),
+                unit_ids.clone(),
+            ))
+            .await
+            .expect("Failed to create worker");
+
+        let worker_id_2 = workers
+            .create_worker(WorkerParams::new(
+                "deal_id_2".into(),
+                PeerId::random(),
+                unit_ids,
+            ))
+            .await
+            .expect("Failed to create worker");
+
+        let mut list = workers.list_workers();
+        list.sort();
+        let mut expected_list = vec![worker_id_1, worker_id_2];
+        expected_list.sort();
+
+        assert_eq!(list, expected_list);
+
+        workers
+            .remove_worker(worker_id_2)
+            .await
+            .expect("Failed to remove worker id");
+
+        let list = workers.list_workers();
+        let expected_list = vec![worker_id_1];
+
+        assert_eq!(list, expected_list);
+        let key_1 = key_storage.get_worker_key_pair(worker_id_1);
+        let key_2 = key_storage.get_worker_key_pair(worker_id_2);
+        assert!(key_1.is_some());
+        assert!(key_2.is_none());
+        // tokio doesn't allow to drop runtimes in async context, so shifting workers drop to the blocking thread
+        tokio::task::spawn_blocking(|| drop(workers)).await.unwrap();
+    }
+
+    #[tokio::test]
+    async fn test_persistence() {
+        // Create a temporary directory for worker storage
+        let temp_dir = tempdir().expect("Failed to create temporary directory");
+        let key_pairs_dir = temp_dir.path().join("key_pairs").to_path_buf();
+        let workers_dir = temp_dir.path().join("workers").to_path_buf();
+        let root_key_pair = fluence_keypair::KeyPair::generate_ed25519();
+        let core_distributor = DummyCoreDistibutor::new();
+        let core_distributor = Arc::new(core_distributor);
+
+        create_dirs(&[&workers_dir]).unwrap();
+
+        let thread_pinner = Arc::new(test_utils::pinning::DUMMY);
+        // Create a new KeyStorage instance
+        let key_storage = Arc::new(
+            KeyStorage::from_path(key_pairs_dir.clone(), root_key_pair.clone())
+                .await
+                .expect("Failed to create KeyStorage from path"),
+        );
+        let config = WorkersConfig::new(32, None);
+
+        // Create a new Workers instance
+        let (workers, _receiver) = Workers::from_path(
+            config,
+            workers_dir.clone(),
+            key_storage.clone(),
+            core_distributor.clone(),
+            thread_pinner,
+        )
+        .await
+        .expect("Failed to create Workers from path");
+        let init_id_1 =
+            <CUID>::from_hex("54ae1b506c260367a054f80800a545f23e32c6bc4a8908c9a794cb8dad23e5ea")
+                .unwrap();
+        let unit_ids = vec![init_id_1];
+
+        let worker_id_1 = workers
+            .create_worker(WorkerParams::new(
+                "deal_id_1".into(),
+                PeerId::random(),
+                unit_ids.clone(),
+            ))
+            .await
+            .expect("Failed to create worker");
+
+        let worker_id_2 = workers
+            .create_worker(WorkerParams::new(
+                "deal_id_2".into(),
+                PeerId::random(),
+                unit_ids,
+            ))
+            .await
+            .expect("Failed to create worker");
+
+        let mut list = workers.list_workers();
+        list.sort();
+        let mut expected_list = vec![worker_id_1, worker_id_2];
+        expected_list.sort();
+
+        assert_eq!(list, expected_list);
+
+        workers
+            .remove_worker(worker_id_2)
+            .await
+            .expect("Failed to remove worker id");
+
+        let list = workers.list_workers();
+        let expected_list = vec![worker_id_1];
+
+        assert_eq!(list, expected_list);
+        let key_1 = key_storage.get_worker_key_pair(worker_id_1);
+        let key_2 = key_storage.get_worker_key_pair(worker_id_2);
+        assert!(key_1.is_some());
+        assert!(key_2.is_none());
+        let status = workers.is_worker_active(worker_id_1);
+        assert!(status);
+        workers
+            .deactivate_worker(worker_id_1)
+            .await
+            .expect("Failed to activate worker");
+        let status = workers.is_worker_active(worker_id_1);
+        assert!(!status);
+        drop(key_storage);
+        // tokio doesn't allow to drop runtimes in async context, so shifting workers drop to the blocking thread
+        tokio::task::spawn_blocking(|| drop(workers)).await.unwrap();
+
+        // Create a new KeyStorage instance
+        let key_storage = Arc::new(
+            KeyStorage::from_path(key_pairs_dir.clone(), root_key_pair.clone())
+                .await
+                .expect("Failed to create KeyStorage from path"),
+        );
+
+        let core_distributor = DummyCoreDistibutor::new();
+        let core_distributor = Arc::new(core_distributor);
+
+        let thread_pinner = Arc::new(test_utils::pinning::DUMMY);
+        let config = WorkersConfig::new(32, None);
+
+        // Create a new Workers instance
+        let (workers, _receiver) = Workers::from_path(
+            config,
+            workers_dir.clone(),
+            key_storage.clone(),
+            core_distributor,
+            thread_pinner,
+        )
+        .await
+        .expect("Failed to create Workers from path");
+
+        let list = workers.list_workers();
+        let expected_list = vec![worker_id_1];
+
+        assert_eq!(list, expected_list);
+        let key_1 = key_storage.get_worker_key_pair(worker_id_1);
+        let key_2 = key_storage.get_worker_key_pair(worker_id_2);
+        assert!(key_1.is_some());
+        assert!(key_2.is_none());
+        let status = workers.is_worker_active(worker_id_1);
+        assert!(!status);
+        // tokio doesn't allow to drop runtimes in async context, so shifting workers drop to the blocking thread
+        tokio::task::spawn_blocking(|| drop(workers)).await.unwrap();
+    }
+}
+
\ No newline at end of file diff --git a/static.files/COPYRIGHT-23e9bde6c69aea69.txt b/static.files/COPYRIGHT-23e9bde6c69aea69.txt new file mode 100644 index 0000000000..1447df792f --- /dev/null +++ b/static.files/COPYRIGHT-23e9bde6c69aea69.txt @@ -0,0 +1,50 @@ +# REUSE-IgnoreStart + +These documentation pages include resources by third parties. This copyright +file applies only to those resources. The following third party resources are +included, and carry their own copyright notices and license terms: + +* Fira Sans (FiraSans-Regular.woff2, FiraSans-Medium.woff2): + + Copyright (c) 2014, Mozilla Foundation https://mozilla.org/ + with Reserved Font Name Fira Sans. + + Copyright (c) 2014, Telefonica S.A. + + Licensed under the SIL Open Font License, Version 1.1. + See FiraSans-LICENSE.txt. + +* rustdoc.css, main.js, and playpen.js: + + Copyright 2015 The Rust Developers. + Licensed under the Apache License, Version 2.0 (see LICENSE-APACHE.txt) or + the MIT license (LICENSE-MIT.txt) at your option. + +* normalize.css: + + Copyright (c) Nicolas Gallagher and Jonathan Neal. + Licensed under the MIT license (see LICENSE-MIT.txt). + +* Source Code Pro (SourceCodePro-Regular.ttf.woff2, + SourceCodePro-Semibold.ttf.woff2, SourceCodePro-It.ttf.woff2): + + Copyright 2010, 2012 Adobe Systems Incorporated (http://www.adobe.com/), + with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark + of Adobe Systems Incorporated in the United States and/or other countries. + + Licensed under the SIL Open Font License, Version 1.1. + See SourceCodePro-LICENSE.txt. + +* Source Serif 4 (SourceSerif4-Regular.ttf.woff2, SourceSerif4-Bold.ttf.woff2, + SourceSerif4-It.ttf.woff2): + + Copyright 2014-2021 Adobe (http://www.adobe.com/), with Reserved Font Name + 'Source'. All Rights Reserved. Source is a trademark of Adobe in the United + States and/or other countries. + + Licensed under the SIL Open Font License, Version 1.1. + See SourceSerif4-LICENSE.md. + +This copyright file is intended to be distributed with rustdoc output. + +# REUSE-IgnoreEnd diff --git a/static.files/FiraSans-LICENSE-db4b642586e02d97.txt b/static.files/FiraSans-LICENSE-db4b642586e02d97.txt new file mode 100644 index 0000000000..d7e9c149b7 --- /dev/null +++ b/static.files/FiraSans-LICENSE-db4b642586e02d97.txt @@ -0,0 +1,98 @@ +// REUSE-IgnoreStart + +Digitized data copyright (c) 2012-2015, The Mozilla Foundation and Telefonica S.A. +with Reserved Font Name < Fira >, + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. + +// REUSE-IgnoreEnd diff --git a/static.files/FiraSans-Medium-8f9a781e4970d388.woff2 b/static.files/FiraSans-Medium-8f9a781e4970d388.woff2 new file mode 100644 index 0000000000..7a1e5fc548 Binary files /dev/null and b/static.files/FiraSans-Medium-8f9a781e4970d388.woff2 differ diff --git a/static.files/FiraSans-Regular-018c141bf0843ffd.woff2 b/static.files/FiraSans-Regular-018c141bf0843ffd.woff2 new file mode 100644 index 0000000000..e766e06ccb Binary files /dev/null and b/static.files/FiraSans-Regular-018c141bf0843ffd.woff2 differ diff --git a/static.files/LICENSE-APACHE-b91fa81cba47b86a.txt b/static.files/LICENSE-APACHE-b91fa81cba47b86a.txt new file mode 100644 index 0000000000..16fe87b06e --- /dev/null +++ b/static.files/LICENSE-APACHE-b91fa81cba47b86a.txt @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/static.files/LICENSE-MIT-65090b722b3f6c56.txt b/static.files/LICENSE-MIT-65090b722b3f6c56.txt new file mode 100644 index 0000000000..31aa79387f --- /dev/null +++ b/static.files/LICENSE-MIT-65090b722b3f6c56.txt @@ -0,0 +1,23 @@ +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. diff --git a/static.files/NanumBarunGothic-0f09457c7a19b7c6.ttf.woff2 b/static.files/NanumBarunGothic-0f09457c7a19b7c6.ttf.woff2 new file mode 100644 index 0000000000..1866ad4bce Binary files /dev/null and b/static.files/NanumBarunGothic-0f09457c7a19b7c6.ttf.woff2 differ diff --git a/static.files/NanumBarunGothic-LICENSE-18c5adf4b52b4041.txt b/static.files/NanumBarunGothic-LICENSE-18c5adf4b52b4041.txt new file mode 100644 index 0000000000..4b3edc29eb --- /dev/null +++ b/static.files/NanumBarunGothic-LICENSE-18c5adf4b52b4041.txt @@ -0,0 +1,103 @@ +// REUSE-IgnoreStart + +Copyright (c) 2010, NAVER Corporation (https://www.navercorp.com/), + +with Reserved Font Name Nanum, Naver Nanum, NanumGothic, Naver NanumGothic, +NanumMyeongjo, Naver NanumMyeongjo, NanumBrush, Naver NanumBrush, NanumPen, +Naver NanumPen, Naver NanumGothicEco, NanumGothicEco, Naver NanumMyeongjoEco, +NanumMyeongjoEco, Naver NanumGothicLight, NanumGothicLight, NanumBarunGothic, +Naver NanumBarunGothic, NanumSquareRound, NanumBarunPen, MaruBuri + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. + +// REUSE-IgnoreEnd diff --git a/static.files/SourceCodePro-It-1cc31594bf4f1f79.ttf.woff2 b/static.files/SourceCodePro-It-1cc31594bf4f1f79.ttf.woff2 new file mode 100644 index 0000000000..462c34efcd Binary files /dev/null and b/static.files/SourceCodePro-It-1cc31594bf4f1f79.ttf.woff2 differ diff --git a/static.files/SourceCodePro-LICENSE-d180d465a756484a.txt b/static.files/SourceCodePro-LICENSE-d180d465a756484a.txt new file mode 100644 index 0000000000..0d2941e148 --- /dev/null +++ b/static.files/SourceCodePro-LICENSE-d180d465a756484a.txt @@ -0,0 +1,97 @@ +// REUSE-IgnoreStart + +Copyright 2010, 2012 Adobe Systems Incorporated (http://www.adobe.com/), with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of Adobe Systems Incorporated in the United States and/or other countries. + +This Font Software is licensed under the SIL Open Font License, Version 1.1. + +This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. + +// REUSE-IgnoreEnd diff --git a/static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2 b/static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2 new file mode 100644 index 0000000000..10b558e0b6 Binary files /dev/null and b/static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2 differ diff --git a/static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2 b/static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2 new file mode 100644 index 0000000000..5ec64eef0e Binary files /dev/null and b/static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2 differ diff --git a/static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2 b/static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2 new file mode 100644 index 0000000000..181a07f63b Binary files /dev/null and b/static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2 differ diff --git a/static.files/SourceSerif4-It-acdfaf1a8af734b1.ttf.woff2 b/static.files/SourceSerif4-It-acdfaf1a8af734b1.ttf.woff2 new file mode 100644 index 0000000000..2ae08a7bed Binary files /dev/null and b/static.files/SourceSerif4-It-acdfaf1a8af734b1.ttf.woff2 differ diff --git a/static.files/SourceSerif4-LICENSE-3bb119e13b1258b7.md b/static.files/SourceSerif4-LICENSE-3bb119e13b1258b7.md new file mode 100644 index 0000000000..175fa4f47a --- /dev/null +++ b/static.files/SourceSerif4-LICENSE-3bb119e13b1258b7.md @@ -0,0 +1,98 @@ + + +Copyright 2014-2021 Adobe (http://www.adobe.com/), with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of Adobe in the United States and/or other countries. +Copyright 2014 - 2023 Adobe (http://www.adobe.com/), with Reserved Font Name ‘Source’. All Rights Reserved. Source is a trademark of Adobe in the United States and/or other countries. + +This Font Software is licensed under the SIL Open Font License, Version 1.1. + +This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. + + diff --git a/static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2 b/static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2 new file mode 100644 index 0000000000..0263fc3042 Binary files /dev/null and b/static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2 differ diff --git a/static.files/clipboard-7571035ce49a181d.svg b/static.files/clipboard-7571035ce49a181d.svg new file mode 100644 index 0000000000..8adbd99630 --- /dev/null +++ b/static.files/clipboard-7571035ce49a181d.svg @@ -0,0 +1 @@ + diff --git a/static.files/favicon-16x16-8b506e7a72182f1c.png b/static.files/favicon-16x16-8b506e7a72182f1c.png new file mode 100644 index 0000000000..ea4b45cae1 Binary files /dev/null and b/static.files/favicon-16x16-8b506e7a72182f1c.png differ diff --git a/static.files/favicon-2c020d218678b618.svg b/static.files/favicon-2c020d218678b618.svg new file mode 100644 index 0000000000..8b34b51198 --- /dev/null +++ b/static.files/favicon-2c020d218678b618.svg @@ -0,0 +1,24 @@ + + + + + diff --git a/static.files/favicon-32x32-422f7d1d52889060.png b/static.files/favicon-32x32-422f7d1d52889060.png new file mode 100644 index 0000000000..69b8613ce1 Binary files /dev/null and b/static.files/favicon-32x32-422f7d1d52889060.png differ diff --git a/static.files/main-9dd44ab47b99a0fb.js b/static.files/main-9dd44ab47b99a0fb.js new file mode 100644 index 0000000000..cfb9a38fca --- /dev/null +++ b/static.files/main-9dd44ab47b99a0fb.js @@ -0,0 +1,12 @@ +"use strict";window.RUSTDOC_TOOLTIP_HOVER_MS=300;window.RUSTDOC_TOOLTIP_HOVER_EXIT_MS=450;function resourcePath(basename,extension){return getVar("root-path")+basename+getVar("resource-suffix")+extension}function hideMain(){addClass(document.getElementById(MAIN_ID),"hidden")}function showMain(){removeClass(document.getElementById(MAIN_ID),"hidden")}function elemIsInParent(elem,parent){while(elem&&elem!==document.body){if(elem===parent){return true}elem=elem.parentElement}return false}function blurHandler(event,parentElem,hideCallback){if(!elemIsInParent(document.activeElement,parentElem)&&!elemIsInParent(event.relatedTarget,parentElem)){hideCallback()}}window.rootPath=getVar("root-path");window.currentCrate=getVar("current-crate");function setMobileTopbar(){const mobileTopbar=document.querySelector(".mobile-topbar");const locationTitle=document.querySelector(".sidebar h2.location");if(mobileTopbar){const mobileTitle=document.createElement("h2");mobileTitle.className="location";if(hasClass(document.body,"crate")){mobileTitle.innerText=`Crate ${window.currentCrate}`}else if(locationTitle){mobileTitle.innerHTML=locationTitle.innerHTML}mobileTopbar.appendChild(mobileTitle)}}function getVirtualKey(ev){if("key"in ev&&typeof ev.key!=="undefined"){return ev.key}const c=ev.charCode||ev.keyCode;if(c===27){return"Escape"}return String.fromCharCode(c)}const MAIN_ID="main-content";const SETTINGS_BUTTON_ID="settings-menu";const ALTERNATIVE_DISPLAY_ID="alternative-display";const NOT_DISPLAYED_ID="not-displayed";const HELP_BUTTON_ID="help-button";function getSettingsButton(){return document.getElementById(SETTINGS_BUTTON_ID)}function getHelpButton(){return document.getElementById(HELP_BUTTON_ID)}function getNakedUrl(){return window.location.href.split("?")[0].split("#")[0]}function insertAfter(newNode,referenceNode){referenceNode.parentNode.insertBefore(newNode,referenceNode.nextSibling)}function getOrCreateSection(id,classes){let el=document.getElementById(id);if(!el){el=document.createElement("section");el.id=id;el.className=classes;insertAfter(el,document.getElementById(MAIN_ID))}return el}function getAlternativeDisplayElem(){return getOrCreateSection(ALTERNATIVE_DISPLAY_ID,"content hidden")}function getNotDisplayedElem(){return getOrCreateSection(NOT_DISPLAYED_ID,"hidden")}function switchDisplayedElement(elemToDisplay){const el=getAlternativeDisplayElem();if(el.children.length>0){getNotDisplayedElem().appendChild(el.firstElementChild)}if(elemToDisplay===null){addClass(el,"hidden");showMain();return}el.appendChild(elemToDisplay);hideMain();removeClass(el,"hidden")}function browserSupportsHistoryApi(){return window.history&&typeof window.history.pushState==="function"}function preLoadCss(cssUrl){const link=document.createElement("link");link.href=cssUrl;link.rel="preload";link.as="style";document.getElementsByTagName("head")[0].appendChild(link)}(function(){const isHelpPage=window.location.pathname.endsWith("/help.html");function loadScript(url){const script=document.createElement("script");script.src=url;document.head.append(script)}getSettingsButton().onclick=event=>{if(event.ctrlKey||event.altKey||event.metaKey){return}window.hideAllModals(false);addClass(getSettingsButton(),"rotate");event.preventDefault();loadScript(getVar("static-root-path")+getVar("settings-js"));setTimeout(()=>{const themes=getVar("themes").split(",");for(const theme of themes){if(theme!==""){preLoadCss(getVar("root-path")+theme+".css")}}},0)};window.searchState={loadingText:"Loading search results...",input:document.getElementsByClassName("search-input")[0],outputElement:()=>{let el=document.getElementById("search");if(!el){el=document.createElement("section");el.id="search";getNotDisplayedElem().appendChild(el)}return el},title:document.title,titleBeforeSearch:document.title,timeout:null,currentTab:0,focusedByTab:[null,null,null],clearInputTimeout:()=>{if(searchState.timeout!==null){clearTimeout(searchState.timeout);searchState.timeout=null}},isDisplayed:()=>searchState.outputElement().parentElement.id===ALTERNATIVE_DISPLAY_ID,focus:()=>{searchState.input.focus()},defocus:()=>{searchState.input.blur()},showResults:search=>{if(search===null||typeof search==="undefined"){search=searchState.outputElement()}switchDisplayedElement(search);searchState.mouseMovedAfterSearch=false;document.title=searchState.title},removeQueryParameters:()=>{document.title=searchState.titleBeforeSearch;if(browserSupportsHistoryApi()){history.replaceState(null,"",getNakedUrl()+window.location.hash)}},hideResults:()=>{switchDisplayedElement(null);searchState.removeQueryParameters()},getQueryStringParams:()=>{const params={};window.location.search.substring(1).split("&").map(s=>{const pair=s.split("=");params[decodeURIComponent(pair[0])]=typeof pair[1]==="undefined"?null:decodeURIComponent(pair[1])});return params},setup:()=>{const search_input=searchState.input;if(!searchState.input){return}let searchLoaded=false;function loadSearch(){if(!searchLoaded){searchLoaded=true;loadScript(getVar("static-root-path")+getVar("search-js"));loadScript(resourcePath("search-index",".js"))}}search_input.addEventListener("focus",()=>{search_input.origPlaceholder=search_input.placeholder;search_input.placeholder="Type your search here.";loadSearch()});if(search_input.value!==""){loadSearch()}const params=searchState.getQueryStringParams();if(params.search!==undefined){searchState.setLoadingSearch();loadSearch()}},setLoadingSearch:()=>{const search=searchState.outputElement();search.innerHTML="

"+searchState.loadingText+"

";searchState.showResults(search)},};const toggleAllDocsId="toggle-all-docs";let savedHash="";function handleHashes(ev){if(ev!==null&&searchState.isDisplayed()&&ev.newURL){switchDisplayedElement(null);const hash=ev.newURL.slice(ev.newURL.indexOf("#")+1);if(browserSupportsHistoryApi()){history.replaceState(null,"",getNakedUrl()+window.location.search+"#"+hash)}const elem=document.getElementById(hash);if(elem){elem.scrollIntoView()}}const pageId=window.location.hash.replace(/^#/,"");if(savedHash!==pageId){savedHash=pageId;if(pageId!==""){expandSection(pageId)}}if(savedHash.startsWith("impl-")){const splitAt=savedHash.indexOf("/");if(splitAt!==-1){const implId=savedHash.slice(0,splitAt);const assocId=savedHash.slice(splitAt+1);const implElem=document.getElementById(implId);if(implElem&&implElem.parentElement.tagName==="SUMMARY"&&implElem.parentElement.parentElement.tagName==="DETAILS"){onEachLazy(implElem.parentElement.parentElement.querySelectorAll(`[id^="${assocId}"]`),item=>{const numbered=/([^-]+)-([0-9]+)/.exec(item.id);if(item.id===assocId||(numbered&&numbered[1]===assocId)){openParentDetails(item);item.scrollIntoView();setTimeout(()=>{window.location.replace("#"+item.id)},0)}})}}}}function onHashChange(ev){hideSidebar();handleHashes(ev)}function openParentDetails(elem){while(elem){if(elem.tagName==="DETAILS"){elem.open=true}elem=elem.parentNode}}function expandSection(id){openParentDetails(document.getElementById(id))}function handleEscape(ev){searchState.clearInputTimeout();searchState.hideResults();ev.preventDefault();searchState.defocus();window.hideAllModals(true)}function handleShortcut(ev){const disableShortcuts=getSettingValue("disable-shortcuts")==="true";if(ev.ctrlKey||ev.altKey||ev.metaKey||disableShortcuts){return}if(document.activeElement.tagName==="INPUT"&&document.activeElement.type!=="checkbox"&&document.activeElement.type!=="radio"){switch(getVirtualKey(ev)){case"Escape":handleEscape(ev);break}}else{switch(getVirtualKey(ev)){case"Escape":handleEscape(ev);break;case"s":case"S":ev.preventDefault();searchState.focus();break;case"+":ev.preventDefault();expandAllDocs();break;case"-":ev.preventDefault();collapseAllDocs();break;case"?":showHelp();break;default:break}}}document.addEventListener("keypress",handleShortcut);document.addEventListener("keydown",handleShortcut);function addSidebarItems(){if(!window.SIDEBAR_ITEMS){return}const sidebar=document.getElementsByClassName("sidebar-elems")[0];function block(shortty,id,longty){const filtered=window.SIDEBAR_ITEMS[shortty];if(!filtered){return}const modpath=hasClass(document.body,"mod")?"../":"";const h3=document.createElement("h3");h3.innerHTML=`${longty}`;const ul=document.createElement("ul");ul.className="block "+shortty;for(const name of filtered){let path;if(shortty==="mod"){path=`${modpath}${name}/index.html`}else{path=`${modpath}${shortty}.${name}.html`}let current_page=document.location.href.toString();if(current_page.endsWith("/")){current_page+="index.html"}const link=document.createElement("a");link.href=path;if(link.href===current_page){link.className="current"}link.textContent=name;const li=document.createElement("li");li.appendChild(link);ul.appendChild(li)}sidebar.appendChild(h3);sidebar.appendChild(ul)}if(sidebar){block("primitive","primitives","Primitive Types");block("mod","modules","Modules");block("macro","macros","Macros");block("struct","structs","Structs");block("enum","enums","Enums");block("constant","constants","Constants");block("static","static","Statics");block("trait","traits","Traits");block("fn","functions","Functions");block("type","types","Type Aliases");block("union","unions","Unions");block("foreigntype","foreign-types","Foreign Types");block("keyword","keywords","Keywords");block("opaque","opaque-types","Opaque Types");block("attr","attributes","Attribute Macros");block("derive","derives","Derive Macros");block("traitalias","trait-aliases","Trait Aliases")}}window.register_implementors=imp=>{const implementors=document.getElementById("implementors-list");const synthetic_implementors=document.getElementById("synthetic-implementors-list");const inlined_types=new Set();const TEXT_IDX=0;const SYNTHETIC_IDX=1;const TYPES_IDX=2;if(synthetic_implementors){onEachLazy(synthetic_implementors.getElementsByClassName("impl"),el=>{const aliases=el.getAttribute("data-aliases");if(!aliases){return}aliases.split(",").forEach(alias=>{inlined_types.add(alias)})})}let currentNbImpls=implementors.getElementsByClassName("impl").length;const traitName=document.querySelector(".main-heading h1 > .trait").textContent;const baseIdName="impl-"+traitName+"-";const libs=Object.getOwnPropertyNames(imp);const script=document.querySelector("script[data-ignore-extern-crates]");const ignoreExternCrates=new Set((script?script.getAttribute("data-ignore-extern-crates"):"").split(","));for(const lib of libs){if(lib===window.currentCrate||ignoreExternCrates.has(lib)){continue}const structs=imp[lib];struct_loop:for(const struct of structs){const list=struct[SYNTHETIC_IDX]?synthetic_implementors:implementors;if(struct[SYNTHETIC_IDX]){for(const struct_type of struct[TYPES_IDX]){if(inlined_types.has(struct_type)){continue struct_loop}inlined_types.add(struct_type)}}const code=document.createElement("h3");code.innerHTML=struct[TEXT_IDX];addClass(code,"code-header");onEachLazy(code.getElementsByTagName("a"),elem=>{const href=elem.getAttribute("href");if(href&&!href.startsWith("#")&&!/^(?:[a-z+]+:)?\/\//.test(href)){elem.setAttribute("href",window.rootPath+href)}});const currentId=baseIdName+currentNbImpls;const anchor=document.createElement("a");anchor.href="#"+currentId;addClass(anchor,"anchor");const display=document.createElement("div");display.id=currentId;addClass(display,"impl");display.appendChild(anchor);display.appendChild(code);list.appendChild(display);currentNbImpls+=1}}};if(window.pending_implementors){window.register_implementors(window.pending_implementors)}window.register_type_impls=imp=>{if(!imp||!imp[window.currentCrate]){return}window.pending_type_impls=null;const idMap=new Map();let implementations=document.getElementById("implementations-list");let trait_implementations=document.getElementById("trait-implementations-list");let trait_implementations_header=document.getElementById("trait-implementations");const script=document.querySelector("script[data-self-path]");const selfPath=script?script.getAttribute("data-self-path"):null;const mainContent=document.querySelector("#main-content");const sidebarSection=document.querySelector(".sidebar section");let methods=document.querySelector(".sidebar .block.method");let associatedTypes=document.querySelector(".sidebar .block.associatedtype");let associatedConstants=document.querySelector(".sidebar .block.associatedconstant");let sidebarTraitList=document.querySelector(".sidebar .block.trait-implementation");for(const impList of imp[window.currentCrate]){const types=impList.slice(2);const text=impList[0];const isTrait=impList[1]!==0;const traitName=impList[1];if(types.indexOf(selfPath)===-1){continue}let outputList=isTrait?trait_implementations:implementations;if(outputList===null){const outputListName=isTrait?"Trait Implementations":"Implementations";const outputListId=isTrait?"trait-implementations-list":"implementations-list";const outputListHeaderId=isTrait?"trait-implementations":"implementations";const outputListHeader=document.createElement("h2");outputListHeader.id=outputListHeaderId;outputListHeader.innerText=outputListName;outputList=document.createElement("div");outputList.id=outputListId;if(isTrait){const link=document.createElement("a");link.href=`#${outputListHeaderId}`;link.innerText="Trait Implementations";const h=document.createElement("h3");h.appendChild(link);trait_implementations=outputList;trait_implementations_header=outputListHeader;sidebarSection.appendChild(h);sidebarTraitList=document.createElement("ul");sidebarTraitList.className="block trait-implementation";sidebarSection.appendChild(sidebarTraitList);mainContent.appendChild(outputListHeader);mainContent.appendChild(outputList)}else{implementations=outputList;if(trait_implementations){mainContent.insertBefore(outputListHeader,trait_implementations_header);mainContent.insertBefore(outputList,trait_implementations_header)}else{const mainContent=document.querySelector("#main-content");mainContent.appendChild(outputListHeader);mainContent.appendChild(outputList)}}}const template=document.createElement("template");template.innerHTML=text;onEachLazy(template.content.querySelectorAll("a"),elem=>{const href=elem.getAttribute("href");if(href&&!href.startsWith("#")&&!/^(?:[a-z+]+:)?\/\//.test(href)){elem.setAttribute("href",window.rootPath+href)}});onEachLazy(template.content.querySelectorAll("[id]"),el=>{let i=0;if(idMap.has(el.id)){i=idMap.get(el.id)}else if(document.getElementById(el.id)){i=1;while(document.getElementById(`${el.id}-${2 * i}`)){i=2*i}while(document.getElementById(`${el.id}-${i}`)){i+=1}}if(i!==0){const oldHref=`#${el.id}`;const newHref=`#${el.id}-${i}`;el.id=`${el.id}-${i}`;onEachLazy(template.content.querySelectorAll("a[href]"),link=>{if(link.getAttribute("href")===oldHref){link.href=newHref}})}idMap.set(el.id,i+1)});const templateAssocItems=template.content.querySelectorAll("section.tymethod, "+"section.method, section.associatedtype, section.associatedconstant");if(isTrait){const li=document.createElement("li");const a=document.createElement("a");a.href=`#${template.content.querySelector(".impl").id}`;a.textContent=traitName;li.appendChild(a);sidebarTraitList.append(li)}else{onEachLazy(templateAssocItems,item=>{let block=hasClass(item,"associatedtype")?associatedTypes:(hasClass(item,"associatedconstant")?associatedConstants:(methods));if(!block){const blockTitle=hasClass(item,"associatedtype")?"Associated Types":(hasClass(item,"associatedconstant")?"Associated Constants":("Methods"));const blockClass=hasClass(item,"associatedtype")?"associatedtype":(hasClass(item,"associatedconstant")?"associatedconstant":("method"));const blockHeader=document.createElement("h3");const blockLink=document.createElement("a");blockLink.href="#implementations";blockLink.innerText=blockTitle;blockHeader.appendChild(blockLink);block=document.createElement("ul");block.className=`block ${blockClass}`;const insertionReference=methods||sidebarTraitList;if(insertionReference){const insertionReferenceH=insertionReference.previousElementSibling;sidebarSection.insertBefore(blockHeader,insertionReferenceH);sidebarSection.insertBefore(block,insertionReferenceH)}else{sidebarSection.appendChild(blockHeader);sidebarSection.appendChild(block)}if(hasClass(item,"associatedtype")){associatedTypes=block}else if(hasClass(item,"associatedconstant")){associatedConstants=block}else{methods=block}}const li=document.createElement("li");const a=document.createElement("a");a.innerText=item.id.split("-")[0].split(".")[1];a.href=`#${item.id}`;li.appendChild(a);block.appendChild(li)})}outputList.appendChild(template.content)}for(const list of[methods,associatedTypes,associatedConstants,sidebarTraitList]){if(!list){continue}const newChildren=Array.prototype.slice.call(list.children);newChildren.sort((a,b)=>{const aI=a.innerText;const bI=b.innerText;return aIbI?1:0});list.replaceChildren(...newChildren)}};if(window.pending_type_impls){window.register_type_impls(window.pending_type_impls)}function addSidebarCrates(){if(!window.ALL_CRATES){return}const sidebarElems=document.getElementsByClassName("sidebar-elems")[0];if(!sidebarElems){return}const h3=document.createElement("h3");h3.innerHTML="Crates";const ul=document.createElement("ul");ul.className="block crate";for(const crate of window.ALL_CRATES){const link=document.createElement("a");link.href=window.rootPath+crate+"/index.html";if(window.rootPath!=="./"&&crate===window.currentCrate){link.className="current"}link.textContent=crate;const li=document.createElement("li");li.appendChild(link);ul.appendChild(li)}sidebarElems.appendChild(h3);sidebarElems.appendChild(ul)}function expandAllDocs(){const innerToggle=document.getElementById(toggleAllDocsId);removeClass(innerToggle,"will-expand");onEachLazy(document.getElementsByClassName("toggle"),e=>{if(!hasClass(e,"type-contents-toggle")&&!hasClass(e,"more-examples-toggle")){e.open=true}});innerToggle.title="collapse all docs";innerToggle.children[0].innerText="\u2212"}function collapseAllDocs(){const innerToggle=document.getElementById(toggleAllDocsId);addClass(innerToggle,"will-expand");onEachLazy(document.getElementsByClassName("toggle"),e=>{if(e.parentNode.id!=="implementations-list"||(!hasClass(e,"implementors-toggle")&&!hasClass(e,"type-contents-toggle"))){e.open=false}});innerToggle.title="expand all docs";innerToggle.children[0].innerText="+"}function toggleAllDocs(){const innerToggle=document.getElementById(toggleAllDocsId);if(!innerToggle){return}if(hasClass(innerToggle,"will-expand")){expandAllDocs()}else{collapseAllDocs()}}(function(){const toggles=document.getElementById(toggleAllDocsId);if(toggles){toggles.onclick=toggleAllDocs}const hideMethodDocs=getSettingValue("auto-hide-method-docs")==="true";const hideImplementations=getSettingValue("auto-hide-trait-implementations")==="true";const hideLargeItemContents=getSettingValue("auto-hide-large-items")!=="false";function setImplementorsTogglesOpen(id,open){const list=document.getElementById(id);if(list!==null){onEachLazy(list.getElementsByClassName("implementors-toggle"),e=>{e.open=open})}}if(hideImplementations){setImplementorsTogglesOpen("trait-implementations-list",false);setImplementorsTogglesOpen("blanket-implementations-list",false)}onEachLazy(document.getElementsByClassName("toggle"),e=>{if(!hideLargeItemContents&&hasClass(e,"type-contents-toggle")){e.open=true}if(hideMethodDocs&&hasClass(e,"method-toggle")){e.open=false}})}());window.rustdoc_add_line_numbers_to_examples=()=>{onEachLazy(document.getElementsByClassName("rust-example-rendered"),x=>{const parent=x.parentNode;const line_numbers=parent.querySelectorAll(".example-line-numbers");if(line_numbers.length>0){return}const count=x.textContent.split("\n").length;const elems=[];for(let i=0;i{onEachLazy(document.getElementsByClassName("rust-example-rendered"),x=>{const parent=x.parentNode;const line_numbers=parent.querySelectorAll(".example-line-numbers");for(const node of line_numbers){parent.removeChild(node)}})};if(getSettingValue("line-numbers")==="true"){window.rustdoc_add_line_numbers_to_examples()}function showSidebar(){window.hideAllModals(false);const sidebar=document.getElementsByClassName("sidebar")[0];addClass(sidebar,"shown")}function hideSidebar(){const sidebar=document.getElementsByClassName("sidebar")[0];removeClass(sidebar,"shown")}window.addEventListener("resize",()=>{if(window.CURRENT_TOOLTIP_ELEMENT){const base=window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE;const force_visible=base.TOOLTIP_FORCE_VISIBLE;hideTooltip(false);if(force_visible){showTooltip(base);base.TOOLTIP_FORCE_VISIBLE=true}}});const mainElem=document.getElementById(MAIN_ID);if(mainElem){mainElem.addEventListener("click",hideSidebar)}onEachLazy(document.querySelectorAll("a[href^='#']"),el=>{el.addEventListener("click",()=>{expandSection(el.hash.slice(1));hideSidebar()})});onEachLazy(document.querySelectorAll(".toggle > summary:not(.hideme)"),el=>{el.addEventListener("click",e=>{if(e.target.tagName!=="SUMMARY"&&e.target.tagName!=="A"){e.preventDefault()}})});function showTooltip(e){const notable_ty=e.getAttribute("data-notable-ty");if(!window.NOTABLE_TRAITS&¬able_ty){const data=document.getElementById("notable-traits-data");if(data){window.NOTABLE_TRAITS=JSON.parse(data.innerText)}else{throw new Error("showTooltip() called with notable without any notable traits!")}}if(window.CURRENT_TOOLTIP_ELEMENT&&window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE===e){clearTooltipHoverTimeout(window.CURRENT_TOOLTIP_ELEMENT);return}window.hideAllModals(false);const wrapper=document.createElement("div");if(notable_ty){wrapper.innerHTML="
"+window.NOTABLE_TRAITS[notable_ty]+"
"}else{if(e.getAttribute("title")!==null){e.setAttribute("data-title",e.getAttribute("title"));e.removeAttribute("title")}if(e.getAttribute("data-title")!==null){const titleContent=document.createElement("div");titleContent.className="content";titleContent.appendChild(document.createTextNode(e.getAttribute("data-title")));wrapper.appendChild(titleContent)}}wrapper.className="tooltip popover";const focusCatcher=document.createElement("div");focusCatcher.setAttribute("tabindex","0");focusCatcher.onfocus=hideTooltip;wrapper.appendChild(focusCatcher);const pos=e.getBoundingClientRect();wrapper.style.top=(pos.top+window.scrollY+pos.height)+"px";wrapper.style.left=0;wrapper.style.right="auto";wrapper.style.visibility="hidden";const body=document.getElementsByTagName("body")[0];body.appendChild(wrapper);const wrapperPos=wrapper.getBoundingClientRect();const finalPos=pos.left+window.scrollX-wrapperPos.width+24;if(finalPos>0){wrapper.style.left=finalPos+"px"}else{wrapper.style.setProperty("--popover-arrow-offset",(wrapperPos.right-pos.right+4)+"px")}wrapper.style.visibility="";window.CURRENT_TOOLTIP_ELEMENT=wrapper;window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE=e;clearTooltipHoverTimeout(window.CURRENT_TOOLTIP_ELEMENT);wrapper.onpointerenter=ev=>{if(ev.pointerType!=="mouse"){return}clearTooltipHoverTimeout(e)};wrapper.onpointerleave=ev=>{if(ev.pointerType!=="mouse"){return}if(!e.TOOLTIP_FORCE_VISIBLE&&!elemIsInParent(ev.relatedTarget,e)){setTooltipHoverTimeout(e,false);addClass(wrapper,"fade-out")}}}function setTooltipHoverTimeout(element,show){clearTooltipHoverTimeout(element);if(!show&&!window.CURRENT_TOOLTIP_ELEMENT){return}if(show&&window.CURRENT_TOOLTIP_ELEMENT){return}if(window.CURRENT_TOOLTIP_ELEMENT&&window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE!==element){return}element.TOOLTIP_HOVER_TIMEOUT=setTimeout(()=>{if(show){showTooltip(element)}else if(!element.TOOLTIP_FORCE_VISIBLE){hideTooltip(false)}},show?window.RUSTDOC_TOOLTIP_HOVER_MS:window.RUSTDOC_TOOLTIP_HOVER_EXIT_MS)}function clearTooltipHoverTimeout(element){if(element.TOOLTIP_HOVER_TIMEOUT!==undefined){removeClass(window.CURRENT_TOOLTIP_ELEMENT,"fade-out");clearTimeout(element.TOOLTIP_HOVER_TIMEOUT);delete element.TOOLTIP_HOVER_TIMEOUT}}function tooltipBlurHandler(event){if(window.CURRENT_TOOLTIP_ELEMENT&&!elemIsInParent(document.activeElement,window.CURRENT_TOOLTIP_ELEMENT)&&!elemIsInParent(event.relatedTarget,window.CURRENT_TOOLTIP_ELEMENT)&&!elemIsInParent(document.activeElement,window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE)&&!elemIsInParent(event.relatedTarget,window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE)){setTimeout(()=>hideTooltip(false),0)}}function hideTooltip(focus){if(window.CURRENT_TOOLTIP_ELEMENT){if(window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE.TOOLTIP_FORCE_VISIBLE){if(focus){window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE.focus()}window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE.TOOLTIP_FORCE_VISIBLE=false}const body=document.getElementsByTagName("body")[0];body.removeChild(window.CURRENT_TOOLTIP_ELEMENT);clearTooltipHoverTimeout(window.CURRENT_TOOLTIP_ELEMENT);window.CURRENT_TOOLTIP_ELEMENT=null}}onEachLazy(document.getElementsByClassName("tooltip"),e=>{e.onclick=()=>{e.TOOLTIP_FORCE_VISIBLE=e.TOOLTIP_FORCE_VISIBLE?false:true;if(window.CURRENT_TOOLTIP_ELEMENT&&!e.TOOLTIP_FORCE_VISIBLE){hideTooltip(true)}else{showTooltip(e);window.CURRENT_TOOLTIP_ELEMENT.setAttribute("tabindex","0");window.CURRENT_TOOLTIP_ELEMENT.focus();window.CURRENT_TOOLTIP_ELEMENT.onblur=tooltipBlurHandler}return false};e.onpointerenter=ev=>{if(ev.pointerType!=="mouse"){return}setTooltipHoverTimeout(e,true)};e.onpointermove=ev=>{if(ev.pointerType!=="mouse"){return}setTooltipHoverTimeout(e,true)};e.onpointerleave=ev=>{if(ev.pointerType!=="mouse"){return}if(!e.TOOLTIP_FORCE_VISIBLE&&!elemIsInParent(ev.relatedTarget,window.CURRENT_TOOLTIP_ELEMENT)){setTooltipHoverTimeout(e,false);addClass(window.CURRENT_TOOLTIP_ELEMENT,"fade-out")}}});const sidebar_menu_toggle=document.getElementsByClassName("sidebar-menu-toggle")[0];if(sidebar_menu_toggle){sidebar_menu_toggle.addEventListener("click",()=>{const sidebar=document.getElementsByClassName("sidebar")[0];if(!hasClass(sidebar,"shown")){showSidebar()}else{hideSidebar()}})}function helpBlurHandler(event){blurHandler(event,getHelpButton(),window.hidePopoverMenus)}function buildHelpMenu(){const book_info=document.createElement("span");const channel=getVar("channel");book_info.className="top";book_info.innerHTML=`You can find more information in \ +the rustdoc book.`;const shortcuts=[["?","Show this help dialog"],["S","Focus the search field"],["↑","Move up in search results"],["↓","Move down in search results"],["← / →","Switch result tab (when results focused)"],["⏎","Go to active search result"],["+","Expand all sections"],["-","Collapse all sections"],].map(x=>"
"+x[0].split(" ").map((y,index)=>((index&1)===0?""+y+"":" "+y+" ")).join("")+"
"+x[1]+"
").join("");const div_shortcuts=document.createElement("div");addClass(div_shortcuts,"shortcuts");div_shortcuts.innerHTML="

Keyboard Shortcuts

"+shortcuts+"
";const infos=[`For a full list of all search features, take a look here.`,"Prefix searches with a type followed by a colon (e.g., fn:) to \ + restrict the search to a given item kind.","Accepted kinds are: fn, mod, struct, \ + enum, trait, type, macro, \ + and const.","Search functions by type signature (e.g., vec -> usize or \ + -> vec or String, enum:Cow -> bool)","You can look for items with an exact name by putting double quotes around \ + your request: \"string\"","Look for functions that accept or return \ + slices and \ + arrays by writing \ + square brackets (e.g., -> [u8] or [] -> Option)","Look for items inside another one by searching for a path: vec::Vec",].map(x=>"

"+x+"

").join("");const div_infos=document.createElement("div");addClass(div_infos,"infos");div_infos.innerHTML="

Search Tricks

"+infos;const rustdoc_version=document.createElement("span");rustdoc_version.className="bottom";const rustdoc_version_code=document.createElement("code");rustdoc_version_code.innerText="rustdoc "+getVar("rustdoc-version");rustdoc_version.appendChild(rustdoc_version_code);const container=document.createElement("div");if(!isHelpPage){container.className="popover"}container.id="help";container.style.display="none";const side_by_side=document.createElement("div");side_by_side.className="side-by-side";side_by_side.appendChild(div_shortcuts);side_by_side.appendChild(div_infos);container.appendChild(book_info);container.appendChild(side_by_side);container.appendChild(rustdoc_version);if(isHelpPage){const help_section=document.createElement("section");help_section.appendChild(container);document.getElementById("main-content").appendChild(help_section);container.style.display="block"}else{const help_button=getHelpButton();help_button.appendChild(container);container.onblur=helpBlurHandler;help_button.onblur=helpBlurHandler;help_button.children[0].onblur=helpBlurHandler}return container}window.hideAllModals=switchFocus=>{hideSidebar();window.hidePopoverMenus();hideTooltip(switchFocus)};window.hidePopoverMenus=()=>{onEachLazy(document.querySelectorAll(".search-form .popover"),elem=>{elem.style.display="none"})};function getHelpMenu(buildNeeded){let menu=getHelpButton().querySelector(".popover");if(!menu&&buildNeeded){menu=buildHelpMenu()}return menu}function showHelp(){getHelpButton().querySelector("a").focus();const menu=getHelpMenu(true);if(menu.style.display==="none"){window.hideAllModals();menu.style.display=""}}if(isHelpPage){showHelp();document.querySelector(`#${HELP_BUTTON_ID} > a`).addEventListener("click",event=>{const target=event.target;if(target.tagName!=="A"||target.parentElement.id!==HELP_BUTTON_ID||event.ctrlKey||event.altKey||event.metaKey){return}event.preventDefault()})}else{document.querySelector(`#${HELP_BUTTON_ID} > a`).addEventListener("click",event=>{const target=event.target;if(target.tagName!=="A"||target.parentElement.id!==HELP_BUTTON_ID||event.ctrlKey||event.altKey||event.metaKey){return}event.preventDefault();const menu=getHelpMenu(true);const shouldShowHelp=menu.style.display==="none";if(shouldShowHelp){showHelp()}else{window.hidePopoverMenus()}})}setMobileTopbar();addSidebarItems();addSidebarCrates();onHashChange(null);window.addEventListener("hashchange",onHashChange);searchState.setup()}());(function(){let reset_button_timeout=null;const but=document.getElementById("copy-path");if(!but){return}but.onclick=()=>{const parent=but.parentElement;const path=[];onEach(parent.childNodes,child=>{if(child.tagName==="A"){path.push(child.textContent)}});const el=document.createElement("textarea");el.value=path.join("::");el.setAttribute("readonly","");el.style.position="absolute";el.style.left="-9999px";document.body.appendChild(el);el.select();document.execCommand("copy");document.body.removeChild(el);but.children[0].style.display="none";let tmp;if(but.childNodes.length<2){tmp=document.createTextNode("✓");but.appendChild(tmp)}else{onEachLazy(but.childNodes,e=>{if(e.nodeType===Node.TEXT_NODE){tmp=e;return true}});tmp.textContent="✓"}if(reset_button_timeout!==null){window.clearTimeout(reset_button_timeout)}function reset_button(){tmp.textContent="";reset_button_timeout=null;but.children[0].style.display=""}reset_button_timeout=window.setTimeout(reset_button,1000)}}()) \ No newline at end of file diff --git a/static.files/normalize-76eba96aa4d2e634.css b/static.files/normalize-76eba96aa4d2e634.css new file mode 100644 index 0000000000..469959f137 --- /dev/null +++ b/static.files/normalize-76eba96aa4d2e634.css @@ -0,0 +1,2 @@ + /*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */ +html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type="button"],[type="reset"],[type="submit"],button{-webkit-appearance:button}[type="button"]::-moz-focus-inner,[type="reset"]::-moz-focus-inner,[type="submit"]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type="button"]:-moz-focusring,[type="reset"]:-moz-focusring,[type="submit"]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type="checkbox"],[type="radio"]{box-sizing:border-box;padding:0}[type="number"]::-webkit-inner-spin-button,[type="number"]::-webkit-outer-spin-button{height:auto}[type="search"]{-webkit-appearance:textfield;outline-offset:-2px}[type="search"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none} \ No newline at end of file diff --git a/static.files/noscript-5d8b3c7633ad77ba.css b/static.files/noscript-5d8b3c7633ad77ba.css new file mode 100644 index 0000000000..8c63ef0657 --- /dev/null +++ b/static.files/noscript-5d8b3c7633ad77ba.css @@ -0,0 +1 @@ + #main-content .attributes{margin-left:0 !important;}#copy-path{display:none;}nav.sub{display:none;}.src .sidebar{display:none;}.notable-traits{display:none;}:root{--main-background-color:white;--main-color:black;--settings-input-color:#2196f3;--settings-input-border-color:#717171;--settings-button-color:#000;--settings-button-border-focus:#717171;--sidebar-background-color:#f5f5f5;--sidebar-background-color-hover:#e0e0e0;--code-block-background-color:#f5f5f5;--scrollbar-track-background-color:#dcdcdc;--scrollbar-thumb-background-color:rgba(36,37,39,0.6);--scrollbar-color:rgba(36,37,39,0.6) #d9d9d9;--headings-border-bottom-color:#ddd;--border-color:#e0e0e0;--button-background-color:#fff;--right-side-color:grey;--code-attribute-color:#999;--toggles-color:#999;--toggle-filter:none;--search-input-focused-border-color:#66afe9;--copy-path-button-color:#999;--copy-path-img-filter:invert(50%);--copy-path-img-hover-filter:invert(35%);--codeblock-error-hover-color:rgb(255,0,0);--codeblock-error-color:rgba(255,0,0,.5);--codeblock-ignore-hover-color:rgb(255,142,0);--codeblock-ignore-color:rgba(255,142,0,.6);--warning-border-color:#ff8e00;--type-link-color:#ad378a;--trait-link-color:#6e4fc9;--assoc-item-link-color:#3873ad;--function-link-color:#ad7c37;--macro-link-color:#068000;--keyword-link-color:#3873ad;--mod-link-color:#3873ad;--link-color:#3873ad;--sidebar-link-color:#356da4;--sidebar-current-link-background-color:#fff;--search-result-link-focus-background-color:#ccc;--search-result-border-color:#aaa3;--search-color:#000;--search-error-code-background-color:#d0cccc;--search-results-alias-color:#000;--search-results-grey-color:#999;--search-tab-title-count-color:#888;--search-tab-button-not-selected-border-top-color:#e6e6e6;--search-tab-button-not-selected-background:#e6e6e6;--search-tab-button-selected-border-top-color:#0089ff;--search-tab-button-selected-background:#fff;--stab-background-color:#fff5d6;--stab-code-color:#000;--code-highlight-kw-color:#8959a8;--code-highlight-kw-2-color:#4271ae;--code-highlight-lifetime-color:#b76514;--code-highlight-prelude-color:#4271ae;--code-highlight-prelude-val-color:#c82829;--code-highlight-number-color:#718c00;--code-highlight-string-color:#718c00;--code-highlight-literal-color:#c82829;--code-highlight-attribute-color:#c82829;--code-highlight-self-color:#c82829;--code-highlight-macro-color:#3e999f;--code-highlight-question-mark-color:#ff9011;--code-highlight-comment-color:#8e908c;--code-highlight-doc-comment-color:#4d4d4c;--src-line-numbers-span-color:#c67e2d;--src-line-number-highlighted-background-color:#fdffd3;--test-arrow-color:#f5f5f5;--test-arrow-background-color:rgba(78,139,202,0.2);--test-arrow-hover-color:#f5f5f5;--test-arrow-hover-background-color:rgb(78,139,202);--target-background-color:#fdffd3;--target-border-color:#ad7c37;--kbd-color:#000;--kbd-background:#fafbfc;--kbd-box-shadow-color:#c6cbd1;--rust-logo-filter:initial;--crate-search-div-filter:invert(100%) sepia(0%) saturate(4223%) hue-rotate(289deg) brightness(114%) contrast(76%);--crate-search-div-hover-filter:invert(44%) sepia(18%) saturate(23%) hue-rotate(317deg) brightness(96%) contrast(93%);--crate-search-hover-border:#717171;--src-sidebar-background-selected:#fff;--src-sidebar-background-hover:#e0e0e0;--table-alt-row-background-color:#f5f5f5;--codeblock-link-background:#eee;--scrape-example-toggle-line-background:#ccc;--scrape-example-toggle-line-hover-background:#999;--scrape-example-code-line-highlight:#fcffd6;--scrape-example-code-line-highlight-focus:#f6fdb0;--scrape-example-help-border-color:#555;--scrape-example-help-color:#333;--scrape-example-help-hover-border-color:#000;--scrape-example-help-hover-color:#000;--scrape-example-code-wrapper-background-start:rgba(255,255,255,1);--scrape-example-code-wrapper-background-end:rgba(255,255,255,0);}@media (prefers-color-scheme:dark){:root{--main-background-color:#353535;--main-color:#ddd;--settings-input-color:#2196f3;--settings-input-border-color:#999;--settings-button-color:#000;--settings-button-border-focus:#ffb900;--sidebar-background-color:#505050;--sidebar-background-color-hover:#676767;--code-block-background-color:#2A2A2A;--scrollbar-track-background-color:#717171;--scrollbar-thumb-background-color:rgba(32,34,37,.6);--scrollbar-color:rgba(32,34,37,.6) #5a5a5a;--headings-border-bottom-color:#d2d2d2;--border-color:#e0e0e0;--button-background-color:#f0f0f0;--right-side-color:grey;--code-attribute-color:#999;--toggles-color:#999;--toggle-filter:invert(100%);--search-input-focused-border-color:#008dfd;--copy-path-button-color:#999;--copy-path-img-filter:invert(50%);--copy-path-img-hover-filter:invert(65%);--codeblock-error-hover-color:rgb(255,0,0);--codeblock-error-color:rgba(255,0,0,.5);--codeblock-ignore-hover-color:rgb(255,142,0);--codeblock-ignore-color:rgba(255,142,0,.6);--warning-border-color:#ff8e00;--type-link-color:#2dbfb8;--trait-link-color:#b78cf2;--assoc-item-link-color:#d2991d;--function-link-color:#2bab63;--macro-link-color:#09bd00;--keyword-link-color:#d2991d;--mod-link-color:#d2991d;--link-color:#d2991d;--sidebar-link-color:#fdbf35;--sidebar-current-link-background-color:#444;--search-result-link-focus-background-color:#616161;--search-result-border-color:#aaa3;--search-color:#111;--search-error-code-background-color:#484848;--search-results-alias-color:#fff;--search-results-grey-color:#ccc;--search-tab-title-count-color:#888;--search-tab-button-not-selected-border-top-color:#252525;--search-tab-button-not-selected-background:#252525;--search-tab-button-selected-border-top-color:#0089ff;--search-tab-button-selected-background:#353535;--stab-background-color:#314559;--stab-code-color:#e6e1cf;--code-highlight-kw-color:#ab8ac1;--code-highlight-kw-2-color:#769acb;--code-highlight-lifetime-color:#d97f26;--code-highlight-prelude-color:#769acb;--code-highlight-prelude-val-color:#ee6868;--code-highlight-number-color:#83a300;--code-highlight-string-color:#83a300;--code-highlight-literal-color:#ee6868;--code-highlight-attribute-color:#ee6868;--code-highlight-self-color:#ee6868;--code-highlight-macro-color:#3e999f;--code-highlight-question-mark-color:#ff9011;--code-highlight-comment-color:#8d8d8b;--code-highlight-doc-comment-color:#8ca375;--src-line-numbers-span-color:#3b91e2;--src-line-number-highlighted-background-color:#0a042f;--test-arrow-color:#dedede;--test-arrow-background-color:rgba(78,139,202,0.2);--test-arrow-hover-color:#dedede;--test-arrow-hover-background-color:#4e8bca;--target-background-color:#494a3d;--target-border-color:#bb7410;--kbd-color:#000;--kbd-background:#fafbfc;--kbd-box-shadow-color:#c6cbd1;--rust-logo-filter:drop-shadow(1px 0 0px #fff) drop-shadow(0 1px 0 #fff) drop-shadow(-1px 0 0 #fff) drop-shadow(0 -1px 0 #fff);--crate-search-div-filter:invert(94%) sepia(0%) saturate(721%) hue-rotate(255deg) brightness(90%) contrast(90%);--crate-search-div-hover-filter:invert(69%) sepia(60%) saturate(6613%) hue-rotate(184deg) brightness(100%) contrast(91%);--crate-search-hover-border:#2196f3;--src-sidebar-background-selected:#333;--src-sidebar-background-hover:#444;--table-alt-row-background-color:#2a2a2a;--codeblock-link-background:#333;--scrape-example-toggle-line-background:#999;--scrape-example-toggle-line-hover-background:#c5c5c5;--scrape-example-code-line-highlight:#5b3b01;--scrape-example-code-line-highlight-focus:#7c4b0f;--scrape-example-help-border-color:#aaa;--scrape-example-help-color:#eee;--scrape-example-help-hover-border-color:#fff;--scrape-example-help-hover-color:#fff;--scrape-example-code-wrapper-background-start:rgba(53,53,53,1);--scrape-example-code-wrapper-background-end:rgba(53,53,53,0);}} \ No newline at end of file diff --git a/static.files/rust-logo-151179464ae7ed46.svg b/static.files/rust-logo-151179464ae7ed46.svg new file mode 100644 index 0000000000..62424d8ffd --- /dev/null +++ b/static.files/rust-logo-151179464ae7ed46.svg @@ -0,0 +1,61 @@ + + + diff --git a/static.files/rustdoc-9ee3a5e31a2afa3e.css b/static.files/rustdoc-9ee3a5e31a2afa3e.css new file mode 100644 index 0000000000..8749d0eb18 --- /dev/null +++ b/static.files/rustdoc-9ee3a5e31a2afa3e.css @@ -0,0 +1,10 @@ + :root{--nav-sub-mobile-padding:8px;--search-typename-width:6.75rem;}@font-face {font-family:'Fira Sans';font-style:normal;font-weight:400;src:local('Fira Sans'),url("FiraSans-Regular-018c141bf0843ffd.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Fira Sans';font-style:normal;font-weight:500;src:local('Fira Sans Medium'),url("FiraSans-Medium-8f9a781e4970d388.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Source Serif 4';font-style:normal;font-weight:400;src:local('Source Serif 4'),url("SourceSerif4-Regular-46f98efaafac5295.ttf.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Source Serif 4';font-style:italic;font-weight:400;src:local('Source Serif 4 Italic'),url("SourceSerif4-It-acdfaf1a8af734b1.ttf.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Source Serif 4';font-style:normal;font-weight:700;src:local('Source Serif 4 Bold'),url("SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Source Code Pro';font-style:normal;font-weight:400;src:url("SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Source Code Pro';font-style:italic;font-weight:400;src:url("SourceCodePro-It-1cc31594bf4f1f79.ttf.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Source Code Pro';font-style:normal;font-weight:600;src:url("SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2") format("woff2");font-display:swap;}@font-face {font-family:'NanumBarunGothic';src:url("NanumBarunGothic-0f09457c7a19b7c6.ttf.woff2") format("woff2");font-display:swap;unicode-range:U+AC00-D7AF,U+1100-11FF,U+3130-318F,U+A960-A97F,U+D7B0-D7FF;}*{box-sizing:border-box;}body{font:1rem/1.5 "Source Serif 4",NanumBarunGothic,serif;margin:0;position:relative;overflow-wrap:break-word;overflow-wrap:anywhere;font-feature-settings:"kern","liga";background-color:var(--main-background-color);color:var(--main-color);}h1{font-size:1.5rem;}h2{font-size:1.375rem;}h3{font-size:1.25rem;}h1,h2,h3,h4,h5,h6{font-weight:500;}h1,h2,h3,h4{margin:25px 0 15px 0;padding-bottom:6px;}.docblock h3,.docblock h4,h5,h6{margin:15px 0 5px 0;}.docblock>h2:first-child,.docblock>h3:first-child,.docblock>h4:first-child,.docblock>h5:first-child,.docblock>h6:first-child{margin-top:0;}.main-heading h1{margin:0;padding:0;flex-grow:1;overflow-wrap:break-word;overflow-wrap:anywhere;}.main-heading{display:flex;flex-wrap:wrap;padding-bottom:6px;margin-bottom:15px;}.content h2,.top-doc .docblock>h3,.top-doc .docblock>h4{border-bottom:1px solid var(--headings-border-bottom-color);}h1,h2{line-height:1.25;padding-top:3px;padding-bottom:9px;}h3.code-header{font-size:1.125rem;}h4.code-header{font-size:1rem;}.code-header{font-weight:600;margin:0;padding:0;white-space:pre-wrap;}#crate-search,h1,h2,h3,h4,h5,h6,.sidebar,.mobile-topbar,.search-input,.search-results .result-name,.item-name>a,.out-of-band,span.since,a.src,#help-button>a,summary.hideme,.scraped-example-list,ul.all-items{font-family:"Fira Sans",Arial,NanumBarunGothic,sans-serif;}#toggle-all-docs,a.anchor,.small-section-header a,#src-sidebar a,.rust a,.sidebar h2 a,.sidebar h3 a,.mobile-topbar h2 a,h1 a,.search-results a,.stab,.result-name i{color:var(--main-color);}span.enum,a.enum,span.struct,a.struct,span.union,a.union,span.primitive,a.primitive,span.type,a.type,span.foreigntype,a.foreigntype{color:var(--type-link-color);}span.trait,a.trait,span.traitalias,a.traitalias{color:var(--trait-link-color);}span.associatedtype,a.associatedtype,span.constant,a.constant,span.static,a.static{color:var(--assoc-item-link-color);}span.fn,a.fn,span.method,a.method,span.tymethod,a.tymethod{color:var(--function-link-color);}span.attr,a.attr,span.derive,a.derive,span.macro,a.macro{color:var(--macro-link-color);}span.mod,a.mod{color:var(--mod-link-color);}span.keyword,a.keyword{color:var(--keyword-link-color);}a{color:var(--link-color);text-decoration:none;}ol,ul{padding-left:24px;}ul ul,ol ul,ul ol,ol ol{margin-bottom:.625em;}p,.docblock>.warning{margin:0 0 .75em 0;}p:last-child,.docblock>.warning:last-child{margin:0;}button{padding:1px 6px;cursor:pointer;}button#toggle-all-docs{padding:0;background:none;border:none;-webkit-appearance:none;opacity:1;}.rustdoc{display:flex;flex-direction:row;flex-wrap:nowrap;}main{position:relative;flex-grow:1;padding:10px 15px 40px 45px;min-width:0;}.src main{padding:15px;}.width-limiter{max-width:960px;margin-right:auto;}details:not(.toggle) summary{margin-bottom:.6em;}code,pre,a.test-arrow,.code-header{font-family:"Source Code Pro",monospace;}.docblock code,.docblock-short code{border-radius:3px;padding:0 0.125em;}.docblock pre code,.docblock-short pre code{padding:0;}pre{padding:14px;line-height:1.5;}pre.item-decl{overflow-x:auto;}.item-decl .type-contents-toggle{contain:initial;}.src .content pre{padding:20px;}.rustdoc.src .example-wrap pre.src-line-numbers{padding:20px 0 20px 4px;}img{max-width:100%;}.sub-logo-container,.logo-container{line-height:0;display:block;}.sub-logo-container{margin-right:32px;}.sub-logo-container>img{height:60px;width:60px;object-fit:contain;}.rust-logo{filter:var(--rust-logo-filter);}.sidebar{font-size:0.875rem;flex:0 0 200px;overflow-y:scroll;overscroll-behavior:contain;position:sticky;height:100vh;top:0;left:0;}.rustdoc.src .sidebar{flex-basis:50px;border-right:1px solid;overflow-x:hidden;overflow-y:hidden;z-index:1;}.sidebar,.mobile-topbar,.sidebar-menu-toggle,#src-sidebar-toggle,#src-sidebar{background-color:var(--sidebar-background-color);}#src-sidebar-toggle>button:hover,#src-sidebar-toggle>button:focus{background-color:var(--sidebar-background-color-hover);}.src .sidebar>*:not(#src-sidebar-toggle){visibility:hidden;}.src-sidebar-expanded .src .sidebar{overflow-y:auto;flex-basis:300px;}.src-sidebar-expanded .src .sidebar>*:not(#src-sidebar-toggle){visibility:visible;}#all-types{margin-top:1em;}*{scrollbar-width:initial;scrollbar-color:var(--scrollbar-color);}.sidebar{scrollbar-width:thin;scrollbar-color:var(--scrollbar-color);}::-webkit-scrollbar{width:12px;}.sidebar::-webkit-scrollbar{width:8px;}::-webkit-scrollbar-track{-webkit-box-shadow:inset 0;background-color:var(--scrollbar-track-background-color);}.sidebar::-webkit-scrollbar-track{background-color:var(--scrollbar-track-background-color);}::-webkit-scrollbar-thumb,.sidebar::-webkit-scrollbar-thumb{background-color:var(--scrollbar-thumb-background-color);}.hidden{display:none !important;}.logo-container>img{height:48px;width:48px;}ul.block,.block li{padding:0;margin:0;list-style:none;}.sidebar-elems a,.sidebar>h2 a{display:block;padding:0.25rem;margin-left:-0.25rem;}.sidebar h2{overflow-wrap:anywhere;padding:0;margin:0.7rem 0;}.sidebar h3{font-size:1.125rem;padding:0;margin:0;}.sidebar-elems,.sidebar>.version,.sidebar>h2{padding-left:24px;}.sidebar a{color:var(--sidebar-link-color);}.sidebar .current,.sidebar .current a,.sidebar-crate a.logo-container:hover+h2 a,.sidebar a:hover:not(.logo-container){background-color:var(--sidebar-current-link-background-color);}.sidebar-elems .block{margin-bottom:2em;}.sidebar-elems .block li a{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;}.sidebar-crate{display:flex;align-items:center;justify-content:center;margin:14px 32px 1rem;row-gap:10px;column-gap:32px;flex-wrap:wrap;}.sidebar-crate h2{flex-grow:1;margin:0 -8px;align-self:start;}.sidebar-crate .logo-container{margin:0 -16px 0 -16px;text-align:center;}.sidebar-crate h2 a{display:block;margin:0 calc(-24px + 0.25rem) 0 -0.5rem;padding:calc((16px - 0.57rem ) / 2 ) 0.25rem;padding-left:0.5rem;}.sidebar-crate h2 .version{display:block;font-weight:normal;font-size:1rem;overflow-wrap:break-word;margin-top:calc((-16px + 0.57rem ) / 2 );}.sidebar-crate+.version{margin-top:-1rem;margin-bottom:1rem;}.mobile-topbar{display:none;}.rustdoc .example-wrap{display:flex;position:relative;margin-bottom:10px;}.rustdoc .example-wrap:last-child{margin-bottom:0px;}.rustdoc .example-wrap pre{margin:0;flex-grow:1;}.rustdoc:not(.src) .example-wrap pre{overflow:auto hidden;}.rustdoc .example-wrap pre.example-line-numbers,.rustdoc .example-wrap pre.src-line-numbers{flex-grow:0;min-width:fit-content;overflow:initial;text-align:right;-webkit-user-select:none;user-select:none;padding:14px 8px;color:var(--src-line-numbers-span-color);}.rustdoc .example-wrap pre.src-line-numbers{padding:14px 0;}.src-line-numbers a,.src-line-numbers span{color:var(--src-line-numbers-span-color);padding:0 8px;}.src-line-numbers :target{background-color:transparent;border-right:none;padding:0 8px;}.src-line-numbers .line-highlighted{background-color:var(--src-line-number-highlighted-background-color);}.search-loading{text-align:center;}.docblock-short{overflow-wrap:break-word;overflow-wrap:anywhere;}.docblock :not(pre)>code,.docblock-short code{white-space:pre-wrap;}.top-doc .docblock h2{font-size:1.375rem;}.top-doc .docblock h3{font-size:1.25rem;}.top-doc .docblock h4,.top-doc .docblock h5{font-size:1.125rem;}.top-doc .docblock h6{font-size:1rem;}.docblock h5{font-size:1rem;}.docblock h6{font-size:0.875rem;}.docblock{margin-left:24px;position:relative;}.docblock>:not(.more-examples-toggle):not(.example-wrap){max-width:100%;overflow-x:auto;}.out-of-band{flex-grow:0;font-size:1.125rem;}.docblock code,.docblock-short code,pre,.rustdoc.src .example-wrap{background-color:var(--code-block-background-color);}#main-content{position:relative;}.docblock table{margin:.5em 0;border-collapse:collapse;}.docblock table td,.docblock table th{padding:.5em;border:1px solid var(--border-color);}.docblock table tbody tr:nth-child(2n){background:var(--table-alt-row-background-color);}.method .where,.fn .where,.where.fmt-newline{display:block;white-space:pre-wrap;font-size:0.875rem;}.item-info{display:block;margin-left:24px;}.item-info code{font-size:0.875rem;}#main-content>.item-info{margin-left:0;}nav.sub{flex-grow:1;flex-flow:row nowrap;margin:4px 0 25px 0;display:flex;align-items:center;}.search-form{position:relative;display:flex;height:34px;flex-grow:1;}.src nav.sub{margin:0 0 15px 0;}.small-section-header{display:block;position:relative;}.small-section-header:hover>.anchor,.impl:hover>.anchor,.trait-impl:hover>.anchor,.variant:hover>.anchor{display:initial;}.anchor{display:none;position:absolute;left:-0.5em;background:none !important;}.anchor.field{left:-5px;}.small-section-header>.anchor{left:-15px;padding-right:8px;}h2.small-section-header>.anchor{padding-right:6px;}.main-heading a:hover,.example-wrap .rust a:hover,.all-items a:hover,.docblock a:not(.test-arrow):not(.scrape-help):not(.tooltip):hover,.docblock-short a:not(.test-arrow):not(.scrape-help):not(.tooltip):hover,.item-info a{text-decoration:underline;}.crate.block a.current{font-weight:500;}table,.item-table{overflow-wrap:break-word;}.item-table{display:table;padding:0;margin:0;}.item-table>li{display:table-row;}.item-table>li>div{display:table-cell;}.item-table>li>.item-name{padding-right:1.25rem;}.search-results-title{margin-top:0;white-space:nowrap;display:flex;align-items:baseline;}#crate-search-div{position:relative;min-width:5em;}#crate-search{min-width:115px;padding:0 23px 0 4px;max-width:100%;text-overflow:ellipsis;border:1px solid var(--border-color);border-radius:4px;outline:none;cursor:pointer;-moz-appearance:none;-webkit-appearance:none;text-indent:0.01px;background-color:var(--main-background-color);color:inherit;line-height:1.5;font-weight:500;}#crate-search:hover,#crate-search:focus{border-color:var(--crate-search-hover-border);}#crate-search-div::after{pointer-events:none;width:100%;height:100%;position:absolute;top:0;left:0;content:"";background-repeat:no-repeat;background-size:20px;background-position:calc(100% - 2px) 56%;background-image:url('data:image/svg+xml, \ + ');filter:var(--crate-search-div-filter);}#crate-search-div:hover::after,#crate-search-div:focus-within::after{filter:var(--crate-search-div-hover-filter);}#crate-search>option{font-size:1rem;}.search-input{-webkit-appearance:none;outline:none;border:1px solid var(--border-color);border-radius:2px;padding:8px;font-size:1rem;flex-grow:1;background-color:var(--button-background-color);color:var(--search-color);}.search-input:focus{border-color:var(--search-input-focused-border-color);}.search-results{display:none;}.search-results.active{display:block;}.search-results>a{display:flex;margin-left:2px;margin-right:2px;border-bottom:1px solid var(--search-result-border-color);gap:1em;}.search-results>a>div.desc{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;flex:2;}.search-results a:hover,.search-results a:focus{background-color:var(--search-result-link-focus-background-color);}.search-results .result-name{display:flex;align-items:center;justify-content:start;flex:3;}.search-results .result-name .alias{color:var(--search-results-alias-color);}.search-results .result-name .grey{color:var(--search-results-grey-color);}.search-results .result-name .typename{color:var(--search-results-grey-color);font-size:0.875rem;width:var(--search-typename-width);}.search-results .result-name .path{word-break:break-all;max-width:calc(100% - var(--search-typename-width));display:inline-block;}.search-results .result-name .path>*{display:inline;}.popover{position:absolute;top:100%;right:0;z-index:2;margin-top:7px;border-radius:3px;border:1px solid var(--border-color);background-color:var(--main-background-color);color:var(--main-color);--popover-arrow-offset:11px;}.popover::before{content:'';position:absolute;right:var(--popover-arrow-offset);border:solid var(--border-color);border-width:1px 1px 0 0;background-color:var(--main-background-color);padding:4px;transform:rotate(-45deg);top:-5px;}.setting-line{margin:1.2em 0.6em;}.setting-radio input,.setting-check input{margin-right:0.3em;height:1.2rem;width:1.2rem;border:2px solid var(--settings-input-border-color);outline:none;-webkit-appearance:none;cursor:pointer;}.setting-radio input{border-radius:50%;}.setting-radio span,.setting-check span{padding-bottom:1px;}.setting-radio{margin-top:0.1em;margin-bottom:0.1em;min-width:3.8em;padding:0.3em;display:inline-flex;align-items:center;cursor:pointer;}.setting-radio+.setting-radio{margin-left:0.5em;}.setting-check{margin-right:20px;display:flex;align-items:center;cursor:pointer;}.setting-radio input:checked{box-shadow:inset 0 0 0 3px var(--main-background-color);background-color:var(--settings-input-color);}.setting-check input:checked{background-color:var(--settings-input-color);border-width:1px;content:url('data:image/svg+xml,\ + \ + ');}.setting-radio input:focus,.setting-check input:focus{box-shadow:0 0 1px 1px var(--settings-input-color);}.setting-radio input:checked:focus{box-shadow:inset 0 0 0 3px var(--main-background-color),0 0 2px 2px var(--settings-input-color);}.setting-radio input:hover,.setting-check input:hover{border-color:var(--settings-input-color) !important;}#help.popover{max-width:600px;--popover-arrow-offset:48px;}#help dt{float:left;clear:left;margin-right:0.5rem;}#help span.top,#help span.bottom{text-align:center;display:block;font-size:1.125rem;}#help span.top{margin:10px 0;border-bottom:1px solid var(--border-color);padding-bottom:4px;margin-bottom:6px;}#help span.bottom{clear:both;border-top:1px solid var(--border-color);}.side-by-side>div{width:50%;float:left;padding:0 20px 20px 17px;}.item-info .stab{min-height:36px;display:flex;padding:3px;margin-bottom:5px;align-items:center;vertical-align:text-bottom;}.item-name .stab{margin-left:0.3125em;}.stab{padding:0 2px;font-size:0.875rem;font-weight:normal;color:var(--main-color);background-color:var(--stab-background-color);width:fit-content;white-space:pre-wrap;border-radius:3px;display:inline;vertical-align:baseline;}.stab.portability>code{background:none;color:var(--stab-code-color);}.stab .emoji{font-size:1.25rem;margin-right:0.3rem;}.emoji{text-shadow:1px 0 0 black,-1px 0 0 black,0 1px 0 black,0 -1px 0 black;}.since{font-weight:normal;font-size:initial;}.rightside{padding-left:12px;float:right;}.rightside:not(a),.out-of-band{color:var(--right-side-color);}pre.rust{tab-size:4;-moz-tab-size:4;}pre.rust .kw{color:var(--code-highlight-kw-color);}pre.rust .kw-2{color:var(--code-highlight-kw-2-color);}pre.rust .lifetime{color:var(--code-highlight-lifetime-color);}pre.rust .prelude-ty{color:var(--code-highlight-prelude-color);}pre.rust .prelude-val{color:var(--code-highlight-prelude-val-color);}pre.rust .string{color:var(--code-highlight-string-color);}pre.rust .number{color:var(--code-highlight-number-color);}pre.rust .bool-val{color:var(--code-highlight-literal-color);}pre.rust .self{color:var(--code-highlight-self-color);}pre.rust .attr{color:var(--code-highlight-attribute-color);}pre.rust .macro,pre.rust .macro-nonterminal{color:var(--code-highlight-macro-color);}pre.rust .question-mark{font-weight:bold;color:var(--code-highlight-question-mark-color);}pre.rust .comment{color:var(--code-highlight-comment-color);}pre.rust .doccomment{color:var(--code-highlight-doc-comment-color);}.rustdoc.src .example-wrap pre.rust a{background:var(--codeblock-link-background);}.example-wrap.compile_fail,.example-wrap.should_panic{border-left:2px solid var(--codeblock-error-color);}.ignore.example-wrap{border-left:2px solid var(--codeblock-ignore-color);}.example-wrap.compile_fail:hover,.example-wrap.should_panic:hover{border-left:2px solid var(--codeblock-error-hover-color);}.example-wrap.ignore:hover{border-left:2px solid var(--codeblock-ignore-hover-color);}.example-wrap.compile_fail .tooltip,.example-wrap.should_panic .tooltip{color:var(--codeblock-error-color);}.example-wrap.ignore .tooltip{color:var(--codeblock-ignore-color);}.example-wrap.compile_fail:hover .tooltip,.example-wrap.should_panic:hover .tooltip{color:var(--codeblock-error-hover-color);}.example-wrap.ignore:hover .tooltip{color:var(--codeblock-ignore-hover-color);}.example-wrap .tooltip{position:absolute;display:block;left:-25px;top:5px;margin:0;line-height:1;}.example-wrap.compile_fail .tooltip,.example-wrap.should_panic .tooltip,.example-wrap.ignore .tooltip{font-weight:bold;font-size:1.25rem;}.content .docblock .warning{border-left:2px solid var(--warning-border-color);padding:14px;position:relative;overflow-x:visible !important;}.content .docblock .warning::before{color:var(--warning-border-color);content:"ⓘ";position:absolute;left:-25px;top:5px;font-weight:bold;font-size:1.25rem;}a.test-arrow{visibility:hidden;position:absolute;padding:5px 10px 5px 10px;border-radius:5px;font-size:1.375rem;top:5px;right:5px;z-index:1;color:var(--test-arrow-color);background-color:var(--test-arrow-background-color);}a.test-arrow:hover{color:var(--test-arrow-hover-color);background-color:var(--test-arrow-hover-background-color);}.example-wrap:hover .test-arrow{visibility:visible;}.code-attribute{font-weight:300;color:var(--code-attribute-color);}.item-spacer{width:100%;height:12px;display:block;}.out-of-band>span.since{font-size:1.25rem;}.sub-variant h4{font-size:1rem;font-weight:400;margin-top:0;margin-bottom:0;}.sub-variant{margin-left:24px;margin-bottom:40px;}.sub-variant>.sub-variant-field{margin-left:24px;}:target{padding-right:3px;background-color:var(--target-background-color);border-right:3px solid var(--target-border-color);}.code-header a.tooltip{color:inherit;margin-right:15px;position:relative;}.code-header a.tooltip:hover{color:var(--link-color);}a.tooltip:hover::after{position:absolute;top:calc(100% - 10px);left:-15px;right:-15px;height:20px;content:"\00a0";}.fade-out{opacity:0;transition:opacity 0.45s cubic-bezier(0,0,0.1,1.0);}.popover.tooltip .content{margin:0.25em 0.5em;}.popover.tooltip .content pre,.popover.tooltip .content code{background:transparent;margin:0;padding:0;font-size:1.25rem;white-space:pre-wrap;}.popover.tooltip .content>h3:first-child{margin:0 0 5px 0;}.search-failed{text-align:center;margin-top:20px;display:none;}.search-failed.active{display:block;}.search-failed>ul{text-align:left;max-width:570px;margin-left:auto;margin-right:auto;}#search-tabs{display:flex;flex-direction:row;gap:1px;margin-bottom:4px;}#search-tabs button{text-align:center;font-size:1.125rem;border:0;border-top:2px solid;flex:1;line-height:1.5;color:inherit;}#search-tabs button:not(.selected){background-color:var(--search-tab-button-not-selected-background);border-top-color:var(--search-tab-button-not-selected-border-top-color);}#search-tabs button:hover,#search-tabs button.selected{background-color:var(--search-tab-button-selected-background);border-top-color:var(--search-tab-button-selected-border-top-color);}#search-tabs .count{font-size:1rem;font-variant-numeric:tabular-nums;color:var(--search-tab-title-count-color);}#search .error code{border-radius:3px;background-color:var(--search-error-code-background-color);}.search-corrections{font-weight:normal;}#src-sidebar-toggle{position:sticky;top:0;left:0;font-size:1.25rem;border-bottom:1px solid;display:flex;height:40px;justify-content:stretch;align-items:stretch;z-index:10;}#src-sidebar{width:100%;overflow:auto;}#src-sidebar>.title{font-size:1.5rem;text-align:center;border-bottom:1px solid var(--border-color);margin-bottom:6px;}#src-sidebar div.files>a:hover,details.dir-entry summary:hover,#src-sidebar div.files>a:focus,details.dir-entry summary:focus{background-color:var(--src-sidebar-background-hover);}#src-sidebar div.files>a.selected{background-color:var(--src-sidebar-background-selected);}#src-sidebar-toggle>button{font-size:inherit;font-weight:bold;background:none;color:inherit;text-align:center;border:none;outline:none;flex:1 1;-webkit-appearance:none;opacity:1;}#settings-menu,#help-button{margin-left:4px;display:flex;}#settings-menu>a,#help-button>a{display:flex;align-items:center;justify-content:center;background-color:var(--button-background-color);border:1px solid var(--border-color);border-radius:2px;color:var(--settings-button-color);font-size:20px;width:33px;}#settings-menu>a:hover,#settings-menu>a:focus,#help-button>a:hover,#help-button>a:focus{border-color:var(--settings-button-border-focus);}#copy-path{color:var(--copy-path-button-color);background:var(--main-background-color);height:34px;margin-left:10px;padding:0;padding-left:2px;border:0;width:33px;}#copy-path>img{filter:var(--copy-path-img-filter);}#copy-path:hover>img{filter:var(--copy-path-img-hover-filter);}@keyframes rotating{from{transform:rotate(0deg);}to{transform:rotate(360deg);}}#settings-menu.rotate>a img{animation:rotating 2s linear infinite;}kbd{display:inline-block;padding:3px 5px;font:15px monospace;line-height:10px;vertical-align:middle;border:solid 1px var(--border-color);border-radius:3px;color:var(--kbd-color);background-color:var(--kbd-background);box-shadow:inset 0 -1px 0 var(--kbd-box-shadow-color);}ul.all-items>li{list-style:none;}details.dir-entry{padding-left:4px;}details.dir-entry>summary{margin:0 0 0 -4px;padding:0 0 0 4px;cursor:pointer;}details.dir-entry div.folders,details.dir-entry div.files{padding-left:23px;}details.dir-entry a{display:block;}details.toggle{contain:layout;position:relative;}details.toggle>summary.hideme{cursor:pointer;font-size:1rem;}details.toggle>summary{list-style:none;outline:none;}details.toggle>summary::-webkit-details-marker,details.toggle>summary::marker{display:none;}details.toggle>summary.hideme>span{margin-left:9px;}details.toggle>summary::before{background:url('data:image/svg+xml,') no-repeat top left;content:"";cursor:pointer;width:16px;height:16px;display:inline-block;vertical-align:middle;opacity:.5;filter:var(--toggle-filter);}details.toggle>summary.hideme>span,.more-examples-toggle summary,.more-examples-toggle .hide-more{color:var(--toggles-color);}details.toggle>summary::after{content:"Expand";overflow:hidden;width:0;height:0;position:absolute;}details.toggle>summary.hideme::after{content:"";}details.toggle>summary:focus::before,details.toggle>summary:hover::before{opacity:1;}details.toggle>summary:focus-visible::before{outline:1px dotted #000;outline-offset:1px;}details.non-exhaustive{margin-bottom:8px;}details.toggle>summary.hideme::before{position:relative;}details.toggle>summary:not(.hideme)::before{position:absolute;left:-24px;top:4px;}.impl-items>details.toggle>summary:not(.hideme)::before{position:absolute;left:-24px;}details.toggle[open] >summary.hideme{position:absolute;}details.toggle[open] >summary.hideme>span{display:none;}details.toggle[open] >summary::before{background:url('data:image/svg+xml,') no-repeat top left;}details.toggle[open] >summary::after{content:"Collapse";}.docblock summary>*{display:inline-block;}.docblock>.example-wrap:first-child .tooltip{margin-top:16px;}@media (max-width:850px){#search-tabs .count{display:block;}}@media (max-width:700px){*[id]{scroll-margin-top:45px;}.rustdoc{display:block;}main{padding-left:15px;padding-top:0px;}.main-heading{flex-direction:column;}.out-of-band{text-align:left;margin-left:initial;padding:initial;}.out-of-band .since::before{content:"Since ";}.sidebar .logo-container,.sidebar .location{display:none;}.sidebar{position:fixed;top:45px;left:-1000px;z-index:11;height:calc(100vh - 45px);width:200px;}.src main,.rustdoc.src .sidebar{top:0;padding:0;height:100vh;border:0;}.sidebar.shown,.src-sidebar-expanded .src .sidebar,.rustdoc:not(.src) .sidebar:focus-within{left:0;}.mobile-topbar h2{padding-bottom:0;margin:auto 0.5em auto auto;overflow:hidden;font-size:24px;}.mobile-topbar h2 a{display:block;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;}.mobile-topbar .logo-container>img{max-width:35px;max-height:35px;margin:5px 0 5px 20px;}.mobile-topbar{display:flex;flex-direction:row;position:sticky;z-index:10;font-size:2rem;height:45px;width:100%;left:0;top:0;}.sidebar-menu-toggle{width:45px;font-size:32px;border:none;color:var(--main-color);}.sidebar-elems{margin-top:1em;}.anchor{display:none !important;}#main-content>details.toggle>summary::before,#main-content>div>details.toggle>summary::before{left:-11px;}#src-sidebar-toggle{position:fixed;left:1px;top:100px;width:30px;font-size:1.5rem;padding:0;z-index:10;border-top-right-radius:3px;border-bottom-right-radius:3px;border:1px solid;border-left:0;}.src-sidebar-expanded #src-sidebar-toggle{left:unset;top:unset;width:unset;border-top-right-radius:unset;border-bottom-right-radius:unset;position:sticky;border:0;border-bottom:1px solid;}#copy-path,#help-button{display:none;}.item-table,.item-row,.item-table>li,.item-table>li>div,.search-results>a,.search-results>a>div{display:block;}.search-results>a{padding:5px 0px;}.search-results>a>div.desc,.item-table>li>div.desc{padding-left:2em;}.search-results .result-name{display:block;}.search-results .result-name .typename{width:initial;margin-right:0;}.search-results .result-name .typename,.search-results .result-name .path{display:inline;}.src-sidebar-expanded .src .sidebar{max-width:100vw;width:100vw;}details.toggle:not(.top-doc)>summary{margin-left:10px;}.impl-items>details.toggle>summary:not(.hideme)::before,#main-content>details.toggle:not(.top-doc)>summary::before,#main-content>div>details.toggle>summary::before{left:-11px;}.impl-items>.item-info{margin-left:34px;}.src nav.sub{margin:0;padding:var(--nav-sub-mobile-padding);}}@media (min-width:701px){.scraped-example-title{position:absolute;z-index:10;background:var(--main-background-color);bottom:8px;right:5px;padding:2px 4px;box-shadow:0 0 4px var(--main-background-color);}}@media print{nav.sidebar,nav.sub,.out-of-band,a.src,#copy-path,details.toggle[open] >summary::before,details.toggle>summary::before,details.toggle.top-doc>summary{display:none;}.docblock{margin-left:0;}main{padding:10px;}}@media (max-width:464px){.docblock{margin-left:12px;}.docblock code{overflow-wrap:break-word;overflow-wrap:anywhere;}nav.sub{flex-direction:column;}.search-form{align-self:stretch;}.sub-logo-container>img{height:35px;width:35px;margin-bottom:var(--nav-sub-mobile-padding);}}.variant,.implementors-toggle>summary,.impl,#implementors-list>.docblock,.impl-items>section,.impl-items>.toggle>summary,.methods>section,.methods>.toggle>summary{margin-bottom:0.75em;}.variants>.docblock,.implementors-toggle>.docblock,.impl-items>.toggle[open]:not(:last-child),.methods>.toggle[open]:not(:last-child),.implementors-toggle[open]:not(:last-child){margin-bottom:2em;}#trait-implementations-list .impl-items>.toggle:not(:last-child),#synthetic-implementations-list .impl-items>.toggle:not(:last-child),#blanket-implementations-list .impl-items>.toggle:not(:last-child){margin-bottom:1em;}.scraped-example-list .scrape-help{margin-left:10px;padding:0 4px;font-weight:normal;font-size:12px;position:relative;bottom:1px;border:1px solid var(--scrape-example-help-border-color);border-radius:50px;color:var(--scrape-example-help-color);}.scraped-example-list .scrape-help:hover{border-color:var(--scrape-example-help-hover-border-color);color:var(--scrape-example-help-hover-color);}.scraped-example{position:relative;}.scraped-example .code-wrapper{position:relative;display:flex;flex-direction:row;flex-wrap:wrap;width:100%;}.scraped-example:not(.expanded) .code-wrapper{max-height:calc(1.5em * 5 + 10px);}.scraped-example:not(.expanded) .code-wrapper pre{overflow-y:hidden;padding-bottom:0;max-height:calc(1.5em * 5 + 10px);}.more-scraped-examples .scraped-example:not(.expanded) .code-wrapper,.more-scraped-examples .scraped-example:not(.expanded) .code-wrapper pre{max-height:calc(1.5em * 10 + 10px);}.scraped-example .code-wrapper .next,.scraped-example .code-wrapper .prev,.scraped-example .code-wrapper .expand{color:var(--main-color);position:absolute;top:0.25em;z-index:1;padding:0;background:none;border:none;-webkit-appearance:none;opacity:1;}.scraped-example .code-wrapper .prev{right:2.25em;}.scraped-example .code-wrapper .next{right:1.25em;}.scraped-example .code-wrapper .expand{right:0.25em;}.scraped-example:not(.expanded) .code-wrapper::before,.scraped-example:not(.expanded) .code-wrapper::after{content:" ";width:100%;height:5px;position:absolute;z-index:1;}.scraped-example:not(.expanded) .code-wrapper::before{top:0;background:linear-gradient(to bottom,var(--scrape-example-code-wrapper-background-start),var(--scrape-example-code-wrapper-background-end));}.scraped-example:not(.expanded) .code-wrapper::after{bottom:0;background:linear-gradient(to top,var(--scrape-example-code-wrapper-background-start),var(--scrape-example-code-wrapper-background-end));}.scraped-example .code-wrapper .example-wrap{width:100%;overflow-y:hidden;margin-bottom:0;}.scraped-example:not(.expanded) .code-wrapper .example-wrap{overflow-x:hidden;}.scraped-example .example-wrap .rust span.highlight{background:var(--scrape-example-code-line-highlight);}.scraped-example .example-wrap .rust span.highlight.focus{background:var(--scrape-example-code-line-highlight-focus);}.more-examples-toggle{max-width:calc(100% + 25px);margin-top:10px;margin-left:-25px;}.more-examples-toggle .hide-more{margin-left:25px;cursor:pointer;}.more-scraped-examples{margin-left:25px;position:relative;}.toggle-line{position:absolute;top:5px;bottom:0;right:calc(100% + 10px);padding:0 4px;cursor:pointer;}.toggle-line-inner{min-width:2px;height:100%;background:var(--scrape-example-toggle-line-background);}.toggle-line:hover .toggle-line-inner{background:var(--scrape-example-toggle-line-hover-background);}.more-scraped-examples .scraped-example,.example-links{margin-top:20px;}.more-scraped-examples .scraped-example:first-child{margin-top:5px;}.example-links ul{margin-bottom:0;}:root[data-theme="light"]{--main-background-color:white;--main-color:black;--settings-input-color:#2196f3;--settings-input-border-color:#717171;--settings-button-color:#000;--settings-button-border-focus:#717171;--sidebar-background-color:#f5f5f5;--sidebar-background-color-hover:#e0e0e0;--code-block-background-color:#f5f5f5;--scrollbar-track-background-color:#dcdcdc;--scrollbar-thumb-background-color:rgba(36,37,39,0.6);--scrollbar-color:rgba(36,37,39,0.6) #d9d9d9;--headings-border-bottom-color:#ddd;--border-color:#e0e0e0;--button-background-color:#fff;--right-side-color:grey;--code-attribute-color:#999;--toggles-color:#999;--toggle-filter:none;--search-input-focused-border-color:#66afe9;--copy-path-button-color:#999;--copy-path-img-filter:invert(50%);--copy-path-img-hover-filter:invert(35%);--codeblock-error-hover-color:rgb(255,0,0);--codeblock-error-color:rgba(255,0,0,.5);--codeblock-ignore-hover-color:rgb(255,142,0);--codeblock-ignore-color:rgba(255,142,0,.6);--warning-border-color:#ff8e00;--type-link-color:#ad378a;--trait-link-color:#6e4fc9;--assoc-item-link-color:#3873ad;--function-link-color:#ad7c37;--macro-link-color:#068000;--keyword-link-color:#3873ad;--mod-link-color:#3873ad;--link-color:#3873ad;--sidebar-link-color:#356da4;--sidebar-current-link-background-color:#fff;--search-result-link-focus-background-color:#ccc;--search-result-border-color:#aaa3;--search-color:#000;--search-error-code-background-color:#d0cccc;--search-results-alias-color:#000;--search-results-grey-color:#999;--search-tab-title-count-color:#888;--search-tab-button-not-selected-border-top-color:#e6e6e6;--search-tab-button-not-selected-background:#e6e6e6;--search-tab-button-selected-border-top-color:#0089ff;--search-tab-button-selected-background:#fff;--stab-background-color:#fff5d6;--stab-code-color:#000;--code-highlight-kw-color:#8959a8;--code-highlight-kw-2-color:#4271ae;--code-highlight-lifetime-color:#b76514;--code-highlight-prelude-color:#4271ae;--code-highlight-prelude-val-color:#c82829;--code-highlight-number-color:#718c00;--code-highlight-string-color:#718c00;--code-highlight-literal-color:#c82829;--code-highlight-attribute-color:#c82829;--code-highlight-self-color:#c82829;--code-highlight-macro-color:#3e999f;--code-highlight-question-mark-color:#ff9011;--code-highlight-comment-color:#8e908c;--code-highlight-doc-comment-color:#4d4d4c;--src-line-numbers-span-color:#c67e2d;--src-line-number-highlighted-background-color:#fdffd3;--test-arrow-color:#f5f5f5;--test-arrow-background-color:rgba(78,139,202,0.2);--test-arrow-hover-color:#f5f5f5;--test-arrow-hover-background-color:rgb(78,139,202);--target-background-color:#fdffd3;--target-border-color:#ad7c37;--kbd-color:#000;--kbd-background:#fafbfc;--kbd-box-shadow-color:#c6cbd1;--rust-logo-filter:initial;--crate-search-div-filter:invert(100%) sepia(0%) saturate(4223%) hue-rotate(289deg) brightness(114%) contrast(76%);--crate-search-div-hover-filter:invert(44%) sepia(18%) saturate(23%) hue-rotate(317deg) brightness(96%) contrast(93%);--crate-search-hover-border:#717171;--src-sidebar-background-selected:#fff;--src-sidebar-background-hover:#e0e0e0;--table-alt-row-background-color:#f5f5f5;--codeblock-link-background:#eee;--scrape-example-toggle-line-background:#ccc;--scrape-example-toggle-line-hover-background:#999;--scrape-example-code-line-highlight:#fcffd6;--scrape-example-code-line-highlight-focus:#f6fdb0;--scrape-example-help-border-color:#555;--scrape-example-help-color:#333;--scrape-example-help-hover-border-color:#000;--scrape-example-help-hover-color:#000;--scrape-example-code-wrapper-background-start:rgba(255,255,255,1);--scrape-example-code-wrapper-background-end:rgba(255,255,255,0);}:root[data-theme="dark"]{--main-background-color:#353535;--main-color:#ddd;--settings-input-color:#2196f3;--settings-input-border-color:#999;--settings-button-color:#000;--settings-button-border-focus:#ffb900;--sidebar-background-color:#505050;--sidebar-background-color-hover:#676767;--code-block-background-color:#2A2A2A;--scrollbar-track-background-color:#717171;--scrollbar-thumb-background-color:rgba(32,34,37,.6);--scrollbar-color:rgba(32,34,37,.6) #5a5a5a;--headings-border-bottom-color:#d2d2d2;--border-color:#e0e0e0;--button-background-color:#f0f0f0;--right-side-color:grey;--code-attribute-color:#999;--toggles-color:#999;--toggle-filter:invert(100%);--search-input-focused-border-color:#008dfd;--copy-path-button-color:#999;--copy-path-img-filter:invert(50%);--copy-path-img-hover-filter:invert(65%);--codeblock-error-hover-color:rgb(255,0,0);--codeblock-error-color:rgba(255,0,0,.5);--codeblock-ignore-hover-color:rgb(255,142,0);--codeblock-ignore-color:rgba(255,142,0,.6);--warning-border-color:#ff8e00;--type-link-color:#2dbfb8;--trait-link-color:#b78cf2;--assoc-item-link-color:#d2991d;--function-link-color:#2bab63;--macro-link-color:#09bd00;--keyword-link-color:#d2991d;--mod-link-color:#d2991d;--link-color:#d2991d;--sidebar-link-color:#fdbf35;--sidebar-current-link-background-color:#444;--search-result-link-focus-background-color:#616161;--search-result-border-color:#aaa3;--search-color:#111;--search-error-code-background-color:#484848;--search-results-alias-color:#fff;--search-results-grey-color:#ccc;--search-tab-title-count-color:#888;--search-tab-button-not-selected-border-top-color:#252525;--search-tab-button-not-selected-background:#252525;--search-tab-button-selected-border-top-color:#0089ff;--search-tab-button-selected-background:#353535;--stab-background-color:#314559;--stab-code-color:#e6e1cf;--code-highlight-kw-color:#ab8ac1;--code-highlight-kw-2-color:#769acb;--code-highlight-lifetime-color:#d97f26;--code-highlight-prelude-color:#769acb;--code-highlight-prelude-val-color:#ee6868;--code-highlight-number-color:#83a300;--code-highlight-string-color:#83a300;--code-highlight-literal-color:#ee6868;--code-highlight-attribute-color:#ee6868;--code-highlight-self-color:#ee6868;--code-highlight-macro-color:#3e999f;--code-highlight-question-mark-color:#ff9011;--code-highlight-comment-color:#8d8d8b;--code-highlight-doc-comment-color:#8ca375;--src-line-numbers-span-color:#3b91e2;--src-line-number-highlighted-background-color:#0a042f;--test-arrow-color:#dedede;--test-arrow-background-color:rgba(78,139,202,0.2);--test-arrow-hover-color:#dedede;--test-arrow-hover-background-color:#4e8bca;--target-background-color:#494a3d;--target-border-color:#bb7410;--kbd-color:#000;--kbd-background:#fafbfc;--kbd-box-shadow-color:#c6cbd1;--rust-logo-filter:drop-shadow(1px 0 0px #fff) drop-shadow(0 1px 0 #fff) drop-shadow(-1px 0 0 #fff) drop-shadow(0 -1px 0 #fff);--crate-search-div-filter:invert(94%) sepia(0%) saturate(721%) hue-rotate(255deg) brightness(90%) contrast(90%);--crate-search-div-hover-filter:invert(69%) sepia(60%) saturate(6613%) hue-rotate(184deg) brightness(100%) contrast(91%);--crate-search-hover-border:#2196f3;--src-sidebar-background-selected:#333;--src-sidebar-background-hover:#444;--table-alt-row-background-color:#2a2a2a;--codeblock-link-background:#333;--scrape-example-toggle-line-background:#999;--scrape-example-toggle-line-hover-background:#c5c5c5;--scrape-example-code-line-highlight:#5b3b01;--scrape-example-code-line-highlight-focus:#7c4b0f;--scrape-example-help-border-color:#aaa;--scrape-example-help-color:#eee;--scrape-example-help-hover-border-color:#fff;--scrape-example-help-hover-color:#fff;--scrape-example-code-wrapper-background-start:rgba(53,53,53,1);--scrape-example-code-wrapper-background-end:rgba(53,53,53,0);}:root[data-theme="ayu"]{--main-background-color:#0f1419;--main-color:#c5c5c5;--settings-input-color:#ffb454;--settings-input-border-color:#999;--settings-button-color:#fff;--settings-button-border-focus:#e0e0e0;--sidebar-background-color:#14191f;--sidebar-background-color-hover:rgba(70,70,70,0.33);--code-block-background-color:#191f26;--scrollbar-track-background-color:transparent;--scrollbar-thumb-background-color:#5c6773;--scrollbar-color:#5c6773 #24292f;--headings-border-bottom-color:#5c6773;--border-color:#5c6773;--button-background-color:#141920;--right-side-color:grey;--code-attribute-color:#999;--toggles-color:#999;--toggle-filter:invert(100%);--search-input-focused-border-color:#5c6773;--copy-path-button-color:#fff;--copy-path-img-filter:invert(70%);--copy-path-img-hover-filter:invert(100%);--codeblock-error-hover-color:rgb(255,0,0);--codeblock-error-color:rgba(255,0,0,.5);--codeblock-ignore-hover-color:rgb(255,142,0);--codeblock-ignore-color:rgba(255,142,0,.6);--warning-border-color:#ff8e00;--type-link-color:#ffa0a5;--trait-link-color:#39afd7;--assoc-item-link-color:#39afd7;--function-link-color:#fdd687;--macro-link-color:#a37acc;--keyword-link-color:#39afd7;--mod-link-color:#39afd7;--link-color:#39afd7;--sidebar-link-color:#53b1db;--sidebar-current-link-background-color:transparent;--search-result-link-focus-background-color:#3c3c3c;--search-result-border-color:#aaa3;--search-color:#fff;--search-error-code-background-color:#4f4c4c;--search-results-alias-color:#c5c5c5;--search-results-grey-color:#999;--search-tab-title-count-color:#888;--search-tab-button-not-selected-border-top-color:none;--search-tab-button-not-selected-background:transparent !important;--search-tab-button-selected-border-top-color:none;--search-tab-button-selected-background:#141920 !important;--stab-background-color:#314559;--stab-code-color:#e6e1cf;--code-highlight-kw-color:#ff7733;--code-highlight-kw-2-color:#ff7733;--code-highlight-lifetime-color:#ff7733;--code-highlight-prelude-color:#69f2df;--code-highlight-prelude-val-color:#ff7733;--code-highlight-number-color:#b8cc52;--code-highlight-string-color:#b8cc52;--code-highlight-literal-color:#ff7733;--code-highlight-attribute-color:#e6e1cf;--code-highlight-self-color:#36a3d9;--code-highlight-macro-color:#a37acc;--code-highlight-question-mark-color:#ff9011;--code-highlight-comment-color:#788797;--code-highlight-doc-comment-color:#a1ac88;--src-line-numbers-span-color:#5c6773;--src-line-number-highlighted-background-color:rgba(255,236,164,0.06);--test-arrow-color:#788797;--test-arrow-background-color:rgba(57,175,215,0.09);--test-arrow-hover-color:#c5c5c5;--test-arrow-hover-background-color:rgba(57,175,215,0.368);--target-background-color:rgba(255,236,164,0.06);--target-border-color:rgba(255,180,76,0.85);--kbd-color:#c5c5c5;--kbd-background:#314559;--kbd-box-shadow-color:#5c6773;--rust-logo-filter:drop-shadow(1px 0 0px #fff) drop-shadow(0 1px 0 #fff) drop-shadow(-1px 0 0 #fff) drop-shadow(0 -1px 0 #fff);--crate-search-div-filter:invert(41%) sepia(12%) saturate(487%) hue-rotate(171deg) brightness(94%) contrast(94%);--crate-search-div-hover-filter:invert(98%) sepia(12%) saturate(81%) hue-rotate(343deg) brightness(113%) contrast(76%);--crate-search-hover-border:#e0e0e0;--src-sidebar-background-selected:#14191f;--src-sidebar-background-hover:#14191f;--table-alt-row-background-color:#191f26;--codeblock-link-background:#333;--scrape-example-toggle-line-background:#999;--scrape-example-toggle-line-hover-background:#c5c5c5;--scrape-example-code-line-highlight:#5b3b01;--scrape-example-code-line-highlight-focus:#7c4b0f;--scrape-example-help-border-color:#aaa;--scrape-example-help-color:#eee;--scrape-example-help-hover-border-color:#fff;--scrape-example-help-hover-color:#fff;--scrape-example-code-wrapper-background-start:rgba(15,20,25,1);--scrape-example-code-wrapper-background-end:rgba(15,20,25,0);}:root[data-theme="ayu"] h1,:root[data-theme="ayu"] h2,:root[data-theme="ayu"] h3,:root[data-theme="ayu"] h4,:where(:root[data-theme="ayu"]) h1 a,:root[data-theme="ayu"] .sidebar h2 a,:root[data-theme="ayu"] .sidebar h3 a,:root[data-theme="ayu"] #source-sidebar>.title{color:#fff;}:root[data-theme="ayu"] .docblock code{color:#ffb454;}:root[data-theme="ayu"] .docblock a>code{color:#39AFD7 !important;}:root[data-theme="ayu"] .code-header,:root[data-theme="ayu"] .docblock pre>code,:root[data-theme="ayu"] pre,:root[data-theme="ayu"] pre>code,:root[data-theme="ayu"] .item-info code,:root[data-theme="ayu"] .rustdoc.source .example-wrap{color:#e6e1cf;}:root[data-theme="ayu"] .sidebar .current,:root[data-theme="ayu"] .sidebar a:hover,:root[data-theme="ayu"] #src-sidebar div.files>a:hover,:root[data-theme="ayu"] details.dir-entry summary:hover,:root[data-theme="ayu"] #src-sidebar div.files>a:focus,:root[data-theme="ayu"] details.dir-entry summary:focus,:root[data-theme="ayu"] #src-sidebar div.files>a.selected{color:#ffb44c;}:root[data-theme="ayu"] .sidebar-elems .location{color:#ff7733;}:root[data-theme="ayu"] .src-line-numbers .line-highlighted{color:#708090;padding-right:7px;border-right:1px solid #ffb44c;}:root[data-theme="ayu"] .search-results a:hover,:root[data-theme="ayu"] .search-results a:focus{color:#fff !important;background-color:#3c3c3c;}:root[data-theme="ayu"] .search-results a{color:#0096cf;}:root[data-theme="ayu"] .search-results a div.desc{color:#c5c5c5;}:root[data-theme="ayu"] .result-name .primitive>i,:root[data-theme="ayu"] .result-name .keyword>i{color:#788797;}:root[data-theme="ayu"] #search-tabs>button.selected{border-bottom:1px solid #ffb44c !important;border-top:none;}:root[data-theme="ayu"] #search-tabs>button:not(.selected){border:none;background-color:transparent !important;}:root[data-theme="ayu"] #search-tabs>button:hover{border-bottom:1px solid rgba(242,151,24,0.3);}:root[data-theme="ayu"] #settings-menu>a img{filter:invert(100);} \ No newline at end of file diff --git a/static.files/scrape-examples-ef1e698c1d417c0c.js b/static.files/scrape-examples-ef1e698c1d417c0c.js new file mode 100644 index 0000000000..ba830e3744 --- /dev/null +++ b/static.files/scrape-examples-ef1e698c1d417c0c.js @@ -0,0 +1 @@ +"use strict";(function(){const DEFAULT_MAX_LINES=5;const HIDDEN_MAX_LINES=10;function scrollToLoc(elt,loc,isHidden){const lines=elt.querySelector(".src-line-numbers");let scrollOffset;const maxLines=isHidden?HIDDEN_MAX_LINES:DEFAULT_MAX_LINES;if(loc[1]-loc[0]>maxLines){const line=Math.max(0,loc[0]-1);scrollOffset=lines.children[line].offsetTop}else{const wrapper=elt.querySelector(".code-wrapper");const halfHeight=wrapper.offsetHeight/2;const offsetTop=lines.children[loc[0]].offsetTop;const lastLine=lines.children[loc[1]];const offsetBot=lastLine.offsetTop+lastLine.offsetHeight;const offsetMid=(offsetTop+offsetBot)/2;scrollOffset=offsetMid-halfHeight}lines.scrollTo(0,scrollOffset);elt.querySelector(".rust").scrollTo(0,scrollOffset)}function updateScrapedExample(example,isHidden){const locs=JSON.parse(example.attributes.getNamedItem("data-locs").textContent);let locIndex=0;const highlights=Array.prototype.slice.call(example.querySelectorAll(".highlight"));const link=example.querySelector(".scraped-example-title a");if(locs.length>1){const onChangeLoc=changeIndex=>{removeClass(highlights[locIndex],"focus");changeIndex();scrollToLoc(example,locs[locIndex][0],isHidden);addClass(highlights[locIndex],"focus");const url=locs[locIndex][1];const title=locs[locIndex][2];link.href=url;link.innerHTML=title};example.querySelector(".prev").addEventListener("click",()=>{onChangeLoc(()=>{locIndex=(locIndex-1+locs.length)%locs.length})});example.querySelector(".next").addEventListener("click",()=>{onChangeLoc(()=>{locIndex=(locIndex+1)%locs.length})})}const expandButton=example.querySelector(".expand");if(expandButton){expandButton.addEventListener("click",()=>{if(hasClass(example,"expanded")){removeClass(example,"expanded");scrollToLoc(example,locs[0][0],isHidden)}else{addClass(example,"expanded")}})}scrollToLoc(example,locs[0][0],isHidden)}const firstExamples=document.querySelectorAll(".scraped-example-list > .scraped-example");onEachLazy(firstExamples,el=>updateScrapedExample(el,false));onEachLazy(document.querySelectorAll(".more-examples-toggle"),toggle=>{onEachLazy(toggle.querySelectorAll(".toggle-line, .hide-more"),button=>{button.addEventListener("click",()=>{toggle.open=false})});const moreExamples=toggle.querySelectorAll(".scraped-example");toggle.querySelector("summary").addEventListener("click",()=>{setTimeout(()=>{onEachLazy(moreExamples,el=>updateScrapedExample(el,true))})},{once:true})})})() \ No newline at end of file diff --git a/static.files/search-8fbf244ebcf71464.js b/static.files/search-8fbf244ebcf71464.js new file mode 100644 index 0000000000..168023b4b8 --- /dev/null +++ b/static.files/search-8fbf244ebcf71464.js @@ -0,0 +1,5 @@ +"use strict";if(!Array.prototype.toSpliced){Array.prototype.toSpliced=function(){const me=this.slice();Array.prototype.splice.apply(me,arguments);return me}}(function(){const itemTypes=["mod","externcrate","import","struct","enum","fn","type","static","trait","impl","tymethod","method","structfield","variant","macro","primitive","associatedtype","constant","associatedconstant","union","foreigntype","keyword","existential","attr","derive","traitalias","generic",];const longItemTypes=["module","extern crate","re-export","struct","enum","function","type alias","static","trait","","trait method","method","struct field","enum variant","macro","primitive type","assoc type","constant","assoc const","union","foreign type","keyword","existential type","attribute macro","derive macro","trait alias",];const TY_PRIMITIVE=itemTypes.indexOf("primitive");const TY_KEYWORD=itemTypes.indexOf("keyword");const TY_GENERIC=itemTypes.indexOf("generic");const ROOT_PATH=typeof window!=="undefined"?window.rootPath:"../";function hasOwnPropertyRustdoc(obj,property){return Object.prototype.hasOwnProperty.call(obj,property)}function printTab(nb){let iter=0;let foundCurrentTab=false;let foundCurrentResultSet=false;onEachLazy(document.getElementById("search-tabs").childNodes,elem=>{if(nb===iter){addClass(elem,"selected");foundCurrentTab=true}else{removeClass(elem,"selected")}iter+=1});const isTypeSearch=(nb>0||iter===1);iter=0;onEachLazy(document.getElementById("results").childNodes,elem=>{if(nb===iter){addClass(elem,"active");foundCurrentResultSet=true}else{removeClass(elem,"active")}iter+=1});if(foundCurrentTab&&foundCurrentResultSet){searchState.currentTab=nb;const correctionsElem=document.getElementsByClassName("search-corrections");if(isTypeSearch){removeClass(correctionsElem[0],"hidden")}else{addClass(correctionsElem[0],"hidden")}}else if(nb!==0){printTab(0)}}const editDistanceState={current:[],prev:[],prevPrev:[],calculate:function calculate(a,b,limit){if(a.lengthlimit){return limit+1}while(b.length>0&&b[0]===a[0]){a=a.substring(1);b=b.substring(1)}while(b.length>0&&b[b.length-1]===a[a.length-1]){a=a.substring(0,a.length-1);b=b.substring(0,b.length-1)}if(b.length===0){return minDist}const aLength=a.length;const bLength=b.length;for(let i=0;i<=bLength;++i){this.current[i]=0;this.prev[i]=i;this.prevPrev[i]=Number.MAX_VALUE}for(let i=1;i<=aLength;++i){this.current[0]=i;const aIdx=i-1;for(let j=1;j<=bLength;++j){const bIdx=j-1;const substitutionCost=a[aIdx]===b[bIdx]?0:1;this.current[j]=Math.min(this.prev[j]+1,this.current[j-1]+1,this.prev[j-1]+substitutionCost);if((i>1)&&(j>1)&&(a[aIdx]===b[bIdx-1])&&(a[aIdx-1]===b[bIdx])){this.current[j]=Math.min(this.current[j],this.prevPrev[j-2]+1)}}const prevPrevTmp=this.prevPrev;this.prevPrev=this.prev;this.prev=this.current;this.current=prevPrevTmp}const distance=this.prev[bLength];return distance<=limit?distance:(limit+1)},};function editDistance(a,b,limit){return editDistanceState.calculate(a,b,limit)}function initSearch(rawSearchIndex){const MAX_RESULTS=200;const NO_TYPE_FILTER=-1;let searchIndex;let currentResults;let typeNameIdMap;const ALIASES=new Map();let typeNameIdOfArray;let typeNameIdOfSlice;let typeNameIdOfArrayOrSlice;function buildTypeMapIndex(name){if(name===""||name===null){return null}if(typeNameIdMap.has(name)){return typeNameIdMap.get(name)}else{const id=typeNameIdMap.size;typeNameIdMap.set(name,id);return id}}function isWhitespace(c){return" \t\n\r".indexOf(c)!==-1}function isSpecialStartCharacter(c){return"<\"".indexOf(c)!==-1}function isEndCharacter(c){return",>-]".indexOf(c)!==-1}function isStopCharacter(c){return isEndCharacter(c)}function isErrorCharacter(c){return"()".indexOf(c)!==-1}function itemTypeFromName(typename){const index=itemTypes.findIndex(i=>i===typename);if(index<0){throw["Unknown type filter ",typename]}return index}function getStringElem(query,parserState,isInGenerics){if(isInGenerics){throw["Unexpected ","\""," in generics"]}else if(query.literalSearch){throw["Cannot have more than one literal search element"]}else if(parserState.totalElems-parserState.genericsElems>0){throw["Cannot use literal search when there is more than one element"]}parserState.pos+=1;const start=parserState.pos;const end=getIdentEndPosition(parserState);if(parserState.pos>=parserState.length){throw["Unclosed ","\""]}else if(parserState.userQuery[end]!=="\""){throw["Unexpected ",parserState.userQuery[end]," in a string element"]}else if(start===end){throw["Cannot have empty string element"]}parserState.pos+=1;query.literalSearch=true}function isPathStart(parserState){return parserState.userQuery.slice(parserState.pos,parserState.pos+2)==="::"}function isReturnArrow(parserState){return parserState.userQuery.slice(parserState.pos,parserState.pos+2)==="->"}function isIdentCharacter(c){return(c==="_"||(c>="0"&&c<="9")||(c>="a"&&c<="z")||(c>="A"&&c<="Z"))}function isSeparatorCharacter(c){return c===","}function isPathSeparator(c){return c===":"||isWhitespace(c)}function prevIs(parserState,lookingFor){let pos=parserState.pos;while(pos>0){const c=parserState.userQuery[pos-1];if(c===lookingFor){return true}else if(!isWhitespace(c)){break}pos-=1}return false}function isLastElemGeneric(elems,parserState){return(elems.length>0&&elems[elems.length-1].generics.length>0)||prevIs(parserState,">")}function skipWhitespace(parserState){while(parserState.pos0){throw["Cannot have more than one element if you use quotes"]}const typeFilter=parserState.typeFilter;parserState.typeFilter=null;if(name==="!"){if(typeFilter!==null&&typeFilter!=="primitive"){throw["Invalid search type: primitive never type ","!"," and ",typeFilter," both specified",]}if(generics.length!==0){throw["Never type ","!"," does not accept generic parameters",]}return{name:"never",id:null,fullPath:["never"],pathWithoutLast:[],pathLast:"never",generics:[],typeFilter:"primitive",}}if(path.startsWith("::")){throw["Paths cannot start with ","::"]}else if(path.endsWith("::")){throw["Paths cannot end with ","::"]}else if(path.includes("::::")){throw["Unexpected ","::::"]}else if(path.includes(" ::")){throw["Unexpected "," ::"]}else if(path.includes(":: ")){throw["Unexpected ",":: "]}const pathSegments=path.split(/::|\s+/);if(pathSegments.length===0||(pathSegments.length===1&&pathSegments[0]==="")){if(generics.length>0||prevIs(parserState,">")){throw["Found generics without a path"]}else{throw["Unexpected ",parserState.userQuery[parserState.pos]]}}for(const[i,pathSegment]of pathSegments.entries()){if(pathSegment==="!"){if(i!==0){throw["Never type ","!"," is not associated item"]}pathSegments[i]="never"}}parserState.totalElems+=1;if(isInGenerics){parserState.genericsElems+=1}return{name:name.trim(),id:null,fullPath:pathSegments,pathWithoutLast:pathSegments.slice(0,pathSegments.length-1),pathLast:pathSegments[pathSegments.length-1],generics:generics,typeFilter,}}function getIdentEndPosition(parserState){const start=parserState.pos;let end=parserState.pos;let foundExclamation=-1;while(parserState.pos=end){throw["Found generics without a path"]}parserState.pos+=1;getItemsBefore(query,parserState,generics,">")}if(isStringElem){skipWhitespace(parserState)}if(start>=end&&generics.length===0){return}elems.push(createQueryElement(query,parserState,parserState.userQuery.slice(start,end),generics,isInGenerics))}}function getItemsBefore(query,parserState,elems,endChar){let foundStopChar=true;let start=parserState.pos;const oldTypeFilter=parserState.typeFilter;parserState.typeFilter=null;let extra="";if(endChar===">"){extra="<"}else if(endChar==="]"){extra="["}else if(endChar===""){extra="->"}else{extra=endChar}while(parserState.pos"]}else if(prevIs(parserState,"\"")){throw["Cannot have more than one element if you use quotes"]}if(endChar!==""){throw["Expected ",","," or ",endChar,...extra,", found ",c,]}throw["Expected ",",",...extra,", found ",c,]}const posBefore=parserState.pos;start=parserState.pos;getNextElem(query,parserState,elems,endChar!=="");if(endChar!==""&&parserState.pos>=parserState.length){throw["Unclosed ",extra]}if(posBefore===parserState.pos){parserState.pos+=1}foundStopChar=false}if(parserState.pos>=parserState.length&&endChar!==""){throw["Unclosed ",extra]}parserState.pos+=1;parserState.typeFilter=oldTypeFilter}function checkExtraTypeFilterCharacters(start,parserState){const query=parserState.userQuery.slice(start,parserState.pos).trim();for(const c in query){if(!isIdentCharacter(query[c])){throw["Unexpected ",query[c]," in type filter (before ",":",")",]}}}function parseInput(query,parserState){let foundStopChar=true;let start=parserState.pos;while(parserState.pos"){if(isReturnArrow(parserState)){break}throw["Unexpected ",c," (did you mean ","->","?)"]}throw["Unexpected ",c]}else if(c===":"&&!isPathStart(parserState)){if(parserState.typeFilter!==null){throw["Unexpected ",":"," (expected path after type filter ",parserState.typeFilter+":",")",]}else if(query.elems.length===0){throw["Expected type filter before ",":"]}else if(query.literalSearch){throw["Cannot use quotes on type filter"]}const typeFilterElem=query.elems.pop();checkExtraTypeFilterCharacters(start,parserState);parserState.typeFilter=typeFilterElem.name;parserState.pos+=1;parserState.totalElems-=1;query.literalSearch=false;foundStopChar=true;continue}else if(isWhitespace(c)){skipWhitespace(parserState);continue}if(!foundStopChar){let extra="";if(isLastElemGeneric(query.elems,parserState)){extra=[" after ",">"]}else if(prevIs(parserState,"\"")){throw["Cannot have more than one element if you use quotes"]}if(parserState.typeFilter!==null){throw["Expected ",","," or ","->",...extra,", found ",c,]}throw["Expected ",",",", ",":"," or ","->",...extra,", found ",c,]}const before=query.elems.length;start=parserState.pos;getNextElem(query,parserState,query.elems,false);if(query.elems.length===before){parserState.pos+=1}foundStopChar=false}if(parserState.typeFilter!==null){throw["Unexpected ",":"," (expected path after type filter ",parserState.typeFilter+":",")",]}while(parserState.pos"]}break}else{parserState.pos+=1}}}function newParsedQuery(userQuery){return{original:userQuery,userQuery:userQuery.toLowerCase(),elems:[],returned:[],foundElems:0,totalElems:0,literalSearch:false,error:null,correction:null,proposeCorrectionFrom:null,proposeCorrectionTo:null,}}function buildUrl(search,filterCrates){let extra="?search="+encodeURIComponent(search);if(filterCrates!==null){extra+="&filter-crate="+encodeURIComponent(filterCrates)}return getNakedUrl()+extra+window.location.hash}function getFilterCrates(){const elem=document.getElementById("crate-search");if(elem&&elem.value!=="all crates"&&hasOwnPropertyRustdoc(rawSearchIndex,elem.value)){return elem.value}return null}function parseQuery(userQuery){function convertTypeFilterOnElem(elem){if(elem.typeFilter!==null){let typeFilter=elem.typeFilter;if(typeFilter==="const"){typeFilter="constant"}elem.typeFilter=itemTypeFromName(typeFilter)}else{elem.typeFilter=NO_TYPE_FILTER}for(const elem2 of elem.generics){convertTypeFilterOnElem(elem2)}}userQuery=userQuery.trim();const parserState={length:userQuery.length,pos:0,totalElems:0,genericsElems:0,typeFilter:null,userQuery:userQuery.toLowerCase(),};let query=newParsedQuery(userQuery);try{parseInput(query,parserState);for(const elem of query.elems){convertTypeFilterOnElem(elem)}for(const elem of query.returned){convertTypeFilterOnElem(elem)}}catch(err){query=newParsedQuery(userQuery);query.error=err;return query}if(!query.literalSearch){query.literalSearch=parserState.totalElems>1}query.foundElems=query.elems.length+query.returned.length;query.totalElems=parserState.totalElems;return query}function createQueryResults(results_in_args,results_returned,results_others,parsedQuery){return{"in_args":results_in_args,"returned":results_returned,"others":results_others,"query":parsedQuery,}}function execQuery(parsedQuery,searchWords,filterCrates,currentCrate){const results_others=new Map(),results_in_args=new Map(),results_returned=new Map();function transformResults(results){const duplicates=new Set();const out=[];for(const result of results){if(result.id!==-1){const obj=searchIndex[result.id];obj.dist=result.dist;const res=buildHrefAndPath(obj);obj.displayPath=pathSplitter(res[0]);obj.fullPath=obj.displayPath+obj.name;obj.fullPath+="|"+obj.ty;if(duplicates.has(obj.fullPath)){continue}duplicates.add(obj.fullPath);obj.href=res[1];out.push(obj);if(out.length>=MAX_RESULTS){break}}}return out}function sortResults(results,isType,preferredCrate){if(results.size===0){return[]}const userQuery=parsedQuery.userQuery;const result_list=[];for(const result of results.values()){result.word=searchWords[result.id];result.item=searchIndex[result.id]||{};result_list.push(result)}result_list.sort((aaa,bbb)=>{let a,b;a=(aaa.word!==userQuery);b=(bbb.word!==userQuery);if(a!==b){return a-b}a=(aaa.index<0);b=(bbb.index<0);if(a!==b){return a-b}a=aaa.path_dist;b=bbb.path_dist;if(a!==b){return a-b}a=aaa.index;b=bbb.index;if(a!==b){return a-b}a=(aaa.dist);b=(bbb.dist);if(a!==b){return a-b}a=aaa.item.deprecated;b=bbb.item.deprecated;if(a!==b){return a-b}a=(aaa.item.crate!==preferredCrate);b=(bbb.item.crate!==preferredCrate);if(a!==b){return a-b}a=aaa.word.length;b=bbb.word.length;if(a!==b){return a-b}a=aaa.word;b=bbb.word;if(a!==b){return(a>b?+1:-1)}if((aaa.item.ty===TY_PRIMITIVE&&bbb.item.ty!==TY_KEYWORD)||(aaa.item.ty===TY_KEYWORD&&bbb.item.ty!==TY_PRIMITIVE)){return-1}if((bbb.item.ty===TY_PRIMITIVE&&aaa.item.ty!==TY_PRIMITIVE)||(bbb.item.ty===TY_KEYWORD&&aaa.item.ty!==TY_KEYWORD)){return 1}a=(aaa.item.desc==="");b=(bbb.item.desc==="");if(a!==b){return a-b}a=aaa.item.ty;b=bbb.item.ty;if(a!==b){return a-b}a=aaa.item.path;b=bbb.item.path;if(a!==b){return(a>b?+1:-1)}return 0});let nameSplit=null;if(parsedQuery.elems.length===1){const hasPath=typeof parsedQuery.elems[0].path==="undefined";nameSplit=hasPath?null:parsedQuery.elems[0].path}for(const result of result_list){if(result.dontValidate){continue}const name=result.item.name.toLowerCase(),path=result.item.path.toLowerCase(),parent=result.item.parent;if(!isType&&!validateResult(name,path,nameSplit,parent)){result.id=-1}}return transformResults(result_list)}function checkGenerics(fnType,queryElem,whereClause,mgensInout){return unifyFunctionTypes(fnType.generics,queryElem.generics,whereClause,mgensInout,mgens=>{if(mgensInout){for(const[fid,qid]of mgens.entries()){mgensInout.set(fid,qid)}}return true})}function unifyFunctionTypes(fnTypesIn,queryElems,whereClause,mgensIn,solutionCb){let mgens=new Map(mgensIn);if(queryElems.length===0){return!solutionCb||solutionCb(mgens)}if(!fnTypesIn||fnTypesIn.length===0){return false}const ql=queryElems.length;let fl=fnTypesIn.length;let fnTypes=fnTypesIn.slice();const backtracking=[];let i=0;let j=0;const backtrack=()=>{while(backtracking.length!==0){const{fnTypesScratch,mgensScratch,queryElemsOffset,fnTypesOffset,unbox,}=backtracking.pop();mgens=new Map(mgensScratch);const fnType=fnTypesScratch[fnTypesOffset];const queryElem=queryElems[queryElemsOffset];if(unbox){if(fnType.id<0){if(mgens.has(fnType.id)&&mgens.get(fnType.id)!==0){continue}mgens.set(fnType.id,0)}const generics=fnType.id<0?whereClause[(-fnType.id)-1]:fnType.generics;fnTypes=fnTypesScratch.toSpliced(fnTypesOffset,1,...generics);fl=fnTypes.length;i=queryElemsOffset-1}else{if(fnType.id<0){if(mgens.has(fnType.id)&&mgens.get(fnType.id)!==queryElem.id){continue}mgens.set(fnType.id,queryElem.id)}fnTypes=fnTypesScratch.slice();fl=fnTypes.length;const tmp=fnTypes[queryElemsOffset];fnTypes[queryElemsOffset]=fnTypes[fnTypesOffset];fnTypes[fnTypesOffset]=tmp;i=queryElemsOffset}return true}return false};for(i=0;i!==ql;++i){const queryElem=queryElems[i];const matchCandidates=[];let fnTypesScratch=null;let mgensScratch=null;for(j=i;j!==fl;++j){const fnType=fnTypes[j];if(unifyFunctionTypeIsMatchCandidate(fnType,queryElem,whereClause,mgens)){if(!fnTypesScratch){fnTypesScratch=fnTypes.slice()}unifyFunctionTypes(fnType.generics,queryElem.generics,whereClause,mgens,mgensScratch=>{matchCandidates.push({fnTypesScratch,mgensScratch,queryElemsOffset:i,fnTypesOffset:j,unbox:false,});return false})}if(unifyFunctionTypeIsUnboxCandidate(fnType,queryElem,whereClause,mgens)){if(!fnTypesScratch){fnTypesScratch=fnTypes.slice()}if(!mgensScratch){mgensScratch=new Map(mgens)}backtracking.push({fnTypesScratch,mgensScratch,queryElemsOffset:i,fnTypesOffset:j,unbox:true,})}}if(matchCandidates.length===0){if(backtrack()){continue}else{return false}}const{fnTypesOffset:candidate,mgensScratch:mgensNew}=matchCandidates.pop();if(fnTypes[candidate].id<0&&queryElems[i].id<0){mgens.set(fnTypes[candidate].id,queryElems[i].id)}for(const[fid,qid]of mgensNew){mgens.set(fid,qid)}const tmp=fnTypes[candidate];fnTypes[candidate]=fnTypes[i];fnTypes[i]=tmp;for(const otherCandidate of matchCandidates){backtracking.push(otherCandidate)}while(i===(ql-1)&&solutionCb&&!solutionCb(mgens)){if(!backtrack()){return false}}}return true}function unifyFunctionTypeIsMatchCandidate(fnType,queryElem,whereClause,mgens){if(!typePassesFilter(queryElem.typeFilter,fnType.ty)){return false}if(fnType.id<0&&queryElem.id<0){if(mgens.has(fnType.id)&&mgens.get(fnType.id)!==queryElem.id){return false}for(const[fid,qid]of mgens.entries()){if(fnType.id!==fid&&queryElem.id===qid){return false}if(fnType.id===fid&&queryElem.id!==qid){return false}}}else{if(queryElem.id===typeNameIdOfArrayOrSlice&&(fnType.id===typeNameIdOfSlice||fnType.id===typeNameIdOfArray)){}else if(fnType.id!==queryElem.id){return false}if(fnType.generics.length===0&&queryElem.generics.length!==0){return false}const queryElemPathLength=queryElem.pathWithoutLast.length;if(queryElemPathLength>0){const fnTypePath=fnType.path!==undefined&&fnType.path!==null?fnType.path.split("::"):[];if(queryElemPathLength>fnTypePath.length){return false}let i=0;for(const path of fnTypePath){if(path===queryElem.pathWithoutLast[i]){i+=1;if(i>=queryElemPathLength){break}}}if(i=0){if(!whereClause){return false}if(mgens.has(fnType.id)&&mgens.get(fnType.id)!==0){return false}return checkIfInList(whereClause[(-fnType.id)-1],queryElem,whereClause)}else if(fnType.generics&&fnType.generics.length>0){return checkIfInList(fnType.generics,queryElem,whereClause)}return false}function checkIfInList(list,elem,whereClause){for(const entry of list){if(checkType(entry,elem,whereClause)){return true}}return false}function checkType(row,elem,whereClause){if(row.id===null){return row.generics.length>0?checkIfInList(row.generics,elem,whereClause):false}if(row.id<0&&elem.id>=0){const gid=(-row.id)-1;return checkIfInList(whereClause[gid],elem,whereClause)}if(row.id<0&&elem.id<0){return true}const matchesExact=row.id===elem.id;const matchesArrayOrSlice=elem.id===typeNameIdOfArrayOrSlice&&(row.id===typeNameIdOfSlice||row.id===typeNameIdOfArray);if((matchesExact||matchesArrayOrSlice)&&typePassesFilter(elem.typeFilter,row.ty)){if(elem.generics.length>0){return checkGenerics(row,elem,whereClause,new Map())}return true}return checkIfInList(row.generics,elem,whereClause)}function checkPath(contains,ty,maxEditDistance){if(contains.length===0){return 0}let ret_dist=maxEditDistance+1;const path=ty.path.split("::");if(ty.parent&&ty.parent.name){path.push(ty.parent.name.toLowerCase())}const length=path.length;const clength=contains.length;if(clength>length){return maxEditDistance+1}for(let i=0;ilength){break}let dist_total=0;let aborted=false;for(let x=0;xmaxEditDistance){aborted=true;break}dist_total+=dist}if(!aborted){ret_dist=Math.min(ret_dist,Math.round(dist_total/clength))}}return ret_dist}function typePassesFilter(filter,type){if(filter<=NO_TYPE_FILTER||filter===type)return true;const name=itemTypes[type];switch(itemTypes[filter]){case"constant":return name==="associatedconstant";case"fn":return name==="method"||name==="tymethod";case"type":return name==="primitive"||name==="associatedtype";case"trait":return name==="traitalias"}return false}function createAliasFromItem(item){return{crate:item.crate,name:item.name,path:item.path,desc:item.desc,ty:item.ty,parent:item.parent,type:item.type,is_alias:true,deprecated:item.deprecated,implDisambiguator:item.implDisambiguator,}}function handleAliases(ret,query,filterCrates,currentCrate){const lowerQuery=query.toLowerCase();const aliases=[];const crateAliases=[];if(filterCrates!==null){if(ALIASES.has(filterCrates)&&ALIASES.get(filterCrates).has(lowerQuery)){const query_aliases=ALIASES.get(filterCrates).get(lowerQuery);for(const alias of query_aliases){aliases.push(createAliasFromItem(searchIndex[alias]))}}}else{for(const[crate,crateAliasesIndex]of ALIASES){if(crateAliasesIndex.has(lowerQuery)){const pushTo=crate===currentCrate?crateAliases:aliases;const query_aliases=crateAliasesIndex.get(lowerQuery);for(const alias of query_aliases){pushTo.push(createAliasFromItem(searchIndex[alias]))}}}}const sortFunc=(aaa,bbb)=>{if(aaa.path{alias.alias=query;const res=buildHrefAndPath(alias);alias.displayPath=pathSplitter(res[0]);alias.fullPath=alias.displayPath+alias.name;alias.href=res[1];ret.others.unshift(alias);if(ret.others.length>MAX_RESULTS){ret.others.pop()}};aliases.forEach(pushFunc);crateAliases.forEach(pushFunc)}function addIntoResults(results,fullId,id,index,dist,path_dist,maxEditDistance){const inBounds=dist<=maxEditDistance||index!==-1;if(dist===0||(!parsedQuery.literalSearch&&inBounds)){if(results.has(fullId)){const result=results.get(fullId);if(result.dontValidate||result.dist<=dist){return}}results.set(fullId,{id:id,index:index,dontValidate:parsedQuery.literalSearch,dist:dist,path_dist:path_dist,})}}function handleSingleArg(row,pos,elem,results_others,results_in_args,results_returned,maxEditDistance){if(!row||(filterCrates!==null&&row.crate!==filterCrates)){return}let index=-1,path_dist=0;const fullId=row.id;const searchWord=searchWords[pos];const in_args=row.type&&row.type.inputs&&checkIfInList(row.type.inputs,elem,row.type.where_clause);if(in_args){addIntoResults(results_in_args,fullId,pos,-1,0,0,maxEditDistance)}const returned=row.type&&row.type.output&&checkIfInList(row.type.output,elem,row.type.where_clause);if(returned){addIntoResults(results_returned,fullId,pos,-1,0,0,maxEditDistance)}if(!typePassesFilter(elem.typeFilter,row.ty)){return}const row_index=row.normalizedName.indexOf(elem.pathLast);const word_index=searchWord.indexOf(elem.pathLast);if(row_index===-1){index=word_index}else if(word_index===-1){index=row_index}else if(word_index1){path_dist=checkPath(elem.pathWithoutLast,row,maxEditDistance);if(path_dist>maxEditDistance){return}}if(parsedQuery.literalSearch){if(searchWord===elem.name){addIntoResults(results_others,fullId,pos,index,0,path_dist)}return}const dist=editDistance(searchWord,elem.pathLast,maxEditDistance);if(index===-1&&dist+path_dist>maxEditDistance){return}addIntoResults(results_others,fullId,pos,index,dist,path_dist,maxEditDistance)}function handleArgs(row,pos,results){if(!row||(filterCrates!==null&&row.crate!==filterCrates)||!row.type){return}if(!unifyFunctionTypes(row.type.inputs,parsedQuery.elems,row.type.where_clause,null,mgens=>{return unifyFunctionTypes(row.type.output,parsedQuery.returned,row.type.where_clause,mgens)})){return}addIntoResults(results,row.id,pos,0,0,0,Number.MAX_VALUE)}function innerRunQuery(){let elem,i,nSearchWords,in_returned,row;let queryLen=0;for(const elem of parsedQuery.elems){queryLen+=elem.name.length}for(const elem of parsedQuery.returned){queryLen+=elem.name.length}const maxEditDistance=Math.floor(queryLen/3);const genericSymbols=new Map();function convertNameToId(elem){if(typeNameIdMap.has(elem.pathLast)){elem.id=typeNameIdMap.get(elem.pathLast)}else if(!parsedQuery.literalSearch){let match=null;let matchDist=maxEditDistance+1;let matchName="";for(const[name,id]of typeNameIdMap){const dist=editDistance(name,elem.pathLast,maxEditDistance);if(dist<=matchDist&&dist<=maxEditDistance){if(dist===matchDist&&matchName>name){continue}match=id;matchDist=dist;matchName=name}}if(match!==null){parsedQuery.correction=matchName}elem.id=match}if((elem.id===null&&parsedQuery.totalElems>1&&elem.typeFilter===-1&&elem.generics.length===0)||elem.typeFilter===TY_GENERIC){if(genericSymbols.has(elem.name)){elem.id=genericSymbols.get(elem.name)}else{elem.id=-(genericSymbols.size+1);genericSymbols.set(elem.name,elem.id)}if(elem.typeFilter===-1&&elem.name.length>=3){const maxPartDistance=Math.floor(elem.name.length/3);let matchDist=maxPartDistance+1;let matchName="";for(const name of typeNameIdMap.keys()){const dist=editDistance(name,elem.name,maxPartDistance);if(dist<=matchDist&&dist<=maxPartDistance){if(dist===matchDist&&matchName>name){continue}matchDist=dist;matchName=name}}if(matchName!==""){parsedQuery.proposeCorrectionFrom=elem.name;parsedQuery.proposeCorrectionTo=matchName}}elem.typeFilter=TY_GENERIC}if(elem.generics.length>0&&elem.typeFilter===TY_GENERIC){parsedQuery.error=["Generic type parameter ",elem.name," does not accept generic parameters",]}for(const elem2 of elem.generics){convertNameToId(elem2)}}for(const elem of parsedQuery.elems){convertNameToId(elem)}for(const elem of parsedQuery.returned){convertNameToId(elem)}if(parsedQuery.foundElems===1){if(parsedQuery.elems.length===1){elem=parsedQuery.elems[0];for(i=0,nSearchWords=searchWords.length;i0){for(i=0,nSearchWords=searchWords.length;i-1||path.indexOf(key)>-1||(parent!==undefined&&parent.name!==undefined&&parent.name.toLowerCase().indexOf(key)>-1)||editDistance(name,key,maxEditDistance)<=maxEditDistance)){return false}}return true}function nextTab(direction){const next=(searchState.currentTab+direction+3)%searchState.focusedByTab.length;searchState.focusedByTab[searchState.currentTab]=document.activeElement;printTab(next);focusSearchResult()}function focusSearchResult(){const target=searchState.focusedByTab[searchState.currentTab]||document.querySelectorAll(".search-results.active a").item(0)||document.querySelectorAll("#search-tabs button").item(searchState.currentTab);searchState.focusedByTab[searchState.currentTab]=null;if(target){target.focus()}}function buildHrefAndPath(item){let displayPath;let href;const type=itemTypes[item.ty];const name=item.name;let path=item.path;if(type==="mod"){displayPath=path+"::";href=ROOT_PATH+path.replace(/::/g,"/")+"/"+name+"/index.html"}else if(type==="import"){displayPath=item.path+"::";href=ROOT_PATH+item.path.replace(/::/g,"/")+"/index.html#reexport."+name}else if(type==="primitive"||type==="keyword"){displayPath="";href=ROOT_PATH+path.replace(/::/g,"/")+"/"+type+"."+name+".html"}else if(type==="externcrate"){displayPath="";href=ROOT_PATH+name+"/index.html"}else if(item.parent!==undefined){const myparent=item.parent;let anchor=type+"."+name;const parentType=itemTypes[myparent.ty];let pageType=parentType;let pageName=myparent.name;if(parentType==="primitive"){displayPath=myparent.name+"::"}else if(type==="structfield"&&parentType==="variant"){const enumNameIdx=item.path.lastIndexOf("::");const enumName=item.path.substr(enumNameIdx+2);path=item.path.substr(0,enumNameIdx);displayPath=path+"::"+enumName+"::"+myparent.name+"::";anchor="variant."+myparent.name+".field."+name;pageType="enum";pageName=enumName}else{displayPath=path+"::"+myparent.name+"::"}if(item.implDisambiguator!==null){anchor=item.implDisambiguator+"/"+anchor}href=ROOT_PATH+path.replace(/::/g,"/")+"/"+pageType+"."+pageName+".html#"+anchor}else{displayPath=item.path+"::";href=ROOT_PATH+item.path.replace(/::/g,"/")+"/"+type+"."+name+".html"}return[displayPath,href]}function pathSplitter(path){const tmp=""+path.replace(/::/g,"::");if(tmp.endsWith("")){return tmp.slice(0,tmp.length-6)}return tmp}function addTab(array,query,display){let extraClass="";if(display===true){extraClass=" active"}const output=document.createElement("div");let length=0;if(array.length>0){output.className="search-results "+extraClass;array.forEach(item=>{const name=item.name;const type=itemTypes[item.ty];const longType=longItemTypes[item.ty];const typeName=longType.length!==0?`${longType}`:"?";length+=1;const link=document.createElement("a");link.className="result-"+type;link.href=item.href;const resultName=document.createElement("div");resultName.className="result-name";resultName.insertAdjacentHTML("beforeend",`${typeName}`);link.appendChild(resultName);let alias=" ";if(item.is_alias){alias=`
\ +${item.alias} - see \ +
`}resultName.insertAdjacentHTML("beforeend",`
${alias}\ +${item.displayPath}${name}\ +
`);const description=document.createElement("div");description.className="desc";description.insertAdjacentHTML("beforeend",item.desc);link.appendChild(description);output.appendChild(link)})}else if(query.error===null){output.className="search-failed"+extraClass;output.innerHTML="No results :(
"+"Try on DuckDuckGo?

"+"Or try looking in one of these:"}return[output,length]}function makeTabHeader(tabNb,text,nbElems){const fmtNbElems=nbElems<10?`\u{2007}(${nbElems})\u{2007}\u{2007}`:nbElems<100?`\u{2007}(${nbElems})\u{2007}`:`\u{2007}(${nbElems})`;if(searchState.currentTab===tabNb){return""}return""}function showResults(results,go_to_first,filterCrates){const search=searchState.outputElement();if(go_to_first||(results.others.length===1&&getSettingValue("go-to-only-result")==="true")){window.onunload=()=>{};searchState.removeQueryParameters();const elem=document.createElement("a");elem.href=results.others[0].href;removeClass(elem,"active");document.body.appendChild(elem);elem.click();return}if(results.query===undefined){results.query=parseQuery(searchState.input.value)}currentResults=results.query.userQuery;const ret_others=addTab(results.others,results.query,true);const ret_in_args=addTab(results.in_args,results.query,false);const ret_returned=addTab(results.returned,results.query,false);let currentTab=searchState.currentTab;if((currentTab===0&&ret_others[1]===0)||(currentTab===1&&ret_in_args[1]===0)||(currentTab===2&&ret_returned[1]===0)){if(ret_others[1]!==0){currentTab=0}else if(ret_in_args[1]!==0){currentTab=1}else if(ret_returned[1]!==0){currentTab=2}}let crates="";const crates_list=Object.keys(rawSearchIndex);if(crates_list.length>1){crates=" in 
"}let output=`

Results${crates}

`;if(results.query.error!==null){const error=results.query.error;error.forEach((value,index)=>{value=value.split("<").join("<").split(">").join(">");if(index%2!==0){error[index]=`${value.replaceAll(" ", " ")}`}else{error[index]=value}});output+=`

Query parser error: "${error.join("")}".

`;output+="
"+makeTabHeader(0,"In Names",ret_others[1])+"
";currentTab=0}else if(results.query.foundElems<=1&&results.query.returned.length===0){output+="
"+makeTabHeader(0,"In Names",ret_others[1])+makeTabHeader(1,"In Parameters",ret_in_args[1])+makeTabHeader(2,"In Return Types",ret_returned[1])+"
"}else{const signatureTabTitle=results.query.elems.length===0?"In Function Return Types":results.query.returned.length===0?"In Function Parameters":"In Function Signatures";output+="
"+makeTabHeader(0,signatureTabTitle,ret_others[1])+"
";currentTab=0}if(results.query.correction!==null){const orig=results.query.returned.length>0?results.query.returned[0].name:results.query.elems[0].name;output+="

"+`Type "${orig}" not found. `+"Showing results for closest type name "+`"${results.query.correction}" instead.

`}if(results.query.proposeCorrectionFrom!==null){const orig=results.query.proposeCorrectionFrom;const targ=results.query.proposeCorrectionTo;output+="

"+`Type "${orig}" not found and used as generic parameter. `+`Consider searching for "${targ}" instead.

`}const resultsElem=document.createElement("div");resultsElem.id="results";resultsElem.appendChild(ret_others[0]);resultsElem.appendChild(ret_in_args[0]);resultsElem.appendChild(ret_returned[0]);search.innerHTML=output;const crateSearch=document.getElementById("crate-search");if(crateSearch){crateSearch.addEventListener("input",updateCrate)}search.appendChild(resultsElem);searchState.showResults(search);const elems=document.getElementById("search-tabs").childNodes;searchState.focusedByTab=[];let i=0;for(const elem of elems){const j=i;elem.onclick=()=>printTab(j);searchState.focusedByTab.push(null);i+=1}printTab(currentTab)}function updateSearchHistory(url){if(!browserSupportsHistoryApi()){return}const params=searchState.getQueryStringParams();if(!history.state&&!params.search){history.pushState(null,"",url)}else{history.replaceState(null,"",url)}}function search(e,forced){if(e){e.preventDefault()}const query=parseQuery(searchState.input.value.trim());let filterCrates=getFilterCrates();if(!forced&&query.userQuery===currentResults){if(query.userQuery.length>0){putBackSearch()}return}searchState.setLoadingSearch();const params=searchState.getQueryStringParams();if(filterCrates===null&¶ms["filter-crate"]!==undefined){filterCrates=params["filter-crate"]}searchState.title="Results for "+query.original+" - Rust";updateSearchHistory(buildUrl(query.original,filterCrates));showResults(execQuery(query,searchWords,filterCrates,window.currentCrate),params.go_to_first,filterCrates)}function buildItemSearchTypeAll(types,lowercasePaths){return types.map(type=>buildItemSearchType(type,lowercasePaths))}function buildItemSearchType(type,lowercasePaths){const PATH_INDEX_DATA=0;const GENERICS_DATA=1;let pathIndex,generics;if(typeof type==="number"){pathIndex=type;generics=[]}else{pathIndex=type[PATH_INDEX_DATA];generics=buildItemSearchTypeAll(type[GENERICS_DATA],lowercasePaths)}if(pathIndex<0){return{id:pathIndex,ty:TY_GENERIC,path:null,generics,}}if(pathIndex===0){return{id:null,ty:null,path:null,generics,}}const item=lowercasePaths[pathIndex-1];return{id:buildTypeMapIndex(item.name),ty:item.ty,path:item.path,generics,}}function buildFunctionSearchType(functionSearchType,lowercasePaths){const INPUTS_DATA=0;const OUTPUT_DATA=1;if(functionSearchType===0){return null}let inputs,output;if(typeof functionSearchType[INPUTS_DATA]==="number"){inputs=[buildItemSearchType(functionSearchType[INPUTS_DATA],lowercasePaths)]}else{inputs=buildItemSearchTypeAll(functionSearchType[INPUTS_DATA],lowercasePaths)}if(functionSearchType.length>1){if(typeof functionSearchType[OUTPUT_DATA]==="number"){output=[buildItemSearchType(functionSearchType[OUTPUT_DATA],lowercasePaths)]}else{output=buildItemSearchTypeAll(functionSearchType[OUTPUT_DATA],lowercasePaths)}}else{output=[]}const where_clause=[];const l=functionSearchType.length;for(let i=2;i2){path=itemPaths.has(elem[2])?itemPaths.get(elem[2]):lastPath;lastPath=path}lowercasePaths.push({ty:ty,name:name.toLowerCase(),path:path});paths[i]={ty:ty,name:name,path:path}}lastPath="";len=itemTypes.length;for(let i=0;i0?paths[itemParentIdxs[i]-1]:undefined,type:buildFunctionSearchType(itemFunctionSearchTypes[i],lowercasePaths),id:id,normalizedName:word.indexOf("_")===-1?word:word.replace(/_/g,""),deprecated:deprecatedItems.has(i),implDisambiguator:implDisambiguator.has(i)?implDisambiguator.get(i):null,};id+=1;searchIndex.push(row);lastPath=row.path;crateSize+=1}if(aliases){const currentCrateAliases=new Map();ALIASES.set(crate,currentCrateAliases);for(const alias_name in aliases){if(!hasOwnPropertyRustdoc(aliases,alias_name)){continue}let currentNameAliases;if(currentCrateAliases.has(alias_name)){currentNameAliases=currentCrateAliases.get(alias_name)}else{currentNameAliases=[];currentCrateAliases.set(alias_name,currentNameAliases)}for(const local_alias of aliases[alias_name]){currentNameAliases.push(local_alias+currentIndex)}}}currentIndex+=crateSize}return searchWords}function onSearchSubmit(e){e.preventDefault();searchState.clearInputTimeout();search()}function putBackSearch(){const search_input=searchState.input;if(!searchState.input){return}if(search_input.value!==""&&!searchState.isDisplayed()){searchState.showResults();if(browserSupportsHistoryApi()){history.replaceState(null,"",buildUrl(search_input.value,getFilterCrates()))}document.title=searchState.title}}function registerSearchEvents(){const params=searchState.getQueryStringParams();if(searchState.input.value===""){searchState.input.value=params.search||""}const searchAfter500ms=()=>{searchState.clearInputTimeout();if(searchState.input.value.length===0){searchState.hideResults()}else{searchState.timeout=setTimeout(search,500)}};searchState.input.onkeyup=searchAfter500ms;searchState.input.oninput=searchAfter500ms;document.getElementsByClassName("search-form")[0].onsubmit=onSearchSubmit;searchState.input.onchange=e=>{if(e.target!==document.activeElement){return}searchState.clearInputTimeout();setTimeout(search,0)};searchState.input.onpaste=searchState.input.onchange;searchState.outputElement().addEventListener("keydown",e=>{if(e.altKey||e.ctrlKey||e.shiftKey||e.metaKey){return}if(e.which===38){const previous=document.activeElement.previousElementSibling;if(previous){previous.focus()}else{searchState.focus()}e.preventDefault()}else if(e.which===40){const next=document.activeElement.nextElementSibling;if(next){next.focus()}const rect=document.activeElement.getBoundingClientRect();if(window.innerHeight-rect.bottom{if(e.which===40){focusSearchResult();e.preventDefault()}});searchState.input.addEventListener("focus",()=>{putBackSearch()});searchState.input.addEventListener("blur",()=>{searchState.input.placeholder=searchState.input.origPlaceholder});if(browserSupportsHistoryApi()){const previousTitle=document.title;window.addEventListener("popstate",e=>{const params=searchState.getQueryStringParams();document.title=previousTitle;currentResults=null;if(params.search&¶ms.search.length>0){searchState.input.value=params.search;search(e)}else{searchState.input.value="";searchState.hideResults()}})}window.onpageshow=()=>{const qSearch=searchState.getQueryStringParams().search;if(searchState.input.value===""&&qSearch){searchState.input.value=qSearch}search()}}function updateCrate(ev){if(ev.target.value==="all crates"){const query=searchState.input.value.trim();updateSearchHistory(buildUrl(query,null))}currentResults=null;search(undefined,true)}const searchWords=buildIndex(rawSearchIndex);if(typeof window!=="undefined"){registerSearchEvents();if(window.searchState.getQueryStringParams().search){search()}}if(typeof exports!=="undefined"){exports.initSearch=initSearch;exports.execQuery=execQuery;exports.parseQuery=parseQuery}return searchWords}if(typeof window!=="undefined"){window.initSearch=initSearch;if(window.searchIndex!==undefined){initSearch(window.searchIndex)}}else{initSearch({})}})() \ No newline at end of file diff --git a/static.files/settings-74424d7eec62a23e.js b/static.files/settings-74424d7eec62a23e.js new file mode 100644 index 0000000000..3014f75c50 --- /dev/null +++ b/static.files/settings-74424d7eec62a23e.js @@ -0,0 +1,17 @@ +"use strict";(function(){const isSettingsPage=window.location.pathname.endsWith("/settings.html");function changeSetting(settingName,value){if(settingName==="theme"){const useSystem=value==="system preference"?"true":"false";updateLocalStorage("use-system-theme",useSystem)}updateLocalStorage(settingName,value);switch(settingName){case"theme":case"preferred-dark-theme":case"preferred-light-theme":updateTheme();updateLightAndDark();break;case"line-numbers":if(value===true){window.rustdoc_add_line_numbers_to_examples()}else{window.rustdoc_remove_line_numbers_from_examples()}break}}function showLightAndDark(){removeClass(document.getElementById("preferred-light-theme"),"hidden");removeClass(document.getElementById("preferred-dark-theme"),"hidden")}function hideLightAndDark(){addClass(document.getElementById("preferred-light-theme"),"hidden");addClass(document.getElementById("preferred-dark-theme"),"hidden")}function updateLightAndDark(){const useSystem=getSettingValue("use-system-theme");if(useSystem==="true"||(useSystem===null&&getSettingValue("theme")===null)){showLightAndDark()}else{hideLightAndDark()}}function setEvents(settingsElement){updateLightAndDark();onEachLazy(settingsElement.querySelectorAll("input[type=\"checkbox\"]"),toggle=>{const settingId=toggle.id;const settingValue=getSettingValue(settingId);if(settingValue!==null){toggle.checked=settingValue==="true"}toggle.onchange=()=>{changeSetting(toggle.id,toggle.checked)}});onEachLazy(settingsElement.querySelectorAll("input[type=\"radio\"]"),elem=>{const settingId=elem.name;let settingValue=getSettingValue(settingId);if(settingId==="theme"){const useSystem=getSettingValue("use-system-theme");if(useSystem==="true"||settingValue===null){settingValue=useSystem==="false"?"light":"system preference"}}if(settingValue!==null&&settingValue!=="null"){elem.checked=settingValue===elem.value}elem.addEventListener("change",ev=>{changeSetting(ev.target.name,ev.target.value)})})}function buildSettingsPageSections(settings){let output="";for(const setting of settings){const js_data_name=setting["js_name"];const setting_name=setting["name"];if(setting["options"]!==undefined){output+=`\ +
+
${setting_name}
+
`;onEach(setting["options"],option=>{const checked=option===setting["default"]?" checked":"";const full=`${js_data_name}-${option.replace(/ /g,"-")}`;output+=`\ + `});output+=`\ +
+
`}else{const checked=setting["default"]===true?" checked":"";output+=`\ +
\ + \ +
`}}return output}function buildSettingsPage(){const theme_names=getVar("themes").split(",").filter(t=>t);theme_names.push("light","dark","ayu");const settings=[{"name":"Theme","js_name":"theme","default":"system preference","options":theme_names.concat("system preference"),},{"name":"Preferred light theme","js_name":"preferred-light-theme","default":"light","options":theme_names,},{"name":"Preferred dark theme","js_name":"preferred-dark-theme","default":"dark","options":theme_names,},{"name":"Auto-hide item contents for large items","js_name":"auto-hide-large-items","default":true,},{"name":"Auto-hide item methods' documentation","js_name":"auto-hide-method-docs","default":false,},{"name":"Auto-hide trait implementation documentation","js_name":"auto-hide-trait-implementations","default":false,},{"name":"Directly go to item in search if there is only one result","js_name":"go-to-only-result","default":false,},{"name":"Show line numbers on code examples","js_name":"line-numbers","default":false,},{"name":"Disable keyboard shortcuts","js_name":"disable-shortcuts","default":false,},];const elementKind=isSettingsPage?"section":"div";const innerHTML=`
${buildSettingsPageSections(settings)}
`;const el=document.createElement(elementKind);el.id="settings";if(!isSettingsPage){el.className="popover"}el.innerHTML=innerHTML;if(isSettingsPage){document.getElementById(MAIN_ID).appendChild(el)}else{el.setAttribute("tabindex","-1");getSettingsButton().appendChild(el)}return el}const settingsMenu=buildSettingsPage();function displaySettings(){settingsMenu.style.display=""}function settingsBlurHandler(event){blurHandler(event,getSettingsButton(),window.hidePopoverMenus)}if(isSettingsPage){getSettingsButton().onclick=event=>{event.preventDefault()}}else{const settingsButton=getSettingsButton();const settingsMenu=document.getElementById("settings");settingsButton.onclick=event=>{if(elemIsInParent(event.target,settingsMenu)){return}event.preventDefault();const shouldDisplaySettings=settingsMenu.style.display==="none";window.hideAllModals();if(shouldDisplaySettings){displaySettings()}};settingsButton.onblur=settingsBlurHandler;settingsButton.querySelector("a").onblur=settingsBlurHandler;onEachLazy(settingsMenu.querySelectorAll("input"),el=>{el.onblur=settingsBlurHandler});settingsMenu.onblur=settingsBlurHandler}setTimeout(()=>{setEvents(settingsMenu);if(!isSettingsPage){displaySettings()}removeClass(getSettingsButton(),"rotate")},0)})() \ No newline at end of file diff --git a/static.files/src-script-3280b574d94e47b4.js b/static.files/src-script-3280b574d94e47b4.js new file mode 100644 index 0000000000..9ea88921e2 --- /dev/null +++ b/static.files/src-script-3280b574d94e47b4.js @@ -0,0 +1 @@ +"use strict";(function(){const rootPath=getVar("root-path");const NAME_OFFSET=0;const DIRS_OFFSET=1;const FILES_OFFSET=2;const RUSTDOC_MOBILE_BREAKPOINT=700;function closeSidebarIfMobile(){if(window.innerWidth"){addClass(document.documentElement,"src-sidebar-expanded");child.innerText="<";updateLocalStorage("source-sidebar-show","true")}else{removeClass(document.documentElement,"src-sidebar-expanded");child.innerText=">";updateLocalStorage("source-sidebar-show","false")}}function createSidebarToggle(){const sidebarToggle=document.createElement("div");sidebarToggle.id="src-sidebar-toggle";const inner=document.createElement("button");if(getCurrentValue("source-sidebar-show")==="true"){inner.innerText="<"}else{inner.innerText=">"}inner.onclick=toggleSidebar;sidebarToggle.appendChild(inner);return sidebarToggle}function createSrcSidebar(){const container=document.querySelector("nav.sidebar");const sidebarToggle=createSidebarToggle();container.insertBefore(sidebarToggle,container.firstChild);const sidebar=document.createElement("div");sidebar.id="src-sidebar";let hasFoundFile=false;const title=document.createElement("div");title.className="title";title.innerText="Files";sidebar.appendChild(title);Object.keys(srcIndex).forEach(key=>{srcIndex[key][NAME_OFFSET]=key;hasFoundFile=createDirEntry(srcIndex[key],sidebar,"",hasFoundFile)});container.appendChild(sidebar);const selected_elem=sidebar.getElementsByClassName("selected")[0];if(typeof selected_elem!=="undefined"){selected_elem.focus()}}const lineNumbersRegex=/^#?(\d+)(?:-(\d+))?$/;function highlightSrcLines(match){if(typeof match==="undefined"){match=window.location.hash.match(lineNumbersRegex)}if(!match){return}let from=parseInt(match[1],10);let to=from;if(typeof match[2]!=="undefined"){to=parseInt(match[2],10)}if(to{onEachLazy(e.getElementsByTagName("a"),i_e=>{removeClass(i_e,"line-highlighted")})});for(let i=from;i<=to;++i){elem=document.getElementById(i);if(!elem){break}addClass(elem,"line-highlighted")}}const handleSrcHighlight=(function(){let prev_line_id=0;const set_fragment=name=>{const x=window.scrollX,y=window.scrollY;if(browserSupportsHistoryApi()){history.replaceState(null,null,"#"+name);highlightSrcLines()}else{location.replace("#"+name)}window.scrollTo(x,y)};return ev=>{let cur_line_id=parseInt(ev.target.id,10);if(isNaN(cur_line_id)||ev.ctrlKey||ev.altKey||ev.metaKey){return}ev.preventDefault();if(ev.shiftKey&&prev_line_id){if(prev_line_id>cur_line_id){const tmp=prev_line_id;prev_line_id=cur_line_id;cur_line_id=tmp}set_fragment(prev_line_id+"-"+cur_line_id)}else{prev_line_id=cur_line_id;set_fragment(cur_line_id)}}}());window.addEventListener("hashchange",()=>{const match=window.location.hash.match(lineNumbersRegex);if(match){return highlightSrcLines(match)}});onEachLazy(document.getElementsByClassName("src-line-numbers"),el=>{el.addEventListener("click",handleSrcHighlight)});highlightSrcLines();window.createSrcSidebar=createSrcSidebar})() \ No newline at end of file diff --git a/static.files/storage-fec3eaa3851e447d.js b/static.files/storage-fec3eaa3851e447d.js new file mode 100644 index 0000000000..a687118f30 --- /dev/null +++ b/static.files/storage-fec3eaa3851e447d.js @@ -0,0 +1 @@ +"use strict";const builtinThemes=["light","dark","ayu"];const darkThemes=["dark","ayu"];window.currentTheme=document.getElementById("themeStyle");const settingsDataset=(function(){const settingsElement=document.getElementById("default-settings");return settingsElement&&settingsElement.dataset?settingsElement.dataset:null})();function getSettingValue(settingName){const current=getCurrentValue(settingName);if(current===null&&settingsDataset!==null){const def=settingsDataset[settingName.replace(/-/g,"_")];if(def!==undefined){return def}}return current}const localStoredTheme=getSettingValue("theme");function hasClass(elem,className){return elem&&elem.classList&&elem.classList.contains(className)}function addClass(elem,className){if(elem&&elem.classList){elem.classList.add(className)}}function removeClass(elem,className){if(elem&&elem.classList){elem.classList.remove(className)}}function onEach(arr,func,reversed){if(arr&&arr.length>0){if(reversed){for(let i=arr.length-1;i>=0;--i){if(func(arr[i])){return true}}}else{for(const elem of arr){if(func(elem)){return true}}}}return false}function onEachLazy(lazyArray,func,reversed){return onEach(Array.prototype.slice.call(lazyArray),func,reversed)}function updateLocalStorage(name,value){try{window.localStorage.setItem("rustdoc-"+name,value)}catch(e){}}function getCurrentValue(name){try{return window.localStorage.getItem("rustdoc-"+name)}catch(e){return null}}const getVar=(function getVar(name){const el=document.querySelector("head > meta[name='rustdoc-vars']");return el?el.attributes["data-"+name].value:null});function switchTheme(newThemeName,saveTheme){if(saveTheme){updateLocalStorage("theme",newThemeName)}document.documentElement.setAttribute("data-theme",newThemeName);if(builtinThemes.indexOf(newThemeName)!==-1){if(window.currentTheme){window.currentTheme.parentNode.removeChild(window.currentTheme);window.currentTheme=null}}else{const newHref=getVar("root-path")+newThemeName+getVar("resource-suffix")+".css";if(!window.currentTheme){if(document.readyState==="loading"){document.write(``);window.currentTheme=document.getElementById("themeStyle")}else{window.currentTheme=document.createElement("link");window.currentTheme.rel="stylesheet";window.currentTheme.id="themeStyle";window.currentTheme.href=newHref;document.documentElement.appendChild(window.currentTheme)}}else if(newHref!==window.currentTheme.href){window.currentTheme.href=newHref}}}const updateTheme=(function(){const mql=window.matchMedia("(prefers-color-scheme: dark)");function updateTheme(){if(getSettingValue("use-system-theme")!=="false"){const lightTheme=getSettingValue("preferred-light-theme")||"light";const darkTheme=getSettingValue("preferred-dark-theme")||"dark";updateLocalStorage("use-system-theme","true");switchTheme(mql.matches?darkTheme:lightTheme,true)}else{switchTheme(getSettingValue("theme"),false)}}mql.addEventListener("change",updateTheme);return updateTheme})();if(getSettingValue("use-system-theme")!=="false"&&window.matchMedia){if(getSettingValue("use-system-theme")===null&&getSettingValue("preferred-dark-theme")===null&&darkThemes.indexOf(localStoredTheme)>=0){updateLocalStorage("preferred-dark-theme",localStoredTheme)}}updateTheme();if(getSettingValue("source-sidebar-show")==="true"){addClass(document.documentElement,"src-sidebar-expanded")}window.addEventListener("pageshow",ev=>{if(ev.persisted){setTimeout(updateTheme,0)}}) \ No newline at end of file diff --git a/static.files/wheel-7b819b6101059cd0.svg b/static.files/wheel-7b819b6101059cd0.svg new file mode 100644 index 0000000000..83c07f63d1 --- /dev/null +++ b/static.files/wheel-7b819b6101059cd0.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/system_services/all.html b/system_services/all.html new file mode 100644 index 0000000000..e91e74ce01 --- /dev/null +++ b/system_services/all.html @@ -0,0 +1 @@ +List of all items in this crate
\ No newline at end of file diff --git a/system_services/deployer/struct.Deployer.html b/system_services/deployer/struct.Deployer.html new file mode 100644 index 0000000000..d9b6dbe81c --- /dev/null +++ b/system_services/deployer/struct.Deployer.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../system_services/struct.Deployer.html...

+ + + \ No newline at end of file diff --git a/system_services/distro/struct.SystemServiceDistros.html b/system_services/distro/struct.SystemServiceDistros.html new file mode 100644 index 0000000000..f8a98efb5c --- /dev/null +++ b/system_services/distro/struct.SystemServiceDistros.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../system_services/struct.SystemServiceDistros.html...

+ + + \ No newline at end of file diff --git a/system_services/distro/struct.Versions.html b/system_services/distro/struct.Versions.html new file mode 100644 index 0000000000..76de31aaf7 --- /dev/null +++ b/system_services/distro/struct.Versions.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../system_services/struct.Versions.html...

+ + + \ No newline at end of file diff --git a/system_services/enum.ServiceStatus.html b/system_services/enum.ServiceStatus.html new file mode 100644 index 0000000000..da3d7d2957 --- /dev/null +++ b/system_services/enum.ServiceStatus.html @@ -0,0 +1,42 @@ +ServiceStatus in system_services - Rust
pub enum ServiceStatus {
+    Created(String),
+    Existing(String),
+}
Expand description

A status of a service/spell after deployment

+

Variants§

§

Created(String)

Id of a newly created service

+
§

Existing(String)

Id of a already existing service

+

Trait Implementations§

source§

impl Clone for ServiceStatus

source§

fn clone(&self) -> ServiceStatus

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ServiceStatus

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/system_services/index.html b/system_services/index.html new file mode 100644 index 0000000000..f000dfd64e --- /dev/null +++ b/system_services/index.html @@ -0,0 +1,5 @@ +system_services - Rust

Crate system_services

source ·

Structs

  • Status of package deployment for each services and spells of the package
  • Package distribution description +Contains enough information about all services and spells used by the package for installation +It’s not the same thing as a worker since this kind of package doesn’t require to be installed +in a separate scope
  • Service distribution description that provides enough information for the service installation.
  • Spell distribution description that provides enough information for the spell installation.

Enums

Traits

\ No newline at end of file diff --git a/system_services/sidebar-items.js b/system_services/sidebar-items.js new file mode 100644 index 0000000000..d049279308 --- /dev/null +++ b/system_services/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["ServiceStatus"],"struct":["Deployer","Deployment","PackageDistro","ServiceDistro","SpellDistro","SystemServiceDistros","Versions"],"trait":["CallService","InitService"]}; \ No newline at end of file diff --git a/system_services/struct.Deployer.html b/system_services/struct.Deployer.html new file mode 100644 index 0000000000..1d994af6dd --- /dev/null +++ b/system_services/struct.Deployer.html @@ -0,0 +1,45 @@ +Deployer in system_services - Rust
pub struct Deployer { /* private fields */ }

Implementations§

source§

impl Deployer

source

pub fn new( + services: ParticleAppServices, + modules_repo: ModuleRepository, + spell_storage: SpellStorage, + spell_event_bus_api: SpellEventBusApi, + spell_service_api: SpellServiceApi, + root_worker_id: PeerId, + management_id: PeerId, + system_service_distros: SystemServiceDistros +) -> Self

source

pub fn versions(&self) -> Versions

source

pub async fn deploy_system_services(self) -> Result<()>

Trait Implementations§

source§

impl Clone for Deployer

source§

fn clone(&self) -> Deployer

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Deployer

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/system_services/struct.Deployment.html b/system_services/struct.Deployment.html new file mode 100644 index 0000000000..33028a2bbd --- /dev/null +++ b/system_services/struct.Deployment.html @@ -0,0 +1,42 @@ +Deployment in system_services - Rust
pub struct Deployment {
+    pub spells: HashMap<String, ServiceStatus>,
+    pub services: HashMap<String, ServiceStatus>,
+}
Expand description

Status of package deployment for each services and spells of the package

+

Fields§

§spells: HashMap<String, ServiceStatus>

Statuses of spells deployment

+
§services: HashMap<String, ServiceStatus>

Statuses of services deployment

+

Trait Implementations§

source§

impl Clone for Deployment

source§

fn clone(&self) -> Deployment

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Deployment

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/system_services/struct.PackageDistro.html b/system_services/struct.PackageDistro.html new file mode 100644 index 0000000000..ce34fb1187 --- /dev/null +++ b/system_services/struct.PackageDistro.html @@ -0,0 +1,52 @@ +PackageDistro in system_services - Rust
pub struct PackageDistro {
+    pub name: String,
+    pub version: &'static str,
+    pub services: Vec<ServiceDistro>,
+    pub spells: Vec<SpellDistro>,
+    pub init: Option<Arc<Box<dyn InitService>>>,
+}
Expand description

Package distribution description +Contains enough information about all services and spells used by the package for installation +It’s not the same thing as a worker since this kind of package doesn’t require to be installed +in a separate scope

+

Fields§

§name: String

High-level name of the package. +For the system services the field is supposed to be a string of ServiceKey enum

+
§version: &'static str

Version of the package, the field is used to display versions of used system services

+
§services: Vec<ServiceDistro>

List services needed by the package

+
§spells: Vec<SpellDistro>

List of spells needed by the package

+
§init: Option<Arc<Box<dyn InitService>>>

Optionally, initialization function for the services.

+

Trait Implementations§

source§

impl Clone for PackageDistro

source§

fn clone(&self) -> PackageDistro

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for PackageDistro

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/system_services/struct.ServiceDistro.html b/system_services/struct.ServiceDistro.html new file mode 100644 index 0000000000..4b25854edc --- /dev/null +++ b/system_services/struct.ServiceDistro.html @@ -0,0 +1,44 @@ +ServiceDistro in system_services - Rust
pub struct ServiceDistro {
+    pub modules: HashMap<&'static str, &'static [u8]>,
+    pub config: TomlMarineConfig,
+    pub name: String,
+}
Expand description

Service distribution description that provides enough information for the service installation.

+

Fields§

§modules: HashMap<&'static str, &'static [u8]>

WASM modules of the service by their names

+
§config: TomlMarineConfig

Marine config of the service

+
§name: String

High-level names of the service used as an alias

+

Trait Implementations§

source§

impl Clone for ServiceDistro

source§

fn clone(&self) -> ServiceDistro

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ServiceDistro

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/system_services/struct.SpellDistro.html b/system_services/struct.SpellDistro.html new file mode 100644 index 0000000000..22958cdac6 --- /dev/null +++ b/system_services/struct.SpellDistro.html @@ -0,0 +1,47 @@ +SpellDistro in system_services - Rust
pub struct SpellDistro {
+    pub name: String,
+    pub air: &'static str,
+    pub kv: HashMap<&'static str, Value>,
+    pub trigger_config: TriggerConfig,
+}
Expand description

Spell distribution description that provides enough information for the spell installation.

+

Fields§

§name: String

The name of the spell which is also used as an alias for the spell

+
§air: &'static str

The AIR script of the spell

+
§kv: HashMap<&'static str, Value>

Initial values for the KV storage of the spell +Note that these values are saved as JSON strings

+
§trigger_config: TriggerConfig

The trigger config for the spell

+

Trait Implementations§

source§

impl Clone for SpellDistro

source§

fn clone(&self) -> SpellDistro

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for SpellDistro

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/system_services/struct.SystemServiceDistros.html b/system_services/struct.SystemServiceDistros.html new file mode 100644 index 0000000000..7271012d29 --- /dev/null +++ b/system_services/struct.SystemServiceDistros.html @@ -0,0 +1,37 @@ +SystemServiceDistros in system_services - Rust
pub struct SystemServiceDistros { /* private fields */ }

Implementations§

source§

impl SystemServiceDistros

source

pub fn extend(self, distros: Vec<PackageDistro>) -> Self

With overriding existing packages

+
source

pub fn default_from(config: SystemServicesConfig) -> Result<Self>

Trait Implementations§

source§

impl Clone for SystemServiceDistros

source§

fn clone(&self) -> SystemServiceDistros

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for SystemServiceDistros

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/system_services/struct.Versions.html b/system_services/struct.Versions.html new file mode 100644 index 0000000000..8f42779db7 --- /dev/null +++ b/system_services/struct.Versions.html @@ -0,0 +1,41 @@ +Versions in system_services - Rust
pub struct Versions {
+    pub aqua_ipfs_version: &'static str,
+    pub trust_graph_version: &'static str,
+    pub registry_version: &'static str,
+    pub decider_version: &'static str,
+}

Fields§

§aqua_ipfs_version: &'static str§trust_graph_version: &'static str§registry_version: &'static str§decider_version: &'static str

Trait Implementations§

source§

impl Clone for Versions

source§

fn clone(&self) -> Versions

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Versions

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/system_services/trait.CallService.html b/system_services/trait.CallService.html new file mode 100644 index 0000000000..44b249263c --- /dev/null +++ b/system_services/trait.CallService.html @@ -0,0 +1,28 @@ +CallService in system_services - Rust
pub trait CallService: Send + Sync {
+    // Required method
+    fn call<'life0, 'async_trait>(
+        &'life0 self,
+        service_name: String,
+        function_name: String,
+        args: Vec<Value>
+    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
+       where Self: 'async_trait,
+             'life0: 'async_trait;
+}
Expand description

Call service functions. Accepts

+
    +
  • service name
  • +
  • function name
  • +
  • function arguments
  • +
+

Restriction: +The functions called via this callback must return a result with execution status in field status: bool +and error message in the field error: string. +Otherwise, the output will be consider invalid.

+

Required Methods§

source

fn call<'life0, 'async_trait>( + &'life0 self, + service_name: String, + function_name: String, + args: Vec<Value> +) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where + Self: 'async_trait, + 'life0: 'async_trait,

Implementors§

\ No newline at end of file diff --git a/system_services/trait.InitService.html b/system_services/trait.InitService.html new file mode 100644 index 0000000000..995b2b32b5 --- /dev/null +++ b/system_services/trait.InitService.html @@ -0,0 +1,23 @@ +InitService in system_services - Rust
pub trait InitService: Send + Sync {
+    // Required method
+    fn init<'life0, 'life1, 'async_trait>(
+        &'life0 self,
+        call_service: &'life1 dyn CallService,
+        deployment: Deployment
+    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
+       where Self: 'async_trait,
+             'life0: 'async_trait,
+             'life1: 'async_trait;
+}
Expand description

Initialization function to initialize services

+
    +
  • accepts DeploymentStatus of services and spells to be able to update or initialize the services
  • +
  • accepts CallService to be able to call installed services for initialization.
  • +
+

Required Methods§

source

fn init<'life0, 'life1, 'async_trait>( + &'life0 self, + call_service: &'life1 dyn CallService, + deployment: Deployment +) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where + Self: 'async_trait, + 'life0: 'async_trait, + 'life1: 'async_trait,

Implementors§

\ No newline at end of file diff --git a/test_constants/all.html b/test_constants/all.html new file mode 100644 index 0000000000..a5ee9390e6 --- /dev/null +++ b/test_constants/all.html @@ -0,0 +1 @@ +List of all items in this crate
\ No newline at end of file diff --git a/test_constants/index.html b/test_constants/index.html new file mode 100644 index 0000000000..34f961107e --- /dev/null +++ b/test_constants/index.html @@ -0,0 +1,2 @@ +test_constants - Rust
\ No newline at end of file diff --git a/test_constants/sidebar-items.js b/test_constants/sidebar-items.js new file mode 100644 index 0000000000..7a48b07ad8 --- /dev/null +++ b/test_constants/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"static":["EXECUTION_TIMEOUT","IDLE_CONNECTION_TIMEOUT","PARTICLE_TTL","SHORT_TIMEOUT","TIMEOUT","TRANSPORT_TIMEOUT"]}; \ No newline at end of file diff --git a/test_constants/static.EXECUTION_TIMEOUT.html b/test_constants/static.EXECUTION_TIMEOUT.html new file mode 100644 index 0000000000..dae57cab6b --- /dev/null +++ b/test_constants/static.EXECUTION_TIMEOUT.html @@ -0,0 +1 @@ +EXECUTION_TIMEOUT in test_constants - Rust
pub static EXECUTION_TIMEOUT: Duration
\ No newline at end of file diff --git a/test_constants/static.IDLE_CONNECTION_TIMEOUT.html b/test_constants/static.IDLE_CONNECTION_TIMEOUT.html new file mode 100644 index 0000000000..f08cb8f49f --- /dev/null +++ b/test_constants/static.IDLE_CONNECTION_TIMEOUT.html @@ -0,0 +1 @@ +IDLE_CONNECTION_TIMEOUT in test_constants - Rust
pub static IDLE_CONNECTION_TIMEOUT: Duration
\ No newline at end of file diff --git a/test_constants/static.PARTICLE_TTL.html b/test_constants/static.PARTICLE_TTL.html new file mode 100644 index 0000000000..94b0f040ba --- /dev/null +++ b/test_constants/static.PARTICLE_TTL.html @@ -0,0 +1 @@ +PARTICLE_TTL in test_constants - Rust
pub static PARTICLE_TTL: u32
\ No newline at end of file diff --git a/test_constants/static.SHORT_TIMEOUT.html b/test_constants/static.SHORT_TIMEOUT.html new file mode 100644 index 0000000000..3db6a4353e --- /dev/null +++ b/test_constants/static.SHORT_TIMEOUT.html @@ -0,0 +1 @@ +SHORT_TIMEOUT in test_constants - Rust
pub static SHORT_TIMEOUT: Duration
\ No newline at end of file diff --git a/test_constants/static.TIMEOUT.html b/test_constants/static.TIMEOUT.html new file mode 100644 index 0000000000..8bc6e532d9 --- /dev/null +++ b/test_constants/static.TIMEOUT.html @@ -0,0 +1,2 @@ +TIMEOUT in test_constants - Rust

Static test_constants::TIMEOUT

source ·
pub static TIMEOUT: Duration
Expand description

In debug, VM startup time is big, account for that

+
\ No newline at end of file diff --git a/test_constants/static.TRANSPORT_TIMEOUT.html b/test_constants/static.TRANSPORT_TIMEOUT.html new file mode 100644 index 0000000000..4367281cb1 --- /dev/null +++ b/test_constants/static.TRANSPORT_TIMEOUT.html @@ -0,0 +1 @@ +TRANSPORT_TIMEOUT in test_constants - Rust
pub static TRANSPORT_TIMEOUT: Duration
\ No newline at end of file diff --git a/test_utils/all.html b/test_utils/all.html new file mode 100644 index 0000000000..4da032c817 --- /dev/null +++ b/test_utils/all.html @@ -0,0 +1 @@ +List of all items in this crate
\ No newline at end of file diff --git a/test_utils/fn.create_service.html b/test_utils/fn.create_service.html new file mode 100644 index 0000000000..91b93cf89d --- /dev/null +++ b/test_utils/fn.create_service.html @@ -0,0 +1,5 @@ +create_service in test_utils - Rust

Function test_utils::create_service

source ·
pub async fn create_service(
+    client: &mut ConnectedClient,
+    module_name: &str,
+    module_bytes: Vec<u8>
+) -> CreatedService
\ No newline at end of file diff --git a/test_utils/fn.create_service_worker.html b/test_utils/fn.create_service_worker.html new file mode 100644 index 0000000000..2878a3de14 --- /dev/null +++ b/test_utils/fn.create_service_worker.html @@ -0,0 +1,6 @@ +create_service_worker in test_utils - Rust
pub async fn create_service_worker(
+    client: &mut ConnectedClient,
+    module_name: &str,
+    module_bytes: Vec<u8>,
+    worker_id: String
+) -> CreatedService
\ No newline at end of file diff --git a/test_utils/fn.get_default_chain_config.html b/test_utils/fn.get_default_chain_config.html new file mode 100644 index 0000000000..a38f023951 --- /dev/null +++ b/test_utils/fn.get_default_chain_config.html @@ -0,0 +1 @@ +get_default_chain_config in test_utils - Rust
pub fn get_default_chain_config(url: &str) -> ChainConfig
\ No newline at end of file diff --git a/test_utils/fn.response_to_return.html b/test_utils/fn.response_to_return.html new file mode 100644 index 0000000000..72cac843db --- /dev/null +++ b/test_utils/fn.response_to_return.html @@ -0,0 +1 @@ +response_to_return in test_utils - Rust
pub fn response_to_return(resp: IValue) -> RetStruct
\ No newline at end of file diff --git a/test_utils/fn.string_result.html b/test_utils/fn.string_result.html new file mode 100644 index 0000000000..047fd65462 --- /dev/null +++ b/test_utils/fn.string_result.html @@ -0,0 +1 @@ +string_result in test_utils - Rust

Function test_utils::string_result

source ·
pub fn string_result(ret: RetStruct) -> Result<String, String>
\ No newline at end of file diff --git a/test_utils/fn.timeout.html b/test_utils/fn.timeout.html new file mode 100644 index 0000000000..4d144d9c43 --- /dev/null +++ b/test_utils/fn.timeout.html @@ -0,0 +1,2 @@ +timeout in test_utils - Rust

Function test_utils::timeout

source ·
pub async fn timeout<F, T>(dur: Duration, f: F) -> Result<T>where
+    F: Future<Output = T>,
\ No newline at end of file diff --git a/test_utils/index.html b/test_utils/index.html new file mode 100644 index 0000000000..8bf463f572 --- /dev/null +++ b/test_utils/index.html @@ -0,0 +1,2 @@ +test_utils - Rust
\ No newline at end of file diff --git a/test_utils/misc/fn.timeout.html b/test_utils/misc/fn.timeout.html new file mode 100644 index 0000000000..734d0e0416 --- /dev/null +++ b/test_utils/misc/fn.timeout.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../test_utils/fn.timeout.html...

+ + + \ No newline at end of file diff --git a/test_utils/pinning/constant.DUMMY.html b/test_utils/pinning/constant.DUMMY.html new file mode 100644 index 0000000000..de59f19266 --- /dev/null +++ b/test_utils/pinning/constant.DUMMY.html @@ -0,0 +1 @@ +DUMMY in test_utils::pinning - Rust

Constant test_utils::pinning::DUMMY

source ·
pub const DUMMY: DummyThreadPinner;
\ No newline at end of file diff --git a/test_utils/pinning/index.html b/test_utils/pinning/index.html new file mode 100644 index 0000000000..c611caa6c1 --- /dev/null +++ b/test_utils/pinning/index.html @@ -0,0 +1 @@ +test_utils::pinning - Rust
\ No newline at end of file diff --git a/test_utils/pinning/sidebar-items.js b/test_utils/pinning/sidebar-items.js new file mode 100644 index 0000000000..2954a21825 --- /dev/null +++ b/test_utils/pinning/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"constant":["DUMMY"],"struct":["DummyThreadPinner"]}; \ No newline at end of file diff --git a/test_utils/pinning/struct.DummyThreadPinner.html b/test_utils/pinning/struct.DummyThreadPinner.html new file mode 100644 index 0000000000..4a8aa44927 --- /dev/null +++ b/test_utils/pinning/struct.DummyThreadPinner.html @@ -0,0 +1,35 @@ +DummyThreadPinner in test_utils::pinning - Rust
pub struct DummyThreadPinner;

Trait Implementations§

source§

impl ThreadPinner for DummyThreadPinner

source§

fn pin_current_thread_to(&self, _core_id: LogicalCoreId) -> bool

source§

fn pin_current_thread_to_cpuset(&self, _core_ids: &[LogicalCoreId]) -> bool

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/test_utils/service/fn.create_service.html b/test_utils/service/fn.create_service.html new file mode 100644 index 0000000000..6754763f24 --- /dev/null +++ b/test_utils/service/fn.create_service.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../test_utils/fn.create_service.html...

+ + + \ No newline at end of file diff --git a/test_utils/service/fn.create_service_worker.html b/test_utils/service/fn.create_service_worker.html new file mode 100644 index 0000000000..511f317d0a --- /dev/null +++ b/test_utils/service/fn.create_service_worker.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../test_utils/fn.create_service_worker.html...

+ + + \ No newline at end of file diff --git a/test_utils/service/struct.CreatedService.html b/test_utils/service/struct.CreatedService.html new file mode 100644 index 0000000000..4a2e54204c --- /dev/null +++ b/test_utils/service/struct.CreatedService.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../test_utils/struct.CreatedService.html...

+ + + \ No newline at end of file diff --git a/test_utils/sidebar-items.js b/test_utils/sidebar-items.js new file mode 100644 index 0000000000..8cc3d4e7f9 --- /dev/null +++ b/test_utils/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"fn":["create_service","create_service_worker","get_default_chain_config","response_to_return","string_result","timeout"],"mod":["pinning"],"struct":["CreatedService","RetStruct"]}; \ No newline at end of file diff --git a/test_utils/struct.CreatedService.html b/test_utils/struct.CreatedService.html new file mode 100644 index 0000000000..77022b8ae5 --- /dev/null +++ b/test_utils/struct.CreatedService.html @@ -0,0 +1,38 @@ +CreatedService in test_utils - Rust
pub struct CreatedService {
+    pub id: String,
+}

Fields§

§id: String

Trait Implementations§

source§

impl Clone for CreatedService

source§

fn clone(&self) -> CreatedService

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for CreatedService

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/test_utils/struct.RetStruct.html b/test_utils/struct.RetStruct.html new file mode 100644 index 0000000000..6b5cd56557 --- /dev/null +++ b/test_utils/struct.RetStruct.html @@ -0,0 +1,40 @@ +RetStruct in test_utils - Rust

Struct test_utils::RetStruct

source ·
pub struct RetStruct {
+    pub ret_code: u32,
+    pub error: String,
+    pub result: String,
+}

Fields§

§ret_code: u32§error: String§result: String

Trait Implementations§

source§

impl Clone for RetStruct

source§

fn clone(&self) -> RetStruct

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for RetStruct

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<U> As for U

§

fn as_<T>(self) -> Twhere + T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/test_utils/utils/fn.get_default_chain_config.html b/test_utils/utils/fn.get_default_chain_config.html new file mode 100644 index 0000000000..d917c0780d --- /dev/null +++ b/test_utils/utils/fn.get_default_chain_config.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../test_utils/fn.get_default_chain_config.html...

+ + + \ No newline at end of file diff --git a/test_utils/utils/fn.response_to_return.html b/test_utils/utils/fn.response_to_return.html new file mode 100644 index 0000000000..e90ea8c473 --- /dev/null +++ b/test_utils/utils/fn.response_to_return.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../test_utils/fn.response_to_return.html...

+ + + \ No newline at end of file diff --git a/test_utils/utils/fn.string_result.html b/test_utils/utils/fn.string_result.html new file mode 100644 index 0000000000..64084d4369 --- /dev/null +++ b/test_utils/utils/fn.string_result.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../test_utils/fn.string_result.html...

+ + + \ No newline at end of file diff --git a/test_utils/utils/struct.RetStruct.html b/test_utils/utils/struct.RetStruct.html new file mode 100644 index 0000000000..76790e6fae --- /dev/null +++ b/test_utils/utils/struct.RetStruct.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../test_utils/struct.RetStruct.html...

+ + + \ No newline at end of file diff --git a/toml_utils/all.html b/toml_utils/all.html new file mode 100644 index 0000000000..93b8dbb9bb --- /dev/null +++ b/toml_utils/all.html @@ -0,0 +1 @@ +List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/toml_utils/fn.table.html b/toml_utils/fn.table.html new file mode 100644 index 0000000000..b571b94296 --- /dev/null +++ b/toml_utils/fn.table.html @@ -0,0 +1 @@ +table in toml_utils - Rust

Function toml_utils::table

source ·
pub fn table(tuples: Vec<(String, String)>) -> TomlValueTable
\ No newline at end of file diff --git a/toml_utils/index.html b/toml_utils/index.html new file mode 100644 index 0000000000..9b21a1b7ab --- /dev/null +++ b/toml_utils/index.html @@ -0,0 +1,2 @@ +toml_utils - Rust
\ No newline at end of file diff --git a/toml_utils/sidebar-items.js b/toml_utils/sidebar-items.js new file mode 100644 index 0000000000..6d05b577ef --- /dev/null +++ b/toml_utils/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"fn":["table"]}; \ No newline at end of file diff --git a/toy_vms/all.html b/toy_vms/all.html new file mode 100644 index 0000000000..5a6d2b30fc --- /dev/null +++ b/toy_vms/all.html @@ -0,0 +1 @@ +List of all items in this crate

List of all items

Structs

\ No newline at end of file diff --git a/toy_vms/easy_vm/struct.EasyVM.html b/toy_vms/easy_vm/struct.EasyVM.html new file mode 100644 index 0000000000..912f538ef1 --- /dev/null +++ b/toy_vms/easy_vm/struct.EasyVM.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../toy_vms/struct.EasyVM.html...

+ + + \ No newline at end of file diff --git a/toy_vms/index.html b/toy_vms/index.html new file mode 100644 index 0000000000..887ff42546 --- /dev/null +++ b/toy_vms/index.html @@ -0,0 +1,2 @@ +toy_vms - Rust
\ No newline at end of file diff --git a/toy_vms/sidebar-items.js b/toy_vms/sidebar-items.js new file mode 100644 index 0000000000..02088d43a6 --- /dev/null +++ b/toy_vms/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":["EasyVM"]}; \ No newline at end of file diff --git a/toy_vms/struct.EasyVM.html b/toy_vms/struct.EasyVM.html new file mode 100644 index 0000000000..c69fc24199 --- /dev/null +++ b/toy_vms/struct.EasyVM.html @@ -0,0 +1,53 @@ +EasyVM in toy_vms - Rust

Struct toy_vms::EasyVM

source ·
pub struct EasyVM { /* private fields */ }

Trait Implementations§

source§

impl AquaRuntime for EasyVM

§

type Config = Option<Duration>

§

type Error = Infallible

source§

fn create_runtime( + delay: Option<Duration>, + _backend: WasmtimeWasmBackend, + _: Waker +) -> Result<Self, Self::Error>

source§

fn into_effects( + outcome: Result<RawAVMOutcome, Self::Error>, + _particle_id: String +) -> ParticleEffects

source§

fn call<'life0, 'life1, 'life2, 'async_trait>( + &'life0 mut self, + air: impl 'async_trait + Into<String> + Send, + _prev_data: impl 'async_trait + Into<Vec<u8>> + Send, + current_data: impl 'async_trait + Into<Vec<u8>> + Send, + particle_params: ParticleParameters<'life1>, + _call_results: CallResults, + _key_pair: &'life2 KeyPair +) -> Pin<Box<dyn Future<Output = Result<RawAVMOutcome, Self::Error>> + Send + 'async_trait>>where + Self: 'async_trait, + 'life0: 'async_trait, + 'life1: 'async_trait, + 'life2: 'async_trait,

source§

fn memory_stats(&self) -> AVMMemoryStats

Return current size of memory. Use only for diagnostics purposes.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>where + T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where + T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where + T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( + pointer: <T as Pointee>::Pointer, + f: &mut Formatter<'_> +) -> Result<(), Error>

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where + R: Read, + E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/trait.impl/alloy_sol_types/private/trait.SolTypeValue.js b/trait.impl/alloy_sol_types/private/trait.SolTypeValue.js new file mode 100644 index 0000000000..c6351711e4 --- /dev/null +++ b/trait.impl/alloy_sol_types/private/trait.SolTypeValue.js @@ -0,0 +1,4 @@ +(function() {var implementors = { +"chain_connector":[["impl SolTypeValue<Status> for Status"],["impl SolTypeValue<CCStatus> for CCStatus"],["impl SolTypeValue<ComputePeer> for ComputePeer"],["impl SolTypeValue<CIDV1> for CIDV1"],["impl SolTypeValue<ComputeUnit> for ComputeUnit"],["impl SolTypeValue<ComputeUnit> for ComputeUnit"]], +"chain_listener":[["impl SolTypeValue<CIDV1> for CIDV1"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/alloy_sol_types/types/enum/trait.SolEnum.js b/trait.impl/alloy_sol_types/types/enum/trait.SolEnum.js new file mode 100644 index 0000000000..85859d82fd --- /dev/null +++ b/trait.impl/alloy_sol_types/types/enum/trait.SolEnum.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"chain_connector":[["impl SolEnum for Status"],["impl SolEnum for CCStatus"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/alloy_sol_types/types/error/trait.SolError.js b/trait.impl/alloy_sol_types/types/error/trait.SolError.js new file mode 100644 index 0000000000..8ce7e76747 --- /dev/null +++ b/trait.impl/alloy_sol_types/types/error/trait.SolError.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"chain_connector":[["impl SolError for TooManyProofs"],["impl SolError for CapacityCommitmentIsNotActive"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/alloy_sol_types/types/event/topic/trait.EventTopic.js b/trait.impl/alloy_sol_types/types/event/topic/trait.EventTopic.js new file mode 100644 index 0000000000..65dacff8d2 --- /dev/null +++ b/trait.impl/alloy_sol_types/types/event/topic/trait.EventTopic.js @@ -0,0 +1,4 @@ +(function() {var implementors = { +"chain_connector":[["impl EventTopic for CCStatus"],["impl EventTopic for CIDV1"],["impl EventTopic for Status"],["impl EventTopic for ComputeUnit"],["impl EventTopic for ComputePeer"],["impl EventTopic for ComputeUnit"]], +"chain_listener":[["impl EventTopic for CIDV1"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/alloy_sol_types/types/event/trait.SolEvent.js b/trait.impl/alloy_sol_types/types/event/trait.SolEvent.js new file mode 100644 index 0000000000..52079536a5 --- /dev/null +++ b/trait.impl/alloy_sol_types/types/event/trait.SolEvent.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"chain_listener":[["impl SolEvent for CommitmentActivated"],["impl SolEvent for UnitActivated"],["impl SolEvent for UnitDeactivated"],["impl SolEvent for ComputeUnitMatched"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/alloy_sol_types/types/function/trait.SolCall.js b/trait.impl/alloy_sol_types/types/function/trait.SolCall.js new file mode 100644 index 0000000000..c9acd5a582 --- /dev/null +++ b/trait.impl/alloy_sol_types/types/function/trait.SolCall.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"chain_connector":[["impl SolCall for marketCall"],["impl SolCall for difficultyCall"],["impl SolCall for returnComputeUnitFromDealCall"],["impl SolCall for getComputeUnitsCall"],["impl SolCall for epochDurationCall"],["impl SolCall for appCIDCall"],["impl SolCall for submitProofCall"],["impl SolCall for submitProofsCall"],["impl SolCall for currentEpochCall"],["impl SolCall for getStatusCall"],["impl SolCall for getStatusCall"],["impl SolCall for capacityCall"],["impl SolCall for getComputeUnitsCall"],["impl SolCall for getComputePeerCall"],["impl SolCall for minProofsPerEpochCall"],["impl SolCall for getGlobalNonceCall"],["impl SolCall for initTimestampCall"],["impl SolCall for maxProofsPerEpochCall"],["impl SolCall for setWorkerCall"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/alloy_sol_types/types/interface/trait.SolInterface.js b/trait.impl/alloy_sol_types/types/interface/trait.SolInterface.js new file mode 100644 index 0000000000..e9da0fc05c --- /dev/null +++ b/trait.impl/alloy_sol_types/types/interface/trait.SolInterface.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"chain_connector":[["impl SolInterface for DealCalls"],["impl SolInterface for CoreCalls"],["impl SolInterface for CapacityErrors"],["impl SolInterface for OfferCalls"],["impl SolInterface for CapacityCalls"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/alloy_sol_types/types/struct/trait.SolStruct.js b/trait.impl/alloy_sol_types/types/struct/trait.SolStruct.js new file mode 100644 index 0000000000..0a9f78e48e --- /dev/null +++ b/trait.impl/alloy_sol_types/types/struct/trait.SolStruct.js @@ -0,0 +1,4 @@ +(function() {var implementors = { +"chain_connector":[["impl SolStruct for CIDV1"],["impl SolStruct for ComputeUnit"],["impl SolStruct for ComputeUnit"],["impl SolStruct for ComputePeer"]], +"chain_listener":[["impl SolStruct for CIDV1"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/alloy_sol_types/types/ty/trait.SolType.js b/trait.impl/alloy_sol_types/types/ty/trait.SolType.js new file mode 100644 index 0000000000..57573fd6d4 --- /dev/null +++ b/trait.impl/alloy_sol_types/types/ty/trait.SolType.js @@ -0,0 +1,4 @@ +(function() {var implementors = { +"chain_connector":[["impl SolType for ComputeUnit"],["impl SolType for CIDV1"],["impl SolType for ComputePeer"],["impl SolType for ComputeUnit"],["impl SolType for CCStatus"],["impl SolType for Status"]], +"chain_listener":[["impl SolType for CIDV1"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/alloy_sol_types/types/value/trait.SolValue.js b/trait.impl/alloy_sol_types/types/value/trait.SolValue.js new file mode 100644 index 0000000000..a68e0c253a --- /dev/null +++ b/trait.impl/alloy_sol_types/types/value/trait.SolValue.js @@ -0,0 +1,4 @@ +(function() {var implementors = { +"chain_connector":[["impl SolValue for CCStatus"],["impl SolValue for Status"],["impl SolValue for CIDV1"],["impl SolValue for ComputePeer"],["impl SolValue for ComputeUnit"],["impl SolValue for ComputeUnit"]], +"chain_listener":[["impl SolValue for CIDV1"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/aquamarine/aqua_runtime/trait.AquaRuntime.js b/trait.impl/aquamarine/aqua_runtime/trait.AquaRuntime.js new file mode 100644 index 0000000000..ec53def375 --- /dev/null +++ b/trait.impl/aquamarine/aqua_runtime/trait.AquaRuntime.js @@ -0,0 +1,4 @@ +(function() {var implementors = { +"aquamarine":[], +"toy_vms":[["impl AquaRuntime for EasyVM"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/chain_connector/connector/trait.ChainConnector.js b/trait.impl/chain_connector/connector/trait.ChainConnector.js new file mode 100644 index 0000000000..38b3a9d453 --- /dev/null +++ b/trait.impl/chain_connector/connector/trait.ChainConnector.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"chain_connector":[] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/clap_builder/derive/trait.Args.js b/trait.impl/clap_builder/derive/trait.Args.js new file mode 100644 index 0000000000..84232b881a --- /dev/null +++ b/trait.impl/clap_builder/derive/trait.Args.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"server_config":[["impl Args for TracingArgs"],["impl Args for DevModeArgs"],["impl Args for RootKeyPairArgs"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/clap_builder/derive/trait.CommandFactory.js b/trait.impl/clap_builder/derive/trait.CommandFactory.js new file mode 100644 index 0000000000..f2c49e284d --- /dev/null +++ b/trait.impl/clap_builder/derive/trait.CommandFactory.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"server_config":[["impl CommandFactory for DevModeArgs"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/clap_builder/derive/trait.FromArgMatches.js b/trait.impl/clap_builder/derive/trait.FromArgMatches.js new file mode 100644 index 0000000000..7e44e6ac63 --- /dev/null +++ b/trait.impl/clap_builder/derive/trait.FromArgMatches.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"server_config":[["impl FromArgMatches for TracingArgs"],["impl FromArgMatches for RootKeyPairArgs"],["impl FromArgMatches for DevModeArgs"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/clap_builder/derive/trait.Parser.js b/trait.impl/clap_builder/derive/trait.Parser.js new file mode 100644 index 0000000000..e5f570a013 --- /dev/null +++ b/trait.impl/clap_builder/derive/trait.Parser.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"server_config":[["impl Parser for DevModeArgs"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/clap_builder/derive/trait.ValueEnum.js b/trait.impl/clap_builder/derive/trait.ValueEnum.js new file mode 100644 index 0000000000..ff5bdd7e9f --- /dev/null +++ b/trait.impl/clap_builder/derive/trait.ValueEnum.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"server_config":[["impl ValueEnum for TracingType"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/connection_pool/connection_pool/trait.ConnectionPoolT.js b/trait.impl/connection_pool/connection_pool/trait.ConnectionPoolT.js new file mode 100644 index 0000000000..90ccfd9424 --- /dev/null +++ b/trait.impl/connection_pool/connection_pool/trait.ConnectionPoolT.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"connection_pool":[] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/clone/trait.Clone.js b/trait.impl/core/clone/trait.Clone.js new file mode 100644 index 0000000000..b4730b3734 --- /dev/null +++ b/trait.impl/core/clone/trait.Clone.js @@ -0,0 +1,32 @@ +(function() {var implementors = { +"aquamarine":[["impl Clone for ParticleEffects"],["impl Clone for ParticleDataStore"],["impl Clone for InterpretationStats"],["impl Clone for VmPoolConfig"],["impl Clone for RemoteRoutingEffects"],["impl Clone for AquamarineApi"],["impl Clone for VmConfig"],["impl Clone for DataStoreConfig"]], +"chain_connector":[["impl Clone for TooManyProofs"],["impl Clone for maxProofsPerEpochCall"],["impl Clone for ComputeUnit"],["impl Clone for initTimestampReturn"],["impl Clone for difficultyCall"],["impl Clone for capacityReturn"],["impl Clone for SubnetResolveResult"],["impl Clone for CCStatus"],["impl Clone for getStatusCall"],["impl Clone for getComputeUnitsReturn"],["impl Clone for marketReturn"],["impl Clone for CapacityCommitmentIsNotActive"],["impl Clone for getStatusCall"],["impl Clone for returnComputeUnitFromDealReturn"],["impl Clone for ComputePeer"],["impl Clone for submitProofReturn"],["impl Clone for submitProofsCall"],["impl Clone for marketCall"],["impl Clone for epochDurationCall"],["impl Clone for returnComputeUnitFromDealCall"],["impl Clone for currentEpochReturn"],["impl Clone for getGlobalNonceCall"],["impl Clone for currentEpochCall"],["impl Clone for epochDurationReturn"],["impl Clone for capacityCall"],["impl Clone for getComputeUnitsCall"],["impl Clone for appCIDReturn"],["impl Clone for minProofsPerEpochReturn"],["impl Clone for Status"],["impl Clone for CIDV1"],["impl Clone for getStatusReturn"],["impl Clone for ComputeUnit"],["impl Clone for getComputePeerCall"],["impl Clone for getComputeUnitsReturn"],["impl Clone for maxProofsPerEpochReturn"],["impl Clone for submitProofCall"],["impl Clone for getStatusReturn"],["impl Clone for CommitmentId"],["impl Clone for getComputePeerReturn"],["impl Clone for appCIDCall"],["impl Clone for initTimestampCall"],["impl Clone for getGlobalNonceReturn"],["impl Clone for setWorkerCall"],["impl Clone for difficultyReturn"],["impl Clone for submitProofsReturn"],["impl Clone for setWorkerReturn"],["impl Clone for getComputeUnitsCall"],["impl Clone for minProofsPerEpochCall"]], +"chain_data":[["impl Clone for Log"],["impl Clone for EventField"]], +"chain_listener":[["impl Clone for CommitmentActivated"],["impl Clone for UnitDeactivated"],["impl Clone for ComputeUnitMatched"],["impl Clone for CIDV1"],["impl Clone for UnitActivated"]], +"cid_utils":[["impl Clone for Hash"]], +"connected_client":[["impl Clone for ClientCommand"]], +"connection_pool":[["impl Clone for ConnectionPoolApi"],["impl Clone for LifecycleEvent"]], +"core_distributor":[["impl Clone for Cores"],["impl Clone for WorkType"],["impl Clone for AcquireRequest"],["impl Clone for Assignment"],["impl Clone for CoreRange"]], +"created_swarm":[["impl Clone for SwarmConfig"],["impl Clone for NetworkKey"]], +"fluence_libp2p":[["impl Clone for Transport"]], +"kademlia":[["impl Clone for KademliaApi"],["impl Clone for KademliaConfig"]], +"log_format":[["impl<T: Clone> Clone for Format<T>"]], +"nox":[["impl Clone for Versions"],["impl Clone for Connectivity"]], +"particle_args":[["impl Clone for JError"],["impl Clone for Args"]], +"particle_builtins":[["impl Clone for NodeInfo"]], +"particle_execution":[["impl Clone for ParticleParams"],["impl Clone for FunctionOutcome"],["impl Clone for ParticleVault"]], +"particle_modules":[["impl Clone for ModuleRepository"],["impl Clone for EffectorsMode"]], +"particle_protocol":[["impl Clone for ProtocolMessage"],["impl Clone for ExtendedParticle"],["impl Clone for ProtocolConfig"],["impl Clone for Particle"],["impl Clone for Contact"]], +"particle_services":[["impl Clone for WasmBackendConfig"],["impl Clone for ServiceType"],["impl Clone for ParticleAppServices"],["impl Clone for ParticleAppServicesConfig"]], +"peer_metrics":[["impl Clone for FunctionKind"],["impl Clone for ParticleLabel"],["impl Clone for DispatcherMetrics"],["impl Clone for VmPoolMetrics"],["impl Clone for ParticleExecutorMetrics"],["impl Clone for Resolution"],["impl Clone for ConnectivityMetrics"],["impl Clone for ServicesMetrics"],["impl Clone for ServiceType"],["impl Clone for ConnectionPoolMetrics"],["impl Clone for ServicesMetricsExternal"],["impl Clone for ChainListenerMetrics"],["impl Clone for ServicesMetricsBuiltin"],["impl Clone for WorkerLabel"],["impl Clone for WorkerType"],["impl Clone for ParticleType"],["impl Clone for SpellMetrics"]], +"server_config":[["impl Clone for TracingType"],["impl Clone for AquaIpfsConfig"],["impl Clone for EnabledSystemServices"],["impl Clone for KademliaConfig"],["impl Clone for NodeConfig"],["impl Clone for ChainListenerConfig"],["impl Clone for UnresolvedConfig"],["impl Clone for DevModeArgs"],["impl Clone for BootstrapConfig"],["impl Clone for DeciderConfig"],["impl Clone for TracingArgs"],["impl Clone for RegistryConfig"],["impl Clone for ResolvedConfig"],["impl Clone for ConnectorConfig"],["impl Clone for TransportConfig"],["impl Clone for Network"],["impl Clone for SystemServicesConfig"],["impl Clone for RootKeyPairArgs"],["impl Clone for ServiceKey"],["impl Clone for TracingConfig"],["impl Clone for ChainConfig"]], +"service_modules":[["impl Clone for Blueprint"],["impl Clone for AddBlueprint"]], +"sorcerer":[["impl Clone for Sorcerer"],["impl Clone for SpellInfo"]], +"spell_event_bus":[["impl Clone for TimerEvent"],["impl Clone for SpellEventBusApi"],["impl Clone for PeerEvent"],["impl Clone for SpellTriggerConfigs"],["impl Clone for PeerEventType"],["impl Clone for Action"],["impl Clone for TriggerInfo"],["impl Clone for TriggerEvent"]], +"spell_service_api":[["impl Clone for CallParams"],["impl Clone for SpellServiceApi"]], +"spell_storage":[["impl Clone for SpellStorage"]], +"system_services":[["impl Clone for PackageDistro"],["impl Clone for Deployer"],["impl Clone for SpellDistro"],["impl Clone for SystemServiceDistros"],["impl Clone for ServiceStatus"],["impl Clone for Versions"],["impl Clone for Deployment"],["impl Clone for ServiceDistro"]], +"test_utils":[["impl Clone for CreatedService"],["impl Clone for RetStruct"]], +"types":[["impl Clone for DealId"],["impl Clone for PeerScope"],["impl Clone for WorkerId"]], +"workers":[["impl Clone for PeerScopes"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/cmp/trait.Eq.js b/trait.impl/core/cmp/trait.Eq.js new file mode 100644 index 0000000000..b59a7b4cf1 --- /dev/null +++ b/trait.impl/core/cmp/trait.Eq.js @@ -0,0 +1,12 @@ +(function() {var implementors = { +"chain_connector":[["impl Eq for CommitmentId"],["impl Eq for Status"],["impl Eq for PendingUnit"]], +"cid_utils":[["impl Eq for Hash"]], +"core_distributor":[["impl Eq for WorkType"],["impl Eq for Assignment"],["impl Eq for Cores"]], +"local_vm":[["impl Eq for Instruction"]], +"particle_protocol":[["impl Eq for Contact"]], +"particle_services":[["impl Eq for ServiceType"]], +"peer_metrics":[["impl Eq for Resolution"],["impl Eq for ParticleType"],["impl Eq for ServiceType"],["impl Eq for WorkerLabel"],["impl Eq for WorkerType"],["impl Eq for FunctionKind"],["impl Eq for ParticleLabel"]], +"server_config":[["impl Eq for ServiceKey"]], +"spell_event_bus":[["impl Eq for PeerEventType"]], +"types":[["impl Eq for PeerScope"],["impl Eq for DealId"],["impl Eq for WorkerId"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/cmp/trait.Ord.js b/trait.impl/core/cmp/trait.Ord.js new file mode 100644 index 0000000000..fd0393d99a --- /dev/null +++ b/trait.impl/core/cmp/trait.Ord.js @@ -0,0 +1,4 @@ +(function() {var implementors = { +"chain_connector":[["impl Ord for PendingUnit"]], +"types":[["impl Ord for DealId"],["impl Ord for PeerScope"],["impl Ord for WorkerId"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/cmp/trait.PartialEq.js b/trait.impl/core/cmp/trait.PartialEq.js new file mode 100644 index 0000000000..d15bb81de6 --- /dev/null +++ b/trait.impl/core/cmp/trait.PartialEq.js @@ -0,0 +1,14 @@ +(function() {var implementors = { +"chain_connector":[["impl PartialEq for SubnetResolveResult"],["impl PartialEq for CommitmentId"],["impl PartialEq for Status"],["impl PartialEq for CCStatus"],["impl PartialEq for PendingUnit"]], +"chain_data":[["impl PartialEq for EventField"]], +"cid_utils":[["impl PartialEq for Hash"]], +"core_distributor":[["impl PartialEq for AcquireRequest"],["impl PartialEq for CoreRange"],["impl PartialEq for AcquireError"],["impl PartialEq for Assignment"],["impl PartialEq for WorkType"],["impl PartialEq for CurrentAssignment"],["impl PartialEq for Cores"]], +"health":[["impl PartialEq for HealthStatus"]], +"local_vm":[["impl PartialEq for Instruction"]], +"particle_protocol":[["impl PartialEq for Contact"],["impl PartialEq for ProtocolMessage"],["impl PartialEq for Particle"]], +"particle_services":[["impl PartialEq for ServiceType"]], +"peer_metrics":[["impl PartialEq for ServiceType"],["impl PartialEq for ParticleLabel"],["impl PartialEq for WorkerType"],["impl PartialEq for FunctionKind"],["impl PartialEq for WorkerLabel"],["impl PartialEq for Resolution"],["impl PartialEq for ParticleType"]], +"server_config":[["impl PartialEq for Network"],["impl PartialEq for ServiceKey"],["impl PartialEq for TracingConfig"]], +"spell_event_bus":[["impl PartialEq for PeerEventType"]], +"types":[["impl PartialEq for DealId"],["impl PartialEq<&str> for &DealId"],["impl PartialEq for PeerScope"],["impl PartialEq<String> for &DealId"],["impl PartialEq<String> for DealId"],["impl PartialEq for WorkerId"],["impl PartialEq<&str> for DealId"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/cmp/trait.PartialOrd.js b/trait.impl/core/cmp/trait.PartialOrd.js new file mode 100644 index 0000000000..c9c197501a --- /dev/null +++ b/trait.impl/core/cmp/trait.PartialOrd.js @@ -0,0 +1,4 @@ +(function() {var implementors = { +"chain_connector":[["impl PartialOrd for PendingUnit"]], +"types":[["impl PartialOrd for WorkerId"],["impl PartialOrd for DealId"],["impl PartialOrd for PeerScope"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/convert/trait.AsRef.js b/trait.impl/core/convert/trait.AsRef.js new file mode 100644 index 0000000000..24d2ae1c3c --- /dev/null +++ b/trait.impl/core/convert/trait.AsRef.js @@ -0,0 +1,4 @@ +(function() {var implementors = { +"nox":[["impl AsRef<ConnectionPoolApi> for Connectivity"],["impl AsRef<KademliaApi> for Connectivity"]], +"particle_protocol":[["impl AsRef<Particle> for ExtendedParticle"],["impl AsRef<str> for ExtendedParticle"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/convert/trait.From.js b/trait.impl/core/convert/trait.From.js new file mode 100644 index 0000000000..4cd5791eca --- /dev/null +++ b/trait.impl/core/convert/trait.From.js @@ -0,0 +1,18 @@ +(function() {var implementors = { +"aquamarine":[["impl From<VaultError> for DataStoreError"]], +"chain_connector":[["impl From<ComputeUnit> for PendingUnit"],["impl From<CCStatus> for u8"],["impl From<Status> for u8"],["impl From<FromHexError> for ConnectorError"],["impl From<Error> for ConnectorError"],["impl From<FromHexError> for ConnectorError"],["impl From<Error> for ConnectorError"],["impl From<Error> for ConnectorError"],["impl From<FromUtf8Error> for ConnectorError"],["impl From<Error> for ConnectorError"],["impl From<ErrorObject<'static>> for ConnectorError"],["impl From<ChainDataError> for ConnectorError"],["impl From<Error> for ConnectorError"]], +"chain_data":[["impl From<ChainDataError> for LogParseError"],["impl From<Error> for LogParseError"],["impl From<ParseError> for LogParseError"],["impl From<ParseError> for ChainDataError"],["impl From<Error> for ChainDataError"],["impl From<FromHexError> for LogParseError"],["impl From<FromHexError> for LogParseError"]], +"chain_listener":[["impl From<&UnitActivated> for LogData"],["impl From<&ComputeUnitMatched> for LogData"],["impl From<&UnitDeactivated> for LogData"],["impl From<UnitActivated> for PendingUnit"],["impl From<&CommitmentActivated> for LogData"]], +"connected_client":[["impl From<ClientCommand> for Particle"]], +"core_distributor":[["impl From<PersistError> for LoadingError"],["impl From<Utf8Error> for LoadingError"],["impl From<CreateError> for LoadingError"],["impl From<Error> for PersistError"],["impl From<Error> for PersistError"],["impl From<Error> for LoadingError"],["impl From<Error> for LoadingError"]], +"created_swarm":[["impl From<NetworkKey> for [u8; 32]"],["impl From<[u8; 32]> for NetworkKey"]], +"kademlia":[["impl From<KademliaConfig> for Config"]], +"particle_args":[["impl From<JError> for Value"],["impl From<ArgsError> for Value"],["impl<E: Error> From<E> for JError"]], +"particle_execution":[["impl From<Box<dyn FnMut(Args, ParticleParams) -> Pin<Box<dyn Future<Output = FunctionOutcome> + Send>> + Sync + Send>> for ServiceFunction"],["impl<E: Error> From<E> for FunctionOutcome"],["impl From<Box<dyn Fn(Args, ParticleParams) -> Pin<Box<dyn Future<Output = FunctionOutcome> + Send>> + Sync + Send>> for ServiceFunction"]], +"particle_modules":[["impl From<Report> for ModuleError"],["impl From<DecodeError> for ModuleError"],["impl From<ModuleInfoError> for ModuleError"],["impl From<ModuleError> for Value"],["impl From<VaultError> for ModuleError"]], +"particle_protocol":[["impl<OutProto: OutboundUpgradeSend, OutEvent> From<ProtocolConfig> for OneShotHandler<ProtocolConfig, OutProto, OutEvent>"],["impl From<ProtocolMessage> for HandlerMessage"],["impl From<()> for HandlerMessage"]], +"particle_services":[["impl From<ServiceError> for Value"],["impl From<AppServiceError> for ServiceError"],["impl From<VaultError> for ServiceError"],["impl From<WasmBackendConfig> for WasmtimeConfig"],["impl From<ModuleError> for ServiceError"],["impl From<ArgsError> for ServiceError"]], +"spell_event_bus":[["impl From<LifecycleEvent> for PeerEvent"],["impl From<TriggerInfoAqua> for TriggerInfo"],["impl From<TriggerInfo> for TriggerInfoAqua"]], +"types":[["impl From<&str> for DealId"],["impl From<DealId> for String"],["impl From<PeerId> for WorkerId"],["impl From<WorkerId> for PeerId"],["impl From<String> for DealId"],["impl From<&DealId> for String"]], +"workers":[["impl From<VmError> for WorkersError"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/convert/trait.TryFrom.js b/trait.impl/core/convert/trait.TryFrom.js new file mode 100644 index 0000000000..dd8b5c9991 --- /dev/null +++ b/trait.impl/core/convert/trait.TryFrom.js @@ -0,0 +1,6 @@ +(function() {var implementors = { +"chain_connector":[["impl TryFrom<u8> for Status"],["impl TryFrom<u8> for CCStatus"]], +"core_distributor":[["impl TryFrom<&[usize]> for CoreRange"]], +"particle_args":[["impl TryFrom<CallRequestParams> for Args"]], +"server_config":[["impl TryFrom<&Network> for StreamProtocol"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/default/trait.Default.js b/trait.impl/core/default/trait.Default.js new file mode 100644 index 0000000000..eee0181fd6 --- /dev/null +++ b/trait.impl/core/default/trait.Default.js @@ -0,0 +1,11 @@ +(function() {var implementors = { +"core_distributor":[["impl Default for CoreRange"],["impl Default for DummyCoreDistibutor"]], +"health":[["impl Default for HealthCheckRegistry"]], +"log_format":[["impl Default for Format<SystemTime>"]], +"log_utils":[["impl Default for LogSpec"]], +"particle_modules":[["impl Default for EffectorsMode"]], +"particle_protocol":[["impl Default for CompletionChannel"],["impl Default for ProtocolConfig"],["impl Default for SendStatus"],["impl Default for Particle"]], +"particle_services":[["impl Default for WasmBackendConfig"]], +"peer_metrics":[["impl Default for ServiceMemoryStat"]], +"server_config":[["impl Default for AquaIpfsConfig"],["impl Default for DeciderConfig"],["impl Default for SystemServicesConfig"],["impl Default for RegistryConfig"],["impl Default for ConnectorConfig"],["impl Default for Network"],["impl Default for BootstrapConfig"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/error/trait.Error.js b/trait.impl/core/error/trait.Error.js new file mode 100644 index 0000000000..e45a5eda40 --- /dev/null +++ b/trait.impl/core/error/trait.Error.js @@ -0,0 +1,17 @@ +(function() {var implementors = { +"aquamarine":[["impl Error for AquamarineApiError"],["impl Error for DataStoreError"]], +"chain_connector":[["impl Error for ConnectorError"]], +"chain_data":[["impl Error for ChainDataError"],["impl Error for LogParseError"]], +"core_distributor":[["impl Error for CreateError"],["impl Error for AcquireError"],["impl Error for LoadingError"],["impl Error for PersistError"]], +"fs_utils":[["impl Error for LoadDataError"]], +"kademlia":[["impl Error for KademliaError"]], +"particle_args":[["impl Error for ArgsError"]], +"particle_execution":[["impl Error for VaultError"]], +"particle_modules":[["impl Error for ModuleError"]], +"particle_protocol":[["impl Error for ParticleError"]], +"particle_services":[["impl Error for ServiceError"]], +"spell_event_bus":[["impl Error for ConfigError"],["impl Error for EventBusError"]], +"spell_service_api":[["impl Error for CallError"]], +"vm_utils":[["impl Error for VmError"]], +"workers":[["impl Error for WorkersError"],["impl Error for KeyStorageError"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/fmt/trait.Debug.js b/trait.impl/core/fmt/trait.Debug.js new file mode 100644 index 0000000000..50444988d3 --- /dev/null +++ b/trait.impl/core/fmt/trait.Debug.js @@ -0,0 +1,36 @@ +(function() {var implementors = { +"aquamarine":[["impl Debug for RemoteRoutingEffects"],["impl Debug for ParticleEffects"],["impl Debug for ParticleDataStore"],["impl Debug for InterpretationStats"],["impl Debug for AquamarineApiError"],["impl Debug for DataStoreError"],["impl Debug for VmPoolConfig"],["impl Debug for VmConfig"],["impl Debug for DataStoreConfig"]], +"chain_connector":[["impl Debug for ConnectorError"],["impl Debug for CommitmentId"],["impl Debug for ComputeUnit"],["impl Debug for PendingUnit"],["impl Debug for CCStatus"],["impl Debug for SubnetResolveResult"],["impl Debug for Status"]], +"chain_data":[["impl Debug for BlockHeader"],["impl Debug for Log"],["impl Debug for ChainDataError"],["impl Debug for LogParseError"],["impl Debug for EventField"]], +"chain_listener":[["impl Debug for UnitActivated"],["impl Debug for CommitmentActivated"],["impl Debug for UnitDeactivated"]], +"cid_utils":[["impl Debug for Hash"]], +"connected_client":[["impl Debug for ClientEvent"],["impl Debug for ClientCommand"]], +"connection_pool":[["impl Debug for ConnectionPoolApi"],["impl Debug for Command"],["impl Debug for LifecycleEvent"]], +"core_distributor":[["impl Debug for CurrentAssignment"],["impl Debug for Cores"],["impl Debug for PersistError"],["impl Debug for WorkType"],["impl Debug for AcquireError"],["impl Debug for Assignment"],["impl Debug for CoreRange"],["impl Debug for LoadingError"],["impl Debug for CreateError"],["impl Debug for AcquireRequest"]], +"created_swarm":[["impl Debug for NetworkKey"],["impl Debug for SwarmConfig"],["impl Debug for CreatedSwarm"]], +"fluence_libp2p":[["impl Debug for Transport"]], +"fs_utils":[["impl Debug for LoadDataError"]], +"health":[["impl Debug for HealthStatus"]], +"kademlia":[["impl Debug for KademliaConfig"],["impl Debug for KademliaError"],["impl Debug for Command"],["impl Debug for KademliaApi"]], +"local_vm":[["impl Debug for ClientFunctionsResult"],["impl Debug for Instruction"]], +"log_format":[["impl<T: Debug> Debug for Format<T>"]], +"nox":[["impl Debug for StartedHttp"],["impl Debug for FluenceNetworkBehaviourEventwhere\n Behaviour: NetworkBehaviour,\n Behaviour: NetworkBehaviour,\n Behaviour: NetworkBehaviour,\n ConnectionPoolBehaviour: NetworkBehaviour,\n Kademlia: NetworkBehaviour,\n <Behaviour as NetworkBehaviour>::ToSwarm: Debug,\n <Behaviour as NetworkBehaviour>::ToSwarm: Debug,\n <Behaviour as NetworkBehaviour>::ToSwarm: Debug,\n <ConnectionPoolBehaviour as NetworkBehaviour>::ToSwarm: Debug,\n <Kademlia as NetworkBehaviour>::ToSwarm: Debug,"],["impl Debug for Versions"]], +"particle_args":[["impl Debug for Args"],["impl Debug for ArgsError"],["impl Debug for JError"]], +"particle_builtins":[["impl<C> Debug for Builtins<C>where\n C: Debug,"],["impl Debug for BuiltinsConfig"],["impl Debug for NodeInfo"]], +"particle_execution":[["impl Debug for FunctionOutcome"],["impl Debug for ParticleVault"],["impl Debug for VaultError"],["impl Debug for ParticleParams"]], +"particle_modules":[["impl Debug for EffectorsMode"],["impl Debug for ModuleRepository"],["impl Debug for ModuleError"]], +"particle_protocol":[["impl Debug for Contact"],["impl Debug for SendStatus"],["impl Debug for ExtendedParticle"],["impl Debug for ParticleError"],["impl Debug for CompletionChannel"],["impl Debug for Particle"],["impl Debug for ProtocolConfig"],["impl Debug for ProtocolMessage"],["impl Debug for HandlerMessage"]], +"particle_services":[["impl Debug for WasmBackendConfig"],["impl Debug for ServiceType"],["impl Debug for ServiceInfo"],["impl Debug for ParticleAppServicesConfig"],["impl Debug for ParticleAppServices"],["impl Debug for ServiceError"]], +"peer_metrics":[["impl Debug for ServiceCallStats"],["impl Debug for WorkerType"],["impl Debug for Resolution"],["impl Debug for WorkerLabel"],["impl Debug for ServiceMemoryStat"],["impl Debug for ParticleLabel"],["impl Debug for ParticleType"],["impl Debug for ServiceType"],["impl Debug for ServicesMetrics"],["impl Debug for FunctionKind"]], +"server_config":[["impl Debug for SystemServicesConfig"],["impl Debug for ChainListenerConfig"],["impl Debug for EnabledSystemServices"],["impl Debug for TransportConfig"],["impl Debug for TracingConfig"],["impl Debug for DeciderConfig"],["impl Debug for ServiceKey"],["impl Debug for ResolvedConfig"],["impl Debug for Network"],["impl Debug for RegistryConfig"],["impl Debug for BootstrapConfig"],["impl Debug for DevModeArgs"],["impl Debug for KademliaConfig"],["impl Debug for NodeConfig"],["impl Debug for ChainConfig"],["impl Debug for ConnectorConfig"],["impl Debug for RootKeyPairArgs"],["impl Debug for TracingArgs"],["impl Debug for AquaIpfsConfig"],["impl Debug for TracingType"],["impl Debug for UnresolvedConfig"]], +"service_modules":[["impl Debug for Blueprint"],["impl Debug for AddBlueprint"]], +"sorcerer":[["impl Debug for SpellInfo"]], +"spell_event_bus":[["impl Debug for SpellEventBusApi"],["impl Debug for TriggerInfoAqua"],["impl Debug for TriggerInfo"],["impl Debug for TimerEvent"],["impl Debug for TriggerEvent"],["impl Debug for ConfigError"],["impl Debug for EventBusError"],["impl Debug for Action"],["impl Debug for PeerEventType"],["impl Debug for SpellTriggerConfigs"],["impl Debug for PeerEvent"]], +"spell_service_api":[["impl Debug for CallError"],["impl Debug for SpellServiceApi"]], +"spell_storage":[["impl Debug for SpellStorage"]], +"system_services":[["impl Debug for ServiceDistro"],["impl Debug for Deployment"],["impl Debug for ServiceStatus"],["impl Debug for SpellDistro"],["impl Debug for Versions"],["impl Debug for Deployer"],["impl Debug for SystemServiceDistros"],["impl Debug for PackageDistro"]], +"test_utils":[["impl Debug for RetStruct"],["impl Debug for CreatedService"]], +"types":[["impl Debug for DealId"],["impl Debug for PeerScope"],["impl Debug for WorkerId"]], +"vm_utils":[["impl Debug for VmError"],["impl Debug for VmStatus"],["impl Debug for CreateVMDomainParams"]], +"workers":[["impl Debug for WorkersError"],["impl Debug for Event"],["impl Debug for KeyStorageError"],["impl Debug for PeerScopes"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/fmt/trait.Display.js b/trait.impl/core/fmt/trait.Display.js new file mode 100644 index 0000000000..95a0401fd6 --- /dev/null +++ b/trait.impl/core/fmt/trait.Display.js @@ -0,0 +1,21 @@ +(function() {var implementors = { +"aquamarine":[["impl Display for DataStoreError"],["impl Display for AquamarineApiError"]], +"chain_connector":[["impl Display for ConnectorError"],["impl Display for CommitmentId"]], +"chain_data":[["impl Display for LogParseError"],["impl Display for ChainDataError"]], +"cid_utils":[["impl Display for Hash"]], +"connection_pool":[["impl Display for LifecycleEvent"]], +"core_distributor":[["impl Display for AcquireError"],["impl Display for CurrentAssignment"],["impl Display for PersistError"],["impl Display for LoadingError"],["impl Display for AcquireRequest"],["impl Display for CreateError"],["impl Display for CoreRange"]], +"fs_utils":[["impl Display for LoadDataError"]], +"kademlia":[["impl Display for KademliaError"]], +"particle_args":[["impl Display for ArgsError"],["impl Display for JError"]], +"particle_execution":[["impl Display for VaultError"]], +"particle_modules":[["impl Display for ModuleError"]], +"particle_protocol":[["impl Display for Contact"],["impl Display for ProtocolMessage"],["impl Display for ParticleError"],["impl Display for Particle"]], +"particle_services":[["impl Display for ServiceError"]], +"server_config":[["impl Display for ServiceKey"]], +"spell_event_bus":[["impl Display for ConfigError"],["impl Display for EventBusError"]], +"spell_service_api":[["impl Display for CallError"]], +"types":[["impl Display for WorkerId"],["impl Display for DealId"]], +"vm_utils":[["impl Display for VmError"],["impl Display for VmStatus"]], +"workers":[["impl Display for WorkersError"],["impl Display for KeyStorageError"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/hash/trait.Hash.js b/trait.impl/core/hash/trait.Hash.js new file mode 100644 index 0000000000..3a0bc5aff5 --- /dev/null +++ b/trait.impl/core/hash/trait.Hash.js @@ -0,0 +1,9 @@ +(function() {var implementors = { +"chain_connector":[["impl Hash for PendingUnit"],["impl Hash for CommitmentId"]], +"cid_utils":[["impl Hash for Hash"]], +"core_distributor":[["impl Hash for WorkType"]], +"peer_metrics":[["impl Hash for ServiceType"],["impl Hash for ParticleType"],["impl Hash for Resolution"],["impl Hash for ParticleLabel"],["impl Hash for WorkerLabel"],["impl Hash for FunctionKind"],["impl Hash for WorkerType"]], +"server_config":[["impl Hash for ServiceKey"]], +"spell_event_bus":[["impl Hash for PeerEventType"]], +"types":[["impl Hash for DealId"],["impl Hash for WorkerId"],["impl Hash for PeerScope"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/marker/trait.Copy.js b/trait.impl/core/marker/trait.Copy.js new file mode 100644 index 0000000000..9917924b19 --- /dev/null +++ b/trait.impl/core/marker/trait.Copy.js @@ -0,0 +1,8 @@ +(function() {var implementors = { +"chain_connector":[["impl Copy for CCStatus"],["impl Copy for Status"]], +"core_distributor":[["impl Copy for WorkType"]], +"fluence_libp2p":[["impl Copy for Transport"]], +"peer_metrics":[["impl Copy for WorkerType"],["impl Copy for FunctionKind"]], +"server_config":[["impl Copy for TransportConfig"]], +"types":[["impl Copy for WorkerId"],["impl Copy for PeerScope"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/marker/trait.Freeze.js b/trait.impl/core/marker/trait.Freeze.js new file mode 100644 index 0000000000..077cf24f4c --- /dev/null +++ b/trait.impl/core/marker/trait.Freeze.js @@ -0,0 +1,39 @@ +(function() {var implementors = { +"aquamarine":[["impl<RT, F> Freeze for AquamarineBackend<RT, F>where\n F: Freeze,\n <RT as AquaRuntime>::Config: Freeze,",1,["aquamarine::aquamarine::AquamarineBackend"]],["impl Freeze for AquamarineApi",1,["aquamarine::aquamarine::AquamarineApi"]],["impl Freeze for VmConfig",1,["aquamarine::config::VmConfig"]],["impl Freeze for VmPoolConfig",1,["aquamarine::config::VmPoolConfig"]],["impl Freeze for DataStoreConfig",1,["aquamarine::config::DataStoreConfig"]],["impl Freeze for AquamarineApiError",1,["aquamarine::error::AquamarineApiError"]],["impl Freeze for ParticleDataStore",1,["aquamarine::particle_data_store::ParticleDataStore"]],["impl Freeze for DataStoreError",1,["aquamarine::particle_data_store::DataStoreError"]],["impl<RT, F> Freeze for Plumber<RT, F>where\n F: Freeze,\n <RT as AquaRuntime>::Config: Freeze,",1,["aquamarine::plumber::Plumber"]],["impl Freeze for ParticleEffects",1,["aquamarine::particle_effects::ParticleEffects"]],["impl Freeze for InterpretationStats",1,["aquamarine::particle_effects::InterpretationStats"]],["impl Freeze for RemoteRoutingEffects",1,["aquamarine::particle_effects::RemoteRoutingEffects"]]], +"chain_connector":[["impl Freeze for HttpChainConnector",1,["chain_connector::connector::HttpChainConnector"]],["impl Freeze for ConnectorError",1,["chain_connector::error::ConnectorError"]],["impl Freeze for TooManyProofs",1,["chain_connector::function::capacity::Capacity::TooManyProofs"]],["impl Freeze for CapacityCommitmentIsNotActive",1,["chain_connector::function::capacity::Capacity::CapacityCommitmentIsNotActive"]],["impl Freeze for getGlobalNonceCall",1,["chain_connector::function::capacity::Capacity::getGlobalNonceCall"]],["impl Freeze for getGlobalNonceReturn",1,["chain_connector::function::capacity::Capacity::getGlobalNonceReturn"]],["impl Freeze for getStatusCall",1,["chain_connector::function::capacity::Capacity::getStatusCall"]],["impl Freeze for getStatusReturn",1,["chain_connector::function::capacity::Capacity::getStatusReturn"]],["impl Freeze for submitProofCall",1,["chain_connector::function::capacity::Capacity::submitProofCall"]],["impl Freeze for submitProofReturn",1,["chain_connector::function::capacity::Capacity::submitProofReturn"]],["impl Freeze for submitProofsCall",1,["chain_connector::function::capacity::Capacity::submitProofsCall"]],["impl Freeze for submitProofsReturn",1,["chain_connector::function::capacity::Capacity::submitProofsReturn"]],["impl Freeze for CapacityCalls",1,["chain_connector::function::capacity::Capacity::CapacityCalls"]],["impl Freeze for CapacityErrors",1,["chain_connector::function::capacity::Capacity::CapacityErrors"]],["impl Freeze for CCStatus",1,["chain_connector::function::capacity::CCStatus"]],["impl Freeze for CommitmentId",1,["chain_connector::function::capacity::CommitmentId"]],["impl Freeze for capacityCall",1,["chain_connector::function::core::Core::capacityCall"]],["impl Freeze for capacityReturn",1,["chain_connector::function::core::Core::capacityReturn"]],["impl Freeze for marketCall",1,["chain_connector::function::core::Core::marketCall"]],["impl Freeze for marketReturn",1,["chain_connector::function::core::Core::marketReturn"]],["impl Freeze for currentEpochCall",1,["chain_connector::function::core::Core::currentEpochCall"]],["impl Freeze for currentEpochReturn",1,["chain_connector::function::core::Core::currentEpochReturn"]],["impl Freeze for epochDurationCall",1,["chain_connector::function::core::Core::epochDurationCall"]],["impl Freeze for epochDurationReturn",1,["chain_connector::function::core::Core::epochDurationReturn"]],["impl Freeze for initTimestampCall",1,["chain_connector::function::core::Core::initTimestampCall"]],["impl Freeze for initTimestampReturn",1,["chain_connector::function::core::Core::initTimestampReturn"]],["impl Freeze for difficultyCall",1,["chain_connector::function::core::Core::difficultyCall"]],["impl Freeze for difficultyReturn",1,["chain_connector::function::core::Core::difficultyReturn"]],["impl Freeze for minProofsPerEpochCall",1,["chain_connector::function::core::Core::minProofsPerEpochCall"]],["impl Freeze for minProofsPerEpochReturn",1,["chain_connector::function::core::Core::minProofsPerEpochReturn"]],["impl Freeze for maxProofsPerEpochCall",1,["chain_connector::function::core::Core::maxProofsPerEpochCall"]],["impl Freeze for maxProofsPerEpochReturn",1,["chain_connector::function::core::Core::maxProofsPerEpochReturn"]],["impl Freeze for CoreCalls",1,["chain_connector::function::core::Core::CoreCalls"]],["impl Freeze for CIDV1",1,["chain_connector::function::deal::Deal::CIDV1"]],["impl Freeze for Status",1,["chain_connector::function::deal::Deal::Status"]],["impl Freeze for ComputeUnit",1,["chain_connector::function::deal::Deal::ComputeUnit"]],["impl Freeze for getStatusCall",1,["chain_connector::function::deal::Deal::getStatusCall"]],["impl Freeze for getStatusReturn",1,["chain_connector::function::deal::Deal::getStatusReturn"]],["impl Freeze for appCIDCall",1,["chain_connector::function::deal::Deal::appCIDCall"]],["impl Freeze for appCIDReturn",1,["chain_connector::function::deal::Deal::appCIDReturn"]],["impl Freeze for setWorkerCall",1,["chain_connector::function::deal::Deal::setWorkerCall"]],["impl Freeze for setWorkerReturn",1,["chain_connector::function::deal::Deal::setWorkerReturn"]],["impl Freeze for getComputeUnitsCall",1,["chain_connector::function::deal::Deal::getComputeUnitsCall"]],["impl Freeze for getComputeUnitsReturn",1,["chain_connector::function::deal::Deal::getComputeUnitsReturn"]],["impl Freeze for DealCalls",1,["chain_connector::function::deal::Deal::DealCalls"]],["impl Freeze for ComputePeer",1,["chain_connector::function::offer::Offer::ComputePeer"]],["impl Freeze for ComputeUnit",1,["chain_connector::function::offer::Offer::ComputeUnit"]],["impl Freeze for getComputePeerCall",1,["chain_connector::function::offer::Offer::getComputePeerCall"]],["impl Freeze for getComputePeerReturn",1,["chain_connector::function::offer::Offer::getComputePeerReturn"]],["impl Freeze for getComputeUnitsCall",1,["chain_connector::function::offer::Offer::getComputeUnitsCall"]],["impl Freeze for getComputeUnitsReturn",1,["chain_connector::function::offer::Offer::getComputeUnitsReturn"]],["impl Freeze for returnComputeUnitFromDealCall",1,["chain_connector::function::offer::Offer::returnComputeUnitFromDealCall"]],["impl Freeze for returnComputeUnitFromDealReturn",1,["chain_connector::function::offer::Offer::returnComputeUnitFromDealReturn"]],["impl Freeze for OfferCalls",1,["chain_connector::function::offer::Offer::OfferCalls"]],["impl Freeze for PendingUnit",1,["chain_connector::function::offer::PendingUnit"]],["impl Freeze for SubnetResolveResult",1,["chain_connector::types::SubnetResolveResult"]],["impl Freeze for CCInitParams",1,["chain_connector::types::CCInitParams"]]], +"chain_data":[["impl Freeze for BlockHeader",1,["chain_data::block_header::BlockHeader"]],["impl Freeze for EventField",1,["chain_data::chain_data::EventField"]],["impl Freeze for ChainDataError",1,["chain_data::error::ChainDataError"]],["impl Freeze for Log",1,["chain_data::log::Log"]],["impl Freeze for LogParseError",1,["chain_data::log::LogParseError"]]], +"chain_listener":[["impl Freeze for CommitmentActivated",1,["chain_listener::event::cc_activated::CommitmentActivated"]],["impl Freeze for CIDV1",1,["chain_listener::event::compute_unit_matched::CIDV1"]],["impl Freeze for ComputeUnitMatched",1,["chain_listener::event::compute_unit_matched::ComputeUnitMatched"]],["impl Freeze for UnitActivated",1,["chain_listener::event::unit_activated::UnitActivated"]],["impl Freeze for UnitDeactivated",1,["chain_listener::event::unit_deactivated::UnitDeactivated"]],["impl !Freeze for ChainListener",1,["chain_listener::listener::ChainListener"]]], +"cid_utils":[["impl Freeze for Hash",1,["cid_utils::hash::Hash"]]], +"connected_client":[["impl Freeze for ClientCommand",1,["connected_client::command::ClientCommand"]],["impl !Freeze for ConnectedClient",1,["connected_client::connected_client::ConnectedClient"]],["impl Freeze for ClientEvent",1,["connected_client::event::ClientEvent"]]], +"connection_pool":[["impl Freeze for Command",1,["connection_pool::api::Command"]],["impl Freeze for ConnectionPoolApi",1,["connection_pool::api::ConnectionPoolApi"]],["impl Freeze for ConnectionPoolBehaviour",1,["connection_pool::behaviour::ConnectionPoolBehaviour"]],["impl Freeze for LifecycleEvent",1,["connection_pool::connection_pool::LifecycleEvent"]]], +"core_distributor":[["impl Freeze for CreateError",1,["core_distributor::errors::CreateError"]],["impl Freeze for LoadingError",1,["core_distributor::errors::LoadingError"]],["impl Freeze for PersistError",1,["core_distributor::errors::PersistError"]],["impl Freeze for CurrentAssignment",1,["core_distributor::errors::CurrentAssignment"]],["impl Freeze for AcquireError",1,["core_distributor::errors::AcquireError"]],["impl Freeze for WorkType",1,["core_distributor::types::WorkType"]],["impl Freeze for AcquireRequest",1,["core_distributor::types::AcquireRequest"]],["impl Freeze for Cores",1,["core_distributor::types::Cores"]],["impl Freeze for Assignment",1,["core_distributor::types::Assignment"]],["impl Freeze for SystemAssignment",1,["core_distributor::types::SystemAssignment"]],["impl Freeze for CoreRange",1,["core_distributor::core_range::CoreRange"]],["impl !Freeze for PersistentCoreDistributor",1,["core_distributor::distributor::PersistentCoreDistributor"]],["impl Freeze for PersistenceTask",1,["core_distributor::persistence::PersistenceTask"]],["impl Freeze for AcquireStrategy",1,["core_distributor::strategy::AcquireStrategy"]],["impl Freeze for DummyCoreDistibutor",1,["core_distributor::dummy::DummyCoreDistibutor"]]], +"created_swarm":[["impl Freeze for CreatedSwarm",1,["created_swarm::swarm::CreatedSwarm"]],["impl Freeze for NetworkKey",1,["created_swarm::swarm::NetworkKey"]],["impl Freeze for SwarmConfig",1,["created_swarm::swarm::SwarmConfig"]],["impl Freeze for BaseVmConfig",1,["created_swarm::swarm::BaseVmConfig"]]], +"fluence_libp2p":[["impl Freeze for RandomPeerId",1,["fluence_libp2p::random_peer_id::RandomPeerId"]],["impl Freeze for Transport",1,["fluence_libp2p::transport::Transport"]]], +"fs_utils":[["impl Freeze for LoadDataError",1,["fs_utils::LoadDataError"]]], +"health":[["impl Freeze for HealthCheckRegistry",1,["health::HealthCheckRegistry"]],["impl Freeze for HealthStatus",1,["health::HealthStatus"]]], +"hex_utils":[["impl Freeze for Hex",1,["hex_utils::serde_as::Hex"]]], +"kademlia":[["impl Freeze for Command",1,["kademlia::api::Command"]],["impl Freeze for KademliaApi",1,["kademlia::api::KademliaApi"]],["impl Freeze for KademliaConfig",1,["kademlia::behaviour::KademliaConfig"]],["impl Freeze for Kademlia",1,["kademlia::behaviour::Kademlia"]],["impl Freeze for KademliaError",1,["kademlia::error::KademliaError"]]], +"local_vm":[["impl Freeze for Instruction",1,["local_vm::local_vm::Instruction"]],["impl Freeze for ClientFunctionsResult",1,["local_vm::local_vm::ClientFunctionsResult"]]], +"log_format":[["impl<T> Freeze for Format<T>where\n T: Freeze,",1,["log_format::Format"]]], +"log_utils":[["impl Freeze for LogSpec",1,["log_utils::LogSpec"]]], +"nox":[["impl Freeze for Connectivity",1,["nox::connectivity::Connectivity"]],["impl Freeze for StartedHttp",1,["nox::http::StartedHttp"]],["impl<RT> !Freeze for Node<RT>",1,["nox::node::Node"]],["impl Freeze for FluenceNetworkBehaviour",1,["nox::behaviour::network::FluenceNetworkBehaviour"]],["impl Freeze for FluenceNetworkBehaviourEvent",1,["nox::behaviour::network::FluenceNetworkBehaviourEvent"]],["impl Freeze for Versions",1,["nox::Versions"]]], +"particle_args":[["impl Freeze for Args",1,["particle_args::args::Args"]],["impl Freeze for ArgsError",1,["particle_args::args_error::ArgsError"]],["impl Freeze for JError",1,["particle_args::args_error::JError"]]], +"particle_builtins":[["impl !Freeze for CustomService",1,["particle_builtins::builtins::CustomService"]],["impl<C> !Freeze for Builtins<C>",1,["particle_builtins::builtins::Builtins"]],["impl Freeze for BuiltinsConfig",1,["particle_builtins::builtins::BuiltinsConfig"]],["impl Freeze for NodeInfo",1,["particle_builtins::identify::NodeInfo"]]], +"particle_execution":[["impl Freeze for FunctionOutcome",1,["particle_execution::function_outcome::FunctionOutcome"]],["impl !Freeze for ServiceFunction",1,["particle_execution::particle_function::ServiceFunction"]],["impl Freeze for ParticleParams",1,["particle_execution::particle_params::ParticleParams"]],["impl Freeze for ParticleVault",1,["particle_execution::particle_vault::ParticleVault"]],["impl Freeze for VaultError",1,["particle_execution::particle_vault::VaultError"]]], +"particle_modules":[["impl Freeze for ModuleError",1,["particle_modules::error::ModuleError"]],["impl Freeze for EffectorsMode",1,["particle_modules::modules::EffectorsMode"]],["impl Freeze for ModuleRepository",1,["particle_modules::modules::ModuleRepository"]]], +"particle_protocol":[["impl Freeze for SendStatus",1,["particle_protocol::libp2p_protocol::message::SendStatus"]],["impl Freeze for CompletionChannel",1,["particle_protocol::libp2p_protocol::message::CompletionChannel"]],["impl Freeze for HandlerMessage",1,["particle_protocol::libp2p_protocol::message::HandlerMessage"]],["impl Freeze for ProtocolMessage",1,["particle_protocol::libp2p_protocol::message::ProtocolMessage"]],["impl Freeze for ProtocolConfig",1,["particle_protocol::libp2p_protocol::upgrade::ProtocolConfig"]],["impl Freeze for Contact",1,["particle_protocol::contact::Contact"]],["impl Freeze for ParticleError",1,["particle_protocol::error::ParticleError"]],["impl Freeze for ExtendedParticle",1,["particle_protocol::particle::ExtendedParticle"]],["impl Freeze for Particle",1,["particle_protocol::particle::Particle"]]], +"particle_services":[["impl Freeze for ServiceType",1,["particle_services::app_services::ServiceType"]],["impl Freeze for ServiceInfo",1,["particle_services::app_services::ServiceInfo"]],["impl Freeze for ParticleAppServices",1,["particle_services::app_services::ParticleAppServices"]],["impl Freeze for ServiceError",1,["particle_services::error::ServiceError"]],["impl Freeze for ParticleAppServicesConfig",1,["particle_services::config::ParticleAppServicesConfig"]],["impl Freeze for WasmBackendConfig",1,["particle_services::config::WasmBackendConfig"]]], +"peer_metrics":[["impl Freeze for ChainListenerMetrics",1,["peer_metrics::chain_listener::ChainListenerMetrics"]],["impl Freeze for ConnectionPoolMetrics",1,["peer_metrics::connection_pool::ConnectionPoolMetrics"]],["impl Freeze for Resolution",1,["peer_metrics::connectivity::Resolution"]],["impl Freeze for ConnectivityMetrics",1,["peer_metrics::connectivity::ConnectivityMetrics"]],["impl Freeze for DispatcherMetrics",1,["peer_metrics::dispatcher::DispatcherMetrics"]],["impl Freeze for FunctionKind",1,["peer_metrics::particle_executor::FunctionKind"]],["impl Freeze for ParticleExecutorMetrics",1,["peer_metrics::particle_executor::ParticleExecutorMetrics"]],["impl Freeze for WorkerLabel",1,["peer_metrics::particle_executor::WorkerLabel"]],["impl Freeze for WorkerType",1,["peer_metrics::particle_executor::WorkerType"]],["impl Freeze for ServicesMetricsBackend",1,["peer_metrics::services_metrics::backend::ServicesMetricsBackend"]],["impl Freeze for ServicesMetricsBuiltin",1,["peer_metrics::services_metrics::builtin::ServicesMetricsBuiltin"]],["impl Freeze for ServiceType",1,["peer_metrics::services_metrics::external::ServiceType"]],["impl Freeze for ServicesMetricsExternal",1,["peer_metrics::services_metrics::external::ServicesMetricsExternal"]],["impl Freeze for ServiceCallStats",1,["peer_metrics::services_metrics::message::ServiceCallStats"]],["impl Freeze for ServiceMemoryStat",1,["peer_metrics::services_metrics::message::ServiceMemoryStat"]],["impl Freeze for ServicesMetrics",1,["peer_metrics::services_metrics::ServicesMetrics"]],["impl Freeze for SpellMetrics",1,["peer_metrics::spell_metrics::SpellMetrics"]],["impl Freeze for VmPoolMetrics",1,["peer_metrics::vm_pool::VmPoolMetrics"]],["impl Freeze for ParticleType",1,["peer_metrics::ParticleType"]],["impl Freeze for ParticleLabel",1,["peer_metrics::ParticleLabel"]]], +"server_config":[["impl Freeze for RootKeyPairArgs",1,["server_config::args::RootKeyPairArgs"]],["impl Freeze for TracingArgs",1,["server_config::args::TracingArgs"]],["impl Freeze for TracingType",1,["server_config::args::TracingType"]],["impl Freeze for EnabledSystemServices",1,["server_config::args::EnabledSystemServices"]],["impl Freeze for DevModeArgs",1,["server_config::args::DevModeArgs"]],["impl Freeze for BootstrapConfig",1,["server_config::bootstrap_config::BootstrapConfig"]],["impl Freeze for KademliaConfig",1,["server_config::kademlia_config::KademliaConfig"]],["impl Freeze for NetworkConfig",1,["server_config::network_config::NetworkConfig"]],["impl Freeze for Network",1,["server_config::node_config::Network"]],["impl Freeze for NodeConfig",1,["server_config::node_config::NodeConfig"]],["impl Freeze for TransportConfig",1,["server_config::node_config::TransportConfig"]],["impl Freeze for ChainConfig",1,["server_config::node_config::ChainConfig"]],["impl Freeze for ChainListenerConfig",1,["server_config::node_config::ChainListenerConfig"]],["impl Freeze for UnresolvedConfig",1,["server_config::resolved_config::UnresolvedConfig"]],["impl Freeze for TracingConfig",1,["server_config::resolved_config::TracingConfig"]],["impl Freeze for ResolvedConfig",1,["server_config::resolved_config::ResolvedConfig"]],["impl Freeze for ConfigData",1,["server_config::resolved_config::ConfigData"]],["impl Freeze for ServiceKey",1,["server_config::system_services_config::ServiceKey"]],["impl Freeze for SystemServicesConfig",1,["server_config::system_services_config::SystemServicesConfig"]],["impl Freeze for AquaIpfsConfig",1,["server_config::system_services_config::AquaIpfsConfig"]],["impl Freeze for ConnectorConfig",1,["server_config::system_services_config::ConnectorConfig"]],["impl Freeze for DeciderConfig",1,["server_config::system_services_config::DeciderConfig"]],["impl Freeze for RegistryConfig",1,["server_config::system_services_config::RegistryConfig"]]], +"service_modules":[["impl Freeze for AddBlueprint",1,["service_modules::modules::blueprint::AddBlueprint"]],["impl Freeze for Blueprint",1,["service_modules::modules::blueprint::Blueprint"]]], +"sorcerer":[["impl Freeze for Sorcerer",1,["sorcerer::sorcerer::Sorcerer"]],["impl Freeze for SpellInfo",1,["sorcerer::spell_builtins::SpellInfo"]]], +"spell_event_bus":[["impl Freeze for TriggerEvent",1,["spell_event_bus::api::TriggerEvent"]],["impl Freeze for TriggerInfo",1,["spell_event_bus::api::TriggerInfo"]],["impl Freeze for TimerEvent",1,["spell_event_bus::api::TimerEvent"]],["impl Freeze for PeerEvent",1,["spell_event_bus::api::PeerEvent"]],["impl Freeze for PeerEventType",1,["spell_event_bus::api::PeerEventType"]],["impl Freeze for TriggerInfoAqua",1,["spell_event_bus::api::TriggerInfoAqua"]],["impl Freeze for Action",1,["spell_event_bus::api::Action"]],["impl Freeze for EventBusError",1,["spell_event_bus::api::EventBusError"]],["impl Freeze for SpellEventBusApi",1,["spell_event_bus::api::SpellEventBusApi"]],["impl Freeze for ConfigError",1,["spell_event_bus::config::ConfigError"]],["impl Freeze for SpellTriggerConfigs",1,["spell_event_bus::config::SpellTriggerConfigs"]],["impl Freeze for SpellEventBus",1,["spell_event_bus::bus::SpellEventBus"]]], +"spell_service_api":[["impl Freeze for CallError",1,["spell_service_api::CallError"]],["impl Freeze for CallParams",1,["spell_service_api::CallParams"]],["impl Freeze for SpellServiceApi",1,["spell_service_api::SpellServiceApi"]]], +"spell_storage":[["impl Freeze for SpellStorage",1,["spell_storage::storage::SpellStorage"]]], +"system_services":[["impl Freeze for Deployer",1,["system_services::deployer::Deployer"]],["impl Freeze for Versions",1,["system_services::distro::Versions"]],["impl Freeze for SystemServiceDistros",1,["system_services::distro::SystemServiceDistros"]],["impl Freeze for Deployment",1,["system_services::Deployment"]],["impl Freeze for PackageDistro",1,["system_services::PackageDistro"]],["impl Freeze for ServiceDistro",1,["system_services::ServiceDistro"]],["impl Freeze for SpellDistro",1,["system_services::SpellDistro"]],["impl Freeze for ServiceStatus",1,["system_services::ServiceStatus"]]], +"test_utils":[["impl Freeze for DummyThreadPinner",1,["test_utils::pinning::DummyThreadPinner"]],["impl Freeze for CreatedService",1,["test_utils::service::CreatedService"]],["impl Freeze for RetStruct",1,["test_utils::utils::RetStruct"]]], +"toy_vms":[["impl Freeze for EasyVM",1,["toy_vms::easy_vm::EasyVM"]]], +"types":[["impl Freeze for DealId",1,["types::deal_id::DealId"]],["impl Freeze for PeerScope",1,["types::peer_scope::PeerScope"]],["impl Freeze for WorkerId",1,["types::peer_scope::WorkerId"]]], +"vm_utils":[["impl Freeze for CreateVMDomainParams",1,["vm_utils::vm_utils::CreateVMDomainParams"]],["impl Freeze for VmError",1,["vm_utils::vm_utils::VmError"]],["impl Freeze for VmStatus",1,["vm_utils::vm_utils::VmStatus"]]], +"workers":[["impl Freeze for KeyStorageError",1,["workers::error::KeyStorageError"]],["impl Freeze for WorkersError",1,["workers::error::WorkersError"]],["impl !Freeze for KeyStorage",1,["workers::key_storage::KeyStorage"]],["impl Freeze for PeerScopes",1,["workers::scope::PeerScopes"]],["impl Freeze for WorkerParams",1,["workers::workers::WorkerParams"]],["impl !Freeze for Workers",1,["workers::workers::Workers"]],["impl Freeze for Event",1,["workers::workers::Event"]],["impl Freeze for WorkersConfig",1,["workers::workers::WorkersConfig"]],["impl Freeze for VmConfig",1,["workers::workers::VmConfig"]]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/marker/trait.Send.js b/trait.impl/core/marker/trait.Send.js new file mode 100644 index 0000000000..7e94576558 --- /dev/null +++ b/trait.impl/core/marker/trait.Send.js @@ -0,0 +1,39 @@ +(function() {var implementors = { +"aquamarine":[["impl<RT, F> Send for AquamarineBackend<RT, F>where\n F: Send,",1,["aquamarine::aquamarine::AquamarineBackend"]],["impl Send for AquamarineApi",1,["aquamarine::aquamarine::AquamarineApi"]],["impl Send for VmConfig",1,["aquamarine::config::VmConfig"]],["impl Send for VmPoolConfig",1,["aquamarine::config::VmPoolConfig"]],["impl Send for DataStoreConfig",1,["aquamarine::config::DataStoreConfig"]],["impl Send for AquamarineApiError",1,["aquamarine::error::AquamarineApiError"]],["impl Send for ParticleDataStore",1,["aquamarine::particle_data_store::ParticleDataStore"]],["impl Send for DataStoreError",1,["aquamarine::particle_data_store::DataStoreError"]],["impl<RT, F> Send for Plumber<RT, F>where\n F: Send,",1,["aquamarine::plumber::Plumber"]],["impl Send for ParticleEffects",1,["aquamarine::particle_effects::ParticleEffects"]],["impl Send for InterpretationStats",1,["aquamarine::particle_effects::InterpretationStats"]],["impl Send for RemoteRoutingEffects",1,["aquamarine::particle_effects::RemoteRoutingEffects"]]], +"chain_connector":[["impl Send for HttpChainConnector",1,["chain_connector::connector::HttpChainConnector"]],["impl Send for ConnectorError",1,["chain_connector::error::ConnectorError"]],["impl Send for TooManyProofs",1,["chain_connector::function::capacity::Capacity::TooManyProofs"]],["impl Send for CapacityCommitmentIsNotActive",1,["chain_connector::function::capacity::Capacity::CapacityCommitmentIsNotActive"]],["impl Send for getGlobalNonceCall",1,["chain_connector::function::capacity::Capacity::getGlobalNonceCall"]],["impl Send for getGlobalNonceReturn",1,["chain_connector::function::capacity::Capacity::getGlobalNonceReturn"]],["impl Send for getStatusCall",1,["chain_connector::function::capacity::Capacity::getStatusCall"]],["impl Send for getStatusReturn",1,["chain_connector::function::capacity::Capacity::getStatusReturn"]],["impl Send for submitProofCall",1,["chain_connector::function::capacity::Capacity::submitProofCall"]],["impl Send for submitProofReturn",1,["chain_connector::function::capacity::Capacity::submitProofReturn"]],["impl Send for submitProofsCall",1,["chain_connector::function::capacity::Capacity::submitProofsCall"]],["impl Send for submitProofsReturn",1,["chain_connector::function::capacity::Capacity::submitProofsReturn"]],["impl Send for CapacityCalls",1,["chain_connector::function::capacity::Capacity::CapacityCalls"]],["impl Send for CapacityErrors",1,["chain_connector::function::capacity::Capacity::CapacityErrors"]],["impl Send for CCStatus",1,["chain_connector::function::capacity::CCStatus"]],["impl Send for CommitmentId",1,["chain_connector::function::capacity::CommitmentId"]],["impl Send for capacityCall",1,["chain_connector::function::core::Core::capacityCall"]],["impl Send for capacityReturn",1,["chain_connector::function::core::Core::capacityReturn"]],["impl Send for marketCall",1,["chain_connector::function::core::Core::marketCall"]],["impl Send for marketReturn",1,["chain_connector::function::core::Core::marketReturn"]],["impl Send for currentEpochCall",1,["chain_connector::function::core::Core::currentEpochCall"]],["impl Send for currentEpochReturn",1,["chain_connector::function::core::Core::currentEpochReturn"]],["impl Send for epochDurationCall",1,["chain_connector::function::core::Core::epochDurationCall"]],["impl Send for epochDurationReturn",1,["chain_connector::function::core::Core::epochDurationReturn"]],["impl Send for initTimestampCall",1,["chain_connector::function::core::Core::initTimestampCall"]],["impl Send for initTimestampReturn",1,["chain_connector::function::core::Core::initTimestampReturn"]],["impl Send for difficultyCall",1,["chain_connector::function::core::Core::difficultyCall"]],["impl Send for difficultyReturn",1,["chain_connector::function::core::Core::difficultyReturn"]],["impl Send for minProofsPerEpochCall",1,["chain_connector::function::core::Core::minProofsPerEpochCall"]],["impl Send for minProofsPerEpochReturn",1,["chain_connector::function::core::Core::minProofsPerEpochReturn"]],["impl Send for maxProofsPerEpochCall",1,["chain_connector::function::core::Core::maxProofsPerEpochCall"]],["impl Send for maxProofsPerEpochReturn",1,["chain_connector::function::core::Core::maxProofsPerEpochReturn"]],["impl Send for CoreCalls",1,["chain_connector::function::core::Core::CoreCalls"]],["impl Send for CIDV1",1,["chain_connector::function::deal::Deal::CIDV1"]],["impl Send for Status",1,["chain_connector::function::deal::Deal::Status"]],["impl Send for ComputeUnit",1,["chain_connector::function::deal::Deal::ComputeUnit"]],["impl Send for getStatusCall",1,["chain_connector::function::deal::Deal::getStatusCall"]],["impl Send for getStatusReturn",1,["chain_connector::function::deal::Deal::getStatusReturn"]],["impl Send for appCIDCall",1,["chain_connector::function::deal::Deal::appCIDCall"]],["impl Send for appCIDReturn",1,["chain_connector::function::deal::Deal::appCIDReturn"]],["impl Send for setWorkerCall",1,["chain_connector::function::deal::Deal::setWorkerCall"]],["impl Send for setWorkerReturn",1,["chain_connector::function::deal::Deal::setWorkerReturn"]],["impl Send for getComputeUnitsCall",1,["chain_connector::function::deal::Deal::getComputeUnitsCall"]],["impl Send for getComputeUnitsReturn",1,["chain_connector::function::deal::Deal::getComputeUnitsReturn"]],["impl Send for DealCalls",1,["chain_connector::function::deal::Deal::DealCalls"]],["impl Send for ComputePeer",1,["chain_connector::function::offer::Offer::ComputePeer"]],["impl Send for ComputeUnit",1,["chain_connector::function::offer::Offer::ComputeUnit"]],["impl Send for getComputePeerCall",1,["chain_connector::function::offer::Offer::getComputePeerCall"]],["impl Send for getComputePeerReturn",1,["chain_connector::function::offer::Offer::getComputePeerReturn"]],["impl Send for getComputeUnitsCall",1,["chain_connector::function::offer::Offer::getComputeUnitsCall"]],["impl Send for getComputeUnitsReturn",1,["chain_connector::function::offer::Offer::getComputeUnitsReturn"]],["impl Send for returnComputeUnitFromDealCall",1,["chain_connector::function::offer::Offer::returnComputeUnitFromDealCall"]],["impl Send for returnComputeUnitFromDealReturn",1,["chain_connector::function::offer::Offer::returnComputeUnitFromDealReturn"]],["impl Send for OfferCalls",1,["chain_connector::function::offer::Offer::OfferCalls"]],["impl Send for PendingUnit",1,["chain_connector::function::offer::PendingUnit"]],["impl Send for SubnetResolveResult",1,["chain_connector::types::SubnetResolveResult"]],["impl Send for CCInitParams",1,["chain_connector::types::CCInitParams"]]], +"chain_data":[["impl Send for BlockHeader",1,["chain_data::block_header::BlockHeader"]],["impl Send for EventField",1,["chain_data::chain_data::EventField"]],["impl Send for ChainDataError",1,["chain_data::error::ChainDataError"]],["impl Send for Log",1,["chain_data::log::Log"]],["impl Send for LogParseError",1,["chain_data::log::LogParseError"]]], +"chain_listener":[["impl Send for CommitmentActivated",1,["chain_listener::event::cc_activated::CommitmentActivated"]],["impl Send for CIDV1",1,["chain_listener::event::compute_unit_matched::CIDV1"]],["impl Send for ComputeUnitMatched",1,["chain_listener::event::compute_unit_matched::ComputeUnitMatched"]],["impl Send for UnitActivated",1,["chain_listener::event::unit_activated::UnitActivated"]],["impl Send for UnitDeactivated",1,["chain_listener::event::unit_deactivated::UnitDeactivated"]],["impl Send for ChainListener",1,["chain_listener::listener::ChainListener"]]], +"cid_utils":[["impl Send for Hash",1,["cid_utils::hash::Hash"]]], +"connected_client":[["impl Send for ClientCommand",1,["connected_client::command::ClientCommand"]],["impl Send for ConnectedClient",1,["connected_client::connected_client::ConnectedClient"]],["impl Send for ClientEvent",1,["connected_client::event::ClientEvent"]]], +"connection_pool":[["impl Send for Command",1,["connection_pool::api::Command"]],["impl Send for ConnectionPoolApi",1,["connection_pool::api::ConnectionPoolApi"]],["impl Send for ConnectionPoolBehaviour",1,["connection_pool::behaviour::ConnectionPoolBehaviour"]],["impl Send for LifecycleEvent",1,["connection_pool::connection_pool::LifecycleEvent"]]], +"core_distributor":[["impl Send for CreateError",1,["core_distributor::errors::CreateError"]],["impl Send for LoadingError",1,["core_distributor::errors::LoadingError"]],["impl Send for PersistError",1,["core_distributor::errors::PersistError"]],["impl Send for CurrentAssignment",1,["core_distributor::errors::CurrentAssignment"]],["impl Send for AcquireError",1,["core_distributor::errors::AcquireError"]],["impl Send for WorkType",1,["core_distributor::types::WorkType"]],["impl Send for AcquireRequest",1,["core_distributor::types::AcquireRequest"]],["impl Send for Cores",1,["core_distributor::types::Cores"]],["impl Send for Assignment",1,["core_distributor::types::Assignment"]],["impl Send for SystemAssignment",1,["core_distributor::types::SystemAssignment"]],["impl Send for CoreRange",1,["core_distributor::core_range::CoreRange"]],["impl Send for PersistentCoreDistributor",1,["core_distributor::distributor::PersistentCoreDistributor"]],["impl Send for PersistenceTask",1,["core_distributor::persistence::PersistenceTask"]],["impl Send for AcquireStrategy",1,["core_distributor::strategy::AcquireStrategy"]],["impl Send for DummyCoreDistibutor",1,["core_distributor::dummy::DummyCoreDistibutor"]]], +"created_swarm":[["impl Send for CreatedSwarm",1,["created_swarm::swarm::CreatedSwarm"]],["impl Send for NetworkKey",1,["created_swarm::swarm::NetworkKey"]],["impl Send for SwarmConfig",1,["created_swarm::swarm::SwarmConfig"]],["impl Send for BaseVmConfig",1,["created_swarm::swarm::BaseVmConfig"]]], +"fluence_libp2p":[["impl Send for RandomPeerId",1,["fluence_libp2p::random_peer_id::RandomPeerId"]],["impl Send for Transport",1,["fluence_libp2p::transport::Transport"]]], +"fs_utils":[["impl Send for LoadDataError",1,["fs_utils::LoadDataError"]]], +"health":[["impl Send for HealthCheckRegistry",1,["health::HealthCheckRegistry"]],["impl Send for HealthStatus",1,["health::HealthStatus"]]], +"hex_utils":[["impl Send for Hex",1,["hex_utils::serde_as::Hex"]]], +"kademlia":[["impl Send for Command",1,["kademlia::api::Command"]],["impl Send for KademliaApi",1,["kademlia::api::KademliaApi"]],["impl Send for KademliaConfig",1,["kademlia::behaviour::KademliaConfig"]],["impl Send for Kademlia",1,["kademlia::behaviour::Kademlia"]],["impl Send for KademliaError",1,["kademlia::error::KademliaError"]]], +"local_vm":[["impl Send for Instruction",1,["local_vm::local_vm::Instruction"]],["impl Send for ClientFunctionsResult",1,["local_vm::local_vm::ClientFunctionsResult"]]], +"log_format":[["impl<T> Send for Format<T>where\n T: Send,",1,["log_format::Format"]]], +"log_utils":[["impl Send for LogSpec",1,["log_utils::LogSpec"]]], +"nox":[["impl Send for Connectivity",1,["nox::connectivity::Connectivity"]],["impl Send for StartedHttp",1,["nox::http::StartedHttp"]],["impl<RT> Send for Node<RT>",1,["nox::node::Node"]],["impl Send for FluenceNetworkBehaviour",1,["nox::behaviour::network::FluenceNetworkBehaviour"]],["impl Send for FluenceNetworkBehaviourEvent",1,["nox::behaviour::network::FluenceNetworkBehaviourEvent"]],["impl Send for Versions",1,["nox::Versions"]]], +"particle_args":[["impl Send for Args",1,["particle_args::args::Args"]],["impl Send for ArgsError",1,["particle_args::args_error::ArgsError"]],["impl Send for JError",1,["particle_args::args_error::JError"]]], +"particle_builtins":[["impl Send for CustomService",1,["particle_builtins::builtins::CustomService"]],["impl<C> Send for Builtins<C>where\n C: Send,",1,["particle_builtins::builtins::Builtins"]],["impl Send for BuiltinsConfig",1,["particle_builtins::builtins::BuiltinsConfig"]],["impl Send for NodeInfo",1,["particle_builtins::identify::NodeInfo"]]], +"particle_execution":[["impl Send for FunctionOutcome",1,["particle_execution::function_outcome::FunctionOutcome"]],["impl Send for ServiceFunction",1,["particle_execution::particle_function::ServiceFunction"]],["impl Send for ParticleParams",1,["particle_execution::particle_params::ParticleParams"]],["impl Send for ParticleVault",1,["particle_execution::particle_vault::ParticleVault"]],["impl Send for VaultError",1,["particle_execution::particle_vault::VaultError"]]], +"particle_modules":[["impl Send for ModuleError",1,["particle_modules::error::ModuleError"]],["impl Send for EffectorsMode",1,["particle_modules::modules::EffectorsMode"]],["impl Send for ModuleRepository",1,["particle_modules::modules::ModuleRepository"]]], +"particle_protocol":[["impl Send for SendStatus",1,["particle_protocol::libp2p_protocol::message::SendStatus"]],["impl Send for CompletionChannel",1,["particle_protocol::libp2p_protocol::message::CompletionChannel"]],["impl Send for HandlerMessage",1,["particle_protocol::libp2p_protocol::message::HandlerMessage"]],["impl Send for ProtocolMessage",1,["particle_protocol::libp2p_protocol::message::ProtocolMessage"]],["impl Send for ProtocolConfig",1,["particle_protocol::libp2p_protocol::upgrade::ProtocolConfig"]],["impl Send for Contact",1,["particle_protocol::contact::Contact"]],["impl Send for ParticleError",1,["particle_protocol::error::ParticleError"]],["impl Send for ExtendedParticle",1,["particle_protocol::particle::ExtendedParticle"]],["impl Send for Particle",1,["particle_protocol::particle::Particle"]]], +"particle_services":[["impl Send for ServiceType",1,["particle_services::app_services::ServiceType"]],["impl Send for ServiceInfo",1,["particle_services::app_services::ServiceInfo"]],["impl Send for ParticleAppServices",1,["particle_services::app_services::ParticleAppServices"]],["impl Send for ServiceError",1,["particle_services::error::ServiceError"]],["impl Send for ParticleAppServicesConfig",1,["particle_services::config::ParticleAppServicesConfig"]],["impl Send for WasmBackendConfig",1,["particle_services::config::WasmBackendConfig"]]], +"peer_metrics":[["impl Send for ChainListenerMetrics",1,["peer_metrics::chain_listener::ChainListenerMetrics"]],["impl Send for ConnectionPoolMetrics",1,["peer_metrics::connection_pool::ConnectionPoolMetrics"]],["impl Send for Resolution",1,["peer_metrics::connectivity::Resolution"]],["impl Send for ConnectivityMetrics",1,["peer_metrics::connectivity::ConnectivityMetrics"]],["impl Send for DispatcherMetrics",1,["peer_metrics::dispatcher::DispatcherMetrics"]],["impl Send for FunctionKind",1,["peer_metrics::particle_executor::FunctionKind"]],["impl Send for ParticleExecutorMetrics",1,["peer_metrics::particle_executor::ParticleExecutorMetrics"]],["impl Send for WorkerLabel",1,["peer_metrics::particle_executor::WorkerLabel"]],["impl Send for WorkerType",1,["peer_metrics::particle_executor::WorkerType"]],["impl Send for ServicesMetricsBackend",1,["peer_metrics::services_metrics::backend::ServicesMetricsBackend"]],["impl Send for ServicesMetricsBuiltin",1,["peer_metrics::services_metrics::builtin::ServicesMetricsBuiltin"]],["impl Send for ServiceType",1,["peer_metrics::services_metrics::external::ServiceType"]],["impl Send for ServicesMetricsExternal",1,["peer_metrics::services_metrics::external::ServicesMetricsExternal"]],["impl Send for ServiceCallStats",1,["peer_metrics::services_metrics::message::ServiceCallStats"]],["impl Send for ServiceMemoryStat",1,["peer_metrics::services_metrics::message::ServiceMemoryStat"]],["impl Send for ServicesMetrics",1,["peer_metrics::services_metrics::ServicesMetrics"]],["impl Send for SpellMetrics",1,["peer_metrics::spell_metrics::SpellMetrics"]],["impl Send for VmPoolMetrics",1,["peer_metrics::vm_pool::VmPoolMetrics"]],["impl Send for ParticleType",1,["peer_metrics::ParticleType"]],["impl Send for ParticleLabel",1,["peer_metrics::ParticleLabel"]]], +"server_config":[["impl Send for RootKeyPairArgs",1,["server_config::args::RootKeyPairArgs"]],["impl Send for TracingArgs",1,["server_config::args::TracingArgs"]],["impl Send for TracingType",1,["server_config::args::TracingType"]],["impl Send for EnabledSystemServices",1,["server_config::args::EnabledSystemServices"]],["impl Send for DevModeArgs",1,["server_config::args::DevModeArgs"]],["impl Send for BootstrapConfig",1,["server_config::bootstrap_config::BootstrapConfig"]],["impl Send for KademliaConfig",1,["server_config::kademlia_config::KademliaConfig"]],["impl Send for NetworkConfig",1,["server_config::network_config::NetworkConfig"]],["impl Send for Network",1,["server_config::node_config::Network"]],["impl Send for NodeConfig",1,["server_config::node_config::NodeConfig"]],["impl Send for TransportConfig",1,["server_config::node_config::TransportConfig"]],["impl Send for ChainConfig",1,["server_config::node_config::ChainConfig"]],["impl Send for ChainListenerConfig",1,["server_config::node_config::ChainListenerConfig"]],["impl Send for UnresolvedConfig",1,["server_config::resolved_config::UnresolvedConfig"]],["impl Send for TracingConfig",1,["server_config::resolved_config::TracingConfig"]],["impl Send for ResolvedConfig",1,["server_config::resolved_config::ResolvedConfig"]],["impl Send for ConfigData",1,["server_config::resolved_config::ConfigData"]],["impl Send for ServiceKey",1,["server_config::system_services_config::ServiceKey"]],["impl Send for SystemServicesConfig",1,["server_config::system_services_config::SystemServicesConfig"]],["impl Send for AquaIpfsConfig",1,["server_config::system_services_config::AquaIpfsConfig"]],["impl Send for ConnectorConfig",1,["server_config::system_services_config::ConnectorConfig"]],["impl Send for DeciderConfig",1,["server_config::system_services_config::DeciderConfig"]],["impl Send for RegistryConfig",1,["server_config::system_services_config::RegistryConfig"]]], +"service_modules":[["impl Send for AddBlueprint",1,["service_modules::modules::blueprint::AddBlueprint"]],["impl Send for Blueprint",1,["service_modules::modules::blueprint::Blueprint"]]], +"sorcerer":[["impl Send for Sorcerer",1,["sorcerer::sorcerer::Sorcerer"]],["impl Send for SpellInfo",1,["sorcerer::spell_builtins::SpellInfo"]]], +"spell_event_bus":[["impl Send for TriggerEvent",1,["spell_event_bus::api::TriggerEvent"]],["impl Send for TriggerInfo",1,["spell_event_bus::api::TriggerInfo"]],["impl Send for TimerEvent",1,["spell_event_bus::api::TimerEvent"]],["impl Send for PeerEvent",1,["spell_event_bus::api::PeerEvent"]],["impl Send for PeerEventType",1,["spell_event_bus::api::PeerEventType"]],["impl Send for TriggerInfoAqua",1,["spell_event_bus::api::TriggerInfoAqua"]],["impl Send for Action",1,["spell_event_bus::api::Action"]],["impl Send for EventBusError",1,["spell_event_bus::api::EventBusError"]],["impl Send for SpellEventBusApi",1,["spell_event_bus::api::SpellEventBusApi"]],["impl Send for ConfigError",1,["spell_event_bus::config::ConfigError"]],["impl Send for SpellTriggerConfigs",1,["spell_event_bus::config::SpellTriggerConfigs"]],["impl Send for SpellEventBus",1,["spell_event_bus::bus::SpellEventBus"]]], +"spell_service_api":[["impl Send for CallError",1,["spell_service_api::CallError"]],["impl Send for CallParams",1,["spell_service_api::CallParams"]],["impl Send for SpellServiceApi",1,["spell_service_api::SpellServiceApi"]]], +"spell_storage":[["impl Send for SpellStorage",1,["spell_storage::storage::SpellStorage"]]], +"system_services":[["impl Send for Deployer",1,["system_services::deployer::Deployer"]],["impl Send for Versions",1,["system_services::distro::Versions"]],["impl Send for SystemServiceDistros",1,["system_services::distro::SystemServiceDistros"]],["impl Send for Deployment",1,["system_services::Deployment"]],["impl Send for PackageDistro",1,["system_services::PackageDistro"]],["impl Send for ServiceDistro",1,["system_services::ServiceDistro"]],["impl Send for SpellDistro",1,["system_services::SpellDistro"]],["impl Send for ServiceStatus",1,["system_services::ServiceStatus"]]], +"test_utils":[["impl Send for DummyThreadPinner",1,["test_utils::pinning::DummyThreadPinner"]],["impl Send for CreatedService",1,["test_utils::service::CreatedService"]],["impl Send for RetStruct",1,["test_utils::utils::RetStruct"]]], +"toy_vms":[["impl Send for EasyVM",1,["toy_vms::easy_vm::EasyVM"]]], +"types":[["impl Send for DealId",1,["types::deal_id::DealId"]],["impl Send for PeerScope",1,["types::peer_scope::PeerScope"]],["impl Send for WorkerId",1,["types::peer_scope::WorkerId"]]], +"vm_utils":[["impl Send for CreateVMDomainParams",1,["vm_utils::vm_utils::CreateVMDomainParams"]],["impl Send for VmError",1,["vm_utils::vm_utils::VmError"]],["impl Send for VmStatus",1,["vm_utils::vm_utils::VmStatus"]]], +"workers":[["impl Send for KeyStorageError",1,["workers::error::KeyStorageError"]],["impl Send for WorkersError",1,["workers::error::WorkersError"]],["impl Send for KeyStorage",1,["workers::key_storage::KeyStorage"]],["impl Send for PeerScopes",1,["workers::scope::PeerScopes"]],["impl Send for WorkerParams",1,["workers::workers::WorkerParams"]],["impl Send for Workers",1,["workers::workers::Workers"]],["impl Send for Event",1,["workers::workers::Event"]],["impl Send for WorkersConfig",1,["workers::workers::WorkersConfig"]],["impl Send for VmConfig",1,["workers::workers::VmConfig"]]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/marker/trait.StructuralEq.js b/trait.impl/core/marker/trait.StructuralEq.js new file mode 100644 index 0000000000..7ebd36fc28 --- /dev/null +++ b/trait.impl/core/marker/trait.StructuralEq.js @@ -0,0 +1,12 @@ +(function() {var implementors = { +"chain_connector":[["impl StructuralEq for Status"],["impl StructuralEq for PendingUnit"],["impl StructuralEq for CommitmentId"]], +"cid_utils":[["impl StructuralEq for Hash"]], +"core_distributor":[["impl StructuralEq for WorkType"],["impl StructuralEq for Assignment"],["impl StructuralEq for Cores"]], +"local_vm":[["impl StructuralEq for Instruction"]], +"particle_protocol":[["impl StructuralEq for Contact"]], +"particle_services":[["impl StructuralEq for ServiceType"]], +"peer_metrics":[["impl StructuralEq for WorkerLabel"],["impl StructuralEq for ServiceType"],["impl StructuralEq for FunctionKind"],["impl StructuralEq for ParticleLabel"],["impl StructuralEq for ParticleType"],["impl StructuralEq for WorkerType"],["impl StructuralEq for Resolution"]], +"server_config":[["impl StructuralEq for ServiceKey"]], +"spell_event_bus":[["impl StructuralEq for PeerEventType"]], +"types":[["impl StructuralEq for DealId"],["impl StructuralEq for PeerScope"],["impl StructuralEq for WorkerId"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/marker/trait.StructuralPartialEq.js b/trait.impl/core/marker/trait.StructuralPartialEq.js new file mode 100644 index 0000000000..25461d4e73 --- /dev/null +++ b/trait.impl/core/marker/trait.StructuralPartialEq.js @@ -0,0 +1,14 @@ +(function() {var implementors = { +"chain_connector":[["impl StructuralPartialEq for SubnetResolveResult"],["impl StructuralPartialEq for Status"],["impl StructuralPartialEq for PendingUnit"],["impl StructuralPartialEq for CommitmentId"],["impl StructuralPartialEq for CCStatus"]], +"chain_data":[["impl StructuralPartialEq for EventField"]], +"cid_utils":[["impl StructuralPartialEq for Hash"]], +"core_distributor":[["impl StructuralPartialEq for AcquireRequest"],["impl StructuralPartialEq for AcquireError"],["impl StructuralPartialEq for Cores"],["impl StructuralPartialEq for CoreRange"],["impl StructuralPartialEq for Assignment"],["impl StructuralPartialEq for CurrentAssignment"],["impl StructuralPartialEq for WorkType"]], +"health":[["impl StructuralPartialEq for HealthStatus"]], +"local_vm":[["impl StructuralPartialEq for Instruction"]], +"particle_protocol":[["impl StructuralPartialEq for ProtocolMessage"],["impl StructuralPartialEq for Particle"],["impl StructuralPartialEq for Contact"]], +"particle_services":[["impl StructuralPartialEq for ServiceType"]], +"peer_metrics":[["impl StructuralPartialEq for ServiceType"],["impl StructuralPartialEq for Resolution"],["impl StructuralPartialEq for WorkerLabel"],["impl StructuralPartialEq for ParticleLabel"],["impl StructuralPartialEq for FunctionKind"],["impl StructuralPartialEq for WorkerType"],["impl StructuralPartialEq for ParticleType"]], +"server_config":[["impl StructuralPartialEq for TracingConfig"],["impl StructuralPartialEq for Network"],["impl StructuralPartialEq for ServiceKey"]], +"spell_event_bus":[["impl StructuralPartialEq for PeerEventType"]], +"types":[["impl StructuralPartialEq for WorkerId"],["impl StructuralPartialEq for DealId"],["impl StructuralPartialEq for PeerScope"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/marker/trait.Sync.js b/trait.impl/core/marker/trait.Sync.js new file mode 100644 index 0000000000..aad716649a --- /dev/null +++ b/trait.impl/core/marker/trait.Sync.js @@ -0,0 +1,39 @@ +(function() {var implementors = { +"aquamarine":[["impl<RT, F> !Sync for AquamarineBackend<RT, F>",1,["aquamarine::aquamarine::AquamarineBackend"]],["impl Sync for AquamarineApi",1,["aquamarine::aquamarine::AquamarineApi"]],["impl Sync for VmConfig",1,["aquamarine::config::VmConfig"]],["impl Sync for VmPoolConfig",1,["aquamarine::config::VmPoolConfig"]],["impl Sync for DataStoreConfig",1,["aquamarine::config::DataStoreConfig"]],["impl Sync for AquamarineApiError",1,["aquamarine::error::AquamarineApiError"]],["impl Sync for ParticleDataStore",1,["aquamarine::particle_data_store::ParticleDataStore"]],["impl Sync for DataStoreError",1,["aquamarine::particle_data_store::DataStoreError"]],["impl<RT, F> !Sync for Plumber<RT, F>",1,["aquamarine::plumber::Plumber"]],["impl Sync for ParticleEffects",1,["aquamarine::particle_effects::ParticleEffects"]],["impl Sync for InterpretationStats",1,["aquamarine::particle_effects::InterpretationStats"]],["impl Sync for RemoteRoutingEffects",1,["aquamarine::particle_effects::RemoteRoutingEffects"]]], +"chain_connector":[["impl Sync for HttpChainConnector",1,["chain_connector::connector::HttpChainConnector"]],["impl Sync for ConnectorError",1,["chain_connector::error::ConnectorError"]],["impl Sync for TooManyProofs",1,["chain_connector::function::capacity::Capacity::TooManyProofs"]],["impl Sync for CapacityCommitmentIsNotActive",1,["chain_connector::function::capacity::Capacity::CapacityCommitmentIsNotActive"]],["impl Sync for getGlobalNonceCall",1,["chain_connector::function::capacity::Capacity::getGlobalNonceCall"]],["impl Sync for getGlobalNonceReturn",1,["chain_connector::function::capacity::Capacity::getGlobalNonceReturn"]],["impl Sync for getStatusCall",1,["chain_connector::function::capacity::Capacity::getStatusCall"]],["impl Sync for getStatusReturn",1,["chain_connector::function::capacity::Capacity::getStatusReturn"]],["impl Sync for submitProofCall",1,["chain_connector::function::capacity::Capacity::submitProofCall"]],["impl Sync for submitProofReturn",1,["chain_connector::function::capacity::Capacity::submitProofReturn"]],["impl Sync for submitProofsCall",1,["chain_connector::function::capacity::Capacity::submitProofsCall"]],["impl Sync for submitProofsReturn",1,["chain_connector::function::capacity::Capacity::submitProofsReturn"]],["impl Sync for CapacityCalls",1,["chain_connector::function::capacity::Capacity::CapacityCalls"]],["impl Sync for CapacityErrors",1,["chain_connector::function::capacity::Capacity::CapacityErrors"]],["impl Sync for CCStatus",1,["chain_connector::function::capacity::CCStatus"]],["impl Sync for CommitmentId",1,["chain_connector::function::capacity::CommitmentId"]],["impl Sync for capacityCall",1,["chain_connector::function::core::Core::capacityCall"]],["impl Sync for capacityReturn",1,["chain_connector::function::core::Core::capacityReturn"]],["impl Sync for marketCall",1,["chain_connector::function::core::Core::marketCall"]],["impl Sync for marketReturn",1,["chain_connector::function::core::Core::marketReturn"]],["impl Sync for currentEpochCall",1,["chain_connector::function::core::Core::currentEpochCall"]],["impl Sync for currentEpochReturn",1,["chain_connector::function::core::Core::currentEpochReturn"]],["impl Sync for epochDurationCall",1,["chain_connector::function::core::Core::epochDurationCall"]],["impl Sync for epochDurationReturn",1,["chain_connector::function::core::Core::epochDurationReturn"]],["impl Sync for initTimestampCall",1,["chain_connector::function::core::Core::initTimestampCall"]],["impl Sync for initTimestampReturn",1,["chain_connector::function::core::Core::initTimestampReturn"]],["impl Sync for difficultyCall",1,["chain_connector::function::core::Core::difficultyCall"]],["impl Sync for difficultyReturn",1,["chain_connector::function::core::Core::difficultyReturn"]],["impl Sync for minProofsPerEpochCall",1,["chain_connector::function::core::Core::minProofsPerEpochCall"]],["impl Sync for minProofsPerEpochReturn",1,["chain_connector::function::core::Core::minProofsPerEpochReturn"]],["impl Sync for maxProofsPerEpochCall",1,["chain_connector::function::core::Core::maxProofsPerEpochCall"]],["impl Sync for maxProofsPerEpochReturn",1,["chain_connector::function::core::Core::maxProofsPerEpochReturn"]],["impl Sync for CoreCalls",1,["chain_connector::function::core::Core::CoreCalls"]],["impl Sync for CIDV1",1,["chain_connector::function::deal::Deal::CIDV1"]],["impl Sync for Status",1,["chain_connector::function::deal::Deal::Status"]],["impl Sync for ComputeUnit",1,["chain_connector::function::deal::Deal::ComputeUnit"]],["impl Sync for getStatusCall",1,["chain_connector::function::deal::Deal::getStatusCall"]],["impl Sync for getStatusReturn",1,["chain_connector::function::deal::Deal::getStatusReturn"]],["impl Sync for appCIDCall",1,["chain_connector::function::deal::Deal::appCIDCall"]],["impl Sync for appCIDReturn",1,["chain_connector::function::deal::Deal::appCIDReturn"]],["impl Sync for setWorkerCall",1,["chain_connector::function::deal::Deal::setWorkerCall"]],["impl Sync for setWorkerReturn",1,["chain_connector::function::deal::Deal::setWorkerReturn"]],["impl Sync for getComputeUnitsCall",1,["chain_connector::function::deal::Deal::getComputeUnitsCall"]],["impl Sync for getComputeUnitsReturn",1,["chain_connector::function::deal::Deal::getComputeUnitsReturn"]],["impl Sync for DealCalls",1,["chain_connector::function::deal::Deal::DealCalls"]],["impl Sync for ComputePeer",1,["chain_connector::function::offer::Offer::ComputePeer"]],["impl Sync for ComputeUnit",1,["chain_connector::function::offer::Offer::ComputeUnit"]],["impl Sync for getComputePeerCall",1,["chain_connector::function::offer::Offer::getComputePeerCall"]],["impl Sync for getComputePeerReturn",1,["chain_connector::function::offer::Offer::getComputePeerReturn"]],["impl Sync for getComputeUnitsCall",1,["chain_connector::function::offer::Offer::getComputeUnitsCall"]],["impl Sync for getComputeUnitsReturn",1,["chain_connector::function::offer::Offer::getComputeUnitsReturn"]],["impl Sync for returnComputeUnitFromDealCall",1,["chain_connector::function::offer::Offer::returnComputeUnitFromDealCall"]],["impl Sync for returnComputeUnitFromDealReturn",1,["chain_connector::function::offer::Offer::returnComputeUnitFromDealReturn"]],["impl Sync for OfferCalls",1,["chain_connector::function::offer::Offer::OfferCalls"]],["impl Sync for PendingUnit",1,["chain_connector::function::offer::PendingUnit"]],["impl Sync for SubnetResolveResult",1,["chain_connector::types::SubnetResolveResult"]],["impl Sync for CCInitParams",1,["chain_connector::types::CCInitParams"]]], +"chain_data":[["impl Sync for BlockHeader",1,["chain_data::block_header::BlockHeader"]],["impl Sync for EventField",1,["chain_data::chain_data::EventField"]],["impl Sync for ChainDataError",1,["chain_data::error::ChainDataError"]],["impl Sync for Log",1,["chain_data::log::Log"]],["impl Sync for LogParseError",1,["chain_data::log::LogParseError"]]], +"chain_listener":[["impl Sync for CommitmentActivated",1,["chain_listener::event::cc_activated::CommitmentActivated"]],["impl Sync for CIDV1",1,["chain_listener::event::compute_unit_matched::CIDV1"]],["impl Sync for ComputeUnitMatched",1,["chain_listener::event::compute_unit_matched::ComputeUnitMatched"]],["impl Sync for UnitActivated",1,["chain_listener::event::unit_activated::UnitActivated"]],["impl Sync for UnitDeactivated",1,["chain_listener::event::unit_deactivated::UnitDeactivated"]],["impl Sync for ChainListener",1,["chain_listener::listener::ChainListener"]]], +"cid_utils":[["impl Sync for Hash",1,["cid_utils::hash::Hash"]]], +"connected_client":[["impl Sync for ClientCommand",1,["connected_client::command::ClientCommand"]],["impl Sync for ConnectedClient",1,["connected_client::connected_client::ConnectedClient"]],["impl Sync for ClientEvent",1,["connected_client::event::ClientEvent"]]], +"connection_pool":[["impl Sync for Command",1,["connection_pool::api::Command"]],["impl Sync for ConnectionPoolApi",1,["connection_pool::api::ConnectionPoolApi"]],["impl Sync for ConnectionPoolBehaviour",1,["connection_pool::behaviour::ConnectionPoolBehaviour"]],["impl Sync for LifecycleEvent",1,["connection_pool::connection_pool::LifecycleEvent"]]], +"core_distributor":[["impl Sync for CreateError",1,["core_distributor::errors::CreateError"]],["impl Sync for LoadingError",1,["core_distributor::errors::LoadingError"]],["impl Sync for PersistError",1,["core_distributor::errors::PersistError"]],["impl Sync for CurrentAssignment",1,["core_distributor::errors::CurrentAssignment"]],["impl Sync for AcquireError",1,["core_distributor::errors::AcquireError"]],["impl Sync for WorkType",1,["core_distributor::types::WorkType"]],["impl Sync for AcquireRequest",1,["core_distributor::types::AcquireRequest"]],["impl Sync for Cores",1,["core_distributor::types::Cores"]],["impl Sync for Assignment",1,["core_distributor::types::Assignment"]],["impl Sync for SystemAssignment",1,["core_distributor::types::SystemAssignment"]],["impl Sync for CoreRange",1,["core_distributor::core_range::CoreRange"]],["impl Sync for PersistentCoreDistributor",1,["core_distributor::distributor::PersistentCoreDistributor"]],["impl Sync for PersistenceTask",1,["core_distributor::persistence::PersistenceTask"]],["impl Sync for AcquireStrategy",1,["core_distributor::strategy::AcquireStrategy"]],["impl Sync for DummyCoreDistibutor",1,["core_distributor::dummy::DummyCoreDistibutor"]]], +"created_swarm":[["impl Sync for CreatedSwarm",1,["created_swarm::swarm::CreatedSwarm"]],["impl Sync for NetworkKey",1,["created_swarm::swarm::NetworkKey"]],["impl Sync for SwarmConfig",1,["created_swarm::swarm::SwarmConfig"]],["impl Sync for BaseVmConfig",1,["created_swarm::swarm::BaseVmConfig"]]], +"fluence_libp2p":[["impl Sync for RandomPeerId",1,["fluence_libp2p::random_peer_id::RandomPeerId"]],["impl Sync for Transport",1,["fluence_libp2p::transport::Transport"]]], +"fs_utils":[["impl Sync for LoadDataError",1,["fs_utils::LoadDataError"]]], +"health":[["impl Sync for HealthCheckRegistry",1,["health::HealthCheckRegistry"]],["impl Sync for HealthStatus",1,["health::HealthStatus"]]], +"hex_utils":[["impl Sync for Hex",1,["hex_utils::serde_as::Hex"]]], +"kademlia":[["impl Sync for Command",1,["kademlia::api::Command"]],["impl Sync for KademliaApi",1,["kademlia::api::KademliaApi"]],["impl Sync for KademliaConfig",1,["kademlia::behaviour::KademliaConfig"]],["impl Sync for Kademlia",1,["kademlia::behaviour::Kademlia"]],["impl Sync for KademliaError",1,["kademlia::error::KademliaError"]]], +"local_vm":[["impl Sync for Instruction",1,["local_vm::local_vm::Instruction"]],["impl Sync for ClientFunctionsResult",1,["local_vm::local_vm::ClientFunctionsResult"]]], +"log_format":[["impl<T> Sync for Format<T>where\n T: Sync,",1,["log_format::Format"]]], +"log_utils":[["impl Sync for LogSpec",1,["log_utils::LogSpec"]]], +"nox":[["impl Sync for Connectivity",1,["nox::connectivity::Connectivity"]],["impl Sync for StartedHttp",1,["nox::http::StartedHttp"]],["impl<RT> !Sync for Node<RT>",1,["nox::node::Node"]],["impl !Sync for FluenceNetworkBehaviour",1,["nox::behaviour::network::FluenceNetworkBehaviour"]],["impl !Sync for FluenceNetworkBehaviourEvent",1,["nox::behaviour::network::FluenceNetworkBehaviourEvent"]],["impl Sync for Versions",1,["nox::Versions"]]], +"particle_args":[["impl Sync for Args",1,["particle_args::args::Args"]],["impl Sync for ArgsError",1,["particle_args::args_error::ArgsError"]],["impl Sync for JError",1,["particle_args::args_error::JError"]]], +"particle_builtins":[["impl Sync for CustomService",1,["particle_builtins::builtins::CustomService"]],["impl<C> Sync for Builtins<C>where\n C: Sync,",1,["particle_builtins::builtins::Builtins"]],["impl Sync for BuiltinsConfig",1,["particle_builtins::builtins::BuiltinsConfig"]],["impl Sync for NodeInfo",1,["particle_builtins::identify::NodeInfo"]]], +"particle_execution":[["impl Sync for FunctionOutcome",1,["particle_execution::function_outcome::FunctionOutcome"]],["impl Sync for ServiceFunction",1,["particle_execution::particle_function::ServiceFunction"]],["impl Sync for ParticleParams",1,["particle_execution::particle_params::ParticleParams"]],["impl Sync for ParticleVault",1,["particle_execution::particle_vault::ParticleVault"]],["impl Sync for VaultError",1,["particle_execution::particle_vault::VaultError"]]], +"particle_modules":[["impl Sync for ModuleError",1,["particle_modules::error::ModuleError"]],["impl Sync for EffectorsMode",1,["particle_modules::modules::EffectorsMode"]],["impl Sync for ModuleRepository",1,["particle_modules::modules::ModuleRepository"]]], +"particle_protocol":[["impl Sync for SendStatus",1,["particle_protocol::libp2p_protocol::message::SendStatus"]],["impl Sync for CompletionChannel",1,["particle_protocol::libp2p_protocol::message::CompletionChannel"]],["impl Sync for HandlerMessage",1,["particle_protocol::libp2p_protocol::message::HandlerMessage"]],["impl Sync for ProtocolMessage",1,["particle_protocol::libp2p_protocol::message::ProtocolMessage"]],["impl Sync for ProtocolConfig",1,["particle_protocol::libp2p_protocol::upgrade::ProtocolConfig"]],["impl Sync for Contact",1,["particle_protocol::contact::Contact"]],["impl Sync for ParticleError",1,["particle_protocol::error::ParticleError"]],["impl Sync for ExtendedParticle",1,["particle_protocol::particle::ExtendedParticle"]],["impl Sync for Particle",1,["particle_protocol::particle::Particle"]]], +"particle_services":[["impl Sync for ServiceType",1,["particle_services::app_services::ServiceType"]],["impl Sync for ServiceInfo",1,["particle_services::app_services::ServiceInfo"]],["impl Sync for ParticleAppServices",1,["particle_services::app_services::ParticleAppServices"]],["impl Sync for ServiceError",1,["particle_services::error::ServiceError"]],["impl Sync for ParticleAppServicesConfig",1,["particle_services::config::ParticleAppServicesConfig"]],["impl Sync for WasmBackendConfig",1,["particle_services::config::WasmBackendConfig"]]], +"peer_metrics":[["impl Sync for ChainListenerMetrics",1,["peer_metrics::chain_listener::ChainListenerMetrics"]],["impl Sync for ConnectionPoolMetrics",1,["peer_metrics::connection_pool::ConnectionPoolMetrics"]],["impl Sync for Resolution",1,["peer_metrics::connectivity::Resolution"]],["impl Sync for ConnectivityMetrics",1,["peer_metrics::connectivity::ConnectivityMetrics"]],["impl Sync for DispatcherMetrics",1,["peer_metrics::dispatcher::DispatcherMetrics"]],["impl Sync for FunctionKind",1,["peer_metrics::particle_executor::FunctionKind"]],["impl Sync for ParticleExecutorMetrics",1,["peer_metrics::particle_executor::ParticleExecutorMetrics"]],["impl Sync for WorkerLabel",1,["peer_metrics::particle_executor::WorkerLabel"]],["impl Sync for WorkerType",1,["peer_metrics::particle_executor::WorkerType"]],["impl Sync for ServicesMetricsBackend",1,["peer_metrics::services_metrics::backend::ServicesMetricsBackend"]],["impl Sync for ServicesMetricsBuiltin",1,["peer_metrics::services_metrics::builtin::ServicesMetricsBuiltin"]],["impl Sync for ServiceType",1,["peer_metrics::services_metrics::external::ServiceType"]],["impl Sync for ServicesMetricsExternal",1,["peer_metrics::services_metrics::external::ServicesMetricsExternal"]],["impl Sync for ServiceCallStats",1,["peer_metrics::services_metrics::message::ServiceCallStats"]],["impl Sync for ServiceMemoryStat",1,["peer_metrics::services_metrics::message::ServiceMemoryStat"]],["impl Sync for ServicesMetrics",1,["peer_metrics::services_metrics::ServicesMetrics"]],["impl Sync for SpellMetrics",1,["peer_metrics::spell_metrics::SpellMetrics"]],["impl Sync for VmPoolMetrics",1,["peer_metrics::vm_pool::VmPoolMetrics"]],["impl Sync for ParticleType",1,["peer_metrics::ParticleType"]],["impl Sync for ParticleLabel",1,["peer_metrics::ParticleLabel"]]], +"server_config":[["impl Sync for RootKeyPairArgs",1,["server_config::args::RootKeyPairArgs"]],["impl Sync for TracingArgs",1,["server_config::args::TracingArgs"]],["impl Sync for TracingType",1,["server_config::args::TracingType"]],["impl Sync for EnabledSystemServices",1,["server_config::args::EnabledSystemServices"]],["impl Sync for DevModeArgs",1,["server_config::args::DevModeArgs"]],["impl Sync for BootstrapConfig",1,["server_config::bootstrap_config::BootstrapConfig"]],["impl Sync for KademliaConfig",1,["server_config::kademlia_config::KademliaConfig"]],["impl Sync for NetworkConfig",1,["server_config::network_config::NetworkConfig"]],["impl Sync for Network",1,["server_config::node_config::Network"]],["impl Sync for NodeConfig",1,["server_config::node_config::NodeConfig"]],["impl Sync for TransportConfig",1,["server_config::node_config::TransportConfig"]],["impl Sync for ChainConfig",1,["server_config::node_config::ChainConfig"]],["impl Sync for ChainListenerConfig",1,["server_config::node_config::ChainListenerConfig"]],["impl Sync for UnresolvedConfig",1,["server_config::resolved_config::UnresolvedConfig"]],["impl Sync for TracingConfig",1,["server_config::resolved_config::TracingConfig"]],["impl Sync for ResolvedConfig",1,["server_config::resolved_config::ResolvedConfig"]],["impl Sync for ConfigData",1,["server_config::resolved_config::ConfigData"]],["impl Sync for ServiceKey",1,["server_config::system_services_config::ServiceKey"]],["impl Sync for SystemServicesConfig",1,["server_config::system_services_config::SystemServicesConfig"]],["impl Sync for AquaIpfsConfig",1,["server_config::system_services_config::AquaIpfsConfig"]],["impl Sync for ConnectorConfig",1,["server_config::system_services_config::ConnectorConfig"]],["impl Sync for DeciderConfig",1,["server_config::system_services_config::DeciderConfig"]],["impl Sync for RegistryConfig",1,["server_config::system_services_config::RegistryConfig"]]], +"service_modules":[["impl Sync for AddBlueprint",1,["service_modules::modules::blueprint::AddBlueprint"]],["impl Sync for Blueprint",1,["service_modules::modules::blueprint::Blueprint"]]], +"sorcerer":[["impl Sync for Sorcerer",1,["sorcerer::sorcerer::Sorcerer"]],["impl Sync for SpellInfo",1,["sorcerer::spell_builtins::SpellInfo"]]], +"spell_event_bus":[["impl Sync for TriggerEvent",1,["spell_event_bus::api::TriggerEvent"]],["impl Sync for TriggerInfo",1,["spell_event_bus::api::TriggerInfo"]],["impl Sync for TimerEvent",1,["spell_event_bus::api::TimerEvent"]],["impl Sync for PeerEvent",1,["spell_event_bus::api::PeerEvent"]],["impl Sync for PeerEventType",1,["spell_event_bus::api::PeerEventType"]],["impl Sync for TriggerInfoAqua",1,["spell_event_bus::api::TriggerInfoAqua"]],["impl Sync for Action",1,["spell_event_bus::api::Action"]],["impl !Sync for EventBusError",1,["spell_event_bus::api::EventBusError"]],["impl Sync for SpellEventBusApi",1,["spell_event_bus::api::SpellEventBusApi"]],["impl Sync for ConfigError",1,["spell_event_bus::config::ConfigError"]],["impl Sync for SpellTriggerConfigs",1,["spell_event_bus::config::SpellTriggerConfigs"]],["impl !Sync for SpellEventBus",1,["spell_event_bus::bus::SpellEventBus"]]], +"spell_service_api":[["impl Sync for CallError",1,["spell_service_api::CallError"]],["impl Sync for CallParams",1,["spell_service_api::CallParams"]],["impl Sync for SpellServiceApi",1,["spell_service_api::SpellServiceApi"]]], +"spell_storage":[["impl Sync for SpellStorage",1,["spell_storage::storage::SpellStorage"]]], +"system_services":[["impl Sync for Deployer",1,["system_services::deployer::Deployer"]],["impl Sync for Versions",1,["system_services::distro::Versions"]],["impl Sync for SystemServiceDistros",1,["system_services::distro::SystemServiceDistros"]],["impl Sync for Deployment",1,["system_services::Deployment"]],["impl Sync for PackageDistro",1,["system_services::PackageDistro"]],["impl Sync for ServiceDistro",1,["system_services::ServiceDistro"]],["impl Sync for SpellDistro",1,["system_services::SpellDistro"]],["impl Sync for ServiceStatus",1,["system_services::ServiceStatus"]]], +"test_utils":[["impl Sync for DummyThreadPinner",1,["test_utils::pinning::DummyThreadPinner"]],["impl Sync for CreatedService",1,["test_utils::service::CreatedService"]],["impl Sync for RetStruct",1,["test_utils::utils::RetStruct"]]], +"toy_vms":[["impl Sync for EasyVM",1,["toy_vms::easy_vm::EasyVM"]]], +"types":[["impl Sync for DealId",1,["types::deal_id::DealId"]],["impl Sync for PeerScope",1,["types::peer_scope::PeerScope"]],["impl Sync for WorkerId",1,["types::peer_scope::WorkerId"]]], +"vm_utils":[["impl Sync for CreateVMDomainParams",1,["vm_utils::vm_utils::CreateVMDomainParams"]],["impl Sync for VmError",1,["vm_utils::vm_utils::VmError"]],["impl Sync for VmStatus",1,["vm_utils::vm_utils::VmStatus"]]], +"workers":[["impl Sync for KeyStorageError",1,["workers::error::KeyStorageError"]],["impl Sync for WorkersError",1,["workers::error::WorkersError"]],["impl Sync for KeyStorage",1,["workers::key_storage::KeyStorage"]],["impl Sync for PeerScopes",1,["workers::scope::PeerScopes"]],["impl Sync for WorkerParams",1,["workers::workers::WorkerParams"]],["impl Sync for Workers",1,["workers::workers::Workers"]],["impl Sync for Event",1,["workers::workers::Event"]],["impl Sync for WorkersConfig",1,["workers::workers::WorkersConfig"]],["impl Sync for VmConfig",1,["workers::workers::VmConfig"]]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/marker/trait.Unpin.js b/trait.impl/core/marker/trait.Unpin.js new file mode 100644 index 0000000000..ee9a841aac --- /dev/null +++ b/trait.impl/core/marker/trait.Unpin.js @@ -0,0 +1,39 @@ +(function() {var implementors = { +"aquamarine":[["impl<RT, F> Unpin for AquamarineBackend<RT, F>where\n F: Unpin,\n RT: Unpin,\n <RT as AquaRuntime>::Config: Unpin,",1,["aquamarine::aquamarine::AquamarineBackend"]],["impl Unpin for AquamarineApi",1,["aquamarine::aquamarine::AquamarineApi"]],["impl Unpin for VmConfig",1,["aquamarine::config::VmConfig"]],["impl Unpin for VmPoolConfig",1,["aquamarine::config::VmPoolConfig"]],["impl Unpin for DataStoreConfig",1,["aquamarine::config::DataStoreConfig"]],["impl Unpin for AquamarineApiError",1,["aquamarine::error::AquamarineApiError"]],["impl Unpin for ParticleDataStore",1,["aquamarine::particle_data_store::ParticleDataStore"]],["impl Unpin for DataStoreError",1,["aquamarine::particle_data_store::DataStoreError"]],["impl<RT, F> Unpin for Plumber<RT, F>where\n F: Unpin,\n RT: Unpin,\n <RT as AquaRuntime>::Config: Unpin,",1,["aquamarine::plumber::Plumber"]],["impl Unpin for ParticleEffects",1,["aquamarine::particle_effects::ParticleEffects"]],["impl Unpin for InterpretationStats",1,["aquamarine::particle_effects::InterpretationStats"]],["impl Unpin for RemoteRoutingEffects",1,["aquamarine::particle_effects::RemoteRoutingEffects"]]], +"chain_connector":[["impl Unpin for HttpChainConnector",1,["chain_connector::connector::HttpChainConnector"]],["impl Unpin for ConnectorError",1,["chain_connector::error::ConnectorError"]],["impl Unpin for TooManyProofs",1,["chain_connector::function::capacity::Capacity::TooManyProofs"]],["impl Unpin for CapacityCommitmentIsNotActive",1,["chain_connector::function::capacity::Capacity::CapacityCommitmentIsNotActive"]],["impl Unpin for getGlobalNonceCall",1,["chain_connector::function::capacity::Capacity::getGlobalNonceCall"]],["impl Unpin for getGlobalNonceReturn",1,["chain_connector::function::capacity::Capacity::getGlobalNonceReturn"]],["impl Unpin for getStatusCall",1,["chain_connector::function::capacity::Capacity::getStatusCall"]],["impl Unpin for getStatusReturn",1,["chain_connector::function::capacity::Capacity::getStatusReturn"]],["impl Unpin for submitProofCall",1,["chain_connector::function::capacity::Capacity::submitProofCall"]],["impl Unpin for submitProofReturn",1,["chain_connector::function::capacity::Capacity::submitProofReturn"]],["impl Unpin for submitProofsCall",1,["chain_connector::function::capacity::Capacity::submitProofsCall"]],["impl Unpin for submitProofsReturn",1,["chain_connector::function::capacity::Capacity::submitProofsReturn"]],["impl Unpin for CapacityCalls",1,["chain_connector::function::capacity::Capacity::CapacityCalls"]],["impl Unpin for CapacityErrors",1,["chain_connector::function::capacity::Capacity::CapacityErrors"]],["impl Unpin for CCStatus",1,["chain_connector::function::capacity::CCStatus"]],["impl Unpin for CommitmentId",1,["chain_connector::function::capacity::CommitmentId"]],["impl Unpin for capacityCall",1,["chain_connector::function::core::Core::capacityCall"]],["impl Unpin for capacityReturn",1,["chain_connector::function::core::Core::capacityReturn"]],["impl Unpin for marketCall",1,["chain_connector::function::core::Core::marketCall"]],["impl Unpin for marketReturn",1,["chain_connector::function::core::Core::marketReturn"]],["impl Unpin for currentEpochCall",1,["chain_connector::function::core::Core::currentEpochCall"]],["impl Unpin for currentEpochReturn",1,["chain_connector::function::core::Core::currentEpochReturn"]],["impl Unpin for epochDurationCall",1,["chain_connector::function::core::Core::epochDurationCall"]],["impl Unpin for epochDurationReturn",1,["chain_connector::function::core::Core::epochDurationReturn"]],["impl Unpin for initTimestampCall",1,["chain_connector::function::core::Core::initTimestampCall"]],["impl Unpin for initTimestampReturn",1,["chain_connector::function::core::Core::initTimestampReturn"]],["impl Unpin for difficultyCall",1,["chain_connector::function::core::Core::difficultyCall"]],["impl Unpin for difficultyReturn",1,["chain_connector::function::core::Core::difficultyReturn"]],["impl Unpin for minProofsPerEpochCall",1,["chain_connector::function::core::Core::minProofsPerEpochCall"]],["impl Unpin for minProofsPerEpochReturn",1,["chain_connector::function::core::Core::minProofsPerEpochReturn"]],["impl Unpin for maxProofsPerEpochCall",1,["chain_connector::function::core::Core::maxProofsPerEpochCall"]],["impl Unpin for maxProofsPerEpochReturn",1,["chain_connector::function::core::Core::maxProofsPerEpochReturn"]],["impl Unpin for CoreCalls",1,["chain_connector::function::core::Core::CoreCalls"]],["impl Unpin for CIDV1",1,["chain_connector::function::deal::Deal::CIDV1"]],["impl Unpin for Status",1,["chain_connector::function::deal::Deal::Status"]],["impl Unpin for ComputeUnit",1,["chain_connector::function::deal::Deal::ComputeUnit"]],["impl Unpin for getStatusCall",1,["chain_connector::function::deal::Deal::getStatusCall"]],["impl Unpin for getStatusReturn",1,["chain_connector::function::deal::Deal::getStatusReturn"]],["impl Unpin for appCIDCall",1,["chain_connector::function::deal::Deal::appCIDCall"]],["impl Unpin for appCIDReturn",1,["chain_connector::function::deal::Deal::appCIDReturn"]],["impl Unpin for setWorkerCall",1,["chain_connector::function::deal::Deal::setWorkerCall"]],["impl Unpin for setWorkerReturn",1,["chain_connector::function::deal::Deal::setWorkerReturn"]],["impl Unpin for getComputeUnitsCall",1,["chain_connector::function::deal::Deal::getComputeUnitsCall"]],["impl Unpin for getComputeUnitsReturn",1,["chain_connector::function::deal::Deal::getComputeUnitsReturn"]],["impl Unpin for DealCalls",1,["chain_connector::function::deal::Deal::DealCalls"]],["impl Unpin for ComputePeer",1,["chain_connector::function::offer::Offer::ComputePeer"]],["impl Unpin for ComputeUnit",1,["chain_connector::function::offer::Offer::ComputeUnit"]],["impl Unpin for getComputePeerCall",1,["chain_connector::function::offer::Offer::getComputePeerCall"]],["impl Unpin for getComputePeerReturn",1,["chain_connector::function::offer::Offer::getComputePeerReturn"]],["impl Unpin for getComputeUnitsCall",1,["chain_connector::function::offer::Offer::getComputeUnitsCall"]],["impl Unpin for getComputeUnitsReturn",1,["chain_connector::function::offer::Offer::getComputeUnitsReturn"]],["impl Unpin for returnComputeUnitFromDealCall",1,["chain_connector::function::offer::Offer::returnComputeUnitFromDealCall"]],["impl Unpin for returnComputeUnitFromDealReturn",1,["chain_connector::function::offer::Offer::returnComputeUnitFromDealReturn"]],["impl Unpin for OfferCalls",1,["chain_connector::function::offer::Offer::OfferCalls"]],["impl Unpin for PendingUnit",1,["chain_connector::function::offer::PendingUnit"]],["impl Unpin for SubnetResolveResult",1,["chain_connector::types::SubnetResolveResult"]],["impl Unpin for CCInitParams",1,["chain_connector::types::CCInitParams"]]], +"chain_data":[["impl Unpin for BlockHeader",1,["chain_data::block_header::BlockHeader"]],["impl Unpin for EventField",1,["chain_data::chain_data::EventField"]],["impl Unpin for ChainDataError",1,["chain_data::error::ChainDataError"]],["impl Unpin for Log",1,["chain_data::log::Log"]],["impl Unpin for LogParseError",1,["chain_data::log::LogParseError"]]], +"chain_listener":[["impl Unpin for CommitmentActivated",1,["chain_listener::event::cc_activated::CommitmentActivated"]],["impl Unpin for CIDV1",1,["chain_listener::event::compute_unit_matched::CIDV1"]],["impl Unpin for ComputeUnitMatched",1,["chain_listener::event::compute_unit_matched::ComputeUnitMatched"]],["impl Unpin for UnitActivated",1,["chain_listener::event::unit_activated::UnitActivated"]],["impl Unpin for UnitDeactivated",1,["chain_listener::event::unit_deactivated::UnitDeactivated"]],["impl Unpin for ChainListener",1,["chain_listener::listener::ChainListener"]]], +"cid_utils":[["impl Unpin for Hash",1,["cid_utils::hash::Hash"]]], +"connected_client":[["impl Unpin for ClientCommand",1,["connected_client::command::ClientCommand"]],["impl Unpin for ConnectedClient",1,["connected_client::connected_client::ConnectedClient"]],["impl Unpin for ClientEvent",1,["connected_client::event::ClientEvent"]]], +"connection_pool":[["impl Unpin for Command",1,["connection_pool::api::Command"]],["impl Unpin for ConnectionPoolApi",1,["connection_pool::api::ConnectionPoolApi"]],["impl Unpin for ConnectionPoolBehaviour",1,["connection_pool::behaviour::ConnectionPoolBehaviour"]],["impl Unpin for LifecycleEvent",1,["connection_pool::connection_pool::LifecycleEvent"]]], +"core_distributor":[["impl Unpin for CreateError",1,["core_distributor::errors::CreateError"]],["impl Unpin for LoadingError",1,["core_distributor::errors::LoadingError"]],["impl Unpin for PersistError",1,["core_distributor::errors::PersistError"]],["impl Unpin for CurrentAssignment",1,["core_distributor::errors::CurrentAssignment"]],["impl Unpin for AcquireError",1,["core_distributor::errors::AcquireError"]],["impl Unpin for WorkType",1,["core_distributor::types::WorkType"]],["impl Unpin for AcquireRequest",1,["core_distributor::types::AcquireRequest"]],["impl Unpin for Cores",1,["core_distributor::types::Cores"]],["impl Unpin for Assignment",1,["core_distributor::types::Assignment"]],["impl Unpin for SystemAssignment",1,["core_distributor::types::SystemAssignment"]],["impl Unpin for CoreRange",1,["core_distributor::core_range::CoreRange"]],["impl Unpin for PersistentCoreDistributor",1,["core_distributor::distributor::PersistentCoreDistributor"]],["impl Unpin for PersistenceTask",1,["core_distributor::persistence::PersistenceTask"]],["impl Unpin for AcquireStrategy",1,["core_distributor::strategy::AcquireStrategy"]],["impl Unpin for DummyCoreDistibutor",1,["core_distributor::dummy::DummyCoreDistibutor"]]], +"created_swarm":[["impl Unpin for CreatedSwarm",1,["created_swarm::swarm::CreatedSwarm"]],["impl Unpin for NetworkKey",1,["created_swarm::swarm::NetworkKey"]],["impl Unpin for SwarmConfig",1,["created_swarm::swarm::SwarmConfig"]],["impl Unpin for BaseVmConfig",1,["created_swarm::swarm::BaseVmConfig"]]], +"fluence_libp2p":[["impl Unpin for RandomPeerId",1,["fluence_libp2p::random_peer_id::RandomPeerId"]],["impl Unpin for Transport",1,["fluence_libp2p::transport::Transport"]]], +"fs_utils":[["impl Unpin for LoadDataError",1,["fs_utils::LoadDataError"]]], +"health":[["impl Unpin for HealthCheckRegistry",1,["health::HealthCheckRegistry"]],["impl Unpin for HealthStatus",1,["health::HealthStatus"]]], +"hex_utils":[["impl Unpin for Hex",1,["hex_utils::serde_as::Hex"]]], +"kademlia":[["impl Unpin for Command",1,["kademlia::api::Command"]],["impl Unpin for KademliaApi",1,["kademlia::api::KademliaApi"]],["impl Unpin for KademliaConfig",1,["kademlia::behaviour::KademliaConfig"]],["impl Unpin for Kademlia",1,["kademlia::behaviour::Kademlia"]],["impl Unpin for KademliaError",1,["kademlia::error::KademliaError"]]], +"local_vm":[["impl Unpin for Instruction",1,["local_vm::local_vm::Instruction"]],["impl Unpin for ClientFunctionsResult",1,["local_vm::local_vm::ClientFunctionsResult"]]], +"log_format":[["impl<T> Unpin for Format<T>where\n T: Unpin,",1,["log_format::Format"]]], +"log_utils":[["impl Unpin for LogSpec",1,["log_utils::LogSpec"]]], +"nox":[["impl Unpin for Connectivity",1,["nox::connectivity::Connectivity"]],["impl Unpin for StartedHttp",1,["nox::http::StartedHttp"]],["impl<RT> Unpin for Node<RT>where\n RT: Unpin,\n <RT as AquaRuntime>::Config: Unpin,",1,["nox::node::Node"]],["impl Unpin for FluenceNetworkBehaviour",1,["nox::behaviour::network::FluenceNetworkBehaviour"]],["impl Unpin for FluenceNetworkBehaviourEvent",1,["nox::behaviour::network::FluenceNetworkBehaviourEvent"]],["impl Unpin for Versions",1,["nox::Versions"]]], +"particle_args":[["impl Unpin for Args",1,["particle_args::args::Args"]],["impl Unpin for ArgsError",1,["particle_args::args_error::ArgsError"]],["impl Unpin for JError",1,["particle_args::args_error::JError"]]], +"particle_builtins":[["impl Unpin for CustomService",1,["particle_builtins::builtins::CustomService"]],["impl<C> Unpin for Builtins<C>where\n C: Unpin,",1,["particle_builtins::builtins::Builtins"]],["impl Unpin for BuiltinsConfig",1,["particle_builtins::builtins::BuiltinsConfig"]],["impl Unpin for NodeInfo",1,["particle_builtins::identify::NodeInfo"]]], +"particle_execution":[["impl Unpin for FunctionOutcome",1,["particle_execution::function_outcome::FunctionOutcome"]],["impl Unpin for ServiceFunction",1,["particle_execution::particle_function::ServiceFunction"]],["impl Unpin for ParticleParams",1,["particle_execution::particle_params::ParticleParams"]],["impl Unpin for ParticleVault",1,["particle_execution::particle_vault::ParticleVault"]],["impl Unpin for VaultError",1,["particle_execution::particle_vault::VaultError"]]], +"particle_modules":[["impl Unpin for ModuleError",1,["particle_modules::error::ModuleError"]],["impl Unpin for EffectorsMode",1,["particle_modules::modules::EffectorsMode"]],["impl Unpin for ModuleRepository",1,["particle_modules::modules::ModuleRepository"]]], +"particle_protocol":[["impl Unpin for SendStatus",1,["particle_protocol::libp2p_protocol::message::SendStatus"]],["impl Unpin for CompletionChannel",1,["particle_protocol::libp2p_protocol::message::CompletionChannel"]],["impl Unpin for HandlerMessage",1,["particle_protocol::libp2p_protocol::message::HandlerMessage"]],["impl Unpin for ProtocolMessage",1,["particle_protocol::libp2p_protocol::message::ProtocolMessage"]],["impl Unpin for ProtocolConfig",1,["particle_protocol::libp2p_protocol::upgrade::ProtocolConfig"]],["impl Unpin for Contact",1,["particle_protocol::contact::Contact"]],["impl Unpin for ParticleError",1,["particle_protocol::error::ParticleError"]],["impl Unpin for ExtendedParticle",1,["particle_protocol::particle::ExtendedParticle"]],["impl Unpin for Particle",1,["particle_protocol::particle::Particle"]]], +"particle_services":[["impl Unpin for ServiceType",1,["particle_services::app_services::ServiceType"]],["impl Unpin for ServiceInfo",1,["particle_services::app_services::ServiceInfo"]],["impl Unpin for ParticleAppServices",1,["particle_services::app_services::ParticleAppServices"]],["impl Unpin for ServiceError",1,["particle_services::error::ServiceError"]],["impl Unpin for ParticleAppServicesConfig",1,["particle_services::config::ParticleAppServicesConfig"]],["impl Unpin for WasmBackendConfig",1,["particle_services::config::WasmBackendConfig"]]], +"peer_metrics":[["impl Unpin for ChainListenerMetrics",1,["peer_metrics::chain_listener::ChainListenerMetrics"]],["impl Unpin for ConnectionPoolMetrics",1,["peer_metrics::connection_pool::ConnectionPoolMetrics"]],["impl Unpin for Resolution",1,["peer_metrics::connectivity::Resolution"]],["impl Unpin for ConnectivityMetrics",1,["peer_metrics::connectivity::ConnectivityMetrics"]],["impl Unpin for DispatcherMetrics",1,["peer_metrics::dispatcher::DispatcherMetrics"]],["impl Unpin for FunctionKind",1,["peer_metrics::particle_executor::FunctionKind"]],["impl Unpin for ParticleExecutorMetrics",1,["peer_metrics::particle_executor::ParticleExecutorMetrics"]],["impl Unpin for WorkerLabel",1,["peer_metrics::particle_executor::WorkerLabel"]],["impl Unpin for WorkerType",1,["peer_metrics::particle_executor::WorkerType"]],["impl Unpin for ServicesMetricsBackend",1,["peer_metrics::services_metrics::backend::ServicesMetricsBackend"]],["impl Unpin for ServicesMetricsBuiltin",1,["peer_metrics::services_metrics::builtin::ServicesMetricsBuiltin"]],["impl Unpin for ServiceType",1,["peer_metrics::services_metrics::external::ServiceType"]],["impl Unpin for ServicesMetricsExternal",1,["peer_metrics::services_metrics::external::ServicesMetricsExternal"]],["impl Unpin for ServiceCallStats",1,["peer_metrics::services_metrics::message::ServiceCallStats"]],["impl Unpin for ServiceMemoryStat",1,["peer_metrics::services_metrics::message::ServiceMemoryStat"]],["impl Unpin for ServicesMetrics",1,["peer_metrics::services_metrics::ServicesMetrics"]],["impl Unpin for SpellMetrics",1,["peer_metrics::spell_metrics::SpellMetrics"]],["impl Unpin for VmPoolMetrics",1,["peer_metrics::vm_pool::VmPoolMetrics"]],["impl Unpin for ParticleType",1,["peer_metrics::ParticleType"]],["impl Unpin for ParticleLabel",1,["peer_metrics::ParticleLabel"]]], +"server_config":[["impl Unpin for RootKeyPairArgs",1,["server_config::args::RootKeyPairArgs"]],["impl Unpin for TracingArgs",1,["server_config::args::TracingArgs"]],["impl Unpin for TracingType",1,["server_config::args::TracingType"]],["impl Unpin for EnabledSystemServices",1,["server_config::args::EnabledSystemServices"]],["impl Unpin for DevModeArgs",1,["server_config::args::DevModeArgs"]],["impl Unpin for BootstrapConfig",1,["server_config::bootstrap_config::BootstrapConfig"]],["impl Unpin for KademliaConfig",1,["server_config::kademlia_config::KademliaConfig"]],["impl Unpin for NetworkConfig",1,["server_config::network_config::NetworkConfig"]],["impl Unpin for Network",1,["server_config::node_config::Network"]],["impl Unpin for NodeConfig",1,["server_config::node_config::NodeConfig"]],["impl Unpin for TransportConfig",1,["server_config::node_config::TransportConfig"]],["impl Unpin for ChainConfig",1,["server_config::node_config::ChainConfig"]],["impl Unpin for ChainListenerConfig",1,["server_config::node_config::ChainListenerConfig"]],["impl Unpin for UnresolvedConfig",1,["server_config::resolved_config::UnresolvedConfig"]],["impl Unpin for TracingConfig",1,["server_config::resolved_config::TracingConfig"]],["impl Unpin for ResolvedConfig",1,["server_config::resolved_config::ResolvedConfig"]],["impl Unpin for ConfigData",1,["server_config::resolved_config::ConfigData"]],["impl Unpin for ServiceKey",1,["server_config::system_services_config::ServiceKey"]],["impl Unpin for SystemServicesConfig",1,["server_config::system_services_config::SystemServicesConfig"]],["impl Unpin for AquaIpfsConfig",1,["server_config::system_services_config::AquaIpfsConfig"]],["impl Unpin for ConnectorConfig",1,["server_config::system_services_config::ConnectorConfig"]],["impl Unpin for DeciderConfig",1,["server_config::system_services_config::DeciderConfig"]],["impl Unpin for RegistryConfig",1,["server_config::system_services_config::RegistryConfig"]]], +"service_modules":[["impl Unpin for AddBlueprint",1,["service_modules::modules::blueprint::AddBlueprint"]],["impl Unpin for Blueprint",1,["service_modules::modules::blueprint::Blueprint"]]], +"sorcerer":[["impl Unpin for Sorcerer",1,["sorcerer::sorcerer::Sorcerer"]],["impl Unpin for SpellInfo",1,["sorcerer::spell_builtins::SpellInfo"]]], +"spell_event_bus":[["impl Unpin for TriggerEvent",1,["spell_event_bus::api::TriggerEvent"]],["impl Unpin for TriggerInfo",1,["spell_event_bus::api::TriggerInfo"]],["impl Unpin for TimerEvent",1,["spell_event_bus::api::TimerEvent"]],["impl Unpin for PeerEvent",1,["spell_event_bus::api::PeerEvent"]],["impl Unpin for PeerEventType",1,["spell_event_bus::api::PeerEventType"]],["impl Unpin for TriggerInfoAqua",1,["spell_event_bus::api::TriggerInfoAqua"]],["impl Unpin for Action",1,["spell_event_bus::api::Action"]],["impl Unpin for EventBusError",1,["spell_event_bus::api::EventBusError"]],["impl Unpin for SpellEventBusApi",1,["spell_event_bus::api::SpellEventBusApi"]],["impl Unpin for ConfigError",1,["spell_event_bus::config::ConfigError"]],["impl Unpin for SpellTriggerConfigs",1,["spell_event_bus::config::SpellTriggerConfigs"]],["impl Unpin for SpellEventBus",1,["spell_event_bus::bus::SpellEventBus"]]], +"spell_service_api":[["impl Unpin for CallError",1,["spell_service_api::CallError"]],["impl Unpin for CallParams",1,["spell_service_api::CallParams"]],["impl Unpin for SpellServiceApi",1,["spell_service_api::SpellServiceApi"]]], +"spell_storage":[["impl Unpin for SpellStorage",1,["spell_storage::storage::SpellStorage"]]], +"system_services":[["impl Unpin for Deployer",1,["system_services::deployer::Deployer"]],["impl Unpin for Versions",1,["system_services::distro::Versions"]],["impl Unpin for SystemServiceDistros",1,["system_services::distro::SystemServiceDistros"]],["impl Unpin for Deployment",1,["system_services::Deployment"]],["impl Unpin for PackageDistro",1,["system_services::PackageDistro"]],["impl Unpin for ServiceDistro",1,["system_services::ServiceDistro"]],["impl Unpin for SpellDistro",1,["system_services::SpellDistro"]],["impl Unpin for ServiceStatus",1,["system_services::ServiceStatus"]]], +"test_utils":[["impl Unpin for DummyThreadPinner",1,["test_utils::pinning::DummyThreadPinner"]],["impl Unpin for CreatedService",1,["test_utils::service::CreatedService"]],["impl Unpin for RetStruct",1,["test_utils::utils::RetStruct"]]], +"toy_vms":[["impl Unpin for EasyVM",1,["toy_vms::easy_vm::EasyVM"]]], +"types":[["impl Unpin for DealId",1,["types::deal_id::DealId"]],["impl Unpin for PeerScope",1,["types::peer_scope::PeerScope"]],["impl Unpin for WorkerId",1,["types::peer_scope::WorkerId"]]], +"vm_utils":[["impl Unpin for CreateVMDomainParams",1,["vm_utils::vm_utils::CreateVMDomainParams"]],["impl Unpin for VmError",1,["vm_utils::vm_utils::VmError"]],["impl Unpin for VmStatus",1,["vm_utils::vm_utils::VmStatus"]]], +"workers":[["impl Unpin for KeyStorageError",1,["workers::error::KeyStorageError"]],["impl Unpin for WorkersError",1,["workers::error::WorkersError"]],["impl Unpin for KeyStorage",1,["workers::key_storage::KeyStorage"]],["impl Unpin for PeerScopes",1,["workers::scope::PeerScopes"]],["impl Unpin for WorkerParams",1,["workers::workers::WorkerParams"]],["impl Unpin for Workers",1,["workers::workers::Workers"]],["impl Unpin for Event",1,["workers::workers::Event"]],["impl Unpin for WorkersConfig",1,["workers::workers::WorkersConfig"]],["impl Unpin for VmConfig",1,["workers::workers::VmConfig"]]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/ops/deref/trait.Deref.js b/trait.impl/core/ops/deref/trait.Deref.js new file mode 100644 index 0000000000..f26a1a8bd8 --- /dev/null +++ b/trait.impl/core/ops/deref/trait.Deref.js @@ -0,0 +1,4 @@ +(function() {var implementors = { +"connected_client":[["impl Deref for ConnectedClient"]], +"server_config":[["impl Deref for ResolvedConfig"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/ops/deref/trait.DerefMut.js b/trait.impl/core/ops/deref/trait.DerefMut.js new file mode 100644 index 0000000000..d3227b7ffe --- /dev/null +++ b/trait.impl/core/ops/deref/trait.DerefMut.js @@ -0,0 +1,4 @@ +(function() {var implementors = { +"connected_client":[["impl DerefMut for ConnectedClient"]], +"server_config":[["impl DerefMut for ResolvedConfig"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/ops/try_trait/trait.FromResidual.js b/trait.impl/core/ops/try_trait/trait.FromResidual.js new file mode 100644 index 0000000000..75c5ecb4de --- /dev/null +++ b/trait.impl/core/ops/try_trait/trait.FromResidual.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"particle_execution":[["impl FromResidual for FunctionOutcome"],["impl<E: Into<JError>> FromResidual<Result<Infallible, E>> for FunctionOutcome"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/ops/try_trait/trait.Try.js b/trait.impl/core/ops/try_trait/trait.Try.js new file mode 100644 index 0000000000..f7fe19cae8 --- /dev/null +++ b/trait.impl/core/ops/try_trait/trait.Try.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"particle_execution":[["impl Try for FunctionOutcome"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/panic/unwind_safe/trait.RefUnwindSafe.js b/trait.impl/core/panic/unwind_safe/trait.RefUnwindSafe.js new file mode 100644 index 0000000000..92caab1b86 --- /dev/null +++ b/trait.impl/core/panic/unwind_safe/trait.RefUnwindSafe.js @@ -0,0 +1,39 @@ +(function() {var implementors = { +"aquamarine":[["impl<RT, F> !RefUnwindSafe for AquamarineBackend<RT, F>",1,["aquamarine::aquamarine::AquamarineBackend"]],["impl !RefUnwindSafe for AquamarineApi",1,["aquamarine::aquamarine::AquamarineApi"]],["impl RefUnwindSafe for VmConfig",1,["aquamarine::config::VmConfig"]],["impl RefUnwindSafe for VmPoolConfig",1,["aquamarine::config::VmPoolConfig"]],["impl RefUnwindSafe for DataStoreConfig",1,["aquamarine::config::DataStoreConfig"]],["impl !RefUnwindSafe for AquamarineApiError",1,["aquamarine::error::AquamarineApiError"]],["impl RefUnwindSafe for ParticleDataStore",1,["aquamarine::particle_data_store::ParticleDataStore"]],["impl !RefUnwindSafe for DataStoreError",1,["aquamarine::particle_data_store::DataStoreError"]],["impl<RT, F> !RefUnwindSafe for Plumber<RT, F>",1,["aquamarine::plumber::Plumber"]],["impl RefUnwindSafe for ParticleEffects",1,["aquamarine::particle_effects::ParticleEffects"]],["impl RefUnwindSafe for InterpretationStats",1,["aquamarine::particle_effects::InterpretationStats"]],["impl !RefUnwindSafe for RemoteRoutingEffects",1,["aquamarine::particle_effects::RemoteRoutingEffects"]]], +"chain_connector":[["impl !RefUnwindSafe for HttpChainConnector",1,["chain_connector::connector::HttpChainConnector"]],["impl !RefUnwindSafe for ConnectorError",1,["chain_connector::error::ConnectorError"]],["impl RefUnwindSafe for TooManyProofs",1,["chain_connector::function::capacity::Capacity::TooManyProofs"]],["impl RefUnwindSafe for CapacityCommitmentIsNotActive",1,["chain_connector::function::capacity::Capacity::CapacityCommitmentIsNotActive"]],["impl RefUnwindSafe for getGlobalNonceCall",1,["chain_connector::function::capacity::Capacity::getGlobalNonceCall"]],["impl RefUnwindSafe for getGlobalNonceReturn",1,["chain_connector::function::capacity::Capacity::getGlobalNonceReturn"]],["impl RefUnwindSafe for getStatusCall",1,["chain_connector::function::capacity::Capacity::getStatusCall"]],["impl RefUnwindSafe for getStatusReturn",1,["chain_connector::function::capacity::Capacity::getStatusReturn"]],["impl RefUnwindSafe for submitProofCall",1,["chain_connector::function::capacity::Capacity::submitProofCall"]],["impl RefUnwindSafe for submitProofReturn",1,["chain_connector::function::capacity::Capacity::submitProofReturn"]],["impl RefUnwindSafe for submitProofsCall",1,["chain_connector::function::capacity::Capacity::submitProofsCall"]],["impl RefUnwindSafe for submitProofsReturn",1,["chain_connector::function::capacity::Capacity::submitProofsReturn"]],["impl RefUnwindSafe for CapacityCalls",1,["chain_connector::function::capacity::Capacity::CapacityCalls"]],["impl RefUnwindSafe for CapacityErrors",1,["chain_connector::function::capacity::Capacity::CapacityErrors"]],["impl RefUnwindSafe for CCStatus",1,["chain_connector::function::capacity::CCStatus"]],["impl RefUnwindSafe for CommitmentId",1,["chain_connector::function::capacity::CommitmentId"]],["impl RefUnwindSafe for capacityCall",1,["chain_connector::function::core::Core::capacityCall"]],["impl RefUnwindSafe for capacityReturn",1,["chain_connector::function::core::Core::capacityReturn"]],["impl RefUnwindSafe for marketCall",1,["chain_connector::function::core::Core::marketCall"]],["impl RefUnwindSafe for marketReturn",1,["chain_connector::function::core::Core::marketReturn"]],["impl RefUnwindSafe for currentEpochCall",1,["chain_connector::function::core::Core::currentEpochCall"]],["impl RefUnwindSafe for currentEpochReturn",1,["chain_connector::function::core::Core::currentEpochReturn"]],["impl RefUnwindSafe for epochDurationCall",1,["chain_connector::function::core::Core::epochDurationCall"]],["impl RefUnwindSafe for epochDurationReturn",1,["chain_connector::function::core::Core::epochDurationReturn"]],["impl RefUnwindSafe for initTimestampCall",1,["chain_connector::function::core::Core::initTimestampCall"]],["impl RefUnwindSafe for initTimestampReturn",1,["chain_connector::function::core::Core::initTimestampReturn"]],["impl RefUnwindSafe for difficultyCall",1,["chain_connector::function::core::Core::difficultyCall"]],["impl RefUnwindSafe for difficultyReturn",1,["chain_connector::function::core::Core::difficultyReturn"]],["impl RefUnwindSafe for minProofsPerEpochCall",1,["chain_connector::function::core::Core::minProofsPerEpochCall"]],["impl RefUnwindSafe for minProofsPerEpochReturn",1,["chain_connector::function::core::Core::minProofsPerEpochReturn"]],["impl RefUnwindSafe for maxProofsPerEpochCall",1,["chain_connector::function::core::Core::maxProofsPerEpochCall"]],["impl RefUnwindSafe for maxProofsPerEpochReturn",1,["chain_connector::function::core::Core::maxProofsPerEpochReturn"]],["impl RefUnwindSafe for CoreCalls",1,["chain_connector::function::core::Core::CoreCalls"]],["impl RefUnwindSafe for CIDV1",1,["chain_connector::function::deal::Deal::CIDV1"]],["impl RefUnwindSafe for Status",1,["chain_connector::function::deal::Deal::Status"]],["impl RefUnwindSafe for ComputeUnit",1,["chain_connector::function::deal::Deal::ComputeUnit"]],["impl RefUnwindSafe for getStatusCall",1,["chain_connector::function::deal::Deal::getStatusCall"]],["impl RefUnwindSafe for getStatusReturn",1,["chain_connector::function::deal::Deal::getStatusReturn"]],["impl RefUnwindSafe for appCIDCall",1,["chain_connector::function::deal::Deal::appCIDCall"]],["impl RefUnwindSafe for appCIDReturn",1,["chain_connector::function::deal::Deal::appCIDReturn"]],["impl RefUnwindSafe for setWorkerCall",1,["chain_connector::function::deal::Deal::setWorkerCall"]],["impl RefUnwindSafe for setWorkerReturn",1,["chain_connector::function::deal::Deal::setWorkerReturn"]],["impl RefUnwindSafe for getComputeUnitsCall",1,["chain_connector::function::deal::Deal::getComputeUnitsCall"]],["impl RefUnwindSafe for getComputeUnitsReturn",1,["chain_connector::function::deal::Deal::getComputeUnitsReturn"]],["impl RefUnwindSafe for DealCalls",1,["chain_connector::function::deal::Deal::DealCalls"]],["impl RefUnwindSafe for ComputePeer",1,["chain_connector::function::offer::Offer::ComputePeer"]],["impl RefUnwindSafe for ComputeUnit",1,["chain_connector::function::offer::Offer::ComputeUnit"]],["impl RefUnwindSafe for getComputePeerCall",1,["chain_connector::function::offer::Offer::getComputePeerCall"]],["impl RefUnwindSafe for getComputePeerReturn",1,["chain_connector::function::offer::Offer::getComputePeerReturn"]],["impl RefUnwindSafe for getComputeUnitsCall",1,["chain_connector::function::offer::Offer::getComputeUnitsCall"]],["impl RefUnwindSafe for getComputeUnitsReturn",1,["chain_connector::function::offer::Offer::getComputeUnitsReturn"]],["impl RefUnwindSafe for returnComputeUnitFromDealCall",1,["chain_connector::function::offer::Offer::returnComputeUnitFromDealCall"]],["impl RefUnwindSafe for returnComputeUnitFromDealReturn",1,["chain_connector::function::offer::Offer::returnComputeUnitFromDealReturn"]],["impl RefUnwindSafe for OfferCalls",1,["chain_connector::function::offer::Offer::OfferCalls"]],["impl RefUnwindSafe for PendingUnit",1,["chain_connector::function::offer::PendingUnit"]],["impl RefUnwindSafe for SubnetResolveResult",1,["chain_connector::types::SubnetResolveResult"]],["impl RefUnwindSafe for CCInitParams",1,["chain_connector::types::CCInitParams"]]], +"chain_data":[["impl RefUnwindSafe for BlockHeader",1,["chain_data::block_header::BlockHeader"]],["impl RefUnwindSafe for EventField",1,["chain_data::chain_data::EventField"]],["impl !RefUnwindSafe for ChainDataError",1,["chain_data::error::ChainDataError"]],["impl RefUnwindSafe for Log",1,["chain_data::log::Log"]],["impl !RefUnwindSafe for LogParseError",1,["chain_data::log::LogParseError"]]], +"chain_listener":[["impl RefUnwindSafe for CommitmentActivated",1,["chain_listener::event::cc_activated::CommitmentActivated"]],["impl RefUnwindSafe for CIDV1",1,["chain_listener::event::compute_unit_matched::CIDV1"]],["impl RefUnwindSafe for ComputeUnitMatched",1,["chain_listener::event::compute_unit_matched::ComputeUnitMatched"]],["impl RefUnwindSafe for UnitActivated",1,["chain_listener::event::unit_activated::UnitActivated"]],["impl RefUnwindSafe for UnitDeactivated",1,["chain_listener::event::unit_deactivated::UnitDeactivated"]],["impl !RefUnwindSafe for ChainListener",1,["chain_listener::listener::ChainListener"]]], +"cid_utils":[["impl RefUnwindSafe for Hash",1,["cid_utils::hash::Hash"]]], +"connected_client":[["impl RefUnwindSafe for ClientCommand",1,["connected_client::command::ClientCommand"]],["impl !RefUnwindSafe for ConnectedClient",1,["connected_client::connected_client::ConnectedClient"]],["impl RefUnwindSafe for ClientEvent",1,["connected_client::event::ClientEvent"]]], +"connection_pool":[["impl !RefUnwindSafe for Command",1,["connection_pool::api::Command"]],["impl !RefUnwindSafe for ConnectionPoolApi",1,["connection_pool::api::ConnectionPoolApi"]],["impl !RefUnwindSafe for ConnectionPoolBehaviour",1,["connection_pool::behaviour::ConnectionPoolBehaviour"]],["impl RefUnwindSafe for LifecycleEvent",1,["connection_pool::connection_pool::LifecycleEvent"]]], +"core_distributor":[["impl RefUnwindSafe for CreateError",1,["core_distributor::errors::CreateError"]],["impl !RefUnwindSafe for LoadingError",1,["core_distributor::errors::LoadingError"]],["impl !RefUnwindSafe for PersistError",1,["core_distributor::errors::PersistError"]],["impl RefUnwindSafe for CurrentAssignment",1,["core_distributor::errors::CurrentAssignment"]],["impl RefUnwindSafe for AcquireError",1,["core_distributor::errors::AcquireError"]],["impl RefUnwindSafe for WorkType",1,["core_distributor::types::WorkType"]],["impl RefUnwindSafe for AcquireRequest",1,["core_distributor::types::AcquireRequest"]],["impl RefUnwindSafe for Cores",1,["core_distributor::types::Cores"]],["impl RefUnwindSafe for Assignment",1,["core_distributor::types::Assignment"]],["impl RefUnwindSafe for SystemAssignment",1,["core_distributor::types::SystemAssignment"]],["impl RefUnwindSafe for CoreRange",1,["core_distributor::core_range::CoreRange"]],["impl !RefUnwindSafe for PersistentCoreDistributor",1,["core_distributor::distributor::PersistentCoreDistributor"]],["impl !RefUnwindSafe for PersistenceTask",1,["core_distributor::persistence::PersistenceTask"]],["impl RefUnwindSafe for AcquireStrategy",1,["core_distributor::strategy::AcquireStrategy"]],["impl RefUnwindSafe for DummyCoreDistibutor",1,["core_distributor::dummy::DummyCoreDistibutor"]]], +"created_swarm":[["impl !RefUnwindSafe for CreatedSwarm",1,["created_swarm::swarm::CreatedSwarm"]],["impl RefUnwindSafe for NetworkKey",1,["created_swarm::swarm::NetworkKey"]],["impl !RefUnwindSafe for SwarmConfig",1,["created_swarm::swarm::SwarmConfig"]],["impl RefUnwindSafe for BaseVmConfig",1,["created_swarm::swarm::BaseVmConfig"]]], +"fluence_libp2p":[["impl RefUnwindSafe for RandomPeerId",1,["fluence_libp2p::random_peer_id::RandomPeerId"]],["impl RefUnwindSafe for Transport",1,["fluence_libp2p::transport::Transport"]]], +"fs_utils":[["impl !RefUnwindSafe for LoadDataError",1,["fs_utils::LoadDataError"]]], +"health":[["impl !RefUnwindSafe for HealthCheckRegistry",1,["health::HealthCheckRegistry"]],["impl RefUnwindSafe for HealthStatus",1,["health::HealthStatus"]]], +"hex_utils":[["impl RefUnwindSafe for Hex",1,["hex_utils::serde_as::Hex"]]], +"kademlia":[["impl !RefUnwindSafe for Command",1,["kademlia::api::Command"]],["impl !RefUnwindSafe for KademliaApi",1,["kademlia::api::KademliaApi"]],["impl RefUnwindSafe for KademliaConfig",1,["kademlia::behaviour::KademliaConfig"]],["impl !RefUnwindSafe for Kademlia",1,["kademlia::behaviour::Kademlia"]],["impl RefUnwindSafe for KademliaError",1,["kademlia::error::KademliaError"]]], +"local_vm":[["impl RefUnwindSafe for Instruction",1,["local_vm::local_vm::Instruction"]],["impl RefUnwindSafe for ClientFunctionsResult",1,["local_vm::local_vm::ClientFunctionsResult"]]], +"log_format":[["impl<T> RefUnwindSafe for Format<T>where\n T: RefUnwindSafe,",1,["log_format::Format"]]], +"log_utils":[["impl RefUnwindSafe for LogSpec",1,["log_utils::LogSpec"]]], +"nox":[["impl !RefUnwindSafe for Connectivity",1,["nox::connectivity::Connectivity"]],["impl RefUnwindSafe for StartedHttp",1,["nox::http::StartedHttp"]],["impl<RT> !RefUnwindSafe for Node<RT>",1,["nox::node::Node"]],["impl !RefUnwindSafe for FluenceNetworkBehaviour",1,["nox::behaviour::network::FluenceNetworkBehaviour"]],["impl !RefUnwindSafe for FluenceNetworkBehaviourEvent",1,["nox::behaviour::network::FluenceNetworkBehaviourEvent"]],["impl RefUnwindSafe for Versions",1,["nox::Versions"]]], +"particle_args":[["impl RefUnwindSafe for Args",1,["particle_args::args::Args"]],["impl !RefUnwindSafe for ArgsError",1,["particle_args::args_error::ArgsError"]],["impl RefUnwindSafe for JError",1,["particle_args::args_error::JError"]]], +"particle_builtins":[["impl !RefUnwindSafe for CustomService",1,["particle_builtins::builtins::CustomService"]],["impl<C> !RefUnwindSafe for Builtins<C>",1,["particle_builtins::builtins::Builtins"]],["impl RefUnwindSafe for BuiltinsConfig",1,["particle_builtins::builtins::BuiltinsConfig"]],["impl RefUnwindSafe for NodeInfo",1,["particle_builtins::identify::NodeInfo"]]], +"particle_execution":[["impl RefUnwindSafe for FunctionOutcome",1,["particle_execution::function_outcome::FunctionOutcome"]],["impl !RefUnwindSafe for ServiceFunction",1,["particle_execution::particle_function::ServiceFunction"]],["impl RefUnwindSafe for ParticleParams",1,["particle_execution::particle_params::ParticleParams"]],["impl RefUnwindSafe for ParticleVault",1,["particle_execution::particle_vault::ParticleVault"]],["impl !RefUnwindSafe for VaultError",1,["particle_execution::particle_vault::VaultError"]]], +"particle_modules":[["impl !RefUnwindSafe for ModuleError",1,["particle_modules::error::ModuleError"]],["impl RefUnwindSafe for EffectorsMode",1,["particle_modules::modules::EffectorsMode"]],["impl !RefUnwindSafe for ModuleRepository",1,["particle_modules::modules::ModuleRepository"]]], +"particle_protocol":[["impl !RefUnwindSafe for SendStatus",1,["particle_protocol::libp2p_protocol::message::SendStatus"]],["impl !RefUnwindSafe for CompletionChannel",1,["particle_protocol::libp2p_protocol::message::CompletionChannel"]],["impl !RefUnwindSafe for HandlerMessage",1,["particle_protocol::libp2p_protocol::message::HandlerMessage"]],["impl RefUnwindSafe for ProtocolMessage",1,["particle_protocol::libp2p_protocol::message::ProtocolMessage"]],["impl RefUnwindSafe for ProtocolConfig",1,["particle_protocol::libp2p_protocol::upgrade::ProtocolConfig"]],["impl RefUnwindSafe for Contact",1,["particle_protocol::contact::Contact"]],["impl !RefUnwindSafe for ParticleError",1,["particle_protocol::error::ParticleError"]],["impl !RefUnwindSafe for ExtendedParticle",1,["particle_protocol::particle::ExtendedParticle"]],["impl RefUnwindSafe for Particle",1,["particle_protocol::particle::Particle"]]], +"particle_services":[["impl RefUnwindSafe for ServiceType",1,["particle_services::app_services::ServiceType"]],["impl RefUnwindSafe for ServiceInfo",1,["particle_services::app_services::ServiceInfo"]],["impl !RefUnwindSafe for ParticleAppServices",1,["particle_services::app_services::ParticleAppServices"]],["impl !RefUnwindSafe for ServiceError",1,["particle_services::error::ServiceError"]],["impl RefUnwindSafe for ParticleAppServicesConfig",1,["particle_services::config::ParticleAppServicesConfig"]],["impl RefUnwindSafe for WasmBackendConfig",1,["particle_services::config::WasmBackendConfig"]]], +"peer_metrics":[["impl !RefUnwindSafe for ChainListenerMetrics",1,["peer_metrics::chain_listener::ChainListenerMetrics"]],["impl !RefUnwindSafe for ConnectionPoolMetrics",1,["peer_metrics::connection_pool::ConnectionPoolMetrics"]],["impl RefUnwindSafe for Resolution",1,["peer_metrics::connectivity::Resolution"]],["impl !RefUnwindSafe for ConnectivityMetrics",1,["peer_metrics::connectivity::ConnectivityMetrics"]],["impl !RefUnwindSafe for DispatcherMetrics",1,["peer_metrics::dispatcher::DispatcherMetrics"]],["impl RefUnwindSafe for FunctionKind",1,["peer_metrics::particle_executor::FunctionKind"]],["impl !RefUnwindSafe for ParticleExecutorMetrics",1,["peer_metrics::particle_executor::ParticleExecutorMetrics"]],["impl RefUnwindSafe for WorkerLabel",1,["peer_metrics::particle_executor::WorkerLabel"]],["impl RefUnwindSafe for WorkerType",1,["peer_metrics::particle_executor::WorkerType"]],["impl !RefUnwindSafe for ServicesMetricsBackend",1,["peer_metrics::services_metrics::backend::ServicesMetricsBackend"]],["impl !RefUnwindSafe for ServicesMetricsBuiltin",1,["peer_metrics::services_metrics::builtin::ServicesMetricsBuiltin"]],["impl RefUnwindSafe for ServiceType",1,["peer_metrics::services_metrics::external::ServiceType"]],["impl !RefUnwindSafe for ServicesMetricsExternal",1,["peer_metrics::services_metrics::external::ServicesMetricsExternal"]],["impl RefUnwindSafe for ServiceCallStats",1,["peer_metrics::services_metrics::message::ServiceCallStats"]],["impl RefUnwindSafe for ServiceMemoryStat",1,["peer_metrics::services_metrics::message::ServiceMemoryStat"]],["impl !RefUnwindSafe for ServicesMetrics",1,["peer_metrics::services_metrics::ServicesMetrics"]],["impl !RefUnwindSafe for SpellMetrics",1,["peer_metrics::spell_metrics::SpellMetrics"]],["impl !RefUnwindSafe for VmPoolMetrics",1,["peer_metrics::vm_pool::VmPoolMetrics"]],["impl RefUnwindSafe for ParticleType",1,["peer_metrics::ParticleType"]],["impl RefUnwindSafe for ParticleLabel",1,["peer_metrics::ParticleLabel"]]], +"server_config":[["impl RefUnwindSafe for RootKeyPairArgs",1,["server_config::args::RootKeyPairArgs"]],["impl RefUnwindSafe for TracingArgs",1,["server_config::args::TracingArgs"]],["impl RefUnwindSafe for TracingType",1,["server_config::args::TracingType"]],["impl RefUnwindSafe for EnabledSystemServices",1,["server_config::args::EnabledSystemServices"]],["impl RefUnwindSafe for DevModeArgs",1,["server_config::args::DevModeArgs"]],["impl RefUnwindSafe for BootstrapConfig",1,["server_config::bootstrap_config::BootstrapConfig"]],["impl RefUnwindSafe for KademliaConfig",1,["server_config::kademlia_config::KademliaConfig"]],["impl !RefUnwindSafe for NetworkConfig",1,["server_config::network_config::NetworkConfig"]],["impl RefUnwindSafe for Network",1,["server_config::node_config::Network"]],["impl RefUnwindSafe for NodeConfig",1,["server_config::node_config::NodeConfig"]],["impl RefUnwindSafe for TransportConfig",1,["server_config::node_config::TransportConfig"]],["impl RefUnwindSafe for ChainConfig",1,["server_config::node_config::ChainConfig"]],["impl RefUnwindSafe for ChainListenerConfig",1,["server_config::node_config::ChainListenerConfig"]],["impl RefUnwindSafe for UnresolvedConfig",1,["server_config::resolved_config::UnresolvedConfig"]],["impl RefUnwindSafe for TracingConfig",1,["server_config::resolved_config::TracingConfig"]],["impl RefUnwindSafe for ResolvedConfig",1,["server_config::resolved_config::ResolvedConfig"]],["impl RefUnwindSafe for ConfigData",1,["server_config::resolved_config::ConfigData"]],["impl RefUnwindSafe for ServiceKey",1,["server_config::system_services_config::ServiceKey"]],["impl RefUnwindSafe for SystemServicesConfig",1,["server_config::system_services_config::SystemServicesConfig"]],["impl RefUnwindSafe for AquaIpfsConfig",1,["server_config::system_services_config::AquaIpfsConfig"]],["impl RefUnwindSafe for ConnectorConfig",1,["server_config::system_services_config::ConnectorConfig"]],["impl RefUnwindSafe for DeciderConfig",1,["server_config::system_services_config::DeciderConfig"]],["impl RefUnwindSafe for RegistryConfig",1,["server_config::system_services_config::RegistryConfig"]]], +"service_modules":[["impl RefUnwindSafe for AddBlueprint",1,["service_modules::modules::blueprint::AddBlueprint"]],["impl RefUnwindSafe for Blueprint",1,["service_modules::modules::blueprint::Blueprint"]]], +"sorcerer":[["impl !RefUnwindSafe for Sorcerer",1,["sorcerer::sorcerer::Sorcerer"]],["impl RefUnwindSafe for SpellInfo",1,["sorcerer::spell_builtins::SpellInfo"]]], +"spell_event_bus":[["impl RefUnwindSafe for TriggerEvent",1,["spell_event_bus::api::TriggerEvent"]],["impl RefUnwindSafe for TriggerInfo",1,["spell_event_bus::api::TriggerInfo"]],["impl RefUnwindSafe for TimerEvent",1,["spell_event_bus::api::TimerEvent"]],["impl RefUnwindSafe for PeerEvent",1,["spell_event_bus::api::PeerEvent"]],["impl RefUnwindSafe for PeerEventType",1,["spell_event_bus::api::PeerEventType"]],["impl RefUnwindSafe for TriggerInfoAqua",1,["spell_event_bus::api::TriggerInfoAqua"]],["impl RefUnwindSafe for Action",1,["spell_event_bus::api::Action"]],["impl !RefUnwindSafe for EventBusError",1,["spell_event_bus::api::EventBusError"]],["impl !RefUnwindSafe for SpellEventBusApi",1,["spell_event_bus::api::SpellEventBusApi"]],["impl RefUnwindSafe for ConfigError",1,["spell_event_bus::config::ConfigError"]],["impl RefUnwindSafe for SpellTriggerConfigs",1,["spell_event_bus::config::SpellTriggerConfigs"]],["impl !RefUnwindSafe for SpellEventBus",1,["spell_event_bus::bus::SpellEventBus"]]], +"spell_service_api":[["impl RefUnwindSafe for CallError",1,["spell_service_api::CallError"]],["impl RefUnwindSafe for CallParams",1,["spell_service_api::CallParams"]],["impl !RefUnwindSafe for SpellServiceApi",1,["spell_service_api::SpellServiceApi"]]], +"spell_storage":[["impl !RefUnwindSafe for SpellStorage",1,["spell_storage::storage::SpellStorage"]]], +"system_services":[["impl !RefUnwindSafe for Deployer",1,["system_services::deployer::Deployer"]],["impl RefUnwindSafe for Versions",1,["system_services::distro::Versions"]],["impl !RefUnwindSafe for SystemServiceDistros",1,["system_services::distro::SystemServiceDistros"]],["impl RefUnwindSafe for Deployment",1,["system_services::Deployment"]],["impl !RefUnwindSafe for PackageDistro",1,["system_services::PackageDistro"]],["impl RefUnwindSafe for ServiceDistro",1,["system_services::ServiceDistro"]],["impl RefUnwindSafe for SpellDistro",1,["system_services::SpellDistro"]],["impl RefUnwindSafe for ServiceStatus",1,["system_services::ServiceStatus"]]], +"test_utils":[["impl RefUnwindSafe for DummyThreadPinner",1,["test_utils::pinning::DummyThreadPinner"]],["impl RefUnwindSafe for CreatedService",1,["test_utils::service::CreatedService"]],["impl RefUnwindSafe for RetStruct",1,["test_utils::utils::RetStruct"]]], +"toy_vms":[["impl RefUnwindSafe for EasyVM",1,["toy_vms::easy_vm::EasyVM"]]], +"types":[["impl RefUnwindSafe for DealId",1,["types::deal_id::DealId"]],["impl RefUnwindSafe for PeerScope",1,["types::peer_scope::PeerScope"]],["impl RefUnwindSafe for WorkerId",1,["types::peer_scope::WorkerId"]]], +"vm_utils":[["impl RefUnwindSafe for CreateVMDomainParams",1,["vm_utils::vm_utils::CreateVMDomainParams"]],["impl RefUnwindSafe for VmError",1,["vm_utils::vm_utils::VmError"]],["impl RefUnwindSafe for VmStatus",1,["vm_utils::vm_utils::VmStatus"]]], +"workers":[["impl !RefUnwindSafe for KeyStorageError",1,["workers::error::KeyStorageError"]],["impl !RefUnwindSafe for WorkersError",1,["workers::error::WorkersError"]],["impl !RefUnwindSafe for KeyStorage",1,["workers::key_storage::KeyStorage"]],["impl !RefUnwindSafe for PeerScopes",1,["workers::scope::PeerScopes"]],["impl RefUnwindSafe for WorkerParams",1,["workers::workers::WorkerParams"]],["impl !RefUnwindSafe for Workers",1,["workers::workers::Workers"]],["impl RefUnwindSafe for Event",1,["workers::workers::Event"]],["impl RefUnwindSafe for WorkersConfig",1,["workers::workers::WorkersConfig"]],["impl RefUnwindSafe for VmConfig",1,["workers::workers::VmConfig"]]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/panic/unwind_safe/trait.UnwindSafe.js b/trait.impl/core/panic/unwind_safe/trait.UnwindSafe.js new file mode 100644 index 0000000000..9722ee9546 --- /dev/null +++ b/trait.impl/core/panic/unwind_safe/trait.UnwindSafe.js @@ -0,0 +1,39 @@ +(function() {var implementors = { +"aquamarine":[["impl<RT, F> !UnwindSafe for AquamarineBackend<RT, F>",1,["aquamarine::aquamarine::AquamarineBackend"]],["impl !UnwindSafe for AquamarineApi",1,["aquamarine::aquamarine::AquamarineApi"]],["impl UnwindSafe for VmConfig",1,["aquamarine::config::VmConfig"]],["impl UnwindSafe for VmPoolConfig",1,["aquamarine::config::VmPoolConfig"]],["impl UnwindSafe for DataStoreConfig",1,["aquamarine::config::DataStoreConfig"]],["impl !UnwindSafe for AquamarineApiError",1,["aquamarine::error::AquamarineApiError"]],["impl UnwindSafe for ParticleDataStore",1,["aquamarine::particle_data_store::ParticleDataStore"]],["impl !UnwindSafe for DataStoreError",1,["aquamarine::particle_data_store::DataStoreError"]],["impl<RT, F> !UnwindSafe for Plumber<RT, F>",1,["aquamarine::plumber::Plumber"]],["impl UnwindSafe for ParticleEffects",1,["aquamarine::particle_effects::ParticleEffects"]],["impl UnwindSafe for InterpretationStats",1,["aquamarine::particle_effects::InterpretationStats"]],["impl !UnwindSafe for RemoteRoutingEffects",1,["aquamarine::particle_effects::RemoteRoutingEffects"]]], +"chain_connector":[["impl !UnwindSafe for HttpChainConnector",1,["chain_connector::connector::HttpChainConnector"]],["impl !UnwindSafe for ConnectorError",1,["chain_connector::error::ConnectorError"]],["impl UnwindSafe for TooManyProofs",1,["chain_connector::function::capacity::Capacity::TooManyProofs"]],["impl UnwindSafe for CapacityCommitmentIsNotActive",1,["chain_connector::function::capacity::Capacity::CapacityCommitmentIsNotActive"]],["impl UnwindSafe for getGlobalNonceCall",1,["chain_connector::function::capacity::Capacity::getGlobalNonceCall"]],["impl UnwindSafe for getGlobalNonceReturn",1,["chain_connector::function::capacity::Capacity::getGlobalNonceReturn"]],["impl UnwindSafe for getStatusCall",1,["chain_connector::function::capacity::Capacity::getStatusCall"]],["impl UnwindSafe for getStatusReturn",1,["chain_connector::function::capacity::Capacity::getStatusReturn"]],["impl UnwindSafe for submitProofCall",1,["chain_connector::function::capacity::Capacity::submitProofCall"]],["impl UnwindSafe for submitProofReturn",1,["chain_connector::function::capacity::Capacity::submitProofReturn"]],["impl UnwindSafe for submitProofsCall",1,["chain_connector::function::capacity::Capacity::submitProofsCall"]],["impl UnwindSafe for submitProofsReturn",1,["chain_connector::function::capacity::Capacity::submitProofsReturn"]],["impl UnwindSafe for CapacityCalls",1,["chain_connector::function::capacity::Capacity::CapacityCalls"]],["impl UnwindSafe for CapacityErrors",1,["chain_connector::function::capacity::Capacity::CapacityErrors"]],["impl UnwindSafe for CCStatus",1,["chain_connector::function::capacity::CCStatus"]],["impl UnwindSafe for CommitmentId",1,["chain_connector::function::capacity::CommitmentId"]],["impl UnwindSafe for capacityCall",1,["chain_connector::function::core::Core::capacityCall"]],["impl UnwindSafe for capacityReturn",1,["chain_connector::function::core::Core::capacityReturn"]],["impl UnwindSafe for marketCall",1,["chain_connector::function::core::Core::marketCall"]],["impl UnwindSafe for marketReturn",1,["chain_connector::function::core::Core::marketReturn"]],["impl UnwindSafe for currentEpochCall",1,["chain_connector::function::core::Core::currentEpochCall"]],["impl UnwindSafe for currentEpochReturn",1,["chain_connector::function::core::Core::currentEpochReturn"]],["impl UnwindSafe for epochDurationCall",1,["chain_connector::function::core::Core::epochDurationCall"]],["impl UnwindSafe for epochDurationReturn",1,["chain_connector::function::core::Core::epochDurationReturn"]],["impl UnwindSafe for initTimestampCall",1,["chain_connector::function::core::Core::initTimestampCall"]],["impl UnwindSafe for initTimestampReturn",1,["chain_connector::function::core::Core::initTimestampReturn"]],["impl UnwindSafe for difficultyCall",1,["chain_connector::function::core::Core::difficultyCall"]],["impl UnwindSafe for difficultyReturn",1,["chain_connector::function::core::Core::difficultyReturn"]],["impl UnwindSafe for minProofsPerEpochCall",1,["chain_connector::function::core::Core::minProofsPerEpochCall"]],["impl UnwindSafe for minProofsPerEpochReturn",1,["chain_connector::function::core::Core::minProofsPerEpochReturn"]],["impl UnwindSafe for maxProofsPerEpochCall",1,["chain_connector::function::core::Core::maxProofsPerEpochCall"]],["impl UnwindSafe for maxProofsPerEpochReturn",1,["chain_connector::function::core::Core::maxProofsPerEpochReturn"]],["impl UnwindSafe for CoreCalls",1,["chain_connector::function::core::Core::CoreCalls"]],["impl UnwindSafe for CIDV1",1,["chain_connector::function::deal::Deal::CIDV1"]],["impl UnwindSafe for Status",1,["chain_connector::function::deal::Deal::Status"]],["impl UnwindSafe for ComputeUnit",1,["chain_connector::function::deal::Deal::ComputeUnit"]],["impl UnwindSafe for getStatusCall",1,["chain_connector::function::deal::Deal::getStatusCall"]],["impl UnwindSafe for getStatusReturn",1,["chain_connector::function::deal::Deal::getStatusReturn"]],["impl UnwindSafe for appCIDCall",1,["chain_connector::function::deal::Deal::appCIDCall"]],["impl UnwindSafe for appCIDReturn",1,["chain_connector::function::deal::Deal::appCIDReturn"]],["impl UnwindSafe for setWorkerCall",1,["chain_connector::function::deal::Deal::setWorkerCall"]],["impl UnwindSafe for setWorkerReturn",1,["chain_connector::function::deal::Deal::setWorkerReturn"]],["impl UnwindSafe for getComputeUnitsCall",1,["chain_connector::function::deal::Deal::getComputeUnitsCall"]],["impl UnwindSafe for getComputeUnitsReturn",1,["chain_connector::function::deal::Deal::getComputeUnitsReturn"]],["impl UnwindSafe for DealCalls",1,["chain_connector::function::deal::Deal::DealCalls"]],["impl UnwindSafe for ComputePeer",1,["chain_connector::function::offer::Offer::ComputePeer"]],["impl UnwindSafe for ComputeUnit",1,["chain_connector::function::offer::Offer::ComputeUnit"]],["impl UnwindSafe for getComputePeerCall",1,["chain_connector::function::offer::Offer::getComputePeerCall"]],["impl UnwindSafe for getComputePeerReturn",1,["chain_connector::function::offer::Offer::getComputePeerReturn"]],["impl UnwindSafe for getComputeUnitsCall",1,["chain_connector::function::offer::Offer::getComputeUnitsCall"]],["impl UnwindSafe for getComputeUnitsReturn",1,["chain_connector::function::offer::Offer::getComputeUnitsReturn"]],["impl UnwindSafe for returnComputeUnitFromDealCall",1,["chain_connector::function::offer::Offer::returnComputeUnitFromDealCall"]],["impl UnwindSafe for returnComputeUnitFromDealReturn",1,["chain_connector::function::offer::Offer::returnComputeUnitFromDealReturn"]],["impl UnwindSafe for OfferCalls",1,["chain_connector::function::offer::Offer::OfferCalls"]],["impl UnwindSafe for PendingUnit",1,["chain_connector::function::offer::PendingUnit"]],["impl UnwindSafe for SubnetResolveResult",1,["chain_connector::types::SubnetResolveResult"]],["impl UnwindSafe for CCInitParams",1,["chain_connector::types::CCInitParams"]]], +"chain_data":[["impl UnwindSafe for BlockHeader",1,["chain_data::block_header::BlockHeader"]],["impl UnwindSafe for EventField",1,["chain_data::chain_data::EventField"]],["impl !UnwindSafe for ChainDataError",1,["chain_data::error::ChainDataError"]],["impl UnwindSafe for Log",1,["chain_data::log::Log"]],["impl !UnwindSafe for LogParseError",1,["chain_data::log::LogParseError"]]], +"chain_listener":[["impl UnwindSafe for CommitmentActivated",1,["chain_listener::event::cc_activated::CommitmentActivated"]],["impl UnwindSafe for CIDV1",1,["chain_listener::event::compute_unit_matched::CIDV1"]],["impl UnwindSafe for ComputeUnitMatched",1,["chain_listener::event::compute_unit_matched::ComputeUnitMatched"]],["impl UnwindSafe for UnitActivated",1,["chain_listener::event::unit_activated::UnitActivated"]],["impl UnwindSafe for UnitDeactivated",1,["chain_listener::event::unit_deactivated::UnitDeactivated"]],["impl !UnwindSafe for ChainListener",1,["chain_listener::listener::ChainListener"]]], +"cid_utils":[["impl UnwindSafe for Hash",1,["cid_utils::hash::Hash"]]], +"connected_client":[["impl UnwindSafe for ClientCommand",1,["connected_client::command::ClientCommand"]],["impl !UnwindSafe for ConnectedClient",1,["connected_client::connected_client::ConnectedClient"]],["impl UnwindSafe for ClientEvent",1,["connected_client::event::ClientEvent"]]], +"connection_pool":[["impl !UnwindSafe for Command",1,["connection_pool::api::Command"]],["impl !UnwindSafe for ConnectionPoolApi",1,["connection_pool::api::ConnectionPoolApi"]],["impl !UnwindSafe for ConnectionPoolBehaviour",1,["connection_pool::behaviour::ConnectionPoolBehaviour"]],["impl UnwindSafe for LifecycleEvent",1,["connection_pool::connection_pool::LifecycleEvent"]]], +"core_distributor":[["impl UnwindSafe for CreateError",1,["core_distributor::errors::CreateError"]],["impl !UnwindSafe for LoadingError",1,["core_distributor::errors::LoadingError"]],["impl !UnwindSafe for PersistError",1,["core_distributor::errors::PersistError"]],["impl UnwindSafe for CurrentAssignment",1,["core_distributor::errors::CurrentAssignment"]],["impl UnwindSafe for AcquireError",1,["core_distributor::errors::AcquireError"]],["impl UnwindSafe for WorkType",1,["core_distributor::types::WorkType"]],["impl UnwindSafe for AcquireRequest",1,["core_distributor::types::AcquireRequest"]],["impl UnwindSafe for Cores",1,["core_distributor::types::Cores"]],["impl UnwindSafe for Assignment",1,["core_distributor::types::Assignment"]],["impl UnwindSafe for SystemAssignment",1,["core_distributor::types::SystemAssignment"]],["impl UnwindSafe for CoreRange",1,["core_distributor::core_range::CoreRange"]],["impl !UnwindSafe for PersistentCoreDistributor",1,["core_distributor::distributor::PersistentCoreDistributor"]],["impl !UnwindSafe for PersistenceTask",1,["core_distributor::persistence::PersistenceTask"]],["impl UnwindSafe for AcquireStrategy",1,["core_distributor::strategy::AcquireStrategy"]],["impl UnwindSafe for DummyCoreDistibutor",1,["core_distributor::dummy::DummyCoreDistibutor"]]], +"created_swarm":[["impl !UnwindSafe for CreatedSwarm",1,["created_swarm::swarm::CreatedSwarm"]],["impl UnwindSafe for NetworkKey",1,["created_swarm::swarm::NetworkKey"]],["impl !UnwindSafe for SwarmConfig",1,["created_swarm::swarm::SwarmConfig"]],["impl UnwindSafe for BaseVmConfig",1,["created_swarm::swarm::BaseVmConfig"]]], +"fluence_libp2p":[["impl UnwindSafe for RandomPeerId",1,["fluence_libp2p::random_peer_id::RandomPeerId"]],["impl UnwindSafe for Transport",1,["fluence_libp2p::transport::Transport"]]], +"fs_utils":[["impl !UnwindSafe for LoadDataError",1,["fs_utils::LoadDataError"]]], +"health":[["impl !UnwindSafe for HealthCheckRegistry",1,["health::HealthCheckRegistry"]],["impl UnwindSafe for HealthStatus",1,["health::HealthStatus"]]], +"hex_utils":[["impl UnwindSafe for Hex",1,["hex_utils::serde_as::Hex"]]], +"kademlia":[["impl !UnwindSafe for Command",1,["kademlia::api::Command"]],["impl !UnwindSafe for KademliaApi",1,["kademlia::api::KademliaApi"]],["impl UnwindSafe for KademliaConfig",1,["kademlia::behaviour::KademliaConfig"]],["impl !UnwindSafe for Kademlia",1,["kademlia::behaviour::Kademlia"]],["impl UnwindSafe for KademliaError",1,["kademlia::error::KademliaError"]]], +"local_vm":[["impl UnwindSafe for Instruction",1,["local_vm::local_vm::Instruction"]],["impl UnwindSafe for ClientFunctionsResult",1,["local_vm::local_vm::ClientFunctionsResult"]]], +"log_format":[["impl<T> UnwindSafe for Format<T>where\n T: UnwindSafe,",1,["log_format::Format"]]], +"log_utils":[["impl UnwindSafe for LogSpec",1,["log_utils::LogSpec"]]], +"nox":[["impl !UnwindSafe for Connectivity",1,["nox::connectivity::Connectivity"]],["impl UnwindSafe for StartedHttp",1,["nox::http::StartedHttp"]],["impl<RT> !UnwindSafe for Node<RT>",1,["nox::node::Node"]],["impl !UnwindSafe for FluenceNetworkBehaviour",1,["nox::behaviour::network::FluenceNetworkBehaviour"]],["impl !UnwindSafe for FluenceNetworkBehaviourEvent",1,["nox::behaviour::network::FluenceNetworkBehaviourEvent"]],["impl UnwindSafe for Versions",1,["nox::Versions"]]], +"particle_args":[["impl UnwindSafe for Args",1,["particle_args::args::Args"]],["impl !UnwindSafe for ArgsError",1,["particle_args::args_error::ArgsError"]],["impl UnwindSafe for JError",1,["particle_args::args_error::JError"]]], +"particle_builtins":[["impl !UnwindSafe for CustomService",1,["particle_builtins::builtins::CustomService"]],["impl<C> !UnwindSafe for Builtins<C>",1,["particle_builtins::builtins::Builtins"]],["impl UnwindSafe for BuiltinsConfig",1,["particle_builtins::builtins::BuiltinsConfig"]],["impl UnwindSafe for NodeInfo",1,["particle_builtins::identify::NodeInfo"]]], +"particle_execution":[["impl UnwindSafe for FunctionOutcome",1,["particle_execution::function_outcome::FunctionOutcome"]],["impl !UnwindSafe for ServiceFunction",1,["particle_execution::particle_function::ServiceFunction"]],["impl UnwindSafe for ParticleParams",1,["particle_execution::particle_params::ParticleParams"]],["impl UnwindSafe for ParticleVault",1,["particle_execution::particle_vault::ParticleVault"]],["impl !UnwindSafe for VaultError",1,["particle_execution::particle_vault::VaultError"]]], +"particle_modules":[["impl !UnwindSafe for ModuleError",1,["particle_modules::error::ModuleError"]],["impl UnwindSafe for EffectorsMode",1,["particle_modules::modules::EffectorsMode"]],["impl !UnwindSafe for ModuleRepository",1,["particle_modules::modules::ModuleRepository"]]], +"particle_protocol":[["impl !UnwindSafe for SendStatus",1,["particle_protocol::libp2p_protocol::message::SendStatus"]],["impl !UnwindSafe for CompletionChannel",1,["particle_protocol::libp2p_protocol::message::CompletionChannel"]],["impl !UnwindSafe for HandlerMessage",1,["particle_protocol::libp2p_protocol::message::HandlerMessage"]],["impl UnwindSafe for ProtocolMessage",1,["particle_protocol::libp2p_protocol::message::ProtocolMessage"]],["impl UnwindSafe for ProtocolConfig",1,["particle_protocol::libp2p_protocol::upgrade::ProtocolConfig"]],["impl UnwindSafe for Contact",1,["particle_protocol::contact::Contact"]],["impl !UnwindSafe for ParticleError",1,["particle_protocol::error::ParticleError"]],["impl !UnwindSafe for ExtendedParticle",1,["particle_protocol::particle::ExtendedParticle"]],["impl UnwindSafe for Particle",1,["particle_protocol::particle::Particle"]]], +"particle_services":[["impl UnwindSafe for ServiceType",1,["particle_services::app_services::ServiceType"]],["impl UnwindSafe for ServiceInfo",1,["particle_services::app_services::ServiceInfo"]],["impl !UnwindSafe for ParticleAppServices",1,["particle_services::app_services::ParticleAppServices"]],["impl !UnwindSafe for ServiceError",1,["particle_services::error::ServiceError"]],["impl UnwindSafe for ParticleAppServicesConfig",1,["particle_services::config::ParticleAppServicesConfig"]],["impl UnwindSafe for WasmBackendConfig",1,["particle_services::config::WasmBackendConfig"]]], +"peer_metrics":[["impl !UnwindSafe for ChainListenerMetrics",1,["peer_metrics::chain_listener::ChainListenerMetrics"]],["impl !UnwindSafe for ConnectionPoolMetrics",1,["peer_metrics::connection_pool::ConnectionPoolMetrics"]],["impl UnwindSafe for Resolution",1,["peer_metrics::connectivity::Resolution"]],["impl !UnwindSafe for ConnectivityMetrics",1,["peer_metrics::connectivity::ConnectivityMetrics"]],["impl !UnwindSafe for DispatcherMetrics",1,["peer_metrics::dispatcher::DispatcherMetrics"]],["impl UnwindSafe for FunctionKind",1,["peer_metrics::particle_executor::FunctionKind"]],["impl !UnwindSafe for ParticleExecutorMetrics",1,["peer_metrics::particle_executor::ParticleExecutorMetrics"]],["impl UnwindSafe for WorkerLabel",1,["peer_metrics::particle_executor::WorkerLabel"]],["impl UnwindSafe for WorkerType",1,["peer_metrics::particle_executor::WorkerType"]],["impl !UnwindSafe for ServicesMetricsBackend",1,["peer_metrics::services_metrics::backend::ServicesMetricsBackend"]],["impl !UnwindSafe for ServicesMetricsBuiltin",1,["peer_metrics::services_metrics::builtin::ServicesMetricsBuiltin"]],["impl UnwindSafe for ServiceType",1,["peer_metrics::services_metrics::external::ServiceType"]],["impl !UnwindSafe for ServicesMetricsExternal",1,["peer_metrics::services_metrics::external::ServicesMetricsExternal"]],["impl UnwindSafe for ServiceCallStats",1,["peer_metrics::services_metrics::message::ServiceCallStats"]],["impl UnwindSafe for ServiceMemoryStat",1,["peer_metrics::services_metrics::message::ServiceMemoryStat"]],["impl !UnwindSafe for ServicesMetrics",1,["peer_metrics::services_metrics::ServicesMetrics"]],["impl !UnwindSafe for SpellMetrics",1,["peer_metrics::spell_metrics::SpellMetrics"]],["impl !UnwindSafe for VmPoolMetrics",1,["peer_metrics::vm_pool::VmPoolMetrics"]],["impl UnwindSafe for ParticleType",1,["peer_metrics::ParticleType"]],["impl UnwindSafe for ParticleLabel",1,["peer_metrics::ParticleLabel"]]], +"server_config":[["impl UnwindSafe for RootKeyPairArgs",1,["server_config::args::RootKeyPairArgs"]],["impl UnwindSafe for TracingArgs",1,["server_config::args::TracingArgs"]],["impl UnwindSafe for TracingType",1,["server_config::args::TracingType"]],["impl UnwindSafe for EnabledSystemServices",1,["server_config::args::EnabledSystemServices"]],["impl UnwindSafe for DevModeArgs",1,["server_config::args::DevModeArgs"]],["impl UnwindSafe for BootstrapConfig",1,["server_config::bootstrap_config::BootstrapConfig"]],["impl UnwindSafe for KademliaConfig",1,["server_config::kademlia_config::KademliaConfig"]],["impl !UnwindSafe for NetworkConfig",1,["server_config::network_config::NetworkConfig"]],["impl UnwindSafe for Network",1,["server_config::node_config::Network"]],["impl UnwindSafe for NodeConfig",1,["server_config::node_config::NodeConfig"]],["impl UnwindSafe for TransportConfig",1,["server_config::node_config::TransportConfig"]],["impl UnwindSafe for ChainConfig",1,["server_config::node_config::ChainConfig"]],["impl UnwindSafe for ChainListenerConfig",1,["server_config::node_config::ChainListenerConfig"]],["impl UnwindSafe for UnresolvedConfig",1,["server_config::resolved_config::UnresolvedConfig"]],["impl UnwindSafe for TracingConfig",1,["server_config::resolved_config::TracingConfig"]],["impl UnwindSafe for ResolvedConfig",1,["server_config::resolved_config::ResolvedConfig"]],["impl UnwindSafe for ConfigData",1,["server_config::resolved_config::ConfigData"]],["impl UnwindSafe for ServiceKey",1,["server_config::system_services_config::ServiceKey"]],["impl UnwindSafe for SystemServicesConfig",1,["server_config::system_services_config::SystemServicesConfig"]],["impl UnwindSafe for AquaIpfsConfig",1,["server_config::system_services_config::AquaIpfsConfig"]],["impl UnwindSafe for ConnectorConfig",1,["server_config::system_services_config::ConnectorConfig"]],["impl UnwindSafe for DeciderConfig",1,["server_config::system_services_config::DeciderConfig"]],["impl UnwindSafe for RegistryConfig",1,["server_config::system_services_config::RegistryConfig"]]], +"service_modules":[["impl UnwindSafe for AddBlueprint",1,["service_modules::modules::blueprint::AddBlueprint"]],["impl UnwindSafe for Blueprint",1,["service_modules::modules::blueprint::Blueprint"]]], +"sorcerer":[["impl !UnwindSafe for Sorcerer",1,["sorcerer::sorcerer::Sorcerer"]],["impl UnwindSafe for SpellInfo",1,["sorcerer::spell_builtins::SpellInfo"]]], +"spell_event_bus":[["impl UnwindSafe for TriggerEvent",1,["spell_event_bus::api::TriggerEvent"]],["impl UnwindSafe for TriggerInfo",1,["spell_event_bus::api::TriggerInfo"]],["impl UnwindSafe for TimerEvent",1,["spell_event_bus::api::TimerEvent"]],["impl UnwindSafe for PeerEvent",1,["spell_event_bus::api::PeerEvent"]],["impl UnwindSafe for PeerEventType",1,["spell_event_bus::api::PeerEventType"]],["impl UnwindSafe for TriggerInfoAqua",1,["spell_event_bus::api::TriggerInfoAqua"]],["impl UnwindSafe for Action",1,["spell_event_bus::api::Action"]],["impl !UnwindSafe for EventBusError",1,["spell_event_bus::api::EventBusError"]],["impl !UnwindSafe for SpellEventBusApi",1,["spell_event_bus::api::SpellEventBusApi"]],["impl UnwindSafe for ConfigError",1,["spell_event_bus::config::ConfigError"]],["impl UnwindSafe for SpellTriggerConfigs",1,["spell_event_bus::config::SpellTriggerConfigs"]],["impl !UnwindSafe for SpellEventBus",1,["spell_event_bus::bus::SpellEventBus"]]], +"spell_service_api":[["impl UnwindSafe for CallError",1,["spell_service_api::CallError"]],["impl UnwindSafe for CallParams",1,["spell_service_api::CallParams"]],["impl !UnwindSafe for SpellServiceApi",1,["spell_service_api::SpellServiceApi"]]], +"spell_storage":[["impl !UnwindSafe for SpellStorage",1,["spell_storage::storage::SpellStorage"]]], +"system_services":[["impl !UnwindSafe for Deployer",1,["system_services::deployer::Deployer"]],["impl UnwindSafe for Versions",1,["system_services::distro::Versions"]],["impl !UnwindSafe for SystemServiceDistros",1,["system_services::distro::SystemServiceDistros"]],["impl UnwindSafe for Deployment",1,["system_services::Deployment"]],["impl !UnwindSafe for PackageDistro",1,["system_services::PackageDistro"]],["impl UnwindSafe for ServiceDistro",1,["system_services::ServiceDistro"]],["impl UnwindSafe for SpellDistro",1,["system_services::SpellDistro"]],["impl UnwindSafe for ServiceStatus",1,["system_services::ServiceStatus"]]], +"test_utils":[["impl UnwindSafe for DummyThreadPinner",1,["test_utils::pinning::DummyThreadPinner"]],["impl UnwindSafe for CreatedService",1,["test_utils::service::CreatedService"]],["impl UnwindSafe for RetStruct",1,["test_utils::utils::RetStruct"]]], +"toy_vms":[["impl UnwindSafe for EasyVM",1,["toy_vms::easy_vm::EasyVM"]]], +"types":[["impl UnwindSafe for DealId",1,["types::deal_id::DealId"]],["impl UnwindSafe for PeerScope",1,["types::peer_scope::PeerScope"]],["impl UnwindSafe for WorkerId",1,["types::peer_scope::WorkerId"]]], +"vm_utils":[["impl UnwindSafe for CreateVMDomainParams",1,["vm_utils::vm_utils::CreateVMDomainParams"]],["impl UnwindSafe for VmError",1,["vm_utils::vm_utils::VmError"]],["impl UnwindSafe for VmStatus",1,["vm_utils::vm_utils::VmStatus"]]], +"workers":[["impl !UnwindSafe for KeyStorageError",1,["workers::error::KeyStorageError"]],["impl !UnwindSafe for WorkersError",1,["workers::error::WorkersError"]],["impl UnwindSafe for KeyStorage",1,["workers::key_storage::KeyStorage"]],["impl !UnwindSafe for PeerScopes",1,["workers::scope::PeerScopes"]],["impl UnwindSafe for WorkerParams",1,["workers::workers::WorkerParams"]],["impl !UnwindSafe for Workers",1,["workers::workers::Workers"]],["impl UnwindSafe for Event",1,["workers::workers::Event"]],["impl UnwindSafe for WorkersConfig",1,["workers::workers::WorkersConfig"]],["impl UnwindSafe for VmConfig",1,["workers::workers::VmConfig"]]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/str/traits/trait.FromStr.js b/trait.impl/core/str/traits/trait.FromStr.js new file mode 100644 index 0000000000..00b3919e06 --- /dev/null +++ b/trait.impl/core/str/traits/trait.FromStr.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"core_distributor":[["impl FromStr for CoreRange"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core_distributor/distributor/trait.CoreDistributor.js b/trait.impl/core_distributor/distributor/trait.CoreDistributor.js new file mode 100644 index 0000000000..32f768c189 --- /dev/null +++ b/trait.impl/core_distributor/distributor/trait.CoreDistributor.js @@ -0,0 +1,4 @@ +(function() {var implementors = { +"core_distributor":[], +"workers":[] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/cpu_utils/pinning/trait.ThreadPinner.js b/trait.impl/cpu_utils/pinning/trait.ThreadPinner.js new file mode 100644 index 0000000000..a62084cd9a --- /dev/null +++ b/trait.impl/cpu_utils/pinning/trait.ThreadPinner.js @@ -0,0 +1,4 @@ +(function() {var implementors = { +"core_distributor":[], +"test_utils":[["impl ThreadPinner for DummyThreadPinner"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/kademlia/api/trait.KademliaApiT.js b/trait.impl/kademlia/api/trait.KademliaApiT.js new file mode 100644 index 0000000000..462f4d0115 --- /dev/null +++ b/trait.impl/kademlia/api/trait.KademliaApiT.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"kademlia":[] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/libp2p_core/upgrade/trait.InboundUpgrade.js b/trait.impl/libp2p_core/upgrade/trait.InboundUpgrade.js new file mode 100644 index 0000000000..8aa981b49f --- /dev/null +++ b/trait.impl/libp2p_core/upgrade/trait.InboundUpgrade.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"particle_protocol":[["impl<Socket> InboundUpgrade<Socket> for ProtocolConfigwhere\n Socket: AsyncRead + Send + Unpin + 'static,"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/libp2p_core/upgrade/trait.OutboundUpgrade.js b/trait.impl/libp2p_core/upgrade/trait.OutboundUpgrade.js new file mode 100644 index 0000000000..c6df72d7c2 --- /dev/null +++ b/trait.impl/libp2p_core/upgrade/trait.OutboundUpgrade.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"particle_protocol":[["impl<Socket> OutboundUpgrade<Socket> for HandlerMessagewhere\n Socket: AsyncRead + AsyncWrite + Send + Unpin + 'static,"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/libp2p_core/upgrade/trait.UpgradeInfo.js b/trait.impl/libp2p_core/upgrade/trait.UpgradeInfo.js new file mode 100644 index 0000000000..1db684e368 --- /dev/null +++ b/trait.impl/libp2p_core/upgrade/trait.UpgradeInfo.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"particle_protocol":[["impl UpgradeInfo for HandlerMessage"],["impl UpgradeInfo for ProtocolConfig"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/libp2p_swarm/behaviour/trait.NetworkBehaviour.js b/trait.impl/libp2p_swarm/behaviour/trait.NetworkBehaviour.js new file mode 100644 index 0000000000..1e69d5f602 --- /dev/null +++ b/trait.impl/libp2p_swarm/behaviour/trait.NetworkBehaviour.js @@ -0,0 +1,5 @@ +(function() {var implementors = { +"connection_pool":[["impl NetworkBehaviour for ConnectionPoolBehaviour"]], +"kademlia":[["impl NetworkBehaviour for Kademlia"]], +"nox":[["impl NetworkBehaviour for FluenceNetworkBehaviourwhere\n Behaviour: NetworkBehaviour,\n Behaviour: NetworkBehaviour,\n Behaviour: NetworkBehaviour,\n ConnectionPoolBehaviour: NetworkBehaviour,\n Kademlia: NetworkBehaviour,"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/particle_execution/particle_function/trait.ParticleFunction.js b/trait.impl/particle_execution/particle_function/trait.ParticleFunction.js new file mode 100644 index 0000000000..6d9eca8957 --- /dev/null +++ b/trait.impl/particle_execution/particle_function/trait.ParticleFunction.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"particle_builtins":[["impl<C> ParticleFunction for Builtins<C>where\n C: Clone + Send + Sync + 'static + AsRef<KademliaApi> + AsRef<ConnectionPoolApi>,"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/particle_execution/particle_function/trait.ParticleFunctionStatic.js b/trait.impl/particle_execution/particle_function/trait.ParticleFunctionStatic.js new file mode 100644 index 0000000000..d701146cfa --- /dev/null +++ b/trait.impl/particle_execution/particle_function/trait.ParticleFunctionStatic.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"particle_execution":[] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/prometheus_client/encoding/trait.EncodeLabelSet.js b/trait.impl/prometheus_client/encoding/trait.EncodeLabelSet.js new file mode 100644 index 0000000000..adcb8281cd --- /dev/null +++ b/trait.impl/prometheus_client/encoding/trait.EncodeLabelSet.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"peer_metrics":[["impl EncodeLabelSet for WorkerLabel"],["impl EncodeLabelSet for ParticleLabel"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/prometheus_client/encoding/trait.EncodeLabelValue.js b/trait.impl/prometheus_client/encoding/trait.EncodeLabelValue.js new file mode 100644 index 0000000000..d8185c9a7a --- /dev/null +++ b/trait.impl/prometheus_client/encoding/trait.EncodeLabelValue.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"peer_metrics":[["impl EncodeLabelValue for Resolution"],["impl EncodeLabelValue for FunctionKind"],["impl EncodeLabelValue for ParticleType"],["impl EncodeLabelValue for WorkerType"],["impl EncodeLabelValue for ServiceType"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/serde/de/trait.Deserialize.js b/trait.impl/serde/de/trait.Deserialize.js new file mode 100644 index 0000000000..9db5c6a053 --- /dev/null +++ b/trait.impl/serde/de/trait.Deserialize.js @@ -0,0 +1,15 @@ +(function() {var implementors = { +"chain_connector":[["impl<'de> Deserialize<'de> for Status"],["impl<'de> Deserialize<'de> for CommitmentId"],["impl<'de> Deserialize<'de> for SubnetResolveResult"]], +"chain_data":[["impl<'de> Deserialize<'de> for BlockHeader"],["impl<'de> Deserialize<'de> for Log"]], +"cid_utils":[["impl<'de> Deserialize<'de> for Hash"]], +"connected_client":[["impl<'de> Deserialize<'de> for ClientCommand"]], +"core_distributor":[["impl<'de> Deserialize<'de> for WorkType"],["impl<'de> Deserialize<'de> for CoreRange"]], +"fluence_libp2p":[["impl<'de> Deserialize<'de> for Transport"]], +"particle_protocol":[["impl<'de> Deserialize<'de> for Particle"],["impl<'de> Deserialize<'de> for ProtocolMessage"],["impl<'de> Deserialize<'de> for Contact"],["impl<'de> Deserialize<'de> for ProtocolConfig"]], +"particle_services":[["impl<'de> Deserialize<'de> for ServiceType"]], +"server_config":[["impl<'de> Deserialize<'de> for DeciderConfig"],["impl<'de> Deserialize<'de> for BootstrapConfig"],["impl<'de> Deserialize<'de> for TransportConfig"],["impl<'de> Deserialize<'de> for ServiceKey"],["impl<'de> Deserialize<'de> for AquaIpfsConfig"],["impl<'de> Deserialize<'de> for RegistryConfig"],["impl<'de> Deserialize<'de> for ConnectorConfig"],["impl<'de> Deserialize<'de> for Network"],["impl<'de> Deserialize<'de> for UnresolvedConfig"],["impl<'de> Deserialize<'de> for ChainListenerConfig"],["impl<'de> Deserialize<'de> for SystemServicesConfig"],["impl<'de> Deserialize<'de> for TracingConfig"],["impl<'de> Deserialize<'de> for ChainConfig"]], +"service_modules":[["impl<'de> Deserialize<'de> for Blueprint"]], +"sorcerer":[["impl<'de> Deserialize<'de> for SpellInfo"]], +"spell_event_bus":[["impl<'de> Deserialize<'de> for TimerEvent"],["impl<'de> Deserialize<'de> for TriggerInfoAqua"],["impl<'de> Deserialize<'de> for PeerEvent"]], +"types":[["impl<'de> Deserialize<'de> for WorkerId"],["impl<'de> Deserialize<'de> for DealId"],["impl<'de> Deserialize<'de> for PeerScope"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/serde/ser/trait.Serialize.js b/trait.impl/serde/ser/trait.Serialize.js new file mode 100644 index 0000000000..32cbbd7b78 --- /dev/null +++ b/trait.impl/serde/ser/trait.Serialize.js @@ -0,0 +1,16 @@ +(function() {var implementors = { +"chain_connector":[["impl Serialize for Status"],["impl Serialize for CommitmentId"],["impl Serialize for SubnetResolveResult"]], +"chain_data":[["impl Serialize for Log"]], +"cid_utils":[["impl Serialize for Hash"]], +"connected_client":[["impl Serialize for ClientCommand"]], +"core_distributor":[["impl Serialize for CoreRange"],["impl Serialize for WorkType"]], +"fluence_libp2p":[["impl Serialize for Transport"]], +"particle_builtins":[["impl Serialize for NodeInfo"]], +"particle_protocol":[["impl Serialize for ProtocolConfig"],["impl Serialize for Contact"],["impl Serialize for ProtocolMessage"],["impl Serialize for Particle"]], +"particle_services":[["impl Serialize for ServiceType"]], +"server_config":[["impl Serialize for TracingConfig"],["impl Serialize for ConnectorConfig"],["impl Serialize for TracingArgs"],["impl Serialize for RootKeyPairArgs"],["impl Serialize for TracingType"],["impl Serialize for ChainListenerConfig"],["impl Serialize for Network"],["impl Serialize for TransportConfig"],["impl Serialize for SystemServicesConfig"],["impl Serialize for UnresolvedConfig"],["impl Serialize for BootstrapConfig"],["impl Serialize for ServiceKey"],["impl Serialize for EnabledSystemServices"],["impl Serialize for KademliaConfig"],["impl Serialize for AquaIpfsConfig"],["impl Serialize for RegistryConfig"],["impl Serialize for NodeConfig"],["impl Serialize for ResolvedConfig"],["impl Serialize for DeciderConfig"],["impl Serialize for ChainConfig"],["impl Serialize for DevModeArgs"]], +"service_modules":[["impl Serialize for Blueprint"]], +"sorcerer":[["impl Serialize for SpellInfo"]], +"spell_event_bus":[["impl Serialize for TimerEvent"],["impl Serialize for PeerEvent"],["impl Serialize for TriggerInfoAqua"]], +"types":[["impl Serialize for DealId"],["impl Serialize for WorkerId"],["impl Serialize for PeerScope"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/serde_with/de/trait.DeserializeAs.js b/trait.impl/serde_with/de/trait.DeserializeAs.js new file mode 100644 index 0000000000..405a7adeed --- /dev/null +++ b/trait.impl/serde_with/de/trait.DeserializeAs.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"hex_utils":[["impl<'de, T> DeserializeAs<'de, T> for Hexwhere\n T: FromHex,\n T::Error: Display,"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/serde_with/ser/trait.SerializeAs.js b/trait.impl/serde_with/ser/trait.SerializeAs.js new file mode 100644 index 0000000000..04bc83b927 --- /dev/null +++ b/trait.impl/serde_with/ser/trait.SerializeAs.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"hex_utils":[["impl<T> SerializeAs<T> for Hexwhere\n T: ToHex,"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/tracing_subscriber/fmt/format/trait.FormatEvent.js b/trait.impl/tracing_subscriber/fmt/format/trait.FormatEvent.js new file mode 100644 index 0000000000..7944425ab1 --- /dev/null +++ b/trait.impl/tracing_subscriber/fmt/format/trait.FormatEvent.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"log_format":[["impl<S, N, T> FormatEvent<S, N> for Format<T>where\n S: Subscriber + for<'a> LookupSpan<'a>,\n N: for<'a> FormatFields<'a> + 'static,\n T: FormatTime,"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/type.impl/alloc/boxed/struct.Box.js b/type.impl/alloc/boxed/struct.Box.js new file mode 100644 index 0000000000..f7c6333ef7 --- /dev/null +++ b/type.impl/alloc/boxed/struct.Box.js @@ -0,0 +1,3 @@ +(function() {var type_impls = { +"particle_execution":[["
source§

impl<T> Box<T>

1.0.0 · source

pub fn new(x: T) -> Box<T>

Allocates memory on the heap and then places x into it.

\n

This doesn’t actually allocate if T is zero-sized.

\n
Examples
\n
let five = Box::new(5);
\n
source

pub fn new_uninit() -> Box<MaybeUninit<T>>

🔬This is a nightly-only experimental API. (new_uninit)

Constructs a new box with uninitialized contents.

\n
Examples
\n
#![feature(new_uninit)]\n\nlet mut five = Box::<u32>::new_uninit();\n\nlet five = unsafe {\n    // Deferred initialization:\n    five.as_mut_ptr().write(5);\n\n    five.assume_init()\n};\n\nassert_eq!(*five, 5)
\n
source

pub fn new_zeroed() -> Box<MaybeUninit<T>>

🔬This is a nightly-only experimental API. (new_uninit)

Constructs a new Box with uninitialized contents, with the memory\nbeing filled with 0 bytes.

\n

See MaybeUninit::zeroed for examples of correct and incorrect usage\nof this method.

\n
Examples
\n
#![feature(new_uninit)]\n\nlet zero = Box::<u32>::new_zeroed();\nlet zero = unsafe { zero.assume_init() };\n\nassert_eq!(*zero, 0)
\n
1.33.0 · source

pub fn pin(x: T) -> Pin<Box<T>>

Constructs a new Pin<Box<T>>. If T does not implement Unpin, then\nx will be pinned in memory and unable to be moved.

\n

Constructing and pinning of the Box can also be done in two steps: Box::pin(x)\ndoes the same as Box::into_pin(Box::new(x)). Consider using\ninto_pin if you already have a Box<T>, or if you want to\nconstruct a (pinned) Box in a different way than with Box::new.

\n
source

pub fn try_new(x: T) -> Result<Box<T>, AllocError>

🔬This is a nightly-only experimental API. (allocator_api)

Allocates memory on the heap then places x into it,\nreturning an error if the allocation fails

\n

This doesn’t actually allocate if T is zero-sized.

\n
Examples
\n
#![feature(allocator_api)]\n\nlet five = Box::try_new(5)?;
\n
source

pub fn try_new_uninit() -> Result<Box<MaybeUninit<T>>, AllocError>

🔬This is a nightly-only experimental API. (allocator_api)

Constructs a new box with uninitialized contents on the heap,\nreturning an error if the allocation fails

\n
Examples
\n
#![feature(allocator_api, new_uninit)]\n\nlet mut five = Box::<u32>::try_new_uninit()?;\n\nlet five = unsafe {\n    // Deferred initialization:\n    five.as_mut_ptr().write(5);\n\n    five.assume_init()\n};\n\nassert_eq!(*five, 5);
\n
source

pub fn try_new_zeroed() -> Result<Box<MaybeUninit<T>>, AllocError>

🔬This is a nightly-only experimental API. (allocator_api)

Constructs a new Box with uninitialized contents, with the memory\nbeing filled with 0 bytes on the heap

\n

See MaybeUninit::zeroed for examples of correct and incorrect usage\nof this method.

\n
Examples
\n
#![feature(allocator_api, new_uninit)]\n\nlet zero = Box::<u32>::try_new_zeroed()?;\nlet zero = unsafe { zero.assume_init() };\n\nassert_eq!(*zero, 0);
\n
",0,"particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
source§

impl<T, A> Box<T, A>where\n A: Allocator,

source

pub fn new_in(x: T, alloc: A) -> Box<T, A>where\n A: Allocator,

🔬This is a nightly-only experimental API. (allocator_api)

Allocates memory in the given allocator then places x into it.

\n

This doesn’t actually allocate if T is zero-sized.

\n
Examples
\n
#![feature(allocator_api)]\n\nuse std::alloc::System;\n\nlet five = Box::new_in(5, System);
\n
source

pub fn try_new_in(x: T, alloc: A) -> Result<Box<T, A>, AllocError>where\n A: Allocator,

🔬This is a nightly-only experimental API. (allocator_api)

Allocates memory in the given allocator then places x into it,\nreturning an error if the allocation fails

\n

This doesn’t actually allocate if T is zero-sized.

\n
Examples
\n
#![feature(allocator_api)]\n\nuse std::alloc::System;\n\nlet five = Box::try_new_in(5, System)?;
\n
source

pub fn new_uninit_in(alloc: A) -> Box<MaybeUninit<T>, A>where\n A: Allocator,

🔬This is a nightly-only experimental API. (allocator_api)

Constructs a new box with uninitialized contents in the provided allocator.

\n
Examples
\n
#![feature(allocator_api, new_uninit)]\n\nuse std::alloc::System;\n\nlet mut five = Box::<u32, _>::new_uninit_in(System);\n\nlet five = unsafe {\n    // Deferred initialization:\n    five.as_mut_ptr().write(5);\n\n    five.assume_init()\n};\n\nassert_eq!(*five, 5)
\n
source

pub fn try_new_uninit_in(alloc: A) -> Result<Box<MaybeUninit<T>, A>, AllocError>where\n A: Allocator,

🔬This is a nightly-only experimental API. (allocator_api)

Constructs a new box with uninitialized contents in the provided allocator,\nreturning an error if the allocation fails

\n
Examples
\n
#![feature(allocator_api, new_uninit)]\n\nuse std::alloc::System;\n\nlet mut five = Box::<u32, _>::try_new_uninit_in(System)?;\n\nlet five = unsafe {\n    // Deferred initialization:\n    five.as_mut_ptr().write(5);\n\n    five.assume_init()\n};\n\nassert_eq!(*five, 5);
\n
source

pub fn new_zeroed_in(alloc: A) -> Box<MaybeUninit<T>, A>where\n A: Allocator,

🔬This is a nightly-only experimental API. (allocator_api)

Constructs a new Box with uninitialized contents, with the memory\nbeing filled with 0 bytes in the provided allocator.

\n

See MaybeUninit::zeroed for examples of correct and incorrect usage\nof this method.

\n
Examples
\n
#![feature(allocator_api, new_uninit)]\n\nuse std::alloc::System;\n\nlet zero = Box::<u32, _>::new_zeroed_in(System);\nlet zero = unsafe { zero.assume_init() };\n\nassert_eq!(*zero, 0)
\n
source

pub fn try_new_zeroed_in(alloc: A) -> Result<Box<MaybeUninit<T>, A>, AllocError>where\n A: Allocator,

🔬This is a nightly-only experimental API. (allocator_api)

Constructs a new Box with uninitialized contents, with the memory\nbeing filled with 0 bytes in the provided allocator,\nreturning an error if the allocation fails,

\n

See MaybeUninit::zeroed for examples of correct and incorrect usage\nof this method.

\n
Examples
\n
#![feature(allocator_api, new_uninit)]\n\nuse std::alloc::System;\n\nlet zero = Box::<u32, _>::try_new_zeroed_in(System)?;\nlet zero = unsafe { zero.assume_init() };\n\nassert_eq!(*zero, 0);
\n
source

pub fn pin_in(x: T, alloc: A) -> Pin<Box<T, A>>where\n A: 'static + Allocator,

🔬This is a nightly-only experimental API. (allocator_api)

Constructs a new Pin<Box<T, A>>. If T does not implement Unpin, then\nx will be pinned in memory and unable to be moved.

\n

Constructing and pinning of the Box can also be done in two steps: Box::pin_in(x, alloc)\ndoes the same as Box::into_pin(Box::new_in(x, alloc)). Consider using\ninto_pin if you already have a Box<T, A>, or if you want to\nconstruct a (pinned) Box in a different way than with Box::new_in.

\n
source

pub fn into_boxed_slice(boxed: Box<T, A>) -> Box<[T], A>

🔬This is a nightly-only experimental API. (box_into_boxed_slice)

Converts a Box<T> into a Box<[T]>

\n

This conversion does not allocate on the heap and happens in place.

\n
source

pub fn into_inner(boxed: Box<T, A>) -> T

🔬This is a nightly-only experimental API. (box_into_inner)

Consumes the Box, returning the wrapped value.

\n
Examples
\n
#![feature(box_into_inner)]\n\nlet c = Box::new(5);\n\nassert_eq!(Box::into_inner(c), 5);
\n
",0,"particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
source§

impl<T> Box<T>where\n T: ?Sized,

1.4.0 · source

pub unsafe fn from_raw(raw: *mut T) -> Box<T>

Constructs a box from a raw pointer.

\n

After calling this function, the raw pointer is owned by the\nresulting Box. Specifically, the Box destructor will call\nthe destructor of T and free the allocated memory. For this\nto be safe, the memory must have been allocated in accordance\nwith the memory layout used by Box .

\n
Safety
\n

This function is unsafe because improper use may lead to\nmemory problems. For example, a double-free may occur if the\nfunction is called twice on the same raw pointer.

\n

The safety conditions are described in the memory layout section.

\n
Examples
\n

Recreate a Box which was previously converted to a raw pointer\nusing Box::into_raw:

\n\n
let x = Box::new(5);\nlet ptr = Box::into_raw(x);\nlet x = unsafe { Box::from_raw(ptr) };
\n

Manually create a Box from scratch by using the global allocator:

\n\n
use std::alloc::{alloc, Layout};\n\nunsafe {\n    let ptr = alloc(Layout::new::<i32>()) as *mut i32;\n    // In general .write is required to avoid attempting to destruct\n    // the (uninitialized) previous contents of `ptr`, though for this\n    // simple example `*ptr = 5` would have worked as well.\n    ptr.write(5);\n    let x = Box::from_raw(ptr);\n}
\n
",0,"particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
source§

impl<T, A> Box<T, A>where\n A: Allocator,\n T: ?Sized,

const: unstable · source

pub unsafe fn from_raw_in(raw: *mut T, alloc: A) -> Box<T, A>

🔬This is a nightly-only experimental API. (allocator_api)

Constructs a box from a raw pointer in the given allocator.

\n

After calling this function, the raw pointer is owned by the\nresulting Box. Specifically, the Box destructor will call\nthe destructor of T and free the allocated memory. For this\nto be safe, the memory must have been allocated in accordance\nwith the memory layout used by Box .

\n
Safety
\n

This function is unsafe because improper use may lead to\nmemory problems. For example, a double-free may occur if the\nfunction is called twice on the same raw pointer.

\n
Examples
\n

Recreate a Box which was previously converted to a raw pointer\nusing Box::into_raw_with_allocator:

\n\n
#![feature(allocator_api)]\n\nuse std::alloc::System;\n\nlet x = Box::new_in(5, System);\nlet (ptr, alloc) = Box::into_raw_with_allocator(x);\nlet x = unsafe { Box::from_raw_in(ptr, alloc) };
\n

Manually create a Box from scratch by using the system allocator:

\n\n
#![feature(allocator_api, slice_ptr_get)]\n\nuse std::alloc::{Allocator, Layout, System};\n\nunsafe {\n    let ptr = System.allocate(Layout::new::<i32>())?.as_mut_ptr() as *mut i32;\n    // In general .write is required to avoid attempting to destruct\n    // the (uninitialized) previous contents of `ptr`, though for this\n    // simple example `*ptr = 5` would have worked as well.\n    ptr.write(5);\n    let x = Box::from_raw_in(ptr, System);\n}
\n
1.4.0 · source

pub fn into_raw(b: Box<T, A>) -> *mut T

Consumes the Box, returning a wrapped raw pointer.

\n

The pointer will be properly aligned and non-null.

\n

After calling this function, the caller is responsible for the\nmemory previously managed by the Box. In particular, the\ncaller should properly destroy T and release the memory, taking\ninto account the memory layout used by Box. The easiest way to\ndo this is to convert the raw pointer back into a Box with the\nBox::from_raw function, allowing the Box destructor to perform\nthe cleanup.

\n

Note: this is an associated function, which means that you have\nto call it as Box::into_raw(b) instead of b.into_raw(). This\nis so that there is no conflict with a method on the inner type.

\n
Examples
\n

Converting the raw pointer back into a Box with Box::from_raw\nfor automatic cleanup:

\n\n
let x = Box::new(String::from("Hello"));\nlet ptr = Box::into_raw(x);\nlet x = unsafe { Box::from_raw(ptr) };
\n

Manual cleanup by explicitly running the destructor and deallocating\nthe memory:

\n\n
use std::alloc::{dealloc, Layout};\nuse std::ptr;\n\nlet x = Box::new(String::from("Hello"));\nlet p = Box::into_raw(x);\nunsafe {\n    ptr::drop_in_place(p);\n    dealloc(p as *mut u8, Layout::new::<String>());\n}
\n
source

pub fn into_raw_with_allocator(b: Box<T, A>) -> (*mut T, A)

🔬This is a nightly-only experimental API. (allocator_api)

Consumes the Box, returning a wrapped raw pointer and the allocator.

\n

The pointer will be properly aligned and non-null.

\n

After calling this function, the caller is responsible for the\nmemory previously managed by the Box. In particular, the\ncaller should properly destroy T and release the memory, taking\ninto account the memory layout used by Box. The easiest way to\ndo this is to convert the raw pointer back into a Box with the\nBox::from_raw_in function, allowing the Box destructor to perform\nthe cleanup.

\n

Note: this is an associated function, which means that you have\nto call it as Box::into_raw_with_allocator(b) instead of b.into_raw_with_allocator(). This\nis so that there is no conflict with a method on the inner type.

\n
Examples
\n

Converting the raw pointer back into a Box with Box::from_raw_in\nfor automatic cleanup:

\n\n
#![feature(allocator_api)]\n\nuse std::alloc::System;\n\nlet x = Box::new_in(String::from("Hello"), System);\nlet (ptr, alloc) = Box::into_raw_with_allocator(x);\nlet x = unsafe { Box::from_raw_in(ptr, alloc) };
\n

Manual cleanup by explicitly running the destructor and deallocating\nthe memory:

\n\n
#![feature(allocator_api)]\n\nuse std::alloc::{Allocator, Layout, System};\nuse std::ptr::{self, NonNull};\n\nlet x = Box::new_in(String::from("Hello"), System);\nlet (ptr, alloc) = Box::into_raw_with_allocator(x);\nunsafe {\n    ptr::drop_in_place(ptr);\n    let non_null = NonNull::new_unchecked(ptr);\n    alloc.deallocate(non_null.cast(), Layout::new::<String>());\n}
\n
const: unstable · source

pub fn allocator(b: &Box<T, A>) -> &A

🔬This is a nightly-only experimental API. (allocator_api)

Returns a reference to the underlying allocator.

\n

Note: this is an associated function, which means that you have\nto call it as Box::allocator(&b) instead of b.allocator(). This\nis so that there is no conflict with a method on the inner type.

\n
1.26.0 · source

pub fn leak<'a>(b: Box<T, A>) -> &'a mut Twhere\n A: 'a,

Consumes and leaks the Box, returning a mutable reference,\n&'a mut T. Note that the type T must outlive the chosen lifetime\n'a. If the type has only static references, or none at all, then this\nmay be chosen to be 'static.

\n

This function is mainly useful for data that lives for the remainder of\nthe program’s life. Dropping the returned reference will cause a memory\nleak. If this is not acceptable, the reference should first be wrapped\nwith the Box::from_raw function producing a Box. This Box can\nthen be dropped which will properly destroy T and release the\nallocated memory.

\n

Note: this is an associated function, which means that you have\nto call it as Box::leak(b) instead of b.leak(). This\nis so that there is no conflict with a method on the inner type.

\n
Examples
\n

Simple usage:

\n\n
let x = Box::new(41);\nlet static_ref: &'static mut usize = Box::leak(x);\n*static_ref += 1;\nassert_eq!(*static_ref, 42);
\n

Unsized data:

\n\n
let x = vec![1, 2, 3].into_boxed_slice();\nlet static_ref = Box::leak(x);\nstatic_ref[0] = 4;\nassert_eq!(*static_ref, [4, 2, 3]);
\n
1.63.0 (const: unstable) · source

pub fn into_pin(boxed: Box<T, A>) -> Pin<Box<T, A>>where\n A: 'static,

Converts a Box<T> into a Pin<Box<T>>. If T does not implement Unpin, then\n*boxed will be pinned in memory and unable to be moved.

\n

This conversion does not allocate on the heap and happens in place.

\n

This is also available via From.

\n

Constructing and pinning a Box with Box::into_pin(Box::new(x))\ncan also be written more concisely using Box::pin(x).\nThis into_pin method is useful if you already have a Box<T>, or you are\nconstructing a (pinned) Box in a different way than with Box::new.

\n
Notes
\n

It’s not recommended that crates add an impl like From<Box<T>> for Pin<T>,\nas it’ll introduce an ambiguity when calling Pin::from.\nA demonstration of such a poor impl is shown below.

\n\n
struct Foo; // A type defined in this crate.\nimpl From<Box<()>> for Pin<Foo> {\n    fn from(_: Box<()>) -> Pin<Foo> {\n        Pin::new(Foo)\n    }\n}\n\nlet foo = Box::new(());\nlet bar = Pin::from(foo);
\n
",0,"particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
1.0.0 · source§

impl<S> Seek for Box<S>where\n S: Seek + ?Sized,

source§

fn seek(&mut self, pos: SeekFrom) -> Result<u64, Error>

Seek to an offset, in bytes, in a stream. Read more
source§

fn stream_position(&mut self) -> Result<u64, Error>

Returns the current seek position from the start of the stream. Read more
1.55.0 · source§

fn rewind(&mut self) -> Result<(), Error>

Rewind to the beginning of a stream. Read more
source§

fn stream_len(&mut self) -> Result<u64, Error>

🔬This is a nightly-only experimental API. (seek_stream_len)
Returns the length of this stream (in bytes). Read more
","Seek","particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
1.0.0 · source§

impl<W> Write for Box<W>where\n W: Write + ?Sized,

source§

fn write(&mut self, buf: &[u8]) -> Result<usize, Error>

Write a buffer into this writer, returning how many bytes were written. Read more
source§

fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> Result<usize, Error>

Like write, except that it writes from a slice of buffers. Read more
source§

fn is_write_vectored(&self) -> bool

🔬This is a nightly-only experimental API. (can_vector)
Determines if this Writer has an efficient write_vectored\nimplementation. Read more
source§

fn flush(&mut self) -> Result<(), Error>

Flush this output stream, ensuring that all intermediately buffered\ncontents reach their destination. Read more
source§

fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>

Attempts to write an entire buffer into this writer. Read more
source§

fn write_fmt(&mut self, fmt: Arguments<'_>) -> Result<(), Error>

Writes a formatted string into this writer, returning any error\nencountered. Read more
source§

fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>

🔬This is a nightly-only experimental API. (write_all_vectored)
Attempts to write multiple buffers into this writer. Read more
1.0.0 · source§

fn by_ref(&mut self) -> &mut Selfwhere\n Self: Sized,

Creates a “by reference” adapter for this instance of Write. Read more
","Write","particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
1.64.0 · source§

impl<T> AsFd for Box<T>where\n T: AsFd,

source§

fn as_fd(&self) -> BorrowedFd<'_>

Borrows the file descriptor. Read more
","AsFd","particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
1.0.0 · source§

impl<B> BufRead for Box<B>where\n B: BufRead + ?Sized,

source§

fn fill_buf(&mut self) -> Result<&[u8], Error>

Returns the contents of the internal buffer, filling it with more data\nfrom the inner reader if it is empty. Read more
source§

fn consume(&mut self, amt: usize)

Tells this buffer that amt bytes have been consumed from the buffer,\nso they should no longer be returned in calls to read. Read more
source§

fn read_until(&mut self, byte: u8, buf: &mut Vec<u8>) -> Result<usize, Error>

Read all bytes into buf until the delimiter byte or EOF is reached. Read more
source§

fn read_line(&mut self, buf: &mut String) -> Result<usize, Error>

Read all bytes until a newline (the 0xA byte) is reached, and append\nthem to the provided String buffer. Read more
source§

fn has_data_left(&mut self) -> Result<bool, Error>

🔬This is a nightly-only experimental API. (buf_read_has_data_left)
Check if the underlying Read has any data left to be read. Read more
1.0.0 · source§

fn split(self, byte: u8) -> Split<Self>where\n Self: Sized,

Returns an iterator over the contents of this reader split on the byte\nbyte. Read more
1.0.0 · source§

fn lines(self) -> Lines<Self>where\n Self: Sized,

Returns an iterator over the lines of this reader. Read more
","BufRead","particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
1.0.0 · source§

impl<R> Read for Box<R>where\n R: Read + ?Sized,

source§

fn read(&mut self, buf: &mut [u8]) -> Result<usize, Error>

Pull some bytes from this source into the specified buffer, returning\nhow many bytes were read. Read more
source§

fn read_buf(&mut self, cursor: BorrowedCursor<'_>) -> Result<(), Error>

🔬This is a nightly-only experimental API. (read_buf)
Pull some bytes from this source into the specified buffer. Read more
source§

fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> Result<usize, Error>

Like read, except that it reads into a slice of buffers. Read more
source§

fn is_read_vectored(&self) -> bool

🔬This is a nightly-only experimental API. (can_vector)
Determines if this Reader has an efficient read_vectored\nimplementation. Read more
source§

fn read_to_end(&mut self, buf: &mut Vec<u8>) -> Result<usize, Error>

Read all bytes until EOF in this source, placing them into buf. Read more
source§

fn read_to_string(&mut self, buf: &mut String) -> Result<usize, Error>

Read all bytes until EOF in this source, appending them to buf. Read more
source§

fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), Error>

Read the exact number of bytes required to fill buf. Read more
source§

fn read_buf_exact(&mut self, cursor: BorrowedCursor<'_>) -> Result<(), Error>

🔬This is a nightly-only experimental API. (read_buf)
Read the exact number of bytes required to fill cursor. Read more
1.0.0 · source§

fn by_ref(&mut self) -> &mut Selfwhere\n Self: Sized,

Creates a “by reference” adaptor for this instance of Read. Read more
1.0.0 · source§

fn bytes(self) -> Bytes<Self>where\n Self: Sized,

Transforms this Read instance to an Iterator over its bytes. Read more
1.0.0 · source§

fn chain<R>(self, next: R) -> Chain<Self, R>where\n R: Read,\n Self: Sized,

Creates an adapter which will chain this stream with another. Read more
1.0.0 · source§

fn take(self, limit: u64) -> Take<Self>where\n Self: Sized,

Creates an adapter which will read at most limit bytes from it. Read more
","Read","particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
1.63.0 · source§

impl<T> AsRawFd for Box<T>where\n T: AsRawFd,

source§

fn as_raw_fd(&self) -> i32

Extracts the raw file descriptor. Read more
","AsRawFd","particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
1.0.0 · source§

impl<T, A> Pointer for Box<T, A>where\n A: Allocator,\n T: ?Sized,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter.
","Pointer","particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
1.0.0 · source§

impl<T, A> Deref for Box<T, A>where\n A: Allocator,\n T: ?Sized,

§

type Target = T

The resulting type after dereferencing.
source§

fn deref(&self) -> &T

Dereferences the value.
","Deref","particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
1.35.0 · source§

impl<Args, F, A> Fn<Args> for Box<F, A>where\n Args: Tuple,\n F: Fn<Args> + ?Sized,\n A: Allocator,

source§

extern "rust-call" fn call(\n &self,\n args: Args\n) -> <Box<F, A> as FnOnce<Args>>::Output

🔬This is a nightly-only experimental API. (fn_traits)
Performs the call operation.
","Fn","particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
1.0.0 · source§

impl<I, A> ExactSizeIterator for Box<I, A>where\n I: ExactSizeIterator + ?Sized,\n A: Allocator,

source§

fn len(&self) -> usize

Returns the exact remaining length of the iterator. Read more
source§

fn is_empty(&self) -> bool

🔬This is a nightly-only experimental API. (exact_size_is_empty)
Returns true if the iterator is empty. Read more
","ExactSizeIterator","particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
1.0.0 · source§

impl<T, A> Ord for Box<T, A>where\n T: Ord + ?Sized,\n A: Allocator,

source§

fn cmp(&self, other: &Box<T, A>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Selfwhere\n Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Selfwhere\n Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Selfwhere\n Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
","Ord","particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
1.22.0 · source§

impl<T, A> Hasher for Box<T, A>where\n T: Hasher + ?Sized,\n A: Allocator,

source§

fn finish(&self) -> u64

Returns the hash value for the values written so far. Read more
source§

fn write(&mut self, bytes: &[u8])

Writes some data into this Hasher. Read more
source§

fn write_u8(&mut self, i: u8)

Writes a single u8 into this hasher.
source§

fn write_u16(&mut self, i: u16)

Writes a single u16 into this hasher.
source§

fn write_u32(&mut self, i: u32)

Writes a single u32 into this hasher.
source§

fn write_u64(&mut self, i: u64)

Writes a single u64 into this hasher.
source§

fn write_u128(&mut self, i: u128)

Writes a single u128 into this hasher.
source§

fn write_usize(&mut self, i: usize)

Writes a single usize into this hasher.
source§

fn write_i8(&mut self, i: i8)

Writes a single i8 into this hasher.
source§

fn write_i16(&mut self, i: i16)

Writes a single i16 into this hasher.
source§

fn write_i32(&mut self, i: i32)

Writes a single i32 into this hasher.
source§

fn write_i64(&mut self, i: i64)

Writes a single i64 into this hasher.
source§

fn write_i128(&mut self, i: i128)

Writes a single i128 into this hasher.
source§

fn write_isize(&mut self, i: isize)

Writes a single isize into this hasher.
source§

fn write_length_prefix(&mut self, len: usize)

🔬This is a nightly-only experimental API. (hasher_prefixfree_extras)
Writes a length prefix into this hasher, as part of being prefix-free. Read more
source§

fn write_str(&mut self, s: &str)

🔬This is a nightly-only experimental API. (hasher_prefixfree_extras)
Writes a single str into this hasher. Read more
","Hasher","particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
1.8.0 · source§

impl<T> Error for Box<T>where\n T: Error,

source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
source§

fn provide<'b>(&'b self, request: &mut Request<'b>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
","Error","particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
source§

impl<G, R, A> Coroutine<R> for Box<G, A>where\n G: Coroutine<R> + Unpin + ?Sized,\n A: Allocator + 'static,

§

type Yield = <G as Coroutine<R>>::Yield

🔬This is a nightly-only experimental API. (coroutine_trait)
The type of value this coroutine yields. Read more
§

type Return = <G as Coroutine<R>>::Return

🔬This is a nightly-only experimental API. (coroutine_trait)
The type of value this coroutine returns. Read more
source§

fn resume(\n self: Pin<&mut Box<G, A>>,\n arg: R\n) -> CoroutineState<<Box<G, A> as Coroutine<R>>::Yield, <Box<G, A> as Coroutine<R>>::Return>

🔬This is a nightly-only experimental API. (coroutine_trait)
Resumes the execution of this coroutine. Read more
","Coroutine","particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
1.0.0 · source§

impl<T, A> PartialEq for Box<T, A>where\n T: PartialEq + ?Sized,\n A: Allocator,

source§

fn eq(&self, other: &Box<T, A>) -> bool

This method tests for self and other values to be equal, and is used\nby ==.
source§

fn ne(&self, other: &Box<T, A>) -> bool

This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
","PartialEq","particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
1.0.0 · source§

impl<T, A> Display for Box<T, A>where\n T: Display + ?Sized,\n A: Allocator,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
","Display","particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
1.35.0 · source§

impl<Args, F, A> FnMut<Args> for Box<F, A>where\n Args: Tuple,\n F: FnMut<Args> + ?Sized,\n A: Allocator,

source§

extern "rust-call" fn call_mut(\n &mut self,\n args: Args\n) -> <Box<F, A> as FnOnce<Args>>::Output

🔬This is a nightly-only experimental API. (fn_traits)
Performs the call operation.
","FnMut","particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
1.0.0 · source§

impl<I, A> DoubleEndedIterator for Box<I, A>where\n I: DoubleEndedIterator + ?Sized,\n A: Allocator,

source§

fn next_back(&mut self) -> Option<<I as Iterator>::Item>

Removes and returns an element from the end of the iterator. Read more
source§

fn nth_back(&mut self, n: usize) -> Option<<I as Iterator>::Item>

Returns the nth element from the end of the iterator. Read more
source§

fn advance_back_by(&mut self, n: usize) -> Result<(), NonZeroUsize>

🔬This is a nightly-only experimental API. (iter_advance_by)
Advances the iterator from the back by n elements. Read more
1.27.0 · source§

fn try_rfold<B, F, R>(&mut self, init: B, f: F) -> Rwhere\n Self: Sized,\n F: FnMut(B, Self::Item) -> R,\n R: Try<Output = B>,

This is the reverse version of Iterator::try_fold(): it takes\nelements starting from the back of the iterator. Read more
1.27.0 · source§

fn rfold<B, F>(self, init: B, f: F) -> Bwhere\n Self: Sized,\n F: FnMut(B, Self::Item) -> B,

An iterator method that reduces the iterator’s elements to a single,\nfinal value, starting from the back. Read more
1.27.0 · source§

fn rfind<P>(&mut self, predicate: P) -> Option<Self::Item>where\n Self: Sized,\n P: FnMut(&Self::Item) -> bool,

Searches for an element of an iterator from the back that satisfies a predicate. Read more
","DoubleEndedIterator","particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
1.0.0 · source§

impl<T, A> Drop for Box<T, A>where\n A: Allocator,\n T: ?Sized,

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
","Drop","particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
1.26.0 · source§

impl<I, A> FusedIterator for Box<I, A>where\n I: FusedIterator + ?Sized,\n A: Allocator,

","FusedIterator","particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
1.0.0 · source§

impl<T, A> PartialOrd for Box<T, A>where\n T: PartialOrd + ?Sized,\n A: Allocator,

source§

fn partial_cmp(&self, other: &Box<T, A>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
source§

fn lt(&self, other: &Box<T, A>) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
source§

fn le(&self, other: &Box<T, A>) -> bool

This method tests less than or equal to (for self and other) and is used by the <=\noperator. Read more
source§

fn ge(&self, other: &Box<T, A>) -> bool

This method tests greater than or equal to (for self and other) and is used by the >=\noperator. Read more
source§

fn gt(&self, other: &Box<T, A>) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
","PartialOrd","particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
1.0.0 · source§

impl<T, A> Hash for Box<T, A>where\n T: Hash + ?Sized,\n A: Allocator,

source§

fn hash<H>(&self, state: &mut H)where\n H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where\n H: Hasher,\n Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
","Hash","particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
1.5.0 · source§

impl<T, A> AsMut<T> for Box<T, A>where\n A: Allocator,\n T: ?Sized,

source§

fn as_mut(&mut self) -> &mut T

Converts this type into a mutable reference of the (usually inferred) input type.
","AsMut","particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
1.1.0 · source§

impl<T, A> Borrow<T> for Box<T, A>where\n A: Allocator,\n T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
","Borrow","particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
1.0.0 · source§

impl<T, A> DerefMut for Box<T, A>where\n A: Allocator,\n T: ?Sized,

source§

fn deref_mut(&mut self) -> &mut T

Mutably dereferences the value.
","DerefMut","particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
1.0.0 · source§

impl<T> Default for Box<T>where\n T: Default,

source§

fn default() -> Box<T>

Creates a Box<T>, with the Default value for T.

\n
","Default","particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
1.5.0 · source§

impl<T, A> AsRef<T> for Box<T, A>where\n A: Allocator,\n T: ?Sized,

source§

fn as_ref(&self) -> &T

Converts this type into a shared reference of the (usually inferred) input type.
","AsRef","particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
1.33.0 · source§

impl<T, A> Unpin for Box<T, A>where\n A: Allocator + 'static,\n T: ?Sized,

","Unpin","particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
1.1.0 · source§

impl<T, A> BorrowMut<T> for Box<T, A>where\n A: Allocator,\n T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
","BorrowMut","particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
1.6.0 · source§

impl<T> From<T> for Box<T>

source§

fn from(t: T) -> Box<T>

Converts a T into a Box<T>

\n

The conversion allocates on the heap and moves t\nfrom the stack into it.

\n
Examples
\n
let x = 5;\nlet boxed = Box::new(5);\n\nassert_eq!(Box::from(x), boxed);
\n
","From","particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
source§

impl<T, U> DispatchFromDyn<Box<U>> for Box<T>where\n T: Unsize<U> + ?Sized,\n U: ?Sized,

","DispatchFromDyn>","particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
1.35.0 · source§

impl<Args, F, A> FnOnce<Args> for Box<F, A>where\n Args: Tuple,\n F: FnOnce<Args> + ?Sized,\n A: Allocator,

§

type Output = <F as FnOnce<Args>>::Output

The returned type after the call operator is used.
source§

extern "rust-call" fn call_once(\n self,\n args: Args\n) -> <Box<F, A> as FnOnce<Args>>::Output

🔬This is a nightly-only experimental API. (fn_traits)
Performs the call operation.
","FnOnce","particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
source§

impl<S> AsyncIterator for Box<S>where\n S: AsyncIterator + Unpin + ?Sized,

§

type Item = <S as AsyncIterator>::Item

🔬This is a nightly-only experimental API. (async_iterator)
The type of items yielded by the async iterator.
source§

fn poll_next(\n self: Pin<&mut Box<S>>,\n cx: &mut Context<'_>\n) -> Poll<Option<<Box<S> as AsyncIterator>::Item>>

🔬This is a nightly-only experimental API. (async_iterator)
Attempt to pull out the next value of this async iterator, registering the\ncurrent task for wakeup if the value is not yet available, and returning\nNone if the async iterator is exhausted. Read more
source§

fn size_hint(&self) -> (usize, Option<usize>)

🔬This is a nightly-only experimental API. (async_iterator)
Returns the bounds on the remaining length of the async iterator. Read more
","AsyncIterator","particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
1.36.0 · source§

impl<F, A> Future for Box<F, A>where\n F: Future + Unpin + ?Sized,\n A: Allocator + 'static,

§

type Output = <F as Future>::Output

The type of value produced on completion.
source§

fn poll(\n self: Pin<&mut Box<F, A>>,\n cx: &mut Context<'_>\n) -> Poll<<Box<F, A> as Future>::Output>

Attempt to resolve the future to a final value, registering\nthe current task for wakeup if the value is not yet available. Read more
","Future","particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
source§

impl<T, U, A> CoerceUnsized<Box<U, A>> for Box<T, A>where\n T: Unsize<U> + ?Sized,\n A: Allocator,\n U: ?Sized,

","CoerceUnsized>","particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
1.0.0 · source§

impl<T, A> Eq for Box<T, A>where\n T: Eq + ?Sized,\n A: Allocator,

","Eq","particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
1.0.0 · source§

impl<I, A> Iterator for Box<I, A>where\n I: Iterator + ?Sized,\n A: Allocator,

§

type Item = <I as Iterator>::Item

The type of the elements being iterated over.
source§

fn next(&mut self) -> Option<<I as Iterator>::Item>

Advances the iterator and returns the next value. Read more
source§

fn size_hint(&self) -> (usize, Option<usize>)

Returns the bounds on the remaining length of the iterator. Read more
source§

fn nth(&mut self, n: usize) -> Option<<I as Iterator>::Item>

Returns the nth element of the iterator. Read more
source§

fn last(self) -> Option<<I as Iterator>::Item>

Consumes the iterator, returning the last element. Read more
source§

fn next_chunk<const N: usize>(\n &mut self\n) -> Result<[Self::Item; N], IntoIter<Self::Item, N>>where\n Self: Sized,

🔬This is a nightly-only experimental API. (iter_next_chunk)
Advances the iterator and returns an array containing the next N values. Read more
1.0.0 · source§

fn count(self) -> usizewhere\n Self: Sized,

Consumes the iterator, counting the number of iterations and returning it. Read more
source§

fn advance_by(&mut self, n: usize) -> Result<(), NonZeroUsize>

🔬This is a nightly-only experimental API. (iter_advance_by)
Advances the iterator by n elements. Read more
1.28.0 · source§

fn step_by(self, step: usize) -> StepBy<Self>where\n Self: Sized,

Creates an iterator starting at the same point, but stepping by\nthe given amount at each iteration. Read more
1.0.0 · source§

fn chain<U>(self, other: U) -> Chain<Self, <U as IntoIterator>::IntoIter>where\n Self: Sized,\n U: IntoIterator<Item = Self::Item>,

Takes two iterators and creates a new iterator over both in sequence. Read more
1.0.0 · source§

fn zip<U>(self, other: U) -> Zip<Self, <U as IntoIterator>::IntoIter>where\n Self: Sized,\n U: IntoIterator,

‘Zips up’ two iterators into a single iterator of pairs. Read more
source§

fn intersperse_with<G>(self, separator: G) -> IntersperseWith<Self, G>where\n Self: Sized,\n G: FnMut() -> Self::Item,

🔬This is a nightly-only experimental API. (iter_intersperse)
Creates a new iterator which places an item generated by separator\nbetween adjacent items of the original iterator. Read more
1.0.0 · source§

fn map<B, F>(self, f: F) -> Map<Self, F>where\n Self: Sized,\n F: FnMut(Self::Item) -> B,

Takes a closure and creates an iterator which calls that closure on each\nelement. Read more
1.21.0 · source§

fn for_each<F>(self, f: F)where\n Self: Sized,\n F: FnMut(Self::Item),

Calls a closure on each element of an iterator. Read more
1.0.0 · source§

fn filter<P>(self, predicate: P) -> Filter<Self, P>where\n Self: Sized,\n P: FnMut(&Self::Item) -> bool,

Creates an iterator which uses a closure to determine if an element\nshould be yielded. Read more
1.0.0 · source§

fn filter_map<B, F>(self, f: F) -> FilterMap<Self, F>where\n Self: Sized,\n F: FnMut(Self::Item) -> Option<B>,

Creates an iterator that both filters and maps. Read more
1.0.0 · source§

fn enumerate(self) -> Enumerate<Self>where\n Self: Sized,

Creates an iterator which gives the current iteration count as well as\nthe next value. Read more
1.0.0 · source§

fn peekable(self) -> Peekable<Self>where\n Self: Sized,

Creates an iterator which can use the peek and peek_mut methods\nto look at the next element of the iterator without consuming it. See\ntheir documentation for more information. Read more
1.0.0 · source§

fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P>where\n Self: Sized,\n P: FnMut(&Self::Item) -> bool,

Creates an iterator that skips elements based on a predicate. Read more
1.0.0 · source§

fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P>where\n Self: Sized,\n P: FnMut(&Self::Item) -> bool,

Creates an iterator that yields elements based on a predicate. Read more
1.57.0 · source§

fn map_while<B, P>(self, predicate: P) -> MapWhile<Self, P>where\n Self: Sized,\n P: FnMut(Self::Item) -> Option<B>,

Creates an iterator that both yields elements based on a predicate and maps. Read more
1.0.0 · source§

fn skip(self, n: usize) -> Skip<Self>where\n Self: Sized,

Creates an iterator that skips the first n elements. Read more
1.0.0 · source§

fn take(self, n: usize) -> Take<Self>where\n Self: Sized,

Creates an iterator that yields the first n elements, or fewer\nif the underlying iterator ends sooner. Read more
1.0.0 · source§

fn scan<St, B, F>(self, initial_state: St, f: F) -> Scan<Self, St, F>where\n Self: Sized,\n F: FnMut(&mut St, Self::Item) -> Option<B>,

An iterator adapter which, like fold, holds internal state, but\nunlike fold, produces a new iterator. Read more
1.0.0 · source§

fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F>where\n Self: Sized,\n U: IntoIterator,\n F: FnMut(Self::Item) -> U,

Creates an iterator that works like map, but flattens nested structure. Read more
source§

fn map_windows<F, R, const N: usize>(self, f: F) -> MapWindows<Self, F, N>where\n Self: Sized,\n F: FnMut(&[Self::Item; N]) -> R,

🔬This is a nightly-only experimental API. (iter_map_windows)
Calls the given function f for each contiguous window of size N over\nself and returns an iterator over the outputs of f. Like slice::windows(),\nthe windows during mapping overlap as well. Read more
1.0.0 · source§

fn fuse(self) -> Fuse<Self>where\n Self: Sized,

Creates an iterator which ends after the first None. Read more
1.0.0 · source§

fn inspect<F>(self, f: F) -> Inspect<Self, F>where\n Self: Sized,\n F: FnMut(&Self::Item),

Does something with each element of an iterator, passing the value on. Read more
1.0.0 · source§

fn by_ref(&mut self) -> &mut Selfwhere\n Self: Sized,

Borrows an iterator, rather than consuming it. Read more
1.0.0 · source§

fn collect<B>(self) -> Bwhere\n B: FromIterator<Self::Item>,\n Self: Sized,

Transforms an iterator into a collection. Read more
source§

fn collect_into<E>(self, collection: &mut E) -> &mut Ewhere\n E: Extend<Self::Item>,\n Self: Sized,

🔬This is a nightly-only experimental API. (iter_collect_into)
Collects all the items from an iterator into a collection. Read more
1.0.0 · source§

fn partition<B, F>(self, f: F) -> (B, B)where\n Self: Sized,\n B: Default + Extend<Self::Item>,\n F: FnMut(&Self::Item) -> bool,

Consumes an iterator, creating two collections from it. Read more
source§

fn is_partitioned<P>(self, predicate: P) -> boolwhere\n Self: Sized,\n P: FnMut(Self::Item) -> bool,

🔬This is a nightly-only experimental API. (iter_is_partitioned)
Checks if the elements of this iterator are partitioned according to the given predicate,\nsuch that all those that return true precede all those that return false. Read more
1.27.0 · source§

fn try_fold<B, F, R>(&mut self, init: B, f: F) -> Rwhere\n Self: Sized,\n F: FnMut(B, Self::Item) -> R,\n R: Try<Output = B>,

An iterator method that applies a function as long as it returns\nsuccessfully, producing a single, final value. Read more
1.27.0 · source§

fn try_for_each<F, R>(&mut self, f: F) -> Rwhere\n Self: Sized,\n F: FnMut(Self::Item) -> R,\n R: Try<Output = ()>,

An iterator method that applies a fallible function to each item in the\niterator, stopping at the first error and returning that error. Read more
1.0.0 · source§

fn fold<B, F>(self, init: B, f: F) -> Bwhere\n Self: Sized,\n F: FnMut(B, Self::Item) -> B,

Folds every element into an accumulator by applying an operation,\nreturning the final result. Read more
1.51.0 · source§

fn reduce<F>(self, f: F) -> Option<Self::Item>where\n Self: Sized,\n F: FnMut(Self::Item, Self::Item) -> Self::Item,

Reduces the elements to a single one, by repeatedly applying a reducing\noperation. Read more
source§

fn try_reduce<F, R>(\n &mut self,\n f: F\n) -> <<R as Try>::Residual as Residual<Option<<R as Try>::Output>>>::TryTypewhere\n Self: Sized,\n F: FnMut(Self::Item, Self::Item) -> R,\n R: Try<Output = Self::Item>,\n <R as Try>::Residual: Residual<Option<Self::Item>>,

🔬This is a nightly-only experimental API. (iterator_try_reduce)
Reduces the elements to a single one by repeatedly applying a reducing operation. If the\nclosure returns a failure, the failure is propagated back to the caller immediately. Read more
1.0.0 · source§

fn all<F>(&mut self, f: F) -> boolwhere\n Self: Sized,\n F: FnMut(Self::Item) -> bool,

Tests if every element of the iterator matches a predicate. Read more
1.0.0 · source§

fn any<F>(&mut self, f: F) -> boolwhere\n Self: Sized,\n F: FnMut(Self::Item) -> bool,

Tests if any element of the iterator matches a predicate. Read more
1.0.0 · source§

fn find<P>(&mut self, predicate: P) -> Option<Self::Item>where\n Self: Sized,\n P: FnMut(&Self::Item) -> bool,

Searches for an element of an iterator that satisfies a predicate. Read more
1.30.0 · source§

fn find_map<B, F>(&mut self, f: F) -> Option<B>where\n Self: Sized,\n F: FnMut(Self::Item) -> Option<B>,

Applies function to the elements of iterator and returns\nthe first non-none result. Read more
source§

fn try_find<F, R>(\n &mut self,\n f: F\n) -> <<R as Try>::Residual as Residual<Option<Self::Item>>>::TryTypewhere\n Self: Sized,\n F: FnMut(&Self::Item) -> R,\n R: Try<Output = bool>,\n <R as Try>::Residual: Residual<Option<Self::Item>>,

🔬This is a nightly-only experimental API. (try_find)
Applies function to the elements of iterator and returns\nthe first true result or the first error. Read more
1.0.0 · source§

fn position<P>(&mut self, predicate: P) -> Option<usize>where\n Self: Sized,\n P: FnMut(Self::Item) -> bool,

Searches for an element in an iterator, returning its index. Read more
1.6.0 · source§

fn max_by_key<B, F>(self, f: F) -> Option<Self::Item>where\n B: Ord,\n Self: Sized,\n F: FnMut(&Self::Item) -> B,

Returns the element that gives the maximum value from the\nspecified function. Read more
1.15.0 · source§

fn max_by<F>(self, compare: F) -> Option<Self::Item>where\n Self: Sized,\n F: FnMut(&Self::Item, &Self::Item) -> Ordering,

Returns the element that gives the maximum value with respect to the\nspecified comparison function. Read more
1.6.0 · source§

fn min_by_key<B, F>(self, f: F) -> Option<Self::Item>where\n B: Ord,\n Self: Sized,\n F: FnMut(&Self::Item) -> B,

Returns the element that gives the minimum value from the\nspecified function. Read more
1.15.0 · source§

fn min_by<F>(self, compare: F) -> Option<Self::Item>where\n Self: Sized,\n F: FnMut(&Self::Item, &Self::Item) -> Ordering,

Returns the element that gives the minimum value with respect to the\nspecified comparison function. Read more
1.0.0 · source§

fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB)where\n FromA: Default + Extend<A>,\n FromB: Default + Extend<B>,\n Self: Sized + Iterator<Item = (A, B)>,

Converts an iterator of pairs into a pair of containers. Read more
1.36.0 · source§

fn copied<'a, T>(self) -> Copied<Self>where\n T: 'a + Copy,\n Self: Sized + Iterator<Item = &'a T>,

Creates an iterator which copies all of its elements. Read more
1.0.0 · source§

fn cloned<'a, T>(self) -> Cloned<Self>where\n T: 'a + Clone,\n Self: Sized + Iterator<Item = &'a T>,

Creates an iterator which clones all of its elements. Read more
source§

fn array_chunks<const N: usize>(self) -> ArrayChunks<Self, N>where\n Self: Sized,

🔬This is a nightly-only experimental API. (iter_array_chunks)
Returns an iterator over N elements of the iterator at a time. Read more
1.11.0 · source§

fn sum<S>(self) -> Swhere\n Self: Sized,\n S: Sum<Self::Item>,

Sums the elements of an iterator. Read more
1.11.0 · source§

fn product<P>(self) -> Pwhere\n Self: Sized,\n P: Product<Self::Item>,

Iterates over the entire iterator, multiplying all the elements Read more
source§

fn cmp_by<I, F>(self, other: I, cmp: F) -> Orderingwhere\n Self: Sized,\n I: IntoIterator,\n F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Ordering,

🔬This is a nightly-only experimental API. (iter_order_by)
Lexicographically compares the elements of this Iterator with those\nof another with respect to the specified comparison function. Read more
1.5.0 · source§

fn partial_cmp<I>(self, other: I) -> Option<Ordering>where\n I: IntoIterator,\n Self::Item: PartialOrd<<I as IntoIterator>::Item>,\n Self: Sized,

Lexicographically compares the PartialOrd elements of\nthis Iterator with those of another. The comparison works like short-circuit\nevaluation, returning a result without comparing the remaining elements.\nAs soon as an order can be determined, the evaluation stops and a result is returned. Read more
source§

fn partial_cmp_by<I, F>(self, other: I, partial_cmp: F) -> Option<Ordering>where\n Self: Sized,\n I: IntoIterator,\n F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Option<Ordering>,

🔬This is a nightly-only experimental API. (iter_order_by)
Lexicographically compares the elements of this Iterator with those\nof another with respect to the specified comparison function. Read more
1.5.0 · source§

fn eq<I>(self, other: I) -> boolwhere\n I: IntoIterator,\n Self::Item: PartialEq<<I as IntoIterator>::Item>,\n Self: Sized,

Determines if the elements of this Iterator are equal to those of\nanother. Read more
source§

fn eq_by<I, F>(self, other: I, eq: F) -> boolwhere\n Self: Sized,\n I: IntoIterator,\n F: FnMut(Self::Item, <I as IntoIterator>::Item) -> bool,

🔬This is a nightly-only experimental API. (iter_order_by)
Determines if the elements of this Iterator are equal to those of\nanother with respect to the specified equality function. Read more
1.5.0 · source§

fn ne<I>(self, other: I) -> boolwhere\n I: IntoIterator,\n Self::Item: PartialEq<<I as IntoIterator>::Item>,\n Self: Sized,

Determines if the elements of this Iterator are not equal to those of\nanother. Read more
1.5.0 · source§

fn lt<I>(self, other: I) -> boolwhere\n I: IntoIterator,\n Self::Item: PartialOrd<<I as IntoIterator>::Item>,\n Self: Sized,

Determines if the elements of this Iterator are lexicographically\nless than those of another. Read more
1.5.0 · source§

fn le<I>(self, other: I) -> boolwhere\n I: IntoIterator,\n Self::Item: PartialOrd<<I as IntoIterator>::Item>,\n Self: Sized,

Determines if the elements of this Iterator are lexicographically\nless or equal to those of another. Read more
1.5.0 · source§

fn gt<I>(self, other: I) -> boolwhere\n I: IntoIterator,\n Self::Item: PartialOrd<<I as IntoIterator>::Item>,\n Self: Sized,

Determines if the elements of this Iterator are lexicographically\ngreater than those of another. Read more
1.5.0 · source§

fn ge<I>(self, other: I) -> boolwhere\n I: IntoIterator,\n Self::Item: PartialOrd<<I as IntoIterator>::Item>,\n Self: Sized,

Determines if the elements of this Iterator are lexicographically\ngreater than or equal to those of another. Read more
source§

fn is_sorted_by<F>(self, compare: F) -> boolwhere\n Self: Sized,\n F: FnMut(&Self::Item, &Self::Item) -> Option<Ordering>,

🔬This is a nightly-only experimental API. (is_sorted)
Checks if the elements of this iterator are sorted using the given comparator function. Read more
source§

fn is_sorted_by_key<F, K>(self, f: F) -> boolwhere\n Self: Sized,\n F: FnMut(Self::Item) -> K,\n K: PartialOrd,

🔬This is a nightly-only experimental API. (is_sorted)
Checks if the elements of this iterator are sorted using the given key extraction\nfunction. Read more
","Iterator","particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
1.0.0 · source§

impl<T, A> Debug for Box<T, A>where\n T: Debug + ?Sized,\n A: Allocator,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
","Debug","particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
1.0.0 · source§

impl<T, A> Clone for Box<T, A>where\n T: Clone,\n A: Allocator + Clone,

source§

fn clone(&self) -> Box<T, A>

Returns a new box with a clone() of this box’s contents.

\n
Examples
\n
let x = Box::new(5);\nlet y = x.clone();\n\n// The value is the same\nassert_eq!(x, y);\n\n// But they are unique objects\nassert_ne!(&*x as *const i32, &*y as *const i32);
\n
source§

fn clone_from(&mut self, source: &Box<T, A>)

Copies source’s contents into self without creating a new allocation.

\n
Examples
\n
let x = Box::new(5);\nlet mut y = Box::new(10);\nlet yp: *const i32 = &*y;\n\ny.clone_from(&x);\n\n// The value is the same\nassert_eq!(x, y);\n\n// And no allocation occurred\nassert_eq!(yp, &*y);
\n
","Clone","particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
source§

impl<T> Serialize for Box<T>where\n T: Serialize + ?Sized,

source§

fn serialize<S>(\n &self,\n serializer: S\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,

Serialize this value into the given Serde serializer. Read more
","Serialize","particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
source§

impl<'de, T> Deserialize<'de> for Box<T>where\n T: Deserialize<'de>,

source§

fn deserialize<D>(\n deserializer: D\n) -> Result<Box<T>, <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
","Deserialize<'de>","particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
§

impl<T> BufMut for Box<T>where\n T: BufMut + ?Sized,

§

fn remaining_mut(&self) -> usize

Returns the number of bytes that can be written from the current\nposition until the end of the buffer is reached. Read more
§

fn chunk_mut(&mut self) -> &mut UninitSlice

Returns a mutable slice starting at the current BufMut position and of\nlength between 0 and BufMut::remaining_mut(). Note that this can be shorter than the\nwhole remainder of the buffer (this allows non-continuous implementation). Read more
§

unsafe fn advance_mut(&mut self, cnt: usize)

Advance the internal cursor of the BufMut Read more
§

fn put_slice(&mut self, src: &[u8])

Transfer bytes into self from src and advance the cursor by the\nnumber of bytes written. Read more
§

fn put_u8(&mut self, n: u8)

Writes an unsigned 8 bit integer to self. Read more
§

fn put_i8(&mut self, n: i8)

Writes a signed 8 bit integer to self. Read more
§

fn put_u16(&mut self, n: u16)

Writes an unsigned 16 bit integer to self in big-endian byte order. Read more
§

fn put_u16_le(&mut self, n: u16)

Writes an unsigned 16 bit integer to self in little-endian byte order. Read more
§

fn put_u16_ne(&mut self, n: u16)

Writes an unsigned 16 bit integer to self in native-endian byte order. Read more
§

fn put_i16(&mut self, n: i16)

Writes a signed 16 bit integer to self in big-endian byte order. Read more
§

fn put_i16_le(&mut self, n: i16)

Writes a signed 16 bit integer to self in little-endian byte order. Read more
§

fn put_i16_ne(&mut self, n: i16)

Writes a signed 16 bit integer to self in native-endian byte order. Read more
§

fn put_u32(&mut self, n: u32)

Writes an unsigned 32 bit integer to self in big-endian byte order. Read more
§

fn put_u32_le(&mut self, n: u32)

Writes an unsigned 32 bit integer to self in little-endian byte order. Read more
§

fn put_u32_ne(&mut self, n: u32)

Writes an unsigned 32 bit integer to self in native-endian byte order. Read more
§

fn put_i32(&mut self, n: i32)

Writes a signed 32 bit integer to self in big-endian byte order. Read more
§

fn put_i32_le(&mut self, n: i32)

Writes a signed 32 bit integer to self in little-endian byte order. Read more
§

fn put_i32_ne(&mut self, n: i32)

Writes a signed 32 bit integer to self in native-endian byte order. Read more
§

fn put_u64(&mut self, n: u64)

Writes an unsigned 64 bit integer to self in the big-endian byte order. Read more
§

fn put_u64_le(&mut self, n: u64)

Writes an unsigned 64 bit integer to self in little-endian byte order. Read more
§

fn put_u64_ne(&mut self, n: u64)

Writes an unsigned 64 bit integer to self in native-endian byte order. Read more
§

fn put_i64(&mut self, n: i64)

Writes a signed 64 bit integer to self in the big-endian byte order. Read more
§

fn put_i64_le(&mut self, n: i64)

Writes a signed 64 bit integer to self in little-endian byte order. Read more
§

fn put_i64_ne(&mut self, n: i64)

Writes a signed 64 bit integer to self in native-endian byte order. Read more
§

fn has_remaining_mut(&self) -> bool

Returns true if there is space in self for more bytes. Read more
§

fn put<T>(&mut self, src: T)where\n T: Buf,\n Self: Sized,

Transfer bytes into self from src and advance the cursor by the\nnumber of bytes written. Read more
§

fn put_bytes(&mut self, val: u8, cnt: usize)

Put cnt bytes val into self. Read more
§

fn put_u128(&mut self, n: u128)

Writes an unsigned 128 bit integer to self in the big-endian byte order. Read more
§

fn put_u128_le(&mut self, n: u128)

Writes an unsigned 128 bit integer to self in little-endian byte order. Read more
§

fn put_u128_ne(&mut self, n: u128)

Writes an unsigned 128 bit integer to self in native-endian byte order. Read more
§

fn put_i128(&mut self, n: i128)

Writes a signed 128 bit integer to self in the big-endian byte order. Read more
§

fn put_i128_le(&mut self, n: i128)

Writes a signed 128 bit integer to self in little-endian byte order. Read more
§

fn put_i128_ne(&mut self, n: i128)

Writes a signed 128 bit integer to self in native-endian byte order. Read more
§

fn put_uint(&mut self, n: u64, nbytes: usize)

Writes an unsigned n-byte integer to self in big-endian byte order. Read more
§

fn put_uint_le(&mut self, n: u64, nbytes: usize)

Writes an unsigned n-byte integer to self in the little-endian byte order. Read more
§

fn put_uint_ne(&mut self, n: u64, nbytes: usize)

Writes an unsigned n-byte integer to self in the native-endian byte order. Read more
§

fn put_int(&mut self, n: i64, nbytes: usize)

Writes low nbytes of a signed integer to self in big-endian byte order. Read more
§

fn put_int_le(&mut self, n: i64, nbytes: usize)

Writes low nbytes of a signed integer to self in little-endian byte order. Read more
§

fn put_int_ne(&mut self, n: i64, nbytes: usize)

Writes low nbytes of a signed integer to self in native-endian byte order. Read more
§

fn put_f32(&mut self, n: f32)

Writes an IEEE754 single-precision (4 bytes) floating point number to\nself in big-endian byte order. Read more
§

fn put_f32_le(&mut self, n: f32)

Writes an IEEE754 single-precision (4 bytes) floating point number to\nself in little-endian byte order. Read more
§

fn put_f32_ne(&mut self, n: f32)

Writes an IEEE754 single-precision (4 bytes) floating point number to\nself in native-endian byte order. Read more
§

fn put_f64(&mut self, n: f64)

Writes an IEEE754 double-precision (8 bytes) floating point number to\nself in big-endian byte order. Read more
§

fn put_f64_le(&mut self, n: f64)

Writes an IEEE754 double-precision (8 bytes) floating point number to\nself in little-endian byte order. Read more
§

fn put_f64_ne(&mut self, n: f64)

Writes an IEEE754 double-precision (8 bytes) floating point number to\nself in native-endian byte order. Read more
§

fn limit(self, limit: usize) -> Limit<Self>where\n Self: Sized,

Creates an adaptor which can write at most limit bytes to self. Read more
§

fn writer(self) -> Writer<Self>where\n Self: Sized,

Creates an adaptor which implements the Write trait for self. Read more
§

fn chain_mut<U>(self, next: U) -> Chain<Self, U>where\n U: BufMut,\n Self: Sized,

Creates an adapter which will chain this buffer with another. Read more
","BufMut","particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
§

impl<T> Buf for Box<T>where\n T: Buf + ?Sized,

§

fn remaining(&self) -> usize

Returns the number of bytes between the current position and the end of\nthe buffer. Read more
§

fn chunk(&self) -> &[u8]

Returns a slice starting at the current position and of length between 0\nand Buf::remaining(). Note that this can return shorter slice (this allows\nnon-continuous internal representation). Read more
§

fn chunks_vectored<'b>(&'b self, dst: &mut [IoSlice<'b>]) -> usize

Fills dst with potentially multiple slices starting at self’s\ncurrent position. Read more
§

fn advance(&mut self, cnt: usize)

Advance the internal cursor of the Buf Read more
§

fn has_remaining(&self) -> bool

Returns true if there are any more bytes to consume Read more
§

fn copy_to_slice(&mut self, dst: &mut [u8])

Copies bytes from self into dst. Read more
§

fn get_u8(&mut self) -> u8

Gets an unsigned 8 bit integer from self. Read more
§

fn get_i8(&mut self) -> i8

Gets a signed 8 bit integer from self. Read more
§

fn get_u16(&mut self) -> u16

Gets an unsigned 16 bit integer from self in big-endian byte order. Read more
§

fn get_u16_le(&mut self) -> u16

Gets an unsigned 16 bit integer from self in little-endian byte order. Read more
§

fn get_u16_ne(&mut self) -> u16

Gets an unsigned 16 bit integer from self in native-endian byte order. Read more
§

fn get_i16(&mut self) -> i16

Gets a signed 16 bit integer from self in big-endian byte order. Read more
§

fn get_i16_le(&mut self) -> i16

Gets a signed 16 bit integer from self in little-endian byte order. Read more
§

fn get_i16_ne(&mut self) -> i16

Gets a signed 16 bit integer from self in native-endian byte order. Read more
§

fn get_u32(&mut self) -> u32

Gets an unsigned 32 bit integer from self in the big-endian byte order. Read more
§

fn get_u32_le(&mut self) -> u32

Gets an unsigned 32 bit integer from self in the little-endian byte order. Read more
§

fn get_u32_ne(&mut self) -> u32

Gets an unsigned 32 bit integer from self in native-endian byte order. Read more
§

fn get_i32(&mut self) -> i32

Gets a signed 32 bit integer from self in big-endian byte order. Read more
§

fn get_i32_le(&mut self) -> i32

Gets a signed 32 bit integer from self in little-endian byte order. Read more
§

fn get_i32_ne(&mut self) -> i32

Gets a signed 32 bit integer from self in native-endian byte order. Read more
§

fn get_u64(&mut self) -> u64

Gets an unsigned 64 bit integer from self in big-endian byte order. Read more
§

fn get_u64_le(&mut self) -> u64

Gets an unsigned 64 bit integer from self in little-endian byte order. Read more
§

fn get_u64_ne(&mut self) -> u64

Gets an unsigned 64 bit integer from self in native-endian byte order. Read more
§

fn get_i64(&mut self) -> i64

Gets a signed 64 bit integer from self in big-endian byte order. Read more
§

fn get_i64_le(&mut self) -> i64

Gets a signed 64 bit integer from self in little-endian byte order. Read more
§

fn get_i64_ne(&mut self) -> i64

Gets a signed 64 bit integer from self in native-endian byte order. Read more
§

fn get_uint(&mut self, nbytes: usize) -> u64

Gets an unsigned n-byte integer from self in big-endian byte order. Read more
§

fn get_uint_le(&mut self, nbytes: usize) -> u64

Gets an unsigned n-byte integer from self in little-endian byte order. Read more
§

fn get_uint_ne(&mut self, nbytes: usize) -> u64

Gets an unsigned n-byte integer from self in native-endian byte order. Read more
§

fn get_int(&mut self, nbytes: usize) -> i64

Gets a signed n-byte integer from self in big-endian byte order. Read more
§

fn get_int_le(&mut self, nbytes: usize) -> i64

Gets a signed n-byte integer from self in little-endian byte order. Read more
§

fn get_int_ne(&mut self, nbytes: usize) -> i64

Gets a signed n-byte integer from self in native-endian byte order. Read more
§

fn copy_to_bytes(&mut self, len: usize) -> Bytes

Consumes len bytes inside self and returns new instance of Bytes\nwith this data. Read more
§

fn get_u128(&mut self) -> u128

Gets an unsigned 128 bit integer from self in big-endian byte order. Read more
§

fn get_u128_le(&mut self) -> u128

Gets an unsigned 128 bit integer from self in little-endian byte order. Read more
§

fn get_u128_ne(&mut self) -> u128

Gets an unsigned 128 bit integer from self in native-endian byte order. Read more
§

fn get_i128(&mut self) -> i128

Gets a signed 128 bit integer from self in big-endian byte order. Read more
§

fn get_i128_le(&mut self) -> i128

Gets a signed 128 bit integer from self in little-endian byte order. Read more
§

fn get_i128_ne(&mut self) -> i128

Gets a signed 128 bit integer from self in native-endian byte order. Read more
§

fn get_f32(&mut self) -> f32

Gets an IEEE754 single-precision (4 bytes) floating point number from\nself in big-endian byte order. Read more
§

fn get_f32_le(&mut self) -> f32

Gets an IEEE754 single-precision (4 bytes) floating point number from\nself in little-endian byte order. Read more
§

fn get_f32_ne(&mut self) -> f32

Gets an IEEE754 single-precision (4 bytes) floating point number from\nself in native-endian byte order. Read more
§

fn get_f64(&mut self) -> f64

Gets an IEEE754 double-precision (8 bytes) floating point number from\nself in big-endian byte order. Read more
§

fn get_f64_le(&mut self) -> f64

Gets an IEEE754 double-precision (8 bytes) floating point number from\nself in little-endian byte order. Read more
§

fn get_f64_ne(&mut self) -> f64

Gets an IEEE754 double-precision (8 bytes) floating point number from\nself in native-endian byte order. Read more
§

fn take(self, limit: usize) -> Take<Self>where\n Self: Sized,

Creates an adaptor which will read at most limit bytes from self. Read more
§

fn chain<U>(self, next: U) -> Chain<Self, U>where\n U: Buf,\n Self: Sized,

Creates an adaptor which will chain this buffer with another. Read more
§

fn reader(self) -> Reader<Self>where\n Self: Sized,

Creates an adaptor which implements the Read trait for self. Read more
","Buf","particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
§

impl<S, Item> Sink<Item> for Box<S>where\n S: Sink<Item> + Unpin + ?Sized,

§

type Error = <S as Sink<Item>>::Error

The type of value produced by the sink when an error occurs.
§

fn poll_ready(\n self: Pin<&mut Box<S>>,\n cx: &mut Context<'_>\n) -> Poll<Result<(), <Box<S> as Sink<Item>>::Error>>

Attempts to prepare the Sink to receive a value. Read more
§

fn start_send(\n self: Pin<&mut Box<S>>,\n item: Item\n) -> Result<(), <Box<S> as Sink<Item>>::Error>

Begin the process of sending a value to the sink.\nEach call to this function must be preceded by a successful call to\npoll_ready which returned Poll::Ready(Ok(())). Read more
§

fn poll_flush(\n self: Pin<&mut Box<S>>,\n cx: &mut Context<'_>\n) -> Poll<Result<(), <Box<S> as Sink<Item>>::Error>>

Flush any remaining output from this sink. Read more
§

fn poll_close(\n self: Pin<&mut Box<S>>,\n cx: &mut Context<'_>\n) -> Poll<Result<(), <Box<S> as Sink<Item>>::Error>>

Flush any remaining output and close this sink, if necessary. Read more
","Sink","particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
§

impl<T> AsyncSeek for Box<T>where\n T: AsyncSeek + Unpin + ?Sized,

§

fn start_seek(self: Pin<&mut Box<T>>, pos: SeekFrom) -> Result<(), Error>

Attempts to seek to an offset, in bytes, in a stream. Read more
§

fn poll_complete(\n self: Pin<&mut Box<T>>,\n cx: &mut Context<'_>\n) -> Poll<Result<u64, Error>>

Waits for a seek operation to complete. Read more
","AsyncSeek","particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
§

impl<T> AsyncWrite for Box<T>where\n T: AsyncWrite + Unpin + ?Sized,

§

fn poll_write(\n self: Pin<&mut Box<T>>,\n cx: &mut Context<'_>,\n buf: &[u8]\n) -> Poll<Result<usize, Error>>

Attempt to write bytes from buf into the object. Read more
§

fn poll_write_vectored(\n self: Pin<&mut Box<T>>,\n cx: &mut Context<'_>,\n bufs: &[IoSlice<'_>]\n) -> Poll<Result<usize, Error>>

Like poll_write, except that it writes from a slice of buffers. Read more
§

fn is_write_vectored(&self) -> bool

Determines if this writer has an efficient poll_write_vectored\nimplementation. Read more
§

fn poll_flush(\n self: Pin<&mut Box<T>>,\n cx: &mut Context<'_>\n) -> Poll<Result<(), Error>>

Attempts to flush the object, ensuring that any buffered data reach\ntheir destination. Read more
§

fn poll_shutdown(\n self: Pin<&mut Box<T>>,\n cx: &mut Context<'_>\n) -> Poll<Result<(), Error>>

Initiates or attempts to shut down this writer, returning success when\nthe I/O connection has completely shut down. Read more
","AsyncWrite","particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
§

impl<T> AsyncBufRead for Box<T>where\n T: AsyncBufRead + Unpin + ?Sized,

§

fn poll_fill_buf(\n self: Pin<&mut Box<T>>,\n cx: &mut Context<'_>\n) -> Poll<Result<&[u8], Error>>

Attempts to return the contents of the internal buffer, filling it with more data\nfrom the inner reader if it is empty. Read more
§

fn consume(self: Pin<&mut Box<T>>, amt: usize)

Tells this buffer that amt bytes have been consumed from the buffer,\nso they should no longer be returned in calls to poll_read. Read more
","AsyncBufRead","particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
§

impl<T> AsyncRead for Box<T>where\n T: AsyncRead + Unpin + ?Sized,

§

fn poll_read(\n self: Pin<&mut Box<T>>,\n cx: &mut Context<'_>,\n buf: &mut ReadBuf<'_>\n) -> Poll<Result<(), Error>>

Attempts to read from the AsyncRead into buf. Read more
","AsyncRead","particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
§

impl<T> Value for Box<T>where\n T: Value + ?Sized,

§

fn record(&self, key: &Field, visitor: &mut dyn Visit)

Visits this value with the given Visitor.
","Value","particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
§

impl<S> Subscriber for Box<S>where\n S: Subscriber + ?Sized,

§

fn register_callsite(&self, metadata: &'static Metadata<'static>) -> Interest

Registers a new callsite with this subscriber, returning whether or not\nthe subscriber is interested in being notified about the callsite. Read more
§

fn enabled(&self, metadata: &Metadata<'_>) -> bool

Returns true if a span or event with the specified metadata would be\nrecorded. Read more
§

fn max_level_hint(&self) -> Option<LevelFilter>

Returns the highest verbosity level that this Subscriber will\nenable, or None, if the subscriber does not implement level-based\nfiltering or chooses not to implement this method. Read more
§

fn new_span(&self, span: &Attributes<'_>) -> Id

Visit the construction of a new span, returning a new span ID for the\nspan being constructed. Read more
§

fn record(&self, span: &Id, values: &Record<'_>)

Record a set of values on a span. Read more
§

fn record_follows_from(&self, span: &Id, follows: &Id)

Adds an indication that span follows from the span with the id\nfollows. Read more
§

fn event_enabled(&self, event: &Event<'_>) -> bool

Determine if an [Event] should be recorded. Read more
§

fn event(&self, event: &Event<'_>)

Records that an Event has occurred. Read more
§

fn enter(&self, span: &Id)

Records that a span has been entered. Read more
§

fn exit(&self, span: &Id)

Records that a span has been exited. Read more
§

fn clone_span(&self, id: &Id) -> Id

Notifies the subscriber that a span ID has been cloned. Read more
§

fn try_close(&self, id: Id) -> bool

Notifies the subscriber that a span ID has been dropped, and returns\ntrue if there are now 0 IDs that refer to that span. Read more
§

fn drop_span(&self, id: Id)

👎Deprecated since 0.1.2: use Subscriber::try_close instead
This method is deprecated. Read more
§

fn current_span(&self) -> Current

Returns a type representing this subscriber’s view of the current span. Read more
§

unsafe fn downcast_raw(&self, id: TypeId) -> Option<*const ()>

If self is the same type as the provided TypeId, returns an untyped\n*const pointer to that type. Otherwise, returns None. Read more
§

fn on_register_dispatch(&self, subscriber: &Dispatch)

Invoked when this subscriber becomes a [Dispatch]. Read more
","Subscriber","particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
source§

impl<T> Log for Box<T>where\n T: Log + ?Sized,

source§

fn enabled(&self, metadata: &Metadata<'_>) -> bool

Determines if a log message with the specified metadata would be\nlogged. Read more
source§

fn log(&self, record: &Record<'_>)

Logs the Record. Read more
source§

fn flush(&self)

Flushes any buffered records. Read more
","Log","particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
§

impl<T> Source for Box<T>where\n T: Source + ?Sized,

§

fn register(\n &mut self,\n registry: &Registry,\n token: Token,\n interests: Interest\n) -> Result<(), Error>

Register self with the given Registry instance. Read more
§

fn reregister(\n &mut self,\n registry: &Registry,\n token: Token,\n interests: Interest\n) -> Result<(), Error>

Re-register self with the given Registry instance. Read more
§

fn deregister(&mut self, registry: &Registry) -> Result<(), Error>

Deregister self from the given Registry instance. Read more
","Source","particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
§

impl<S> Stream for Box<S>where\n S: Stream + Unpin + ?Sized,

§

type Item = <S as Stream>::Item

Values yielded by the stream.
§

fn poll_next(\n self: Pin<&mut Box<S>>,\n cx: &mut Context<'_>\n) -> Poll<Option<<Box<S> as Stream>::Item>>

Attempt to pull out the next value of this stream, registering the\ncurrent task for wakeup if the value is not yet available, and returning\nNone if the stream is exhausted. Read more
§

fn size_hint(&self) -> (usize, Option<usize>)

Returns the bounds on the remaining length of the stream. Read more
","Stream","particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
§

impl<F> FusedFuture for Box<F>where\n F: FusedFuture + Unpin + ?Sized,

§

fn is_terminated(&self) -> bool

Returns true if the underlying future should no longer be polled.
","FusedFuture","particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
§

impl<S> FusedStream for Box<S>where\n S: FusedStream + Unpin + ?Sized,

§

fn is_terminated(&self) -> bool

Returns true if the stream should no longer be polled.
","FusedStream","particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
§

impl<'a, T, F> UnsafeFutureObj<'a, T> for Box<F>where\n F: Future<Output = T> + 'a,

§

fn into_raw(self) -> *mut dyn Future<Output = T> + 'a

Convert an owned instance into a (conceptually owned) fat pointer. Read more
§

unsafe fn drop(ptr: *mut dyn Future<Output = T> + 'a)

Drops the future represented by the given fat pointer. Read more
","UnsafeFutureObj<'a, T>","particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
§

impl<Sp> LocalSpawn for Box<Sp>where\n Sp: LocalSpawn + ?Sized,

§

fn spawn_local_obj(\n &self,\n future: LocalFutureObj<'static, ()>\n) -> Result<(), SpawnError>

Spawns a future that will be run to completion. Read more
§

fn status_local(&self) -> Result<(), SpawnError>

Determines whether the executor is able to spawn new tasks. Read more
","LocalSpawn","particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
§

impl<Sp> Spawn for Box<Sp>where\n Sp: Spawn + ?Sized,

§

fn spawn_obj(&self, future: FutureObj<'static, ()>) -> Result<(), SpawnError>

Spawns a future that will be run to completion. Read more
§

fn status(&self) -> Result<(), SpawnError>

Determines whether the executor is able to spawn new tasks. Read more
","Spawn","particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
§

impl<T> AsyncWrite for Box<T>where\n T: AsyncWrite + Unpin + ?Sized,

§

fn poll_write(\n self: Pin<&mut Box<T>>,\n cx: &mut Context<'_>,\n buf: &[u8]\n) -> Poll<Result<usize, Error>>

Attempt to write bytes from buf into the object. Read more
§

fn poll_write_vectored(\n self: Pin<&mut Box<T>>,\n cx: &mut Context<'_>,\n bufs: &[IoSlice<'_>]\n) -> Poll<Result<usize, Error>>

Attempt to write bytes from bufs into the object using vectored\nIO operations. Read more
§

fn poll_flush(\n self: Pin<&mut Box<T>>,\n cx: &mut Context<'_>\n) -> Poll<Result<(), Error>>

Attempt to flush the object, ensuring that any buffered data reach\ntheir destination. Read more
§

fn poll_close(\n self: Pin<&mut Box<T>>,\n cx: &mut Context<'_>\n) -> Poll<Result<(), Error>>

Attempt to close the object. Read more
","AsyncWrite","particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
§

impl<T> AsyncRead for Box<T>where\n T: AsyncRead + Unpin + ?Sized,

§

fn poll_read(\n self: Pin<&mut Box<T>>,\n cx: &mut Context<'_>,\n buf: &mut [u8]\n) -> Poll<Result<usize, Error>>

Attempt to read from the AsyncRead into buf. Read more
§

fn poll_read_vectored(\n self: Pin<&mut Box<T>>,\n cx: &mut Context<'_>,\n bufs: &mut [IoSliceMut<'_>]\n) -> Poll<Result<usize, Error>>

Attempt to read from the AsyncRead into bufs using vectored\nIO operations. Read more
","AsyncRead","particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
§

impl<T> AsyncSeek for Box<T>where\n T: AsyncSeek + Unpin + ?Sized,

§

fn poll_seek(\n self: Pin<&mut Box<T>>,\n cx: &mut Context<'_>,\n pos: SeekFrom\n) -> Poll<Result<u64, Error>>

Attempt to seek to an offset, in bytes, in a stream. Read more
","AsyncSeek","particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
§

impl<T> AsyncBufRead for Box<T>where\n T: AsyncBufRead + Unpin + ?Sized,

§

fn poll_fill_buf(\n self: Pin<&mut Box<T>>,\n cx: &mut Context<'_>\n) -> Poll<Result<&[u8], Error>>

Attempt to return the contents of the internal buffer, filling it with more data\nfrom the inner reader if it is empty. Read more
§

fn consume(self: Pin<&mut Box<T>>, amt: usize)

Tells this buffer that amt bytes have been consumed from the buffer,\nso they should no longer be returned in calls to poll_read. Read more
","AsyncBufRead","particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
source§

impl<T> Serialize for Box<T>where\n T: Serialize + ?Sized,

source§

fn serialize<S>(\n &self,\n serializer: S\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,

","Serialize","particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
source§

impl<R> CryptoRng for Box<R>where\n R: CryptoRng + ?Sized,

","CryptoRng","particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
source§

impl<R> RngCore for Box<R>where\n R: RngCore + ?Sized,

source§

fn next_u32(&mut self) -> u32

Return the next random u32. Read more
source§

fn next_u64(&mut self) -> u64

Return the next random u64. Read more
source§

fn fill_bytes(&mut self, dest: &mut [u8])

Fill dest with random data. Read more
source§

fn try_fill_bytes(&mut self, dest: &mut [u8]) -> Result<(), Error>

Fill dest entirely with random data. Read more
","RngCore","particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
§

impl<'a, V> VisitOperator<'a> for Box<V>where\n V: VisitOperator<'a> + ?Sized,

§

type Output = <V as VisitOperator<'a>>::Output

The result type of the visitor.
§

fn visit_operator(\n &mut self,\n op: &Operator<'a>\n) -> <Box<V> as VisitOperator<'a>>::Output

Visits the [Operator] op using the given offset. Read more
§

fn visit_unreachable(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_nop(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_block(\n &mut self,\n blockty: BlockType\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_loop(\n &mut self,\n blockty: BlockType\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_if(\n &mut self,\n blockty: BlockType\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_else(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_try(\n &mut self,\n blockty: BlockType\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_catch(\n &mut self,\n tag_index: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_throw(\n &mut self,\n tag_index: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_rethrow(\n &mut self,\n relative_depth: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_end(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_br(\n &mut self,\n relative_depth: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_br_if(\n &mut self,\n relative_depth: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_br_table(\n &mut self,\n targets: BrTable<'a>\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_return(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_call(\n &mut self,\n function_index: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_call_indirect(\n &mut self,\n type_index: u32,\n table_index: u32,\n table_byte: u8\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_return_call(\n &mut self,\n function_index: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_return_call_indirect(\n &mut self,\n type_index: u32,\n table_index: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_delegate(\n &mut self,\n relative_depth: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_catch_all(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_drop(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_select(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_typed_select(\n &mut self,\n ty: ValType\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_local_get(\n &mut self,\n local_index: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_local_set(\n &mut self,\n local_index: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_local_tee(\n &mut self,\n local_index: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_global_get(\n &mut self,\n global_index: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_global_set(\n &mut self,\n global_index: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_load(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_load(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_load(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_load(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_load8_s(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_load8_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_load16_s(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_load16_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_load8_s(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_load8_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_load16_s(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_load16_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_load32_s(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_load32_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_store(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_store(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_store(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_store(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_store8(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_store16(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_store8(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_store16(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_store32(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_memory_size(\n &mut self,\n mem: u32,\n mem_byte: u8\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_memory_grow(\n &mut self,\n mem: u32,\n mem_byte: u8\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_const(\n &mut self,\n value: i32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_const(\n &mut self,\n value: i64\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_const(\n &mut self,\n value: Ieee32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_const(\n &mut self,\n value: Ieee64\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_ref_null(\n &mut self,\n hty: HeapType\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_ref_is_null(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_ref_func(\n &mut self,\n function_index: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_eqz(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_eq(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_ne(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_lt_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_lt_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_gt_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_gt_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_le_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_le_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_ge_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_ge_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_eqz(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_eq(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_ne(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_lt_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_lt_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_gt_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_gt_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_le_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_le_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_ge_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_ge_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_eq(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_ne(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_lt(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_gt(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_le(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_ge(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_eq(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_ne(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_lt(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_gt(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_le(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_ge(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_clz(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_ctz(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_popcnt(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_add(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_sub(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_mul(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_div_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_div_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_rem_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_rem_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_and(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_or(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_xor(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_shl(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_shr_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_shr_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_rotl(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_rotr(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_clz(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_ctz(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_popcnt(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_add(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_sub(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_mul(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_div_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_div_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_rem_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_rem_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_and(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_or(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_xor(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_shl(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_shr_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_shr_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_rotl(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_rotr(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_abs(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_neg(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_ceil(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_floor(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_trunc(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_nearest(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_sqrt(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_add(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_sub(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_mul(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_div(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_min(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_max(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_copysign(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_abs(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_neg(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_ceil(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_floor(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_trunc(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_nearest(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_sqrt(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_add(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_sub(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_mul(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_div(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_min(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_max(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_copysign(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_wrap_i64(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_trunc_f32_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_trunc_f32_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_trunc_f64_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_trunc_f64_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_extend_i32_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_extend_i32_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_trunc_f32_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_trunc_f32_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_trunc_f64_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_trunc_f64_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_convert_i32_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_convert_i32_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_convert_i64_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_convert_i64_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_demote_f64(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_convert_i32_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_convert_i32_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_convert_i64_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_convert_i64_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_promote_f32(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_reinterpret_f32(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_reinterpret_f64(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_reinterpret_i32(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_reinterpret_i64(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_extend8_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_extend16_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_extend8_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_extend16_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_extend32_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_trunc_sat_f32_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_trunc_sat_f32_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_trunc_sat_f64_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_trunc_sat_f64_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_trunc_sat_f32_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_trunc_sat_f32_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_trunc_sat_f64_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_trunc_sat_f64_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_memory_init(\n &mut self,\n data_index: u32,\n mem: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_data_drop(\n &mut self,\n data_index: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_memory_copy(\n &mut self,\n dst_mem: u32,\n src_mem: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_memory_fill(\n &mut self,\n mem: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_table_init(\n &mut self,\n elem_index: u32,\n table: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_elem_drop(\n &mut self,\n elem_index: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_table_copy(\n &mut self,\n dst_table: u32,\n src_table: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_table_fill(\n &mut self,\n table: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_table_get(\n &mut self,\n table: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_table_set(\n &mut self,\n table: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_table_grow(\n &mut self,\n table: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_table_size(\n &mut self,\n table: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_memory_discard(\n &mut self,\n mem: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_memory_atomic_notify(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_memory_atomic_wait32(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_memory_atomic_wait64(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_atomic_fence(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_atomic_load(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_load(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_atomic_load8_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_atomic_load16_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_load8_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_load16_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_load32_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_atomic_store(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_store(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_atomic_store8(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_atomic_store16(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_store8(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_store16(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_store32(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_atomic_rmw_add(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_rmw_add(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_atomic_rmw8_add_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_atomic_rmw16_add_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_rmw8_add_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_rmw16_add_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_rmw32_add_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_atomic_rmw_sub(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_rmw_sub(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_atomic_rmw8_sub_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_atomic_rmw16_sub_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_rmw8_sub_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_rmw16_sub_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_rmw32_sub_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_atomic_rmw_and(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_rmw_and(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_atomic_rmw8_and_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_atomic_rmw16_and_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_rmw8_and_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_rmw16_and_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_rmw32_and_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_atomic_rmw_or(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_rmw_or(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_atomic_rmw8_or_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_atomic_rmw16_or_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_rmw8_or_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_rmw16_or_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_rmw32_or_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_atomic_rmw_xor(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_rmw_xor(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_atomic_rmw8_xor_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_atomic_rmw16_xor_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_rmw8_xor_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_rmw16_xor_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_rmw32_xor_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_atomic_rmw_xchg(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_rmw_xchg(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_atomic_rmw8_xchg_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_atomic_rmw16_xchg_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_rmw8_xchg_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_rmw16_xchg_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_rmw32_xchg_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_atomic_rmw_cmpxchg(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_rmw_cmpxchg(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_atomic_rmw8_cmpxchg_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_atomic_rmw16_cmpxchg_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_rmw8_cmpxchg_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_rmw16_cmpxchg_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_rmw32_cmpxchg_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_load(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_load8x8_s(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_load8x8_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_load16x4_s(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_load16x4_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_load32x2_s(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_load32x2_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_load8_splat(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_load16_splat(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_load32_splat(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_load64_splat(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_load32_zero(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_load64_zero(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_store(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_load8_lane(\n &mut self,\n memarg: MemArg,\n lane: u8\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_load16_lane(\n &mut self,\n memarg: MemArg,\n lane: u8\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_load32_lane(\n &mut self,\n memarg: MemArg,\n lane: u8\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_load64_lane(\n &mut self,\n memarg: MemArg,\n lane: u8\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_store8_lane(\n &mut self,\n memarg: MemArg,\n lane: u8\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_store16_lane(\n &mut self,\n memarg: MemArg,\n lane: u8\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_store32_lane(\n &mut self,\n memarg: MemArg,\n lane: u8\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_store64_lane(\n &mut self,\n memarg: MemArg,\n lane: u8\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_const(\n &mut self,\n value: V128\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_shuffle(\n &mut self,\n lanes: [u8; 16]\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_extract_lane_s(\n &mut self,\n lane: u8\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_extract_lane_u(\n &mut self,\n lane: u8\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_replace_lane(\n &mut self,\n lane: u8\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_extract_lane_s(\n &mut self,\n lane: u8\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_extract_lane_u(\n &mut self,\n lane: u8\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_replace_lane(\n &mut self,\n lane: u8\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_extract_lane(\n &mut self,\n lane: u8\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_replace_lane(\n &mut self,\n lane: u8\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64x2_extract_lane(\n &mut self,\n lane: u8\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64x2_replace_lane(\n &mut self,\n lane: u8\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_extract_lane(\n &mut self,\n lane: u8\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_replace_lane(\n &mut self,\n lane: u8\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_extract_lane(\n &mut self,\n lane: u8\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_replace_lane(\n &mut self,\n lane: u8\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_swizzle(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_splat(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_splat(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_splat(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64x2_splat(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_splat(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_splat(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_eq(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_ne(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_lt_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_lt_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_gt_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_gt_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_le_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_le_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_ge_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_ge_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_eq(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_ne(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_lt_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_lt_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_gt_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_gt_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_le_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_le_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_ge_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_ge_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_eq(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_ne(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_lt_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_lt_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_gt_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_gt_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_le_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_le_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_ge_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_ge_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64x2_eq(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64x2_ne(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64x2_lt_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64x2_gt_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64x2_le_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64x2_ge_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_eq(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_ne(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_lt(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_gt(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_le(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_ge(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_eq(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_ne(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_lt(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_gt(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_le(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_ge(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_not(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_and(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_andnot(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_or(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_xor(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_bitselect(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_any_true(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_abs(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_neg(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_popcnt(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_all_true(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_bitmask(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_narrow_i16x8_s(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_narrow_i16x8_u(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_shl(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_shr_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_shr_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_add(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_add_sat_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_add_sat_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_sub(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_sub_sat_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_sub_sat_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_min_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_min_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_max_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_max_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_avgr_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_extadd_pairwise_i8x16_s(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_extadd_pairwise_i8x16_u(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_abs(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_neg(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_q15mulr_sat_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_all_true(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_bitmask(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_narrow_i32x4_s(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_narrow_i32x4_u(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_extend_low_i8x16_s(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_extend_high_i8x16_s(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_extend_low_i8x16_u(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_extend_high_i8x16_u(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_shl(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_shr_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_shr_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_add(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_add_sat_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_add_sat_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_sub(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_sub_sat_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_sub_sat_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_mul(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_min_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_min_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_max_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_max_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_avgr_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_extmul_low_i8x16_s(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_extmul_high_i8x16_s(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_extmul_low_i8x16_u(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_extmul_high_i8x16_u(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_extadd_pairwise_i16x8_s(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_extadd_pairwise_i16x8_u(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_abs(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_neg(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_all_true(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_bitmask(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_extend_low_i16x8_s(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_extend_high_i16x8_s(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_extend_low_i16x8_u(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_extend_high_i16x8_u(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_shl(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_shr_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_shr_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_add(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_sub(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_mul(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_min_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_min_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_max_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_max_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_dot_i16x8_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_extmul_low_i16x8_s(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_extmul_high_i16x8_s(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_extmul_low_i16x8_u(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_extmul_high_i16x8_u(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64x2_abs(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64x2_neg(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64x2_all_true(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64x2_bitmask(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64x2_extend_low_i32x4_s(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64x2_extend_high_i32x4_s(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64x2_extend_low_i32x4_u(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64x2_extend_high_i32x4_u(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64x2_shl(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64x2_shr_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64x2_shr_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64x2_add(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64x2_sub(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64x2_mul(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64x2_extmul_low_i32x4_s(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64x2_extmul_high_i32x4_s(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64x2_extmul_low_i32x4_u(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64x2_extmul_high_i32x4_u(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_ceil(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_floor(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_trunc(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_nearest(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_abs(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_neg(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_sqrt(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_add(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_sub(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_mul(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_div(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_min(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_max(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_pmin(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_pmax(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_ceil(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_floor(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_trunc(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_nearest(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_abs(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_neg(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_sqrt(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_add(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_sub(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_mul(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_div(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_min(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_max(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_pmin(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_pmax(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_trunc_sat_f32x4_s(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_trunc_sat_f32x4_u(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_convert_i32x4_s(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_convert_i32x4_u(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_trunc_sat_f64x2_s_zero(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_trunc_sat_f64x2_u_zero(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_convert_low_i32x4_s(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_convert_low_i32x4_u(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_demote_f64x2_zero(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_promote_low_f32x4(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_relaxed_swizzle(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_relaxed_trunc_sat_f32x4_s(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_relaxed_trunc_sat_f32x4_u(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_relaxed_trunc_sat_f64x2_s_zero(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_relaxed_trunc_sat_f64x2_u_zero(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_relaxed_fma(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_relaxed_fnma(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_relaxed_fma(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_relaxed_fnma(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_relaxed_laneselect(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_relaxed_laneselect(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_relaxed_laneselect(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64x2_relaxed_laneselect(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_relaxed_min(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_relaxed_max(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_relaxed_min(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_relaxed_max(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_relaxed_q15mulr_s(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_dot_i8x16_i7x16_s(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_dot_i8x16_i7x16_add_s(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_relaxed_dot_bf16x8_add_f32x4(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_call_ref(\n &mut self,\n hty: HeapType\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_return_call_ref(\n &mut self,\n hty: HeapType\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_ref_as_non_null(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_br_on_null(\n &mut self,\n relative_depth: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_br_on_non_null(\n &mut self,\n relative_depth: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

","VisitOperator<'a>","particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
source§

impl<'de, T, U> DeserializeAs<'de, Box<T>> for Box<U>where\n U: DeserializeAs<'de, T>,

source§

fn deserialize_as<D>(\n deserializer: D\n) -> Result<Box<T>, <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer.
","DeserializeAs<'de, Box>","particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
source§

impl<T, U> SerializeAs<Box<T>> for Box<U>where\n U: SerializeAs<T>,

source§

fn serialize_as<S>(\n source: &Box<T>,\n serializer: S\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,

Serialize this value into the given Serde serializer.
","SerializeAs>","particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
§

impl<T> StableDeref for Box<T>where\n T: ?Sized,

","StableDeref","particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
source§

impl<I> DoubleEndedFallibleIterator for Box<I>where\n I: DoubleEndedFallibleIterator + ?Sized,

source§

fn next_back(\n &mut self\n) -> Result<Option<<I as FallibleIterator>::Item>, <I as FallibleIterator>::Error>

Advances the end of the iterator, returning the last value.
source§

fn rfold<B, F>(self, init: B, f: F) -> Result<B, Self::Error>where\n Self: Sized,\n F: FnMut(B, Self::Item) -> Result<B, Self::Error>,

Applies a function over the elements of the iterator in reverse order, producing a single final value.
source§

fn try_rfold<B, E, F>(&mut self, init: B, f: F) -> Result<B, E>where\n Self: Sized,\n E: From<Self::Error>,\n F: FnMut(B, Self::Item) -> Result<B, E>,

Applies a function over the elements of the iterator in reverse, producing a single final value. Read more
","DoubleEndedFallibleIterator","particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
source§

impl<I> FallibleIterator for Box<I>where\n I: FallibleIterator + ?Sized,

§

type Item = <I as FallibleIterator>::Item

The type being iterated over.
§

type Error = <I as FallibleIterator>::Error

The error type.
source§

fn next(\n &mut self\n) -> Result<Option<<I as FallibleIterator>::Item>, <I as FallibleIterator>::Error>

Advances the iterator and returns the next value. Read more
source§

fn size_hint(&self) -> (usize, Option<usize>)

Returns bounds on the remaining length of the iterator. Read more
source§

fn nth(\n &mut self,\n n: usize\n) -> Result<Option<<I as FallibleIterator>::Item>, <I as FallibleIterator>::Error>

Returns the nth element of the iterator.
source§

fn count(self) -> Result<usize, Self::Error>where\n Self: Sized,

Consumes the iterator, returning the number of remaining items.
source§

fn last(self) -> Result<Option<Self::Item>, Self::Error>where\n Self: Sized,

Returns the last element of the iterator.
source§

fn step_by(self, step: usize) -> StepBy<Self>where\n Self: Sized,

Returns an iterator starting at the same point, but stepping by the given amount at each iteration. Read more
source§

fn chain<I>(self, it: I) -> Chain<Self, I>where\n I: IntoFallibleIterator<Item = Self::Item, Error = Self::Error>,\n Self: Sized,

Returns an iterator which yields the elements of this iterator followed\nby another.
source§

fn zip<I>(\n self,\n o: I\n) -> Zip<Self, <I as IntoFallibleIterator>::IntoFallibleIter>where\n Self: Sized,\n I: IntoFallibleIterator<Error = Self::Error>,

Returns an iterator that yields pairs of this iterator’s and another\niterator’s values.
source§

fn map<F, B>(self, f: F) -> Map<Self, F>where\n Self: Sized,\n F: FnMut(Self::Item) -> Result<B, Self::Error>,

Returns an iterator which applies a fallible transform to the elements\nof the underlying iterator.
source§

fn for_each<F>(self, f: F) -> Result<(), Self::Error>where\n Self: Sized,\n F: FnMut(Self::Item) -> Result<(), Self::Error>,

Calls a fallible closure on each element of an iterator.
source§

fn filter<F>(self, f: F) -> Filter<Self, F>where\n Self: Sized,\n F: FnMut(&Self::Item) -> Result<bool, Self::Error>,

Returns an iterator which uses a predicate to determine which values\nshould be yielded. The predicate may fail; such failures are passed to\nthe caller.
source§

fn filter_map<B, F>(self, f: F) -> FilterMap<Self, F>where\n Self: Sized,\n F: FnMut(Self::Item) -> Result<Option<B>, Self::Error>,

Returns an iterator which both filters and maps. The closure may fail;\nsuch failures are passed along to the consumer.
source§

fn enumerate(self) -> Enumerate<Self>where\n Self: Sized,

Returns an iterator which yields the current iteration count as well\nas the value.
source§

fn peekable(self) -> Peekable<Self>where\n Self: Sized,

Returns an iterator that can peek at the next element without consuming\nit.
source§

fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P>where\n Self: Sized,\n P: FnMut(&Self::Item) -> Result<bool, Self::Error>,

Returns an iterator that skips elements based on a predicate.
source§

fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P>where\n Self: Sized,\n P: FnMut(&Self::Item) -> Result<bool, Self::Error>,

Returns an iterator that yields elements based on a predicate.
source§

fn skip(self, n: usize) -> Skip<Self>where\n Self: Sized,

Returns an iterator which skips the first n values of this iterator.
source§

fn take(self, n: usize) -> Take<Self>where\n Self: Sized,

Returns an iterator that yields only the first n values of this\niterator.
source§

fn scan<St, B, F>(self, initial_state: St, f: F) -> Scan<Self, St, F>where\n Self: Sized,\n F: FnMut(&mut St, Self::Item) -> Result<Option<B>, Self::Error>,

Returns an iterator which applies a stateful map to values of this\niterator.
source§

fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F>where\n Self: Sized,\n U: IntoFallibleIterator<Error = Self::Error>,\n F: FnMut(Self::Item) -> Result<U, Self::Error>,

Returns an iterator which maps this iterator’s elements to iterators, yielding those iterators’ values.
source§

fn fuse(self) -> Fuse<Self>where\n Self: Sized,

Returns an iterator which yields this iterator’s elements and ends after\nthe first Ok(None). Read more
source§

fn inspect<F>(self, f: F) -> Inspect<Self, F>where\n Self: Sized,\n F: FnMut(&Self::Item) -> Result<(), Self::Error>,

Returns an iterator which passes each element to a closure before returning it.
source§

fn by_ref(&mut self) -> &mut Selfwhere\n Self: Sized,

Borrow an iterator rather than consuming it. Read more
source§

fn collect<T>(self) -> Result<T, Self::Error>where\n T: FromFallibleIterator<Self::Item>,\n Self: Sized,

Transforms the iterator into a collection. Read more
source§

fn partition<B, F>(self, f: F) -> Result<(B, B), Self::Error>where\n Self: Sized,\n B: Default + Extend<Self::Item>,\n F: FnMut(&Self::Item) -> Result<bool, Self::Error>,

Transforms the iterator into two collections, partitioning elements by a closure.
source§

fn fold<B, F>(self, init: B, f: F) -> Result<B, Self::Error>where\n Self: Sized,\n F: FnMut(B, Self::Item) -> Result<B, Self::Error>,

Applies a function over the elements of the iterator, producing a single\nfinal value.
source§

fn try_fold<B, E, F>(&mut self, init: B, f: F) -> Result<B, E>where\n Self: Sized,\n E: From<Self::Error>,\n F: FnMut(B, Self::Item) -> Result<B, E>,

Applies a function over the elements of the iterator, producing a single final value. Read more
source§

fn all<F>(&mut self, f: F) -> Result<bool, Self::Error>where\n Self: Sized,\n F: FnMut(Self::Item) -> Result<bool, Self::Error>,

Determines if all elements of this iterator match a predicate.
source§

fn any<F>(&mut self, f: F) -> Result<bool, Self::Error>where\n Self: Sized,\n F: FnMut(Self::Item) -> Result<bool, Self::Error>,

Determines if any element of this iterator matches a predicate.
source§

fn find<F>(&mut self, f: F) -> Result<Option<Self::Item>, Self::Error>where\n Self: Sized,\n F: FnMut(&Self::Item) -> Result<bool, Self::Error>,

Returns the first element of the iterator that matches a predicate.
source§

fn find_map<B, F>(&mut self, f: F) -> Result<Option<B>, Self::Error>where\n Self: Sized,\n F: FnMut(Self::Item) -> Result<Option<B>, Self::Error>,

Applies a function to the elements of the iterator, returning the first non-None result.
source§

fn position<F>(&mut self, f: F) -> Result<Option<usize>, Self::Error>where\n Self: Sized,\n F: FnMut(Self::Item) -> Result<bool, Self::Error>,

Returns the position of the first element of this iterator that matches\na predicate. The predicate may fail; such failures are returned to the\ncaller.
source§

fn max_by_key<B, F>(self, f: F) -> Result<Option<Self::Item>, Self::Error>where\n Self: Sized,\n B: Ord,\n F: FnMut(&Self::Item) -> Result<B, Self::Error>,

Returns the element of the iterator which gives the maximum value from\nthe function.
source§

fn max_by<F>(self, f: F) -> Result<Option<Self::Item>, Self::Error>where\n Self: Sized,\n F: FnMut(&Self::Item, &Self::Item) -> Result<Ordering, Self::Error>,

Returns the element that gives the maximum value with respect to the function.
source§

fn min_by_key<B, F>(self, f: F) -> Result<Option<Self::Item>, Self::Error>where\n Self: Sized,\n B: Ord,\n F: FnMut(&Self::Item) -> Result<B, Self::Error>,

Returns the element of the iterator which gives the minimum value from\nthe function.
source§

fn min_by<F>(self, f: F) -> Result<Option<Self::Item>, Self::Error>where\n Self: Sized,\n F: FnMut(&Self::Item, &Self::Item) -> Result<Ordering, Self::Error>,

Returns the element that gives the minimum value with respect to the function.
source§

fn unzip<A, B, FromA, FromB>(self) -> Result<(FromA, FromB), Self::Error>where\n Self: Sized + FallibleIterator<Item = (A, B)>,\n FromA: Default + Extend<A>,\n FromB: Default + Extend<B>,

Converts an iterator of pairs into a pair of containers.
source§

fn cloned<'a, T>(self) -> Cloned<Self>where\n Self: Sized + FallibleIterator<Item = &'a T>,\n T: 'a + Clone,

Returns an iterator which clones all of its elements.
source§

fn partial_cmp<I>(self, other: I) -> Result<Option<Ordering>, Self::Error>where\n Self: Sized,\n I: IntoFallibleIterator<Error = Self::Error>,\n Self::Item: PartialOrd<<I as IntoFallibleIterator>::Item>,

Lexicographically compares the elements of this iterator to that of\nanother.
source§

fn eq<I>(self, other: I) -> Result<bool, Self::Error>where\n Self: Sized,\n I: IntoFallibleIterator<Error = Self::Error>,\n Self::Item: PartialEq<<I as IntoFallibleIterator>::Item>,

Determines if the elements of this iterator are equal to those of\nanother.
source§

fn ne<I>(self, other: I) -> Result<bool, Self::Error>where\n Self: Sized,\n I: IntoFallibleIterator<Error = Self::Error>,\n Self::Item: PartialEq<<I as IntoFallibleIterator>::Item>,

Determines if the elements of this iterator are not equal to those of\nanother.
source§

fn lt<I>(self, other: I) -> Result<bool, Self::Error>where\n Self: Sized,\n I: IntoFallibleIterator<Error = Self::Error>,\n Self::Item: PartialOrd<<I as IntoFallibleIterator>::Item>,

Determines if the elements of this iterator are lexicographically less\nthan those of another.
source§

fn le<I>(self, other: I) -> Result<bool, Self::Error>where\n Self: Sized,\n I: IntoFallibleIterator<Error = Self::Error>,\n Self::Item: PartialOrd<<I as IntoFallibleIterator>::Item>,

Determines if the elements of this iterator are lexicographically less\nthan or equal to those of another.
source§

fn gt<I>(self, other: I) -> Result<bool, Self::Error>where\n Self: Sized,\n I: IntoFallibleIterator<Error = Self::Error>,\n Self::Item: PartialOrd<<I as IntoFallibleIterator>::Item>,

Determines if the elements of this iterator are lexicographically\ngreater than those of another.
source§

fn ge<I>(self, other: I) -> Result<bool, Self::Error>where\n Self: Sized,\n I: IntoFallibleIterator<Error = Self::Error>,\n Self::Item: PartialOrd<<I as IntoFallibleIterator>::Item>,

Determines if the elements of this iterator are lexicographically\ngreater than or equal to those of another.
source§

fn iterator(self) -> Iterator<Self>where\n Self: Sized,

Returns a normal (non-fallible) iterator over Result<Item, Error>.
source§

fn map_err<B, F>(self, f: F) -> MapErr<Self, F>where\n F: FnMut(Self::Error) -> B,\n Self: Sized,

Returns an iterator which applies a transform to the errors of the\nunderlying iterator.
","FallibleIterator","particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
§

impl<T> Lower for Box<T>where\n T: Lower + ?Sized,

","Lower","particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
§

impl<T> ComponentType for Box<T>where\n T: ComponentType + ?Sized,

","ComponentType","particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
§

impl<'a, V> VisitOperator<'a> for Box<V>where\n V: VisitOperator<'a> + ?Sized,

§

type Output = <V as VisitOperator<'a>>::Output

The result type of the visitor.
§

fn visit_operator(\n &mut self,\n op: &Operator<'a>\n) -> <Box<V> as VisitOperator<'a>>::Output

Visits the [Operator] op using the given offset. Read more
§

fn visit_unreachable(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_nop(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_block(\n &mut self,\n blockty: BlockType\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_loop(\n &mut self,\n blockty: BlockType\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_if(\n &mut self,\n blockty: BlockType\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_else(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_try(\n &mut self,\n blockty: BlockType\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_catch(\n &mut self,\n tag_index: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_throw(\n &mut self,\n tag_index: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_rethrow(\n &mut self,\n relative_depth: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_end(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_br(\n &mut self,\n relative_depth: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_br_if(\n &mut self,\n relative_depth: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_br_table(\n &mut self,\n targets: BrTable<'a>\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_return(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_call(\n &mut self,\n function_index: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_call_indirect(\n &mut self,\n type_index: u32,\n table_index: u32,\n table_byte: u8\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_return_call(\n &mut self,\n function_index: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_return_call_indirect(\n &mut self,\n type_index: u32,\n table_index: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_delegate(\n &mut self,\n relative_depth: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_catch_all(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_drop(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_select(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_typed_select(\n &mut self,\n ty: ValType\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_local_get(\n &mut self,\n local_index: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_local_set(\n &mut self,\n local_index: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_local_tee(\n &mut self,\n local_index: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_global_get(\n &mut self,\n global_index: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_global_set(\n &mut self,\n global_index: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_load(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_load(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_load(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_load(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_load8_s(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_load8_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_load16_s(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_load16_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_load8_s(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_load8_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_load16_s(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_load16_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_load32_s(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_load32_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_store(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_store(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_store(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_store(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_store8(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_store16(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_store8(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_store16(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_store32(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_memory_size(\n &mut self,\n mem: u32,\n mem_byte: u8\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_memory_grow(\n &mut self,\n mem: u32,\n mem_byte: u8\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_const(\n &mut self,\n value: i32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_const(\n &mut self,\n value: i64\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_const(\n &mut self,\n value: Ieee32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_const(\n &mut self,\n value: Ieee64\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_ref_null(\n &mut self,\n hty: HeapType\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_ref_is_null(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_ref_func(\n &mut self,\n function_index: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_eqz(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_eq(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_ne(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_lt_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_lt_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_gt_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_gt_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_le_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_le_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_ge_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_ge_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_eqz(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_eq(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_ne(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_lt_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_lt_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_gt_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_gt_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_le_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_le_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_ge_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_ge_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_eq(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_ne(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_lt(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_gt(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_le(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_ge(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_eq(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_ne(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_lt(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_gt(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_le(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_ge(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_clz(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_ctz(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_popcnt(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_add(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_sub(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_mul(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_div_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_div_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_rem_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_rem_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_and(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_or(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_xor(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_shl(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_shr_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_shr_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_rotl(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_rotr(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_clz(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_ctz(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_popcnt(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_add(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_sub(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_mul(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_div_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_div_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_rem_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_rem_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_and(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_or(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_xor(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_shl(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_shr_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_shr_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_rotl(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_rotr(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_abs(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_neg(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_ceil(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_floor(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_trunc(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_nearest(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_sqrt(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_add(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_sub(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_mul(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_div(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_min(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_max(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_copysign(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_abs(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_neg(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_ceil(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_floor(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_trunc(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_nearest(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_sqrt(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_add(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_sub(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_mul(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_div(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_min(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_max(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_copysign(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_wrap_i64(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_trunc_f32_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_trunc_f32_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_trunc_f64_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_trunc_f64_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_extend_i32_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_extend_i32_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_trunc_f32_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_trunc_f32_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_trunc_f64_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_trunc_f64_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_convert_i32_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_convert_i32_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_convert_i64_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_convert_i64_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_demote_f64(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_convert_i32_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_convert_i32_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_convert_i64_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_convert_i64_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_promote_f32(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_reinterpret_f32(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_reinterpret_f64(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_reinterpret_i32(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_reinterpret_i64(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_extend8_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_extend16_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_extend8_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_extend16_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_extend32_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i31_new(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i31_get_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i31_get_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_trunc_sat_f32_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_trunc_sat_f32_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_trunc_sat_f64_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_trunc_sat_f64_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_trunc_sat_f32_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_trunc_sat_f32_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_trunc_sat_f64_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_trunc_sat_f64_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_memory_init(\n &mut self,\n data_index: u32,\n mem: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_data_drop(\n &mut self,\n data_index: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_memory_copy(\n &mut self,\n dst_mem: u32,\n src_mem: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_memory_fill(\n &mut self,\n mem: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_table_init(\n &mut self,\n elem_index: u32,\n table: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_elem_drop(\n &mut self,\n elem_index: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_table_copy(\n &mut self,\n dst_table: u32,\n src_table: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_table_fill(\n &mut self,\n table: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_table_get(\n &mut self,\n table: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_table_set(\n &mut self,\n table: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_table_grow(\n &mut self,\n table: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_table_size(\n &mut self,\n table: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_memory_discard(\n &mut self,\n mem: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_memory_atomic_notify(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_memory_atomic_wait32(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_memory_atomic_wait64(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_atomic_fence(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_atomic_load(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_load(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_atomic_load8_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_atomic_load16_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_load8_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_load16_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_load32_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_atomic_store(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_store(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_atomic_store8(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_atomic_store16(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_store8(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_store16(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_store32(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_atomic_rmw_add(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_rmw_add(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_atomic_rmw8_add_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_atomic_rmw16_add_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_rmw8_add_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_rmw16_add_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_rmw32_add_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_atomic_rmw_sub(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_rmw_sub(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_atomic_rmw8_sub_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_atomic_rmw16_sub_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_rmw8_sub_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_rmw16_sub_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_rmw32_sub_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_atomic_rmw_and(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_rmw_and(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_atomic_rmw8_and_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_atomic_rmw16_and_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_rmw8_and_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_rmw16_and_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_rmw32_and_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_atomic_rmw_or(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_rmw_or(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_atomic_rmw8_or_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_atomic_rmw16_or_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_rmw8_or_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_rmw16_or_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_rmw32_or_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_atomic_rmw_xor(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_rmw_xor(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_atomic_rmw8_xor_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_atomic_rmw16_xor_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_rmw8_xor_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_rmw16_xor_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_rmw32_xor_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_atomic_rmw_xchg(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_rmw_xchg(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_atomic_rmw8_xchg_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_atomic_rmw16_xchg_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_rmw8_xchg_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_rmw16_xchg_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_rmw32_xchg_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_atomic_rmw_cmpxchg(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_rmw_cmpxchg(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_atomic_rmw8_cmpxchg_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_atomic_rmw16_cmpxchg_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_rmw8_cmpxchg_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_rmw16_cmpxchg_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_rmw32_cmpxchg_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_load(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_load8x8_s(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_load8x8_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_load16x4_s(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_load16x4_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_load32x2_s(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_load32x2_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_load8_splat(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_load16_splat(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_load32_splat(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_load64_splat(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_load32_zero(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_load64_zero(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_store(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_load8_lane(\n &mut self,\n memarg: MemArg,\n lane: u8\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_load16_lane(\n &mut self,\n memarg: MemArg,\n lane: u8\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_load32_lane(\n &mut self,\n memarg: MemArg,\n lane: u8\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_load64_lane(\n &mut self,\n memarg: MemArg,\n lane: u8\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_store8_lane(\n &mut self,\n memarg: MemArg,\n lane: u8\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_store16_lane(\n &mut self,\n memarg: MemArg,\n lane: u8\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_store32_lane(\n &mut self,\n memarg: MemArg,\n lane: u8\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_store64_lane(\n &mut self,\n memarg: MemArg,\n lane: u8\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_const(\n &mut self,\n value: V128\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_shuffle(\n &mut self,\n lanes: [u8; 16]\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_extract_lane_s(\n &mut self,\n lane: u8\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_extract_lane_u(\n &mut self,\n lane: u8\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_replace_lane(\n &mut self,\n lane: u8\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_extract_lane_s(\n &mut self,\n lane: u8\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_extract_lane_u(\n &mut self,\n lane: u8\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_replace_lane(\n &mut self,\n lane: u8\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_extract_lane(\n &mut self,\n lane: u8\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_replace_lane(\n &mut self,\n lane: u8\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64x2_extract_lane(\n &mut self,\n lane: u8\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64x2_replace_lane(\n &mut self,\n lane: u8\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_extract_lane(\n &mut self,\n lane: u8\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_replace_lane(\n &mut self,\n lane: u8\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_extract_lane(\n &mut self,\n lane: u8\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_replace_lane(\n &mut self,\n lane: u8\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_swizzle(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_splat(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_splat(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_splat(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64x2_splat(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_splat(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_splat(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_eq(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_ne(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_lt_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_lt_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_gt_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_gt_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_le_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_le_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_ge_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_ge_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_eq(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_ne(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_lt_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_lt_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_gt_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_gt_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_le_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_le_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_ge_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_ge_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_eq(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_ne(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_lt_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_lt_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_gt_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_gt_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_le_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_le_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_ge_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_ge_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64x2_eq(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64x2_ne(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64x2_lt_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64x2_gt_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64x2_le_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64x2_ge_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_eq(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_ne(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_lt(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_gt(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_le(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_ge(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_eq(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_ne(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_lt(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_gt(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_le(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_ge(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_not(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_and(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_andnot(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_or(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_xor(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_bitselect(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_any_true(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_abs(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_neg(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_popcnt(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_all_true(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_bitmask(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_narrow_i16x8_s(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_narrow_i16x8_u(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_shl(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_shr_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_shr_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_add(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_add_sat_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_add_sat_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_sub(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_sub_sat_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_sub_sat_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_min_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_min_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_max_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_max_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_avgr_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_extadd_pairwise_i8x16_s(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_extadd_pairwise_i8x16_u(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_abs(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_neg(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_q15mulr_sat_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_all_true(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_bitmask(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_narrow_i32x4_s(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_narrow_i32x4_u(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_extend_low_i8x16_s(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_extend_high_i8x16_s(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_extend_low_i8x16_u(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_extend_high_i8x16_u(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_shl(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_shr_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_shr_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_add(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_add_sat_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_add_sat_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_sub(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_sub_sat_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_sub_sat_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_mul(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_min_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_min_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_max_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_max_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_avgr_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_extmul_low_i8x16_s(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_extmul_high_i8x16_s(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_extmul_low_i8x16_u(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_extmul_high_i8x16_u(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_extadd_pairwise_i16x8_s(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_extadd_pairwise_i16x8_u(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_abs(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_neg(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_all_true(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_bitmask(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_extend_low_i16x8_s(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_extend_high_i16x8_s(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_extend_low_i16x8_u(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_extend_high_i16x8_u(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_shl(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_shr_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_shr_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_add(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_sub(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_mul(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_min_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_min_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_max_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_max_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_dot_i16x8_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_extmul_low_i16x8_s(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_extmul_high_i16x8_s(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_extmul_low_i16x8_u(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_extmul_high_i16x8_u(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64x2_abs(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64x2_neg(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64x2_all_true(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64x2_bitmask(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64x2_extend_low_i32x4_s(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64x2_extend_high_i32x4_s(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64x2_extend_low_i32x4_u(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64x2_extend_high_i32x4_u(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64x2_shl(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64x2_shr_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64x2_shr_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64x2_add(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64x2_sub(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64x2_mul(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64x2_extmul_low_i32x4_s(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64x2_extmul_high_i32x4_s(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64x2_extmul_low_i32x4_u(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64x2_extmul_high_i32x4_u(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_ceil(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_floor(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_trunc(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_nearest(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_abs(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_neg(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_sqrt(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_add(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_sub(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_mul(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_div(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_min(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_max(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_pmin(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_pmax(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_ceil(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_floor(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_trunc(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_nearest(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_abs(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_neg(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_sqrt(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_add(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_sub(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_mul(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_div(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_min(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_max(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_pmin(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_pmax(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_trunc_sat_f32x4_s(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_trunc_sat_f32x4_u(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_convert_i32x4_s(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_convert_i32x4_u(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_trunc_sat_f64x2_s_zero(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_trunc_sat_f64x2_u_zero(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_convert_low_i32x4_s(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_convert_low_i32x4_u(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_demote_f64x2_zero(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_promote_low_f32x4(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_relaxed_swizzle(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_relaxed_trunc_f32x4_s(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_relaxed_trunc_f32x4_u(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_relaxed_trunc_f64x2_s_zero(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_relaxed_trunc_f64x2_u_zero(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_relaxed_madd(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_relaxed_nmadd(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_relaxed_madd(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_relaxed_nmadd(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_relaxed_laneselect(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_relaxed_laneselect(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_relaxed_laneselect(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64x2_relaxed_laneselect(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_relaxed_min(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_relaxed_max(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_relaxed_min(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_relaxed_max(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_relaxed_q15mulr_s(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_relaxed_dot_i8x16_i7x16_s(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_relaxed_dot_i8x16_i7x16_add_s(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_call_ref(\n &mut self,\n type_index: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_return_call_ref(\n &mut self,\n type_index: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_ref_as_non_null(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_br_on_null(\n &mut self,\n relative_depth: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_br_on_non_null(\n &mut self,\n relative_depth: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

","VisitOperator<'a>","particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
§

impl<'a, V> VisitOperator<'a> for Box<V>where\n V: VisitOperator<'a> + ?Sized,

§

type Output = <V as VisitOperator<'a>>::Output

The result type of the visitor.
§

fn visit_operator(\n &mut self,\n op: &Operator<'a>\n) -> <Box<V> as VisitOperator<'a>>::Output

Visits the [Operator] op using the given offset. Read more
§

fn visit_unreachable(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_nop(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_block(\n &mut self,\n blockty: BlockType\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_loop(\n &mut self,\n blockty: BlockType\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_if(\n &mut self,\n blockty: BlockType\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_else(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_try_table(\n &mut self,\n try_table: TryTable\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_throw(\n &mut self,\n tag_index: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_throw_ref(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_try(\n &mut self,\n blockty: BlockType\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_catch(\n &mut self,\n tag_index: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_rethrow(\n &mut self,\n relative_depth: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_delegate(\n &mut self,\n relative_depth: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_catch_all(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_end(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_br(\n &mut self,\n relative_depth: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_br_if(\n &mut self,\n relative_depth: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_br_table(\n &mut self,\n targets: BrTable<'a>\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_return(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_call(\n &mut self,\n function_index: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_call_indirect(\n &mut self,\n type_index: u32,\n table_index: u32,\n table_byte: u8\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_return_call(\n &mut self,\n function_index: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_return_call_indirect(\n &mut self,\n type_index: u32,\n table_index: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_drop(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_select(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_typed_select(\n &mut self,\n ty: ValType\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_local_get(\n &mut self,\n local_index: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_local_set(\n &mut self,\n local_index: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_local_tee(\n &mut self,\n local_index: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_global_get(\n &mut self,\n global_index: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_global_set(\n &mut self,\n global_index: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_load(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_load(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_load(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_load(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_load8_s(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_load8_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_load16_s(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_load16_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_load8_s(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_load8_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_load16_s(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_load16_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_load32_s(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_load32_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_store(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_store(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_store(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_store(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_store8(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_store16(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_store8(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_store16(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_store32(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_memory_size(\n &mut self,\n mem: u32,\n mem_byte: u8\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_memory_grow(\n &mut self,\n mem: u32,\n mem_byte: u8\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_const(\n &mut self,\n value: i32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_const(\n &mut self,\n value: i64\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_const(\n &mut self,\n value: Ieee32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_const(\n &mut self,\n value: Ieee64\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_ref_null(\n &mut self,\n hty: HeapType\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_ref_is_null(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_ref_func(\n &mut self,\n function_index: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_ref_eq(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_eqz(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_eq(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_ne(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_lt_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_lt_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_gt_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_gt_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_le_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_le_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_ge_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_ge_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_eqz(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_eq(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_ne(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_lt_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_lt_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_gt_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_gt_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_le_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_le_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_ge_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_ge_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_eq(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_ne(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_lt(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_gt(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_le(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_ge(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_eq(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_ne(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_lt(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_gt(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_le(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_ge(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_clz(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_ctz(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_popcnt(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_add(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_sub(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_mul(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_div_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_div_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_rem_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_rem_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_and(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_or(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_xor(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_shl(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_shr_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_shr_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_rotl(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_rotr(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_clz(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_ctz(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_popcnt(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_add(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_sub(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_mul(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_div_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_div_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_rem_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_rem_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_and(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_or(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_xor(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_shl(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_shr_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_shr_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_rotl(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_rotr(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_abs(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_neg(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_ceil(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_floor(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_trunc(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_nearest(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_sqrt(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_add(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_sub(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_mul(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_div(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_min(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_max(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_copysign(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_abs(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_neg(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_ceil(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_floor(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_trunc(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_nearest(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_sqrt(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_add(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_sub(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_mul(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_div(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_min(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_max(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_copysign(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_wrap_i64(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_trunc_f32_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_trunc_f32_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_trunc_f64_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_trunc_f64_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_extend_i32_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_extend_i32_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_trunc_f32_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_trunc_f32_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_trunc_f64_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_trunc_f64_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_convert_i32_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_convert_i32_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_convert_i64_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_convert_i64_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_demote_f64(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_convert_i32_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_convert_i32_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_convert_i64_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_convert_i64_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_promote_f32(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_reinterpret_f32(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_reinterpret_f64(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32_reinterpret_i32(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64_reinterpret_i64(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_extend8_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_extend16_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_extend8_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_extend16_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_extend32_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_struct_new(\n &mut self,\n struct_type_index: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_struct_new_default(\n &mut self,\n struct_type_index: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_struct_get(\n &mut self,\n struct_type_index: u32,\n field_index: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_struct_get_s(\n &mut self,\n struct_type_index: u32,\n field_index: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_struct_get_u(\n &mut self,\n struct_type_index: u32,\n field_index: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_struct_set(\n &mut self,\n struct_type_index: u32,\n field_index: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_array_new(\n &mut self,\n array_type_index: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_array_new_default(\n &mut self,\n array_type_index: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_array_new_fixed(\n &mut self,\n array_type_index: u32,\n array_size: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_array_new_data(\n &mut self,\n array_type_index: u32,\n array_data_index: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_array_new_elem(\n &mut self,\n array_type_index: u32,\n array_elem_index: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_array_get(\n &mut self,\n array_type_index: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_array_get_s(\n &mut self,\n array_type_index: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_array_get_u(\n &mut self,\n array_type_index: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_array_set(\n &mut self,\n array_type_index: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_array_len(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_array_fill(\n &mut self,\n array_type_index: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_array_copy(\n &mut self,\n array_type_index_dst: u32,\n array_type_index_src: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_array_init_data(\n &mut self,\n array_type_index: u32,\n array_data_index: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_array_init_elem(\n &mut self,\n array_type_index: u32,\n array_elem_index: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_ref_test_non_null(\n &mut self,\n hty: HeapType\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_ref_test_nullable(\n &mut self,\n hty: HeapType\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_ref_cast_non_null(\n &mut self,\n hty: HeapType\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_ref_cast_nullable(\n &mut self,\n hty: HeapType\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_br_on_cast(\n &mut self,\n relative_depth: u32,\n from_ref_type: RefType,\n to_ref_type: RefType\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_br_on_cast_fail(\n &mut self,\n relative_depth: u32,\n from_ref_type: RefType,\n to_ref_type: RefType\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_any_convert_extern(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_extern_convert_any(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_ref_i31(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i31_get_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i31_get_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_trunc_sat_f32_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_trunc_sat_f32_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_trunc_sat_f64_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_trunc_sat_f64_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_trunc_sat_f32_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_trunc_sat_f32_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_trunc_sat_f64_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_trunc_sat_f64_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_memory_init(\n &mut self,\n data_index: u32,\n mem: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_data_drop(\n &mut self,\n data_index: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_memory_copy(\n &mut self,\n dst_mem: u32,\n src_mem: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_memory_fill(\n &mut self,\n mem: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_table_init(\n &mut self,\n elem_index: u32,\n table: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_elem_drop(\n &mut self,\n elem_index: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_table_copy(\n &mut self,\n dst_table: u32,\n src_table: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_table_fill(\n &mut self,\n table: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_table_get(\n &mut self,\n table: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_table_set(\n &mut self,\n table: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_table_grow(\n &mut self,\n table: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_table_size(\n &mut self,\n table: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_memory_discard(\n &mut self,\n mem: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_memory_atomic_notify(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_memory_atomic_wait32(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_memory_atomic_wait64(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_atomic_fence(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_atomic_load(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_load(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_atomic_load8_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_atomic_load16_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_load8_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_load16_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_load32_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_atomic_store(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_store(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_atomic_store8(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_atomic_store16(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_store8(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_store16(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_store32(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_atomic_rmw_add(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_rmw_add(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_atomic_rmw8_add_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_atomic_rmw16_add_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_rmw8_add_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_rmw16_add_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_rmw32_add_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_atomic_rmw_sub(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_rmw_sub(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_atomic_rmw8_sub_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_atomic_rmw16_sub_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_rmw8_sub_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_rmw16_sub_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_rmw32_sub_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_atomic_rmw_and(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_rmw_and(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_atomic_rmw8_and_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_atomic_rmw16_and_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_rmw8_and_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_rmw16_and_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_rmw32_and_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_atomic_rmw_or(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_rmw_or(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_atomic_rmw8_or_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_atomic_rmw16_or_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_rmw8_or_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_rmw16_or_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_rmw32_or_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_atomic_rmw_xor(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_rmw_xor(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_atomic_rmw8_xor_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_atomic_rmw16_xor_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_rmw8_xor_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_rmw16_xor_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_rmw32_xor_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_atomic_rmw_xchg(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_rmw_xchg(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_atomic_rmw8_xchg_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_atomic_rmw16_xchg_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_rmw8_xchg_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_rmw16_xchg_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_rmw32_xchg_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_atomic_rmw_cmpxchg(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_rmw_cmpxchg(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_atomic_rmw8_cmpxchg_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32_atomic_rmw16_cmpxchg_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_rmw8_cmpxchg_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_rmw16_cmpxchg_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64_atomic_rmw32_cmpxchg_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_load(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_load8x8_s(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_load8x8_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_load16x4_s(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_load16x4_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_load32x2_s(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_load32x2_u(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_load8_splat(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_load16_splat(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_load32_splat(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_load64_splat(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_load32_zero(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_load64_zero(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_store(\n &mut self,\n memarg: MemArg\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_load8_lane(\n &mut self,\n memarg: MemArg,\n lane: u8\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_load16_lane(\n &mut self,\n memarg: MemArg,\n lane: u8\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_load32_lane(\n &mut self,\n memarg: MemArg,\n lane: u8\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_load64_lane(\n &mut self,\n memarg: MemArg,\n lane: u8\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_store8_lane(\n &mut self,\n memarg: MemArg,\n lane: u8\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_store16_lane(\n &mut self,\n memarg: MemArg,\n lane: u8\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_store32_lane(\n &mut self,\n memarg: MemArg,\n lane: u8\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_store64_lane(\n &mut self,\n memarg: MemArg,\n lane: u8\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_const(\n &mut self,\n value: V128\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_shuffle(\n &mut self,\n lanes: [u8; 16]\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_extract_lane_s(\n &mut self,\n lane: u8\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_extract_lane_u(\n &mut self,\n lane: u8\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_replace_lane(\n &mut self,\n lane: u8\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_extract_lane_s(\n &mut self,\n lane: u8\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_extract_lane_u(\n &mut self,\n lane: u8\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_replace_lane(\n &mut self,\n lane: u8\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_extract_lane(\n &mut self,\n lane: u8\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_replace_lane(\n &mut self,\n lane: u8\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64x2_extract_lane(\n &mut self,\n lane: u8\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64x2_replace_lane(\n &mut self,\n lane: u8\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_extract_lane(\n &mut self,\n lane: u8\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_replace_lane(\n &mut self,\n lane: u8\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_extract_lane(\n &mut self,\n lane: u8\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_replace_lane(\n &mut self,\n lane: u8\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_swizzle(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_splat(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_splat(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_splat(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64x2_splat(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_splat(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_splat(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_eq(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_ne(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_lt_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_lt_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_gt_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_gt_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_le_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_le_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_ge_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_ge_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_eq(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_ne(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_lt_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_lt_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_gt_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_gt_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_le_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_le_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_ge_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_ge_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_eq(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_ne(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_lt_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_lt_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_gt_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_gt_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_le_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_le_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_ge_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_ge_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64x2_eq(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64x2_ne(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64x2_lt_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64x2_gt_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64x2_le_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64x2_ge_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_eq(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_ne(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_lt(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_gt(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_le(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_ge(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_eq(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_ne(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_lt(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_gt(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_le(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_ge(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_not(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_and(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_andnot(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_or(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_xor(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_bitselect(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_v128_any_true(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_abs(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_neg(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_popcnt(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_all_true(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_bitmask(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_narrow_i16x8_s(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_narrow_i16x8_u(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_shl(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_shr_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_shr_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_add(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_add_sat_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_add_sat_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_sub(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_sub_sat_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_sub_sat_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_min_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_min_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_max_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_max_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_avgr_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_extadd_pairwise_i8x16_s(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_extadd_pairwise_i8x16_u(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_abs(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_neg(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_q15mulr_sat_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_all_true(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_bitmask(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_narrow_i32x4_s(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_narrow_i32x4_u(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_extend_low_i8x16_s(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_extend_high_i8x16_s(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_extend_low_i8x16_u(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_extend_high_i8x16_u(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_shl(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_shr_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_shr_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_add(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_add_sat_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_add_sat_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_sub(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_sub_sat_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_sub_sat_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_mul(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_min_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_min_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_max_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_max_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_avgr_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_extmul_low_i8x16_s(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_extmul_high_i8x16_s(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_extmul_low_i8x16_u(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_extmul_high_i8x16_u(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_extadd_pairwise_i16x8_s(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_extadd_pairwise_i16x8_u(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_abs(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_neg(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_all_true(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_bitmask(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_extend_low_i16x8_s(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_extend_high_i16x8_s(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_extend_low_i16x8_u(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_extend_high_i16x8_u(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_shl(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_shr_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_shr_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_add(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_sub(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_mul(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_min_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_min_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_max_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_max_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_dot_i16x8_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_extmul_low_i16x8_s(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_extmul_high_i16x8_s(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_extmul_low_i16x8_u(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_extmul_high_i16x8_u(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64x2_abs(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64x2_neg(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64x2_all_true(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64x2_bitmask(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64x2_extend_low_i32x4_s(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64x2_extend_high_i32x4_s(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64x2_extend_low_i32x4_u(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64x2_extend_high_i32x4_u(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64x2_shl(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64x2_shr_s(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64x2_shr_u(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64x2_add(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64x2_sub(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64x2_mul(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64x2_extmul_low_i32x4_s(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64x2_extmul_high_i32x4_s(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64x2_extmul_low_i32x4_u(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64x2_extmul_high_i32x4_u(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_ceil(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_floor(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_trunc(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_nearest(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_abs(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_neg(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_sqrt(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_add(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_sub(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_mul(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_div(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_min(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_max(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_pmin(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_pmax(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_ceil(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_floor(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_trunc(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_nearest(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_abs(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_neg(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_sqrt(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_add(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_sub(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_mul(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_div(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_min(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_max(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_pmin(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_pmax(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_trunc_sat_f32x4_s(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_trunc_sat_f32x4_u(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_convert_i32x4_s(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_convert_i32x4_u(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_trunc_sat_f64x2_s_zero(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_trunc_sat_f64x2_u_zero(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_convert_low_i32x4_s(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_convert_low_i32x4_u(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_demote_f64x2_zero(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_promote_low_f32x4(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_relaxed_swizzle(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_relaxed_trunc_f32x4_s(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_relaxed_trunc_f32x4_u(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_relaxed_trunc_f64x2_s_zero(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_relaxed_trunc_f64x2_u_zero(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_relaxed_madd(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_relaxed_nmadd(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_relaxed_madd(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_relaxed_nmadd(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i8x16_relaxed_laneselect(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_relaxed_laneselect(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_relaxed_laneselect(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i64x2_relaxed_laneselect(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_relaxed_min(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f32x4_relaxed_max(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_relaxed_min(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_f64x2_relaxed_max(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_relaxed_q15mulr_s(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i16x8_relaxed_dot_i8x16_i7x16_s(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_i32x4_relaxed_dot_i8x16_i7x16_add_s(\n &mut self\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_call_ref(\n &mut self,\n type_index: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_return_call_ref(\n &mut self,\n type_index: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_ref_as_non_null(&mut self) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_br_on_null(\n &mut self,\n relative_depth: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

§

fn visit_br_on_non_null(\n &mut self,\n relative_depth: u32\n) -> <Box<V> as VisitOperator<'a>>::Output

","VisitOperator<'a>","particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
§

impl<'a, A> Arbitrary<'a> for Box<A>where\n A: Arbitrary<'a>,

§

fn arbitrary(u: &mut Unstructured<'a>) -> Result<Box<A>, Error>

Generate an arbitrary value of Self from the given unstructured data. Read more
§

fn size_hint(depth: usize) -> (usize, Option<usize>)

Get a size hint for how many bytes out of an Unstructured this type\nneeds to construct itself. Read more
§

fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>

Generate an arbitrary value of Self from the entirety of the given\nunstructured data. Read more
","Arbitrary<'a>","particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
§

impl<'a, T> Parse<'a> for Box<T>where\n T: Parse<'a>,

§

fn parse(parser: Parser<'a>) -> Result<Box<T>, Error>

Attempts to parse Self from parser, returning an error if it could\nnot be parsed. Read more
","Parse<'a>","particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
§

impl<T> AsReadWriteFd for Box<T>where\n T: AsReadWriteFd,

§

fn as_read_fd(&self) -> BorrowedFd<'_>

Extracts the file descriptor for reading. Read more
§

fn as_write_fd(&self) -> BorrowedFd<'_>

Extracts the file descriptor for writing. Read more
","AsReadWriteFd","particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
§

impl<T> AsRawReadWriteFd for Box<T>where\n T: AsRawReadWriteFd,

§

fn as_raw_read_fd(&self) -> i32

Extracts the raw file descriptor for reading. Read more
§

fn as_raw_write_fd(&self) -> i32

Extracts the raw file descriptor for writing. Read more
","AsRawReadWriteFd","particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
§

impl<R> ReadReady for Box<R>where\n R: ReadReady,

Implement ReadReady for Box.

\n
§

fn num_ready_bytes(&self) -> Result<u64, Error>

Return the number of bytes which are ready to be read immediately. Read more
","ReadReady","particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
§

impl<B> Peek for Box<B>where\n B: BufRead + ?Sized,

§

fn peek(&mut self, buf: &mut [u8]) -> Result<usize, Error>

Reads data from a stream without consuming it; subsequent reads will\nre-read the data. May return fewer bytes than requested; Ok(0)\nindicates that seeking is not possible (but reading may still be).
","Peek","particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
§

impl<T> GuestMemory for Box<T>where\n T: GuestMemory + ?Sized,

§

fn base(&self) -> &[UnsafeCell<u8>]

Returns the base allocation of this guest memory, located in host\nmemory. Read more
§

fn has_outstanding_borrows(&self) -> bool

Indicates whether any outstanding borrows are known to the\nGuestMemory. This function must be false in order for it to be\nsafe to recursively call into a WebAssembly module, or to manipulate\nthe WebAssembly memory by any other means.
§

fn is_mut_borrowed(&self, r: Region) -> bool

Check if a region of linear memory is exclusively borrowed. This is called during any\nGuestPtr::read or GuestPtr::write operation to ensure that wiggle is not reading or\nwriting a region of memory which Rust believes it has exclusive access to.
§

fn is_shared_borrowed(&self, r: Region) -> bool

Check if a region of linear memory has any shared borrows.
§

fn mut_borrow(&self, r: Region) -> Result<BorrowHandle, GuestError>

Exclusively borrow a region of linear memory. This is used when constructing a\nGuestSliceMut or GuestStrMut. Those types will give Rust &mut access\nto the region of linear memory, therefore, the GuestMemory impl must\nguarantee that at most one BorrowHandle is issued to a given region,\nGuestMemory::has_outstanding_borrows is true for the duration of the\nborrow, and that GuestMemory::is_mut_borrowed of any overlapping region\nis false for the duration of the borrow.
§

fn shared_borrow(&self, r: Region) -> Result<BorrowHandle, GuestError>

Shared borrow a region of linear memory. This is used when constructing a\nGuestSlice or GuestStr. Those types will give Rust & (shared reference) access\nto the region of linear memory.
§

fn mut_unborrow(&self, h: BorrowHandle)

Unborrow a previously borrowed mutable region. As long as GuestSliceMut and\nGuestStrMut are implemented correctly, a mut BorrowHandle should only be\nunborrowed once.
§

fn shared_unborrow(&self, h: BorrowHandle)

Unborrow a previously borrowed shared region. As long as GuestSlice and\nGuestStr are implemented correctly, a shared BorrowHandle should only be\nunborrowed once.
§

fn ptr<T, 'a>(&'a self, offset: <T as Pointee>::Pointer) -> GuestPtr<'a, T>where\n Self: Sized,\n T: Pointee + ?Sized,

Convenience method for creating a GuestPtr at a particular offset. Read more
§

fn is_shared_memory(&self) -> bool

Check if the underlying memory is shared across multiple threads; e.g.,\nwith a WebAssembly shared memory.
","GuestMemory","particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
§

impl<T> EncodeLabelValue for Box<T>where\n &'a T: for<'a> EncodeLabelValue,

§

fn encode(&self, encoder: &mut LabelValueEncoder<'_>) -> Result<(), Error>

Encode oneself into the given encoder.
","EncodeLabelValue","particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
§

impl<T> EncodeLabelKey for Box<T>where\n &'a T: for<'a> EncodeLabelKey,

§

fn encode(&self, encoder: &mut LabelKeyEncoder<'_>) -> Result<(), Error>

Encode oneself into the given encoder.
","EncodeLabelKey","particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"],["
§

impl<E> Extension for Box<E>where\n E: Extension + ?Sized,

§

fn is_enabled(&self) -> bool

Is this extension enabled?
§

fn name(&self) -> &str

The name of this extension.
§

fn params(&self) -> &[Param<'_>]

The parameters this extension wants to send for negotiation.
§

fn configure(\n &mut self,\n params: &[Param<'_>]\n) -> Result<(), Box<dyn Error + Sync + Send>>

Configure this extension with the parameters received from negotiation.
§

fn encode(\n &mut self,\n header: &mut Header,\n data: &mut Storage<'_>\n) -> Result<(), Box<dyn Error + Sync + Send>>

Encode a frame, given as frame header and payload data.
§

fn decode(\n &mut self,\n header: &mut Header,\n data: &mut Vec<u8>\n) -> Result<(), Box<dyn Error + Sync + Send>>

Decode a frame. Read more
§

fn reserved_bits(&self) -> (bool, bool, bool)

The reserved bits this extension uses.
","Extension","particle_execution::particle_function::ServiceFunctionMut","particle_execution::particle_function::ServiceFunctionImmut"]] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/type.impl/alloc/string/struct.String.js b/type.impl/alloc/string/struct.String.js new file mode 100644 index 0000000000..fabefb50ac --- /dev/null +++ b/type.impl/alloc/string/struct.String.js @@ -0,0 +1,3 @@ +(function() {var type_impls = { +"spell_event_bus":[["
source§

impl String

1.0.0 (const: 1.39.0) · source

pub const fn new() -> String

Creates a new empty String.

\n

Given that the String is empty, this will not allocate any initial\nbuffer. While that means that this initial operation is very\ninexpensive, it may cause excessive allocation later when you add\ndata. If you have an idea of how much data the String will hold,\nconsider the with_capacity method to prevent excessive\nre-allocation.

\n
Examples
\n
let s = String::new();
\n
1.0.0 · source

pub fn with_capacity(capacity: usize) -> String

Creates a new empty String with at least the specified capacity.

\n

Strings have an internal buffer to hold their data. The capacity is\nthe length of that buffer, and can be queried with the capacity\nmethod. This method creates an empty String, but one with an initial\nbuffer that can hold at least capacity bytes. This is useful when you\nmay be appending a bunch of data to the String, reducing the number of\nreallocations it needs to do.

\n

If the given capacity is 0, no allocation will occur, and this method\nis identical to the new method.

\n
Examples
\n
let mut s = String::with_capacity(10);\n\n// The String contains no chars, even though it has capacity for more\nassert_eq!(s.len(), 0);\n\n// These are all done without reallocating...\nlet cap = s.capacity();\nfor _ in 0..10 {\n    s.push('a');\n}\n\nassert_eq!(s.capacity(), cap);\n\n// ...but this may make the string reallocate\ns.push('a');
\n
1.0.0 · source

pub fn from_utf8(vec: Vec<u8>) -> Result<String, FromUtf8Error>

Converts a vector of bytes to a String.

\n

A string (String) is made of bytes (u8), and a vector of bytes\n(Vec<u8>) is made of bytes, so this function converts between the\ntwo. Not all byte slices are valid Strings, however: String\nrequires that it is valid UTF-8. from_utf8() checks to ensure that\nthe bytes are valid UTF-8, and then does the conversion.

\n

If you are sure that the byte slice is valid UTF-8, and you don’t want\nto incur the overhead of the validity check, there is an unsafe version\nof this function, from_utf8_unchecked, which has the same behavior\nbut skips the check.

\n

This method will take care to not copy the vector, for efficiency’s\nsake.

\n

If you need a &str instead of a String, consider\nstr::from_utf8.

\n

The inverse of this method is into_bytes.

\n
Errors
\n

Returns Err if the slice is not UTF-8 with a description as to why the\nprovided bytes are not UTF-8. The vector you moved in is also included.

\n
Examples
\n

Basic usage:

\n\n
// some bytes, in a vector\nlet sparkle_heart = vec![240, 159, 146, 150];\n\n// We know these bytes are valid, so we'll use `unwrap()`.\nlet sparkle_heart = String::from_utf8(sparkle_heart).unwrap();\n\nassert_eq!("💖", sparkle_heart);
\n

Incorrect bytes:

\n\n
// some invalid bytes, in a vector\nlet sparkle_heart = vec![0, 159, 146, 150];\n\nassert!(String::from_utf8(sparkle_heart).is_err());
\n

See the docs for FromUtf8Error for more details on what you can do\nwith this error.

\n
1.0.0 · source

pub fn from_utf8_lossy(v: &[u8]) -> Cow<'_, str>

Converts a slice of bytes to a string, including invalid characters.

\n

Strings are made of bytes (u8), and a slice of bytes\n(&[u8]) is made of bytes, so this function converts\nbetween the two. Not all byte slices are valid strings, however: strings\nare required to be valid UTF-8. During this conversion,\nfrom_utf8_lossy() will replace any invalid UTF-8 sequences with\nU+FFFD REPLACEMENT CHARACTER, which looks like this: �

\n

If you are sure that the byte slice is valid UTF-8, and you don’t want\nto incur the overhead of the conversion, there is an unsafe version\nof this function, from_utf8_unchecked, which has the same behavior\nbut skips the checks.

\n

This function returns a Cow<'a, str>. If our byte slice is invalid\nUTF-8, then we need to insert the replacement characters, which will\nchange the size of the string, and hence, require a String. But if\nit’s already valid UTF-8, we don’t need a new allocation. This return\ntype allows us to handle both cases.

\n
Examples
\n

Basic usage:

\n\n
// some bytes, in a vector\nlet sparkle_heart = vec![240, 159, 146, 150];\n\nlet sparkle_heart = String::from_utf8_lossy(&sparkle_heart);\n\nassert_eq!("💖", sparkle_heart);
\n

Incorrect bytes:

\n\n
// some invalid bytes\nlet input = b"Hello \\xF0\\x90\\x80World";\nlet output = String::from_utf8_lossy(input);\n\nassert_eq!("Hello �World", output);
\n
1.0.0 · source

pub fn from_utf16(v: &[u16]) -> Result<String, FromUtf16Error>

Decode a UTF-16–encoded vector v into a String, returning Err\nif v contains any invalid data.

\n
Examples
\n
// 𝄞music\nlet v = &[0xD834, 0xDD1E, 0x006d, 0x0075,\n          0x0073, 0x0069, 0x0063];\nassert_eq!(String::from("𝄞music"),\n           String::from_utf16(v).unwrap());\n\n// 𝄞mu<invalid>ic\nlet v = &[0xD834, 0xDD1E, 0x006d, 0x0075,\n          0xD800, 0x0069, 0x0063];\nassert!(String::from_utf16(v).is_err());
\n
1.0.0 · source

pub fn from_utf16_lossy(v: &[u16]) -> String

Decode a UTF-16–encoded slice v into a String, replacing\ninvalid data with the replacement character (U+FFFD).

\n

Unlike from_utf8_lossy which returns a Cow<'a, str>,\nfrom_utf16_lossy returns a String since the UTF-16 to UTF-8\nconversion requires a memory allocation.

\n
Examples
\n
// 𝄞mus<invalid>ic<invalid>\nlet v = &[0xD834, 0xDD1E, 0x006d, 0x0075,\n          0x0073, 0xDD1E, 0x0069, 0x0063,\n          0xD834];\n\nassert_eq!(String::from("𝄞mus\\u{FFFD}ic\\u{FFFD}"),\n           String::from_utf16_lossy(v));
\n
source

pub fn from_utf16le(v: &[u8]) -> Result<String, FromUtf16Error>

🔬This is a nightly-only experimental API. (str_from_utf16_endian)

Decode a UTF-16LE–encoded vector v into a String, returning Err\nif v contains any invalid data.

\n
Examples
\n

Basic usage:

\n\n
#![feature(str_from_utf16_endian)]\n// 𝄞music\nlet v = &[0x34, 0xD8, 0x1E, 0xDD, 0x6d, 0x00, 0x75, 0x00,\n          0x73, 0x00, 0x69, 0x00, 0x63, 0x00];\nassert_eq!(String::from("𝄞music"),\n           String::from_utf16le(v).unwrap());\n\n// 𝄞mu<invalid>ic\nlet v = &[0x34, 0xD8, 0x1E, 0xDD, 0x6d, 0x00, 0x75, 0x00,\n          0x00, 0xD8, 0x69, 0x00, 0x63, 0x00];\nassert!(String::from_utf16le(v).is_err());
\n
source

pub fn from_utf16le_lossy(v: &[u8]) -> String

🔬This is a nightly-only experimental API. (str_from_utf16_endian)

Decode a UTF-16LE–encoded slice v into a String, replacing\ninvalid data with the replacement character (U+FFFD).

\n

Unlike from_utf8_lossy which returns a Cow<'a, str>,\nfrom_utf16le_lossy returns a String since the UTF-16 to UTF-8\nconversion requires a memory allocation.

\n
Examples
\n

Basic usage:

\n\n
#![feature(str_from_utf16_endian)]\n// 𝄞mus<invalid>ic<invalid>\nlet v = &[0x34, 0xD8, 0x1E, 0xDD, 0x6d, 0x00, 0x75, 0x00,\n          0x73, 0x00, 0x1E, 0xDD, 0x69, 0x00, 0x63, 0x00,\n          0x34, 0xD8];\n\nassert_eq!(String::from("𝄞mus\\u{FFFD}ic\\u{FFFD}"),\n           String::from_utf16le_lossy(v));
\n
source

pub fn from_utf16be(v: &[u8]) -> Result<String, FromUtf16Error>

🔬This is a nightly-only experimental API. (str_from_utf16_endian)

Decode a UTF-16BE–encoded vector v into a String, returning Err\nif v contains any invalid data.

\n
Examples
\n

Basic usage:

\n\n
#![feature(str_from_utf16_endian)]\n// 𝄞music\nlet v = &[0xD8, 0x34, 0xDD, 0x1E, 0x00, 0x6d, 0x00, 0x75,\n          0x00, 0x73, 0x00, 0x69, 0x00, 0x63];\nassert_eq!(String::from("𝄞music"),\n           String::from_utf16be(v).unwrap());\n\n// 𝄞mu<invalid>ic\nlet v = &[0xD8, 0x34, 0xDD, 0x1E, 0x00, 0x6d, 0x00, 0x75,\n          0xD8, 0x00, 0x00, 0x69, 0x00, 0x63];\nassert!(String::from_utf16be(v).is_err());
\n
source

pub fn from_utf16be_lossy(v: &[u8]) -> String

🔬This is a nightly-only experimental API. (str_from_utf16_endian)

Decode a UTF-16BE–encoded slice v into a String, replacing\ninvalid data with the replacement character (U+FFFD).

\n

Unlike from_utf8_lossy which returns a Cow<'a, str>,\nfrom_utf16le_lossy returns a String since the UTF-16 to UTF-8\nconversion requires a memory allocation.

\n
Examples
\n

Basic usage:

\n\n
#![feature(str_from_utf16_endian)]\n// 𝄞mus<invalid>ic<invalid>\nlet v = &[0xD8, 0x34, 0xDD, 0x1E, 0x00, 0x6d, 0x00, 0x75,\n          0x00, 0x73, 0xDD, 0x1E, 0x00, 0x69, 0x00, 0x63,\n          0xD8, 0x34];\n\nassert_eq!(String::from("𝄞mus\\u{FFFD}ic\\u{FFFD}"),\n           String::from_utf16be_lossy(v));
\n
source

pub fn into_raw_parts(self) -> (*mut u8, usize, usize)

🔬This is a nightly-only experimental API. (vec_into_raw_parts)

Decomposes a String into its raw components.

\n

Returns the raw pointer to the underlying data, the length of\nthe string (in bytes), and the allocated capacity of the data\n(in bytes). These are the same arguments in the same order as\nthe arguments to from_raw_parts.

\n

After calling this function, the caller is responsible for the\nmemory previously managed by the String. The only way to do\nthis is to convert the raw pointer, length, and capacity back\ninto a String with the from_raw_parts function, allowing\nthe destructor to perform the cleanup.

\n
Examples
\n
#![feature(vec_into_raw_parts)]\nlet s = String::from("hello");\n\nlet (ptr, len, cap) = s.into_raw_parts();\n\nlet rebuilt = unsafe { String::from_raw_parts(ptr, len, cap) };\nassert_eq!(rebuilt, "hello");
\n
1.0.0 · source

pub unsafe fn from_raw_parts(\n buf: *mut u8,\n length: usize,\n capacity: usize\n) -> String

Creates a new String from a length, capacity, and pointer.

\n
Safety
\n

This is highly unsafe, due to the number of invariants that aren’t\nchecked:

\n
    \n
  • The memory at buf needs to have been previously allocated by the\nsame allocator the standard library uses, with a required alignment of exactly 1.
  • \n
  • length needs to be less than or equal to capacity.
  • \n
  • capacity needs to be the correct value.
  • \n
  • The first length bytes at buf need to be valid UTF-8.
  • \n
\n

Violating these may cause problems like corrupting the allocator’s\ninternal data structures. For example, it is normally not safe to\nbuild a String from a pointer to a C char array containing UTF-8\nunless you are certain that array was originally allocated by the\nRust standard library’s allocator.

\n

The ownership of buf is effectively transferred to the\nString which may then deallocate, reallocate or change the\ncontents of memory pointed to by the pointer at will. Ensure\nthat nothing else uses the pointer after calling this\nfunction.

\n
Examples
\n
use std::mem;\n\nunsafe {\n    let s = String::from("hello");\n\n    // Prevent automatically dropping the String's data\n    let mut s = mem::ManuallyDrop::new(s);\n\n    let ptr = s.as_mut_ptr();\n    let len = s.len();\n    let capacity = s.capacity();\n\n    let s = String::from_raw_parts(ptr, len, capacity);\n\n    assert_eq!(String::from("hello"), s);\n}
\n
1.0.0 · source

pub unsafe fn from_utf8_unchecked(bytes: Vec<u8>) -> String

Converts a vector of bytes to a String without checking that the\nstring contains valid UTF-8.

\n

See the safe version, from_utf8, for more details.

\n
Safety
\n

This function is unsafe because it does not check that the bytes passed\nto it are valid UTF-8. If this constraint is violated, it may cause\nmemory unsafety issues with future users of the String, as the rest of\nthe standard library assumes that Strings are valid UTF-8.

\n
Examples
\n
// some bytes, in a vector\nlet sparkle_heart = vec![240, 159, 146, 150];\n\nlet sparkle_heart = unsafe {\n    String::from_utf8_unchecked(sparkle_heart)\n};\n\nassert_eq!("💖", sparkle_heart);
\n
1.0.0 · source

pub fn into_bytes(self) -> Vec<u8>

Converts a String into a byte vector.

\n

This consumes the String, so we do not need to copy its contents.

\n
Examples
\n
let s = String::from("hello");\nlet bytes = s.into_bytes();\n\nassert_eq!(&[104, 101, 108, 108, 111][..], &bytes[..]);
\n
1.7.0 · source

pub fn as_str(&self) -> &str

Extracts a string slice containing the entire String.

\n
Examples
\n
let s = String::from("foo");\n\nassert_eq!("foo", s.as_str());
\n
1.7.0 · source

pub fn as_mut_str(&mut self) -> &mut str

Converts a String into a mutable string slice.

\n
Examples
\n
let mut s = String::from("foobar");\nlet s_mut_str = s.as_mut_str();\n\ns_mut_str.make_ascii_uppercase();\n\nassert_eq!("FOOBAR", s_mut_str);
\n
1.0.0 · source

pub fn push_str(&mut self, string: &str)

Appends a given string slice onto the end of this String.

\n
Examples
\n
let mut s = String::from("foo");\n\ns.push_str("bar");\n\nassert_eq!("foobar", s);
\n
source

pub fn extend_from_within<R>(&mut self, src: R)where\n R: RangeBounds<usize>,

🔬This is a nightly-only experimental API. (string_extend_from_within)

Copies elements from src range to the end of the string.

\n
Panics
\n

Panics if the starting point or end point do not lie on a char\nboundary, or if they’re out of bounds.

\n
Examples
\n
#![feature(string_extend_from_within)]\nlet mut string = String::from("abcde");\n\nstring.extend_from_within(2..);\nassert_eq!(string, "abcdecde");\n\nstring.extend_from_within(..2);\nassert_eq!(string, "abcdecdeab");\n\nstring.extend_from_within(4..8);\nassert_eq!(string, "abcdecdeabecde");
\n
1.0.0 · source

pub fn capacity(&self) -> usize

Returns this String’s capacity, in bytes.

\n
Examples
\n
let s = String::with_capacity(10);\n\nassert!(s.capacity() >= 10);
\n
1.0.0 · source

pub fn reserve(&mut self, additional: usize)

Reserves capacity for at least additional bytes more than the\ncurrent length. The allocator may reserve more space to speculatively\navoid frequent allocations. After calling reserve,\ncapacity will be greater than or equal to self.len() + additional.\nDoes nothing if capacity is already sufficient.

\n
Panics
\n

Panics if the new capacity overflows usize.

\n
Examples
\n

Basic usage:

\n\n
let mut s = String::new();\n\ns.reserve(10);\n\nassert!(s.capacity() >= 10);
\n

This might not actually increase the capacity:

\n\n
let mut s = String::with_capacity(10);\ns.push('a');\ns.push('b');\n\n// s now has a length of 2 and a capacity of at least 10\nlet capacity = s.capacity();\nassert_eq!(2, s.len());\nassert!(capacity >= 10);\n\n// Since we already have at least an extra 8 capacity, calling this...\ns.reserve(8);\n\n// ... doesn't actually increase.\nassert_eq!(capacity, s.capacity());
\n
1.0.0 · source

pub fn reserve_exact(&mut self, additional: usize)

Reserves the minimum capacity for at least additional bytes more than\nthe current length. Unlike reserve, this will not\ndeliberately over-allocate to speculatively avoid frequent allocations.\nAfter calling reserve_exact, capacity will be greater than or equal to\nself.len() + additional. Does nothing if the capacity is already\nsufficient.

\n
Panics
\n

Panics if the new capacity overflows usize.

\n
Examples
\n

Basic usage:

\n\n
let mut s = String::new();\n\ns.reserve_exact(10);\n\nassert!(s.capacity() >= 10);
\n

This might not actually increase the capacity:

\n\n
let mut s = String::with_capacity(10);\ns.push('a');\ns.push('b');\n\n// s now has a length of 2 and a capacity of at least 10\nlet capacity = s.capacity();\nassert_eq!(2, s.len());\nassert!(capacity >= 10);\n\n// Since we already have at least an extra 8 capacity, calling this...\ns.reserve_exact(8);\n\n// ... doesn't actually increase.\nassert_eq!(capacity, s.capacity());
\n
1.57.0 · source

pub fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError>

Tries to reserve capacity for at least additional bytes more than the\ncurrent length. The allocator may reserve more space to speculatively\navoid frequent allocations. After calling try_reserve, capacity will be\ngreater than or equal to self.len() + additional if it returns\nOk(()). Does nothing if capacity is already sufficient. This method\npreserves the contents even if an error occurs.

\n
Errors
\n

If the capacity overflows, or the allocator reports a failure, then an error\nis returned.

\n
Examples
\n
use std::collections::TryReserveError;\n\nfn process_data(data: &str) -> Result<String, TryReserveError> {\n    let mut output = String::new();\n\n    // Pre-reserve the memory, exiting if we can't\n    output.try_reserve(data.len())?;\n\n    // Now we know this can't OOM in the middle of our complex work\n    output.push_str(data);\n\n    Ok(output)\n}
\n
1.57.0 · source

pub fn try_reserve_exact(\n &mut self,\n additional: usize\n) -> Result<(), TryReserveError>

Tries to reserve the minimum capacity for at least additional bytes\nmore than the current length. Unlike try_reserve, this will not\ndeliberately over-allocate to speculatively avoid frequent allocations.\nAfter calling try_reserve_exact, capacity will be greater than or\nequal to self.len() + additional if it returns Ok(()).\nDoes nothing if the capacity is already sufficient.

\n

Note that the allocator may give the collection more space than it\nrequests. Therefore, capacity can not be relied upon to be precisely\nminimal. Prefer try_reserve if future insertions are expected.

\n
Errors
\n

If the capacity overflows, or the allocator reports a failure, then an error\nis returned.

\n
Examples
\n
use std::collections::TryReserveError;\n\nfn process_data(data: &str) -> Result<String, TryReserveError> {\n    let mut output = String::new();\n\n    // Pre-reserve the memory, exiting if we can't\n    output.try_reserve_exact(data.len())?;\n\n    // Now we know this can't OOM in the middle of our complex work\n    output.push_str(data);\n\n    Ok(output)\n}
\n
1.0.0 · source

pub fn shrink_to_fit(&mut self)

Shrinks the capacity of this String to match its length.

\n
Examples
\n
let mut s = String::from("foo");\n\ns.reserve(100);\nassert!(s.capacity() >= 100);\n\ns.shrink_to_fit();\nassert_eq!(3, s.capacity());
\n
1.56.0 · source

pub fn shrink_to(&mut self, min_capacity: usize)

Shrinks the capacity of this String with a lower bound.

\n

The capacity will remain at least as large as both the length\nand the supplied value.

\n

If the current capacity is less than the lower limit, this is a no-op.

\n
Examples
\n
let mut s = String::from("foo");\n\ns.reserve(100);\nassert!(s.capacity() >= 100);\n\ns.shrink_to(10);\nassert!(s.capacity() >= 10);\ns.shrink_to(0);\nassert!(s.capacity() >= 3);
\n
1.0.0 · source

pub fn push(&mut self, ch: char)

Appends the given char to the end of this String.

\n
Examples
\n
let mut s = String::from("abc");\n\ns.push('1');\ns.push('2');\ns.push('3');\n\nassert_eq!("abc123", s);
\n
1.0.0 · source

pub fn as_bytes(&self) -> &[u8]

Returns a byte slice of this String’s contents.

\n

The inverse of this method is from_utf8.

\n
Examples
\n
let s = String::from("hello");\n\nassert_eq!(&[104, 101, 108, 108, 111], s.as_bytes());
\n
1.0.0 · source

pub fn truncate(&mut self, new_len: usize)

Shortens this String to the specified length.

\n

If new_len is greater than the string’s current length, this has no\neffect.

\n

Note that this method has no effect on the allocated capacity\nof the string

\n
Panics
\n

Panics if new_len does not lie on a char boundary.

\n
Examples
\n
let mut s = String::from("hello");\n\ns.truncate(2);\n\nassert_eq!("he", s);
\n
1.0.0 · source

pub fn pop(&mut self) -> Option<char>

Removes the last character from the string buffer and returns it.

\n

Returns None if this String is empty.

\n
Examples
\n
let mut s = String::from("abč");\n\nassert_eq!(s.pop(), Some('č'));\nassert_eq!(s.pop(), Some('b'));\nassert_eq!(s.pop(), Some('a'));\n\nassert_eq!(s.pop(), None);
\n
1.0.0 · source

pub fn remove(&mut self, idx: usize) -> char

Removes a char from this String at a byte position and returns it.

\n

This is an O(n) operation, as it requires copying every element in the\nbuffer.

\n
Panics
\n

Panics if idx is larger than or equal to the String’s length,\nor if it does not lie on a char boundary.

\n
Examples
\n
let mut s = String::from("abç");\n\nassert_eq!(s.remove(0), 'a');\nassert_eq!(s.remove(1), 'ç');\nassert_eq!(s.remove(0), 'b');
\n
source

pub fn remove_matches<P, 'a>(&'a mut self, pat: P)where\n P: for<'x> Pattern<'x>,

🔬This is a nightly-only experimental API. (string_remove_matches)

Remove all matches of pattern pat in the String.

\n
Examples
\n
#![feature(string_remove_matches)]\nlet mut s = String::from("Trees are not green, the sky is not blue.");\ns.remove_matches("not ");\nassert_eq!("Trees are green, the sky is blue.", s);
\n

Matches will be detected and removed iteratively, so in cases where\npatterns overlap, only the first pattern will be removed:

\n\n
#![feature(string_remove_matches)]\nlet mut s = String::from("banana");\ns.remove_matches("ana");\nassert_eq!("bna", s);
\n
1.26.0 · source

pub fn retain<F>(&mut self, f: F)where\n F: FnMut(char) -> bool,

Retains only the characters specified by the predicate.

\n

In other words, remove all characters c such that f(c) returns false.\nThis method operates in place, visiting each character exactly once in the\noriginal order, and preserves the order of the retained characters.

\n
Examples
\n
let mut s = String::from("f_o_ob_ar");\n\ns.retain(|c| c != '_');\n\nassert_eq!(s, "foobar");
\n

Because the elements are visited exactly once in the original order,\nexternal state may be used to decide which elements to keep.

\n\n
let mut s = String::from("abcde");\nlet keep = [false, true, true, false, true];\nlet mut iter = keep.iter();\ns.retain(|_| *iter.next().unwrap());\nassert_eq!(s, "bce");
\n
1.0.0 · source

pub fn insert(&mut self, idx: usize, ch: char)

Inserts a character into this String at a byte position.

\n

This is an O(n) operation as it requires copying every element in the\nbuffer.

\n
Panics
\n

Panics if idx is larger than the String’s length, or if it does not\nlie on a char boundary.

\n
Examples
\n
let mut s = String::with_capacity(3);\n\ns.insert(0, 'f');\ns.insert(1, 'o');\ns.insert(2, 'o');\n\nassert_eq!("foo", s);
\n
1.16.0 · source

pub fn insert_str(&mut self, idx: usize, string: &str)

Inserts a string slice into this String at a byte position.

\n

This is an O(n) operation as it requires copying every element in the\nbuffer.

\n
Panics
\n

Panics if idx is larger than the String’s length, or if it does not\nlie on a char boundary.

\n
Examples
\n
let mut s = String::from("bar");\n\ns.insert_str(0, "foo");\n\nassert_eq!("foobar", s);
\n
1.0.0 · source

pub unsafe fn as_mut_vec(&mut self) -> &mut Vec<u8>

Returns a mutable reference to the contents of this String.

\n
Safety
\n

This function is unsafe because the returned &mut Vec allows writing\nbytes which are not valid UTF-8. If this constraint is violated, using\nthe original String after dropping the &mut Vec may violate memory\nsafety, as the rest of the standard library assumes that Strings are\nvalid UTF-8.

\n
Examples
\n
let mut s = String::from("hello");\n\nunsafe {\n    let vec = s.as_mut_vec();\n    assert_eq!(&[104, 101, 108, 108, 111][..], &vec[..]);\n\n    vec.reverse();\n}\nassert_eq!(s, "olleh");
\n
1.0.0 · source

pub fn len(&self) -> usize

Returns the length of this String, in bytes, not chars or\ngraphemes. In other words, it might not be what a human considers the\nlength of the string.

\n
Examples
\n
let a = String::from("foo");\nassert_eq!(a.len(), 3);\n\nlet fancy_f = String::from("ƒoo");\nassert_eq!(fancy_f.len(), 4);\nassert_eq!(fancy_f.chars().count(), 3);
\n
1.0.0 · source

pub fn is_empty(&self) -> bool

Returns true if this String has a length of zero, and false otherwise.

\n
Examples
\n
let mut v = String::new();\nassert!(v.is_empty());\n\nv.push('a');\nassert!(!v.is_empty());
\n
1.16.0 · source

pub fn split_off(&mut self, at: usize) -> String

Splits the string into two at the given byte index.

\n

Returns a newly allocated String. self contains bytes [0, at), and\nthe returned String contains bytes [at, len). at must be on the\nboundary of a UTF-8 code point.

\n

Note that the capacity of self does not change.

\n
Panics
\n

Panics if at is not on a UTF-8 code point boundary, or if it is beyond the last\ncode point of the string.

\n
Examples
\n
let mut hello = String::from("Hello, World!");\nlet world = hello.split_off(7);\nassert_eq!(hello, "Hello, ");\nassert_eq!(world, "World!");
\n
1.0.0 · source

pub fn clear(&mut self)

Truncates this String, removing all contents.

\n

While this means the String will have a length of zero, it does not\ntouch its capacity.

\n
Examples
\n
let mut s = String::from("foo");\n\ns.clear();\n\nassert!(s.is_empty());\nassert_eq!(0, s.len());\nassert_eq!(3, s.capacity());
\n
1.6.0 · source

pub fn drain<R>(&mut self, range: R) -> Drain<'_>where\n R: RangeBounds<usize>,

Removes the specified range from the string in bulk, returning all\nremoved characters as an iterator.

\n

The returned iterator keeps a mutable borrow on the string to optimize\nits implementation.

\n
Panics
\n

Panics if the starting point or end point do not lie on a char\nboundary, or if they’re out of bounds.

\n
Leaking
\n

If the returned iterator goes out of scope without being dropped (due to\ncore::mem::forget, for example), the string may still contain a copy\nof any drained characters, or may have lost characters arbitrarily,\nincluding characters outside the range.

\n
Examples
\n
let mut s = String::from("α is alpha, β is beta");\nlet beta_offset = s.find('β').unwrap_or(s.len());\n\n// Remove the range up until the β from the string\nlet t: String = s.drain(..beta_offset).collect();\nassert_eq!(t, "α is alpha, ");\nassert_eq!(s, "β is beta");\n\n// A full range clears the string, like `clear()` does\ns.drain(..);\nassert_eq!(s, "");
\n
1.27.0 · source

pub fn replace_range<R>(&mut self, range: R, replace_with: &str)where\n R: RangeBounds<usize>,

Removes the specified range in the string,\nand replaces it with the given string.\nThe given string doesn’t need to be the same length as the range.

\n
Panics
\n

Panics if the starting point or end point do not lie on a char\nboundary, or if they’re out of bounds.

\n
Examples
\n
let mut s = String::from("α is alpha, β is beta");\nlet beta_offset = s.find('β').unwrap_or(s.len());\n\n// Replace the range up until the β from the string\ns.replace_range(..beta_offset, "Α is capital alpha; ");\nassert_eq!(s, "Α is capital alpha; β is beta");
\n
1.4.0 · source

pub fn into_boxed_str(self) -> Box<str>

Converts this String into a Box<str>.

\n

This will drop any excess capacity.

\n
Examples
\n
let s = String::from("hello");\n\nlet b = s.into_boxed_str();
\n
1.72.0 · source

pub fn leak<'a>(self) -> &'a mut str

Consumes and leaks the String, returning a mutable reference to the contents,\n&'a mut str.

\n

The caller has free choice over the returned lifetime, including 'static. Indeed,\nthis function is ideally used for data that lives for the remainder of the program’s life,\nas dropping the returned reference will cause a memory leak.

\n

It does not reallocate or shrink the String,\nso the leaked allocation may include unused capacity that is not part\nof the returned slice. If you don’t want that, call into_boxed_str,\nand then Box::leak.

\n
Examples
\n
let x = String::from("bucket");\nlet static_ref: &'static mut str = x.leak();\nassert_eq!(static_ref, "bucket");
\n
",0,"spell_event_bus::api::SpellId"],["
1.16.0 · source§

impl ToSocketAddrs for String

§

type Iter = IntoIter<SocketAddr>

Returned iterator over socket addresses which this type may correspond\nto.
source§

fn to_socket_addrs(&self) -> Result<IntoIter<SocketAddr>, Error>

Converts this object to an iterator of resolved SocketAddrs. Read more
","ToSocketAddrs","spell_event_bus::api::SpellId"],["
1.0.0 · source§

impl AsRef<OsStr> for String

source§

fn as_ref(&self) -> &OsStr

Converts this type into a shared reference of the (usually inferred) input type.
","AsRef","spell_event_bus::api::SpellId"],["
1.0.0 · source§

impl AsRef<Path> for String

source§

fn as_ref(&self) -> &Path

Converts this type into a shared reference of the (usually inferred) input type.
","AsRef","spell_event_bus::api::SpellId"],["
1.0.0 · source§

impl StructuralEq for String

","StructuralEq","spell_event_bus::api::SpellId"],["
1.0.0 · source§

impl Add<&str> for String

Implements the + operator for concatenating two strings.

\n

This consumes the String on the left-hand side and re-uses its buffer (growing it if\nnecessary). This is done to avoid allocating a new String and copying the entire contents on\nevery operation, which would lead to O(n^2) running time when building an n-byte string by\nrepeated concatenation.

\n

The string on the right-hand side is only borrowed; its contents are copied into the returned\nString.

\n

Examples

\n

Concatenating two Strings takes the first by value and borrows the second:

\n\n
let a = String::from("hello");\nlet b = String::from(" world");\nlet c = a + &b;\n// `a` is moved and can no longer be used here.
\n

If you want to keep using the first String, you can clone it and append to the clone instead:

\n\n
let a = String::from("hello");\nlet b = String::from(" world");\nlet c = a.clone() + &b;\n// `a` is still valid here.
\n

Concatenating &str slices can be done by converting the first to a String:

\n\n
let a = "hello";\nlet b = " world";\nlet c = a.to_string() + b;
\n
§

type Output = String

The resulting type after applying the + operator.
source§

fn add(self, other: &str) -> String

Performs the + operation. Read more
","Add<&str>","spell_event_bus::api::SpellId"],["
1.0.0 · source§

impl Index<RangeFull> for String

§

type Output = str

The returned type after indexing.
source§

fn index(&self, _index: RangeFull) -> &str

Performs the indexing (container[index]) operation. Read more
","Index","spell_event_bus::api::SpellId"],["
1.0.0 · source§

impl Index<RangeFrom<usize>> for String

§

type Output = str

The returned type after indexing.
source§

fn index(&self, index: RangeFrom<usize>) -> &str

Performs the indexing (container[index]) operation. Read more
","Index>","spell_event_bus::api::SpellId"],["
1.0.0 · source§

impl Index<Range<usize>> for String

§

type Output = str

The returned type after indexing.
source§

fn index(&self, index: Range<usize>) -> &str

Performs the indexing (container[index]) operation. Read more
","Index>","spell_event_bus::api::SpellId"],["
1.0.0 · source§

impl Index<RangeTo<usize>> for String

§

type Output = str

The returned type after indexing.
source§

fn index(&self, index: RangeTo<usize>) -> &str

Performs the indexing (container[index]) operation. Read more
","Index>","spell_event_bus::api::SpellId"],["
1.26.0 · source§

impl Index<RangeInclusive<usize>> for String

§

type Output = str

The returned type after indexing.
source§

fn index(&self, index: RangeInclusive<usize>) -> &str

Performs the indexing (container[index]) operation. Read more
","Index>","spell_event_bus::api::SpellId"],["
1.26.0 · source§

impl Index<RangeToInclusive<usize>> for String

§

type Output = str

The returned type after indexing.
source§

fn index(&self, index: RangeToInclusive<usize>) -> &str

Performs the indexing (container[index]) operation. Read more
","Index>","spell_event_bus::api::SpellId"],["
1.0.0 · source§

impl Deref for String

§

type Target = str

The resulting type after dereferencing.
source§

fn deref(&self) -> &str

Dereferences the value.
","Deref","spell_event_bus::api::SpellId"],["
1.2.0 · source§

impl<'a> Extend<&'a char> for String

source§

fn extend<I>(&mut self, iter: I)where\n I: IntoIterator<Item = &'a char>,

Extends a collection with the contents of an iterator. Read more
source§

fn extend_one(&mut self, _: &'a char)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
","Extend<&'a char>","spell_event_bus::api::SpellId"],["
1.4.0 · source§

impl Extend<String> for String

source§

fn extend<I>(&mut self, iter: I)where\n I: IntoIterator<Item = String>,

Extends a collection with the contents of an iterator. Read more
source§

fn extend_one(&mut self, s: String)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
","Extend","spell_event_bus::api::SpellId"],["
1.19.0 · source§

impl<'a> Extend<Cow<'a, str>> for String

source§

fn extend<I>(&mut self, iter: I)where\n I: IntoIterator<Item = Cow<'a, str>>,

Extends a collection with the contents of an iterator. Read more
source§

fn extend_one(&mut self, s: Cow<'a, str>)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
","Extend>","spell_event_bus::api::SpellId"],["
1.0.0 · source§

impl<'a> Extend<&'a str> for String

source§

fn extend<I>(&mut self, iter: I)where\n I: IntoIterator<Item = &'a str>,

Extends a collection with the contents of an iterator. Read more
source§

fn extend_one(&mut self, s: &'a str)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
","Extend<&'a str>","spell_event_bus::api::SpellId"],["
1.45.0 · source§

impl Extend<Box<str>> for String

source§

fn extend<I>(&mut self, iter: I)where\n I: IntoIterator<Item = Box<str>>,

Extends a collection with the contents of an iterator. Read more
source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
","Extend>","spell_event_bus::api::SpellId"],["
1.0.0 · source§

impl Extend<char> for String

source§

fn extend<I>(&mut self, iter: I)where\n I: IntoIterator<Item = char>,

Extends a collection with the contents of an iterator. Read more
source§

fn extend_one(&mut self, c: char)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
","Extend","spell_event_bus::api::SpellId"],["
1.0.0 · source§

impl Ord for String

source§

fn cmp(&self, other: &String) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Selfwhere\n Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Selfwhere\n Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Selfwhere\n Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
","Ord","spell_event_bus::api::SpellId"],["
1.0.0 · source§

impl<'a, 'b> PartialEq<str> for String

source§

fn eq(&self, other: &str) -> bool

This method tests for self and other values to be equal, and is used\nby ==.
source§

fn ne(&self, other: &str) -> bool

This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
","PartialEq","spell_event_bus::api::SpellId"],["
1.0.0 · source§

impl<'a, 'b> PartialEq<&'a str> for String

source§

fn eq(&self, other: &&'a str) -> bool

This method tests for self and other values to be equal, and is used\nby ==.
source§

fn ne(&self, other: &&'a str) -> bool

This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
","PartialEq<&'a str>","spell_event_bus::api::SpellId"],["
1.0.0 · source§

impl<'a, 'b> PartialEq<Cow<'a, str>> for String

source§

fn eq(&self, other: &Cow<'a, str>) -> bool

This method tests for self and other values to be equal, and is used\nby ==.
source§

fn ne(&self, other: &Cow<'a, str>) -> bool

This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
","PartialEq>","spell_event_bus::api::SpellId"],["
1.0.0 · source§

impl PartialEq for String

source§

fn eq(&self, other: &String) -> bool

This method tests for self and other values to be equal, and is used\nby ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
","PartialEq","spell_event_bus::api::SpellId"],["
1.0.0 · source§

impl Display for String

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
","Display","spell_event_bus::api::SpellId"],["
1.0.0 · source§

impl PartialOrd for String

source§

fn partial_cmp(&self, other: &String) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <=\noperator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >=\noperator. Read more
","PartialOrd","spell_event_bus::api::SpellId"],["
1.0.0 · source§

impl Hash for String

source§

fn hash<H>(&self, hasher: &mut H)where\n H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where\n H: Hasher,\n Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
","Hash","spell_event_bus::api::SpellId"],["
1.43.0 · source§

impl AsMut<str> for String

source§

fn as_mut(&mut self) -> &mut str

Converts this type into a mutable reference of the (usually inferred) input type.
","AsMut","spell_event_bus::api::SpellId"],["
1.0.0 · source§

impl Borrow<str> for String

source§

fn borrow(&self) -> &str

Immutably borrows from an owned value. Read more
","Borrow","spell_event_bus::api::SpellId"],["
1.3.0 · source§

impl DerefMut for String

source§

fn deref_mut(&mut self) -> &mut str

Mutably dereferences the value.
","DerefMut","spell_event_bus::api::SpellId"],["
1.0.0 · source§

impl FromStr for String

§

type Err = Infallible

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<String, <String as FromStr>::Err>

Parses a string s to return a value of this type. Read more
","FromStr","spell_event_bus::api::SpellId"],["
1.12.0 · source§

impl AddAssign<&str> for String

Implements the += operator for appending to a String.

\n

This has the same behavior as the push_str method.

\n
source§

fn add_assign(&mut self, other: &str)

Performs the += operation. Read more
","AddAssign<&str>","spell_event_bus::api::SpellId"],["
1.0.0 · source§

impl Default for String

source§

fn default() -> String

Creates an empty String.

\n
","Default","spell_event_bus::api::SpellId"],["
1.0.0 · source§

impl AsRef<str> for String

source§

fn as_ref(&self) -> &str

Converts this type into a shared reference of the (usually inferred) input type.
","AsRef","spell_event_bus::api::SpellId"],["
1.0.0 · source§

impl AsRef<[u8]> for String

source§

fn as_ref(&self) -> &[u8]

Converts this type into a shared reference of the (usually inferred) input type.
","AsRef<[u8]>","spell_event_bus::api::SpellId"],["
1.36.0 · source§

impl BorrowMut<str> for String

source§

fn borrow_mut(&mut self) -> &mut str

Mutably borrows from an owned value. Read more
","BorrowMut","spell_event_bus::api::SpellId"],["
1.3.0 · source§

impl IndexMut<RangeFrom<usize>> for String

source§

fn index_mut(&mut self, index: RangeFrom<usize>) -> &mut str

Performs the mutable indexing (container[index]) operation. Read more
","IndexMut>","spell_event_bus::api::SpellId"],["
1.26.0 · source§

impl IndexMut<RangeInclusive<usize>> for String

source§

fn index_mut(&mut self, index: RangeInclusive<usize>) -> &mut str

Performs the mutable indexing (container[index]) operation. Read more
","IndexMut>","spell_event_bus::api::SpellId"],["
1.3.0 · source§

impl IndexMut<Range<usize>> for String

source§

fn index_mut(&mut self, index: Range<usize>) -> &mut str

Performs the mutable indexing (container[index]) operation. Read more
","IndexMut>","spell_event_bus::api::SpellId"],["
1.26.0 · source§

impl IndexMut<RangeToInclusive<usize>> for String

source§

fn index_mut(&mut self, index: RangeToInclusive<usize>) -> &mut str

Performs the mutable indexing (container[index]) operation. Read more
","IndexMut>","spell_event_bus::api::SpellId"],["
1.3.0 · source§

impl IndexMut<RangeTo<usize>> for String

source§

fn index_mut(&mut self, index: RangeTo<usize>) -> &mut str

Performs the mutable indexing (container[index]) operation. Read more
","IndexMut>","spell_event_bus::api::SpellId"],["
1.3.0 · source§

impl IndexMut<RangeFull> for String

source§

fn index_mut(&mut self, _index: RangeFull) -> &mut str

Performs the mutable indexing (container[index]) operation. Read more
","IndexMut","spell_event_bus::api::SpellId"],["
1.35.0 · source§

impl From<&String> for String

source§

fn from(s: &String) -> String

Converts a &String into a String.

\n

This clones s and returns the clone.

\n
","From<&String>","spell_event_bus::api::SpellId"],["
1.14.0 · source§

impl<'a> From<Cow<'a, str>> for String

source§

fn from(s: Cow<'a, str>) -> String

Converts a clone-on-write string to an owned\ninstance of String.

\n

This extracts the owned string,\nclones the string if it is not already owned.

\n
Example
\n
// If the string is not owned...\nlet cow: Cow<'_, str> = Cow::Borrowed("eggplant");\n// It will allocate on the heap and copy the string.\nlet owned: String = String::from(cow);\nassert_eq!(&owned[..], "eggplant");
\n
","From>","spell_event_bus::api::SpellId"],["
1.18.0 · source§

impl From<Box<str>> for String

source§

fn from(s: Box<str>) -> String

Converts the given boxed str slice to a String.\nIt is notable that the str slice is owned.

\n
Examples
\n
let s1: String = String::from("hello world");\nlet s2: Box<str> = s1.into_boxed_str();\nlet s3: String = String::from(s2);\n\nassert_eq!("hello world", s3)
\n
","From>","spell_event_bus::api::SpellId"],["
1.44.0 · source§

impl From<&mut str> for String

source§

fn from(s: &mut str) -> String

Converts a &mut str into a String.

\n

The result is allocated on the heap.

\n
","From<&mut str>","spell_event_bus::api::SpellId"],["
1.46.0 · source§

impl From<char> for String

source§

fn from(c: char) -> String

Allocates an owned String from a single character.

\n
Example
\n
let c: char = 'a';\nlet s: String = String::from(c);\nassert_eq!("a", &s[..]);
\n
","From","spell_event_bus::api::SpellId"],["
1.0.0 · source§

impl From<&str> for String

source§

fn from(s: &str) -> String

Converts a &str into a String.

\n

The result is allocated on the heap.

\n
","From<&str>","spell_event_bus::api::SpellId"],["
1.0.0 · source§

impl StructuralPartialEq for String

","StructuralPartialEq","spell_event_bus::api::SpellId"],["
1.0.0 · source§

impl Eq for String

","Eq","spell_event_bus::api::SpellId"],["
1.0.0 · source§

impl Debug for String

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
","Debug","spell_event_bus::api::SpellId"],["
1.0.0 · source§

impl Clone for String

source§

fn clone(&self) -> String

Returns a copy of the value. Read more
source§

fn clone_from(&mut self, source: &String)

Performs copy-assignment from source. Read more
","Clone","spell_event_bus::api::SpellId"],["
1.0.0 · source§

impl Write for String

source§

fn write_str(&mut self, s: &str) -> Result<(), Error>

Writes a string slice into this writer, returning whether the write\nsucceeded. Read more
source§

fn write_char(&mut self, c: char) -> Result<(), Error>

Writes a char into this writer, returning whether the write succeeded. Read more
1.0.0 · source§

fn write_fmt(&mut self, args: Arguments<'_>) -> Result<(), Error>

Glue for usage of the write! macro with implementors of this trait. Read more
","Write","spell_event_bus::api::SpellId"],["
1.0.0 · source§

impl<'a> FromIterator<&'a str> for String

source§

fn from_iter<I>(iter: I) -> Stringwhere\n I: IntoIterator<Item = &'a str>,

Creates a value from an iterator. Read more
","FromIterator<&'a str>","spell_event_bus::api::SpellId"],["
1.0.0 · source§

impl FromIterator<char> for String

source§

fn from_iter<I>(iter: I) -> Stringwhere\n I: IntoIterator<Item = char>,

Creates a value from an iterator. Read more
","FromIterator","spell_event_bus::api::SpellId"],["
1.45.0 · source§

impl FromIterator<Box<str>> for String

source§

fn from_iter<I>(iter: I) -> Stringwhere\n I: IntoIterator<Item = Box<str>>,

Creates a value from an iterator. Read more
","FromIterator>","spell_event_bus::api::SpellId"],["
1.17.0 · source§

impl<'a> FromIterator<&'a char> for String

source§

fn from_iter<I>(iter: I) -> Stringwhere\n I: IntoIterator<Item = &'a char>,

Creates a value from an iterator. Read more
","FromIterator<&'a char>","spell_event_bus::api::SpellId"],["
1.19.0 · source§

impl<'a> FromIterator<Cow<'a, str>> for String

source§

fn from_iter<I>(iter: I) -> Stringwhere\n I: IntoIterator<Item = Cow<'a, str>>,

Creates a value from an iterator. Read more
","FromIterator>","spell_event_bus::api::SpellId"],["
1.4.0 · source§

impl FromIterator<String> for String

source§

fn from_iter<I>(iter: I) -> Stringwhere\n I: IntoIterator<Item = String>,

Creates a value from an iterator. Read more
","FromIterator","spell_event_bus::api::SpellId"],["
§

impl PartialEq<BytesMut> for String

§

fn eq(&self, other: &BytesMut) -> bool

This method tests for self and other values to be equal, and is used\nby ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
","PartialEq","spell_event_bus::api::SpellId"],["
§

impl PartialEq<Bytes> for String

§

fn eq(&self, other: &Bytes) -> bool

This method tests for self and other values to be equal, and is used\nby ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
","PartialEq","spell_event_bus::api::SpellId"],["
§

impl PartialOrd<Bytes> for String

§

fn partial_cmp(&self, other: &Bytes) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <=\noperator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >=\noperator. Read more
","PartialOrd","spell_event_bus::api::SpellId"],["
§

impl PartialOrd<BytesMut> for String

§

fn partial_cmp(&self, other: &BytesMut) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <=\noperator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >=\noperator. Read more
","PartialOrd","spell_event_bus::api::SpellId"],["
source§

impl<'de, E> IntoDeserializer<'de, E> for Stringwhere\n E: Error,

§

type Deserializer = StringDeserializer<E>

The type of the deserializer being converted into.
source§

fn into_deserializer(self) -> StringDeserializer<E>

Convert this value into a deserializer.
","IntoDeserializer<'de, E>","spell_event_bus::api::SpellId"],["
source§

impl Serialize for String

source§

fn serialize<S>(\n &self,\n serializer: S\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,

Serialize this value into the given Serde serializer. Read more
","Serialize","spell_event_bus::api::SpellId"],["
source§

impl<'de> Deserialize<'de> for String

source§

fn deserialize<D>(\n deserializer: D\n) -> Result<String, <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
","Deserialize<'de>","spell_event_bus::api::SpellId"],["
§

impl Zeroize for String

§

fn zeroize(&mut self)

Zero out this object from memory using Rust intrinsics which ensure the\nzeroization operation is not “optimized away” by the compiler.
","Zeroize","spell_event_bus::api::SpellId"],["
§

impl<'a> DerDecodable<'a> for String

§

fn load(object: DerObject<'a>) -> Result<String, Asn1DerError>

Loads object as Self
§

fn decode(raw: &'a [u8]) -> Result<Self, Asn1DerError>

Decodes an object as Self
§

fn decode_at(raw: &'a [u8], header_start: usize) -> Result<Self, Asn1DerError>

Decodes an object as Self
§

fn decode_from_source<A, B>(\n source: &mut A,\n sink: B\n) -> Result<Self, Asn1DerError>where\n A: Source,\n B: Sink + Into<&'a [u8]>,

Reads an object from source by parsing the length field and copying the necessary bytes\ninto sink and decoding it from sink
","DerDecodable<'a>","spell_event_bus::api::SpellId"],["
§

impl DerEncodable for String

§

fn encode<S>(&self, sink: &mut S) -> Result<(), Asn1DerError>where\n S: Sink,

Encodes self into sink
§

fn der_object<'a, S>(&self, sink: S) -> Result<DerObject<'a>, Asn1DerError>where\n S: Sink + Into<&'a [u8]>,

Creates an DER object from an encodable type
","DerEncodable","spell_event_bus::api::SpellId"],["
§

impl Value for String

§

fn record(&self, key: &Field, visitor: &mut dyn Visit)

Visits this value with the given Visitor.
","Value","spell_event_bus::api::SpellId"],["
§

impl EncodeTarget for String

§

fn encode_with(\n &mut self,\n max_len: usize,\n f: impl for<'a> FnOnce(&'a mut [u8]) -> Result<usize, Error>\n) -> Result<usize, Error>

Encodes into this buffer, provides the maximum length for implementations that wish to\npreallocate space, along with a function that will encode ASCII bytes into the buffer and\nreturn the length written to it.
","EncodeTarget","spell_event_bus::api::SpellId"],["
source§

impl From<Url> for String

String conversion.

\n
source§

fn from(value: Url) -> String

Converts to this type from the input type.
","From","spell_event_bus::api::SpellId"],["
§

impl Target for String

§

fn as_mut_string(&mut self) -> &mut String

§

fn finish(self) -> String

§

type Finished = String

","Target","spell_event_bus::api::SpellId"],["
§

impl ToSocketAddrs for String

","ToSocketAddrs","spell_event_bus::api::SpellId"],["
§

impl<A> Extend<Box<str, A>> for Stringwhere\n A: Allocator,

§

fn extend<I>(&mut self, iter: I)where\n I: IntoIterator<Item = Box<str, A>>,

Extends a collection with the contents of an iterator. Read more
source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
","Extend>","spell_event_bus::api::SpellId"],["
§

impl TryParseIp for String

§

fn try_parse_ip(&self) -> Option<RData>

Attempts to parse self into an RData::A or RData::AAAA, None is returned if not possible
","TryParseIp","spell_event_bus::api::SpellId"],["
§

impl IntoName for String

§

fn into_name(self) -> Result<Name, ProtoError>

Performs a utf8, IDNA or punycode, translation of the String into Name

\n
","IntoName","spell_event_bus::api::SpellId"],["
§

impl IntoLabel for String

§

fn into_label(self) -> Result<Label, ProtoError>

Convert this into Label
","IntoLabel","spell_event_bus::api::SpellId"],["
§

impl From<ProtoError> for String

§

fn from(e: ProtoError) -> String

Converts to this type from the input type.
","From","spell_event_bus::api::SpellId"],["
§

impl EncodeLabelValue for String

§

fn encode(&self, encoder: &mut LabelValueEncoder<'_>) -> Result<(), Error>

Encode oneself into the given encoder.
","EncodeLabelValue","spell_event_bus::api::SpellId"],["
§

impl EncodeLabelKey for String

§

fn encode(&self, encoder: &mut LabelKeyEncoder<'_>) -> Result<(), Error>

Encode oneself into the given encoder.
","EncodeLabelKey","spell_event_bus::api::SpellId"],["
§

impl<T> FromStream<T> for Stringwhere\n T: AsRef<str>,

","FromStream","spell_event_bus::api::SpellId"],["
source§

impl From<DealId> for String

source§

fn from(deal_id: DealId) -> String

Converts to this type from the input type.
","From","spell_event_bus::api::SpellId"],["
source§

impl From<&DealId> for String

source§

fn from(deal_id: &DealId) -> String

Converts to this type from the input type.
","From<&DealId>","spell_event_bus::api::SpellId"],["
§

impl From<KeyFormat> for String

§

fn from(kf: KeyFormat) -> String

Converts to this type from the input type.
","From","spell_event_bus::api::SpellId"],["
§

impl IntoDerObject for String

§

fn into_der_object(self) -> DerObject

Converts self into a DER object
§

fn serialized_len(&self) -> usize

Efficiently computes the length of the DER-serialized representation of self
§

fn serialize<'a>(\n self,\n buf: impl Iterator<Item = &'a mut u8>\n) -> Result<usize, Asn1DerError>

DER-serializes self into buf and returns the amount of bytes written
","IntoDerObject","spell_event_bus::api::SpellId"],["
§

impl FromDerObject for String

§

fn from_der_object(der_object: DerObject) -> Result<String, Asn1DerError>

Converts der_object into Self
§

fn deserialize<'a>(\n source: impl Iterator<Item = &'a u8>\n) -> Result<Self, Asn1DerError>

DER-deserializes the data from source
","FromDerObject","spell_event_bus::api::SpellId"],["
§

impl StrConsumer for String

Pushes the str onto the end of the String

\n
§

fn consume(&mut self, buf: &str)

Consume the base64 encoded data in buf
","StrConsumer","spell_event_bus::api::SpellId"],["
source§

impl PartialEq<Value> for String

source§

fn eq(&self, other: &Value) -> bool

This method tests for self and other values to be equal, and is used\nby ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
","PartialEq","spell_event_bus::api::SpellId"],["
source§

impl Index for String

","Index","spell_event_bus::api::SpellId"],["
§

impl PartialEq<JValue> for String

§

fn eq(&self, other: &JValue) -> bool

This method tests for self and other values to be equal, and is used\nby ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
","PartialEq","spell_event_bus::api::SpellId"],["
§

impl NativeType for String

§

const INTERFACE_TYPE: IType = IType::String

The associated interface type that maps to the native type.
","NativeType","spell_event_bus::api::SpellId"],["
§

impl TryFrom<IValue> for String

§

type Error = WasmValueNativeCastError

The type returned in the event of a conversion error.
§

fn try_from(w: IValue) -> Result<String, <String as TryFrom<IValue>>::Error>

Performs the conversion.
","TryFrom","spell_event_bus::api::SpellId"],["
§

impl<W> ToBytes<W> for Stringwhere\n W: Write,

Encode a String into bytes.

\n

Decoder is decoders::binary::string.

\n
§

fn to_bytes(&self, writer: &mut W) -> Result<(), Error>

Converts the given value into &[u8] in the given writer.
","ToBytes","spell_event_bus::api::SpellId"],["
§

impl Parse<'_> for String

§

fn parse(parser: Parser<'_>) -> Result<String, Error>

Attempts to parse Self from parser, returning an error if it could\nnot be parsed. Read more
","Parse<'_>","spell_event_bus::api::SpellId"],["
§

impl From<KebabString> for String

§

fn from(s: KebabString) -> String

Converts to this type from the input type.
","From","spell_event_bus::api::SpellId"],["
§

impl CallHasher for String

§

fn get_hash<H, B>(value: &H, build_hasher: &B) -> u64where\n H: Hash + ?Sized,\n B: BuildHasher,

","CallHasher","spell_event_bus::api::SpellId"],["
source§

impl Format for String

Serialize into a String

\n
","Format","spell_event_bus::api::SpellId"],["
§

impl StableDeref for String

","StableDeref","spell_event_bus::api::SpellId"],["
§

impl Lower for String

","Lower","spell_event_bus::api::SpellId"],["
§

impl ComponentType for String

","ComponentType","spell_event_bus::api::SpellId"],["
§

impl Lift for String

","Lift","spell_event_bus::api::SpellId"],["
§

impl From<KebabName> for String

§

fn from(name: KebabName) -> String

Converts to this type from the input type.
","From","spell_event_bus::api::SpellId"],["
§

impl From<KebabString> for String

§

fn from(s: KebabString) -> String

Converts to this type from the input type.
","From","spell_event_bus::api::SpellId"],["
§

impl From<KebabString> for String

§

fn from(s: KebabString) -> String

Converts to this type from the input type.
","From","spell_event_bus::api::SpellId"],["
§

impl From<ComponentName> for String

§

fn from(name: ComponentName) -> String

Converts to this type from the input type.
","From","spell_event_bus::api::SpellId"],["
§

impl Arg for String

§

fn as_str(&self) -> Result<&str, Errno>

Returns a view of this string as a string slice.
§

fn to_string_lossy(&self) -> Cow<'_, str>

Returns a potentially-lossy rendering of this string as a\nCow<'_, str>.
§

fn as_cow_c_str(&self) -> Result<Cow<'_, CStr>, Errno>

Returns a view of this string as a maybe-owned CStr.
§

fn into_c_str<'b>(self) -> Result<Cow<'b, CStr>, Errno>where\n String: 'b,

Consumes self and returns a view of this string as a maybe-owned\nCStr.
§

fn into_with_c_str<T, F>(self, f: F) -> Result<T, Errno>where\n String: Sized,\n F: FnOnce(&CStr) -> Result<T, Errno>,

Runs a closure with self passed in as a &CStr.
","Arg","spell_event_bus::api::SpellId"],["
§

impl Index for String

","Index","spell_event_bus::api::SpellId"],["
§

impl<'a> FromParallelIterator<Cow<'a, str>> for String

Collects string slices from a parallel iterator into a string.

\n
§

fn from_par_iter<I>(par_iter: I) -> Stringwhere\n I: IntoParallelIterator<Item = Cow<'a, str>>,

Creates an instance of the collection from the parallel iterator par_iter. Read more
","FromParallelIterator>","spell_event_bus::api::SpellId"],["
§

impl FromParallelIterator<char> for String

Collects characters from a parallel iterator into a string.

\n
§

fn from_par_iter<I>(par_iter: I) -> Stringwhere\n I: IntoParallelIterator<Item = char>,

Creates an instance of the collection from the parallel iterator par_iter. Read more
","FromParallelIterator","spell_event_bus::api::SpellId"],["
§

impl FromParallelIterator<String> for String

Collects strings from a parallel iterator into one large string.

\n
§

fn from_par_iter<I>(par_iter: I) -> Stringwhere\n I: IntoParallelIterator<Item = String>,

Creates an instance of the collection from the parallel iterator par_iter. Read more
","FromParallelIterator","spell_event_bus::api::SpellId"],["
§

impl<'a> FromParallelIterator<&'a char> for String

Collects characters from a parallel iterator into a string.

\n
§

fn from_par_iter<I>(par_iter: I) -> Stringwhere\n I: IntoParallelIterator<Item = &'a char>,

Creates an instance of the collection from the parallel iterator par_iter. Read more
","FromParallelIterator<&'a char>","spell_event_bus::api::SpellId"],["
§

impl FromParallelIterator<Box<str>> for String

Collects boxed strings from a parallel iterator into one large string.

\n
§

fn from_par_iter<I>(par_iter: I) -> Stringwhere\n I: IntoParallelIterator<Item = Box<str>>,

Creates an instance of the collection from the parallel iterator par_iter. Read more
","FromParallelIterator>","spell_event_bus::api::SpellId"],["
§

impl<'a> FromParallelIterator<&'a str> for String

Collects string slices from a parallel iterator into a string.

\n
§

fn from_par_iter<I>(par_iter: I) -> Stringwhere\n I: IntoParallelIterator<Item = &'a str>,

Creates an instance of the collection from the parallel iterator par_iter. Read more
","FromParallelIterator<&'a str>","spell_event_bus::api::SpellId"],["
§

impl ParallelExtend<String> for String

Extends a string with strings from a parallel iterator.

\n
§

fn par_extend<I>(&mut self, par_iter: I)where\n I: IntoParallelIterator<Item = String>,

Extends an instance of the collection with the elements drawn\nfrom the parallel iterator par_iter. Read more
","ParallelExtend","spell_event_bus::api::SpellId"],["
§

impl ParallelExtend<Box<str>> for String

Extends a string with boxed strings from a parallel iterator.

\n
§

fn par_extend<I>(&mut self, par_iter: I)where\n I: IntoParallelIterator<Item = Box<str>>,

Extends an instance of the collection with the elements drawn\nfrom the parallel iterator par_iter. Read more
","ParallelExtend>","spell_event_bus::api::SpellId"],["
§

impl<'a> ParallelExtend<&'a str> for String

Extends a string with string slices from a parallel iterator.

\n
§

fn par_extend<I>(&mut self, par_iter: I)where\n I: IntoParallelIterator<Item = &'a str>,

Extends an instance of the collection with the elements drawn\nfrom the parallel iterator par_iter. Read more
","ParallelExtend<&'a str>","spell_event_bus::api::SpellId"],["
§

impl<'a> ParallelExtend<Cow<'a, str>> for String

Extends a string with string slices from a parallel iterator.

\n
§

fn par_extend<I>(&mut self, par_iter: I)where\n I: IntoParallelIterator<Item = Cow<'a, str>>,

Extends an instance of the collection with the elements drawn\nfrom the parallel iterator par_iter. Read more
","ParallelExtend>","spell_event_bus::api::SpellId"],["
§

impl<'a> ParallelExtend<&'a char> for String

Extends a string with copied characters from a parallel iterator.

\n
§

fn par_extend<I>(&mut self, par_iter: I)where\n I: IntoParallelIterator<Item = &'a char>,

Extends an instance of the collection with the elements drawn\nfrom the parallel iterator par_iter. Read more
","ParallelExtend<&'a char>","spell_event_bus::api::SpellId"],["
§

impl ParallelExtend<char> for String

Extends a string with characters from a parallel iterator.

\n
§

fn par_extend<I>(&mut self, par_iter: I)where\n I: IntoParallelIterator<Item = char>,

Extends an instance of the collection with the elements drawn\nfrom the parallel iterator par_iter. Read more
","ParallelExtend","spell_event_bus::api::SpellId"],["
source§

impl From<Uuid> for String

source§

fn from(uuid: Uuid) -> String

Converts to this type from the input type.
","From","spell_event_bus::api::SpellId"],["
§

impl<'a> Arbitrary<'a> for String

§

fn arbitrary(u: &mut Unstructured<'a>) -> Result<String, Error>

Generate an arbitrary value of Self from the given unstructured data. Read more
§

fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<String, Error>

Generate an arbitrary value of Self from the entirety of the given\nunstructured data. Read more
§

fn size_hint(depth: usize) -> (usize, Option<usize>)

Get a size hint for how many bytes out of an Unstructured this type\nneeds to construct itself. Read more
","Arbitrary<'a>","spell_event_bus::api::SpellId"],["
§

impl Parse<'_> for String

§

fn parse(parser: Parser<'_>) -> Result<String, Error>

Attempts to parse Self from parser, returning an error if it could\nnot be parsed. Read more
","Parse<'_>","spell_event_bus::api::SpellId"],["
§

impl Readable for String

§

fn read(statement: &Statement, i: usize) -> Result<String, Error>

Read from a column. Read more
","Readable","spell_event_bus::api::SpellId"]] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/type.impl/avm_server/runner/struct.AVMRunner.js b/type.impl/avm_server/runner/struct.AVMRunner.js new file mode 100644 index 0000000000..a8a4e7b266 --- /dev/null +++ b/type.impl/avm_server/runner/struct.AVMRunner.js @@ -0,0 +1,3 @@ +(function() {var type_impls = { +"aquamarine":[["
§

impl<WB> AVMRunner<WB>where\n WB: WasmBackend,

pub async fn new(\n air_wasm_path: PathBuf,\n total_memory_limit: Option<u64>,\n avm_runtime_limits: AVMRuntimeLimits,\n logging_mask: i32,\n wasm_backend: WB\n) -> Result<AVMRunner<WB>, RunnerError>

Create AVM with the provided config.

\n

pub async fn call(\n &mut self,\n air: impl Into<String>,\n prev_data: impl Into<Vec<u8>>,\n data: impl Into<Vec<u8>>,\n init_peer_id: impl Into<String>,\n timestamp: u64,\n ttl: u32,\n current_peer_id: impl Into<String>,\n call_results: HashMap<u32, CallServiceResult>,\n keypair: &KeyPair,\n particle_id: String\n) -> Result<RawAVMOutcome, RunnerError>

pub async fn call_tracing(\n &mut self,\n air: impl Into<String>,\n prev_data: impl Into<Vec<u8>>,\n data: impl Into<Vec<u8>>,\n init_peer_id: impl Into<String>,\n timestamp: u64,\n ttl: u32,\n current_peer_id: impl Into<String>,\n call_results: HashMap<u32, CallServiceResult>,\n tracing_params: String,\n tracing_output_mode: u8,\n key_format: u8,\n secret_key_bytes: Vec<u8>,\n particle_id: String\n) -> Result<RawAVMOutcome, RunnerError>

pub async fn to_human_readable_data<'this>(\n &'this mut self,\n data: Vec<u8>\n) -> Result<String, RunnerError>

pub fn memory_stats(&self) -> AVMMemoryStats

",0,"aquamarine::AVMRunner"],["
source§

impl AquaRuntime for AVMRunner<WasmtimeWasmBackend>

source§

fn create_runtime(\n config: Self::Config,\n backend: WasmtimeWasmBackend,\n waker: Waker\n) -> Result<Self, Self::Error>

Creates AVM in background (on blocking threadpool)

\n
§

type Config = VmConfig

§

type Error = RunnerError

source§

fn into_effects(\n outcome: Result<RawAVMOutcome, Self::Error>,\n particle_id: String\n) -> ParticleEffects

source§

fn call<'life0, 'life1, 'life2, 'async_trait>(\n &'life0 mut self,\n air: impl 'async_trait + Into<String> + Send,\n prev_data: impl 'async_trait + Into<Vec<u8>> + Send,\n current_data: impl 'async_trait + Into<Vec<u8>> + Send,\n particle_params: ParticleParameters<'life1>,\n call_results: CallResults,\n key_pair: &'life2 KeyPair\n) -> Pin<Box<dyn Future<Output = Result<RawAVMOutcome, Self::Error>> + Send + 'async_trait>>where\n Self: 'async_trait,\n 'life0: 'async_trait,\n 'life1: 'async_trait,\n 'life2: 'async_trait,

source§

fn memory_stats(&self) -> AVMMemoryStats

Return current size of memory. Use only for diagnostics purposes.
","AquaRuntime","aquamarine::AVMRunner"]] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/type.impl/core/option/enum.Option.js b/type.impl/core/option/enum.Option.js new file mode 100644 index 0000000000..fc6ef7de09 --- /dev/null +++ b/type.impl/core/option/enum.Option.js @@ -0,0 +1,3 @@ +(function() {var type_impls = { +"local_vm":[["
source§

impl<T> Option<T>

1.0.0 (const: 1.48.0) · source

pub const fn is_some(&self) -> bool

Returns true if the option is a Some value.

\n
Examples
\n
let x: Option<u32> = Some(2);\nassert_eq!(x.is_some(), true);\n\nlet x: Option<u32> = None;\nassert_eq!(x.is_some(), false);
\n
1.70.0 · source

pub fn is_some_and(self, f: impl FnOnce(T) -> bool) -> bool

Returns true if the option is a Some and the value inside of it matches a predicate.

\n
Examples
\n
let x: Option<u32> = Some(2);\nassert_eq!(x.is_some_and(|x| x > 1), true);\n\nlet x: Option<u32> = Some(0);\nassert_eq!(x.is_some_and(|x| x > 1), false);\n\nlet x: Option<u32> = None;\nassert_eq!(x.is_some_and(|x| x > 1), false);
\n
1.0.0 (const: 1.48.0) · source

pub const fn is_none(&self) -> bool

Returns true if the option is a None value.

\n
Examples
\n
let x: Option<u32> = Some(2);\nassert_eq!(x.is_none(), false);\n\nlet x: Option<u32> = None;\nassert_eq!(x.is_none(), true);
\n
1.0.0 (const: 1.48.0) · source

pub const fn as_ref(&self) -> Option<&T>

Converts from &Option<T> to Option<&T>.

\n
Examples
\n

Calculates the length of an Option<String> as an Option<usize>\nwithout moving the String. The map method takes the self argument by value,\nconsuming the original, so this technique uses as_ref to first take an Option to a\nreference to the value inside the original.

\n\n
let text: Option<String> = Some("Hello, world!".to_string());\n// First, cast `Option<String>` to `Option<&String>` with `as_ref`,\n// then consume *that* with `map`, leaving `text` on the stack.\nlet text_length: Option<usize> = text.as_ref().map(|s| s.len());\nprintln!("still can print text: {text:?}");
\n
1.0.0 (const: unstable) · source

pub fn as_mut(&mut self) -> Option<&mut T>

Converts from &mut Option<T> to Option<&mut T>.

\n
Examples
\n
let mut x = Some(2);\nmatch x.as_mut() {\n    Some(v) => *v = 42,\n    None => {},\n}\nassert_eq!(x, Some(42));
\n
1.33.0 (const: unstable) · source

pub fn as_pin_ref(self: Pin<&Option<T>>) -> Option<Pin<&T>>

Converts from Pin<&Option<T>> to Option<Pin<&T>>.

\n
1.33.0 (const: unstable) · source

pub fn as_pin_mut(self: Pin<&mut Option<T>>) -> Option<Pin<&mut T>>

Converts from Pin<&mut Option<T>> to Option<Pin<&mut T>>.

\n
1.75.0 · source

pub fn as_slice(&self) -> &[T]

Returns a slice of the contained value, if any. If this is None, an\nempty slice is returned. This can be useful to have a single type of\niterator over an Option or slice.

\n

Note: Should you have an Option<&T> and wish to get a slice of T,\nyou can unpack it via opt.map_or(&[], std::slice::from_ref).

\n
Examples
\n
assert_eq!(\n    [Some(1234).as_slice(), None.as_slice()],\n    [&[1234][..], &[][..]],\n);
\n

The inverse of this function is (discounting\nborrowing) [_]::first:

\n\n
for i in [Some(1234_u16), None] {\n    assert_eq!(i.as_ref(), i.as_slice().first());\n}
\n
1.75.0 · source

pub fn as_mut_slice(&mut self) -> &mut [T]

Returns a mutable slice of the contained value, if any. If this is\nNone, an empty slice is returned. This can be useful to have a\nsingle type of iterator over an Option or slice.

\n

Note: Should you have an Option<&mut T> instead of a\n&mut Option<T>, which this method takes, you can obtain a mutable\nslice via opt.map_or(&mut [], std::slice::from_mut).

\n
Examples
\n
assert_eq!(\n    [Some(1234).as_mut_slice(), None.as_mut_slice()],\n    [&mut [1234][..], &mut [][..]],\n);
\n

The result is a mutable slice of zero or one items that points into\nour original Option:

\n\n
let mut x = Some(1234);\nx.as_mut_slice()[0] += 1;\nassert_eq!(x, Some(1235));
\n

The inverse of this method (discounting borrowing)\nis [_]::first_mut:

\n\n
assert_eq!(Some(123).as_mut_slice().first_mut(), Some(&mut 123))
\n
1.0.0 (const: unstable) · source

pub fn expect(self, msg: &str) -> T

Returns the contained Some value, consuming the self value.

\n
Panics
\n

Panics if the value is a None with a custom panic message provided by\nmsg.

\n
Examples
\n
let x = Some("value");\nassert_eq!(x.expect("fruits are healthy"), "value");
\n\n
let x: Option<&str> = None;\nx.expect("fruits are healthy"); // panics with `fruits are healthy`
\n
Recommended Message Style
\n

We recommend that expect messages are used to describe the reason you\nexpect the Option should be Some.

\n\n
let item = slice.get(0)\n    .expect("slice should not be empty");
\n

Hint: If you’re having trouble remembering how to phrase expect\nerror messages remember to focus on the word “should” as in “env\nvariable should be set by blah” or “the given binary should be available\nand executable by the current user”.

\n

For more detail on expect message styles and the reasoning behind our\nrecommendation please refer to the section on “Common Message\nStyles” in the std::error module docs.

\n
1.0.0 (const: unstable) · source

pub fn unwrap(self) -> T

Returns the contained Some value, consuming the self value.

\n

Because this function may panic, its use is generally discouraged.\nInstead, prefer to use pattern matching and handle the None\ncase explicitly, or call unwrap_or, unwrap_or_else, or\nunwrap_or_default.

\n
Panics
\n

Panics if the self value equals None.

\n
Examples
\n
let x = Some("air");\nassert_eq!(x.unwrap(), "air");
\n\n
let x: Option<&str> = None;\nassert_eq!(x.unwrap(), "air"); // fails
\n
1.0.0 · source

pub fn unwrap_or(self, default: T) -> T

Returns the contained Some value or a provided default.

\n

Arguments passed to unwrap_or are eagerly evaluated; if you are passing\nthe result of a function call, it is recommended to use unwrap_or_else,\nwhich is lazily evaluated.

\n
Examples
\n
assert_eq!(Some("car").unwrap_or("bike"), "car");\nassert_eq!(None.unwrap_or("bike"), "bike");
\n
1.0.0 · source

pub fn unwrap_or_else<F>(self, f: F) -> Twhere\n F: FnOnce() -> T,

Returns the contained Some value or computes it from a closure.

\n
Examples
\n
let k = 10;\nassert_eq!(Some(4).unwrap_or_else(|| 2 * k), 4);\nassert_eq!(None.unwrap_or_else(|| 2 * k), 20);
\n
1.0.0 · source

pub fn unwrap_or_default(self) -> Twhere\n T: Default,

Returns the contained Some value or a default.

\n

Consumes the self argument then, if Some, returns the contained\nvalue, otherwise if None, returns the default value for that\ntype.

\n
Examples
\n
let x: Option<u32> = None;\nlet y: Option<u32> = Some(12);\n\nassert_eq!(x.unwrap_or_default(), 0);\nassert_eq!(y.unwrap_or_default(), 12);
\n
1.58.0 (const: unstable) · source

pub unsafe fn unwrap_unchecked(self) -> T

Returns the contained Some value, consuming the self value,\nwithout checking that the value is not None.

\n
Safety
\n

Calling this method on None is undefined behavior.

\n
Examples
\n
let x = Some("air");\nassert_eq!(unsafe { x.unwrap_unchecked() }, "air");
\n\n
let x: Option<&str> = None;\nassert_eq!(unsafe { x.unwrap_unchecked() }, "air"); // Undefined behavior!
\n
1.0.0 · source

pub fn map<U, F>(self, f: F) -> Option<U>where\n F: FnOnce(T) -> U,

Maps an Option<T> to Option<U> by applying a function to a contained value (if Some) or returns None (if None).

\n
Examples
\n

Calculates the length of an Option<String> as an\nOption<usize>, consuming the original:

\n\n
let maybe_some_string = Some(String::from("Hello, World!"));\n// `Option::map` takes self *by value*, consuming `maybe_some_string`\nlet maybe_some_len = maybe_some_string.map(|s| s.len());\nassert_eq!(maybe_some_len, Some(13));\n\nlet x: Option<&str> = None;\nassert_eq!(x.map(|s| s.len()), None);
\n
source

pub fn inspect<F>(self, f: F) -> Option<T>where\n F: FnOnce(&T),

🔬This is a nightly-only experimental API. (result_option_inspect)

Calls the provided closure with a reference to the contained value (if Some).

\n
Examples
\n
#![feature(result_option_inspect)]\n\nlet v = vec![1, 2, 3, 4, 5];\n\n// prints "got: 4"\nlet x: Option<&usize> = v.get(3).inspect(|x| println!("got: {x}"));\n\n// prints nothing\nlet x: Option<&usize> = v.get(5).inspect(|x| println!("got: {x}"));
\n
1.0.0 · source

pub fn map_or<U, F>(self, default: U, f: F) -> Uwhere\n F: FnOnce(T) -> U,

Returns the provided default result (if none),\nor applies a function to the contained value (if any).

\n

Arguments passed to map_or are eagerly evaluated; if you are passing\nthe result of a function call, it is recommended to use map_or_else,\nwhich is lazily evaluated.

\n
Examples
\n
let x = Some("foo");\nassert_eq!(x.map_or(42, |v| v.len()), 3);\n\nlet x: Option<&str> = None;\nassert_eq!(x.map_or(42, |v| v.len()), 42);
\n
1.0.0 · source

pub fn map_or_else<U, D, F>(self, default: D, f: F) -> Uwhere\n D: FnOnce() -> U,\n F: FnOnce(T) -> U,

Computes a default function result (if none), or\napplies a different function to the contained value (if any).

\n
Basic examples
\n
let k = 21;\n\nlet x = Some("foo");\nassert_eq!(x.map_or_else(|| 2 * k, |v| v.len()), 3);\n\nlet x: Option<&str> = None;\nassert_eq!(x.map_or_else(|| 2 * k, |v| v.len()), 42);
\n
Handling a Result-based fallback
\n

A somewhat common occurrence when dealing with optional values\nin combination with Result<T, E> is the case where one wants to invoke\na fallible fallback if the option is not present. This example\nparses a command line argument (if present), or the contents of a file to\nan integer. However, unlike accessing the command line argument, reading\nthe file is fallible, so it must be wrapped with Ok.

\n\n
let v: u64 = std::env::args()\n   .nth(1)\n   .map_or_else(|| std::fs::read_to_string("/etc/someconfig.conf"), Ok)?\n   .parse()?;
\n
1.0.0 · source

pub fn ok_or<E>(self, err: E) -> Result<T, E>

Transforms the Option<T> into a Result<T, E>, mapping Some(v) to\nOk(v) and None to Err(err).

\n

Arguments passed to ok_or are eagerly evaluated; if you are passing the\nresult of a function call, it is recommended to use ok_or_else, which is\nlazily evaluated.

\n
Examples
\n
let x = Some("foo");\nassert_eq!(x.ok_or(0), Ok("foo"));\n\nlet x: Option<&str> = None;\nassert_eq!(x.ok_or(0), Err(0));
\n
1.0.0 · source

pub fn ok_or_else<E, F>(self, err: F) -> Result<T, E>where\n F: FnOnce() -> E,

Transforms the Option<T> into a Result<T, E>, mapping Some(v) to\nOk(v) and None to Err(err()).

\n
Examples
\n
let x = Some("foo");\nassert_eq!(x.ok_or_else(|| 0), Ok("foo"));\n\nlet x: Option<&str> = None;\nassert_eq!(x.ok_or_else(|| 0), Err(0));
\n
1.40.0 · source

pub fn as_deref(&self) -> Option<&<T as Deref>::Target>where\n T: Deref,

Converts from Option<T> (or &Option<T>) to Option<&T::Target>.

\n

Leaves the original Option in-place, creating a new one with a reference\nto the original one, additionally coercing the contents via Deref.

\n
Examples
\n
let x: Option<String> = Some("hey".to_owned());\nassert_eq!(x.as_deref(), Some("hey"));\n\nlet x: Option<String> = None;\nassert_eq!(x.as_deref(), None);
\n
1.40.0 · source

pub fn as_deref_mut(&mut self) -> Option<&mut <T as Deref>::Target>where\n T: DerefMut,

Converts from Option<T> (or &mut Option<T>) to Option<&mut T::Target>.

\n

Leaves the original Option in-place, creating a new one containing a mutable reference to\nthe inner type’s Deref::Target type.

\n
Examples
\n
let mut x: Option<String> = Some("hey".to_owned());\nassert_eq!(x.as_deref_mut().map(|x| {\n    x.make_ascii_uppercase();\n    x\n}), Some("HEY".to_owned().as_mut_str()));
\n
1.0.0 (const: unstable) · source

pub fn iter(&self) -> Iter<'_, T>

Returns an iterator over the possibly contained value.

\n
Examples
\n
let x = Some(4);\nassert_eq!(x.iter().next(), Some(&4));\n\nlet x: Option<u32> = None;\nassert_eq!(x.iter().next(), None);
\n
1.0.0 · source

pub fn iter_mut(&mut self) -> IterMut<'_, T>

Returns a mutable iterator over the possibly contained value.

\n
Examples
\n
let mut x = Some(4);\nmatch x.iter_mut().next() {\n    Some(v) => *v = 42,\n    None => {},\n}\nassert_eq!(x, Some(42));\n\nlet mut x: Option<u32> = None;\nassert_eq!(x.iter_mut().next(), None);
\n
1.0.0 · source

pub fn and<U>(self, optb: Option<U>) -> Option<U>

Returns None if the option is None, otherwise returns optb.

\n

Arguments passed to and are eagerly evaluated; if you are passing the\nresult of a function call, it is recommended to use and_then, which is\nlazily evaluated.

\n
Examples
\n
let x = Some(2);\nlet y: Option<&str> = None;\nassert_eq!(x.and(y), None);\n\nlet x: Option<u32> = None;\nlet y = Some("foo");\nassert_eq!(x.and(y), None);\n\nlet x = Some(2);\nlet y = Some("foo");\nassert_eq!(x.and(y), Some("foo"));\n\nlet x: Option<u32> = None;\nlet y: Option<&str> = None;\nassert_eq!(x.and(y), None);
\n
1.0.0 · source

pub fn and_then<U, F>(self, f: F) -> Option<U>where\n F: FnOnce(T) -> Option<U>,

Returns None if the option is None, otherwise calls f with the\nwrapped value and returns the result.

\n

Some languages call this operation flatmap.

\n
Examples
\n
fn sq_then_to_string(x: u32) -> Option<String> {\n    x.checked_mul(x).map(|sq| sq.to_string())\n}\n\nassert_eq!(Some(2).and_then(sq_then_to_string), Some(4.to_string()));\nassert_eq!(Some(1_000_000).and_then(sq_then_to_string), None); // overflowed!\nassert_eq!(None.and_then(sq_then_to_string), None);
\n

Often used to chain fallible operations that may return None.

\n\n
let arr_2d = [["A0", "A1"], ["B0", "B1"]];\n\nlet item_0_1 = arr_2d.get(0).and_then(|row| row.get(1));\nassert_eq!(item_0_1, Some(&"A1"));\n\nlet item_2_0 = arr_2d.get(2).and_then(|row| row.get(0));\nassert_eq!(item_2_0, None);
\n
1.27.0 · source

pub fn filter<P>(self, predicate: P) -> Option<T>where\n P: FnOnce(&T) -> bool,

Returns None if the option is None, otherwise calls predicate\nwith the wrapped value and returns:

\n
    \n
  • Some(t) if predicate returns true (where t is the wrapped\nvalue), and
  • \n
  • None if predicate returns false.
  • \n
\n

This function works similar to Iterator::filter(). You can imagine\nthe Option<T> being an iterator over one or zero elements. filter()\nlets you decide which elements to keep.

\n
Examples
\n
fn is_even(n: &i32) -> bool {\n    n % 2 == 0\n}\n\nassert_eq!(None.filter(is_even), None);\nassert_eq!(Some(3).filter(is_even), None);\nassert_eq!(Some(4).filter(is_even), Some(4));
\n
1.0.0 · source

pub fn or(self, optb: Option<T>) -> Option<T>

Returns the option if it contains a value, otherwise returns optb.

\n

Arguments passed to or are eagerly evaluated; if you are passing the\nresult of a function call, it is recommended to use or_else, which is\nlazily evaluated.

\n
Examples
\n
let x = Some(2);\nlet y = None;\nassert_eq!(x.or(y), Some(2));\n\nlet x = None;\nlet y = Some(100);\nassert_eq!(x.or(y), Some(100));\n\nlet x = Some(2);\nlet y = Some(100);\nassert_eq!(x.or(y), Some(2));\n\nlet x: Option<u32> = None;\nlet y = None;\nassert_eq!(x.or(y), None);
\n
1.0.0 · source

pub fn or_else<F>(self, f: F) -> Option<T>where\n F: FnOnce() -> Option<T>,

Returns the option if it contains a value, otherwise calls f and\nreturns the result.

\n
Examples
\n
fn nobody() -> Option<&'static str> { None }\nfn vikings() -> Option<&'static str> { Some("vikings") }\n\nassert_eq!(Some("barbarians").or_else(vikings), Some("barbarians"));\nassert_eq!(None.or_else(vikings), Some("vikings"));\nassert_eq!(None.or_else(nobody), None);
\n
1.37.0 · source

pub fn xor(self, optb: Option<T>) -> Option<T>

Returns Some if exactly one of self, optb is Some, otherwise returns None.

\n
Examples
\n
let x = Some(2);\nlet y: Option<u32> = None;\nassert_eq!(x.xor(y), Some(2));\n\nlet x: Option<u32> = None;\nlet y = Some(2);\nassert_eq!(x.xor(y), Some(2));\n\nlet x = Some(2);\nlet y = Some(2);\nassert_eq!(x.xor(y), None);\n\nlet x: Option<u32> = None;\nlet y: Option<u32> = None;\nassert_eq!(x.xor(y), None);
\n
1.53.0 · source

pub fn insert(&mut self, value: T) -> &mut T

Inserts value into the option, then returns a mutable reference to it.

\n

If the option already contains a value, the old value is dropped.

\n

See also Option::get_or_insert, which doesn’t update the value if\nthe option already contains Some.

\n
Example
\n
let mut opt = None;\nlet val = opt.insert(1);\nassert_eq!(*val, 1);\nassert_eq!(opt.unwrap(), 1);\nlet val = opt.insert(2);\nassert_eq!(*val, 2);\n*val = 3;\nassert_eq!(opt.unwrap(), 3);
\n
1.20.0 · source

pub fn get_or_insert(&mut self, value: T) -> &mut T

Inserts value into the option if it is None, then\nreturns a mutable reference to the contained value.

\n

See also Option::insert, which updates the value even if\nthe option already contains Some.

\n
Examples
\n
let mut x = None;\n\n{\n    let y: &mut u32 = x.get_or_insert(5);\n    assert_eq!(y, &5);\n\n    *y = 7;\n}\n\nassert_eq!(x, Some(7));
\n
source

pub fn get_or_insert_default(&mut self) -> &mut Twhere\n T: Default,

🔬This is a nightly-only experimental API. (option_get_or_insert_default)

Inserts the default value into the option if it is None, then\nreturns a mutable reference to the contained value.

\n
Examples
\n
#![feature(option_get_or_insert_default)]\n\nlet mut x = None;\n\n{\n    let y: &mut u32 = x.get_or_insert_default();\n    assert_eq!(y, &0);\n\n    *y = 7;\n}\n\nassert_eq!(x, Some(7));
\n
1.20.0 · source

pub fn get_or_insert_with<F>(&mut self, f: F) -> &mut Twhere\n F: FnOnce() -> T,

Inserts a value computed from f into the option if it is None,\nthen returns a mutable reference to the contained value.

\n
Examples
\n
let mut x = None;\n\n{\n    let y: &mut u32 = x.get_or_insert_with(|| 5);\n    assert_eq!(y, &5);\n\n    *y = 7;\n}\n\nassert_eq!(x, Some(7));
\n
1.0.0 (const: unstable) · source

pub fn take(&mut self) -> Option<T>

Takes the value out of the option, leaving a None in its place.

\n
Examples
\n
let mut x = Some(2);\nlet y = x.take();\nassert_eq!(x, None);\nassert_eq!(y, Some(2));\n\nlet mut x: Option<u32> = None;\nlet y = x.take();\nassert_eq!(x, None);\nassert_eq!(y, None);
\n
source

pub fn take_if<P>(&mut self, predicate: P) -> Option<T>where\n P: FnOnce(&mut T) -> bool,

🔬This is a nightly-only experimental API. (option_take_if)

Takes the value out of the option, but only if the predicate evaluates to\ntrue on a mutable reference to the value.

\n

In other words, replaces self with None if the predicate returns true.\nThis method operates similar to Option::take but conditional.

\n
Examples
\n
#![feature(option_take_if)]\n\nlet mut x = Some(42);\n\nlet prev = x.take_if(|v| if *v == 42 {\n    *v += 1;\n    false\n} else {\n    false\n});\nassert_eq!(x, Some(43));\nassert_eq!(prev, None);\n\nlet prev = x.take_if(|v| *v == 43);\nassert_eq!(x, None);\nassert_eq!(prev, Some(43));
\n
1.31.0 (const: unstable) · source

pub fn replace(&mut self, value: T) -> Option<T>

Replaces the actual value in the option by the value given in parameter,\nreturning the old value if present,\nleaving a Some in its place without deinitializing either one.

\n
Examples
\n
let mut x = Some(2);\nlet old = x.replace(5);\nassert_eq!(x, Some(5));\nassert_eq!(old, Some(2));\n\nlet mut x = None;\nlet old = x.replace(3);\nassert_eq!(x, Some(3));\nassert_eq!(old, None);
\n
1.46.0 · source

pub fn zip<U>(self, other: Option<U>) -> Option<(T, U)>

Zips self with another Option.

\n

If self is Some(s) and other is Some(o), this method returns Some((s, o)).\nOtherwise, None is returned.

\n
Examples
\n
let x = Some(1);\nlet y = Some("hi");\nlet z = None::<u8>;\n\nassert_eq!(x.zip(y), Some((1, "hi")));\nassert_eq!(x.zip(z), None);
\n
source

pub fn zip_with<U, F, R>(self, other: Option<U>, f: F) -> Option<R>where\n F: FnOnce(T, U) -> R,

🔬This is a nightly-only experimental API. (option_zip)

Zips self and another Option with function f.

\n

If self is Some(s) and other is Some(o), this method returns Some(f(s, o)).\nOtherwise, None is returned.

\n
Examples
\n
#![feature(option_zip)]\n\n#[derive(Debug, PartialEq)]\nstruct Point {\n    x: f64,\n    y: f64,\n}\n\nimpl Point {\n    fn new(x: f64, y: f64) -> Self {\n        Self { x, y }\n    }\n}\n\nlet x = Some(17.5);\nlet y = Some(42.7);\n\nassert_eq!(x.zip_with(y, Point::new), Some(Point { x: 17.5, y: 42.7 }));\nassert_eq!(x.zip_with(None, Point::new), None);
\n
",0,"local_vm::local_vm::Returned"],["
source§

impl<T, E> Option<Result<T, E>>

1.33.0 (const: unstable) · source

pub fn transpose(self) -> Result<Option<T>, E>

Transposes an Option of a Result into a Result of an Option.

\n

None will be mapped to Ok(None).\nSome(Ok(_)) and Some(Err(_)) will be mapped to\nOk(Some(_)) and Err(_).

\n
Examples
\n
#[derive(Debug, Eq, PartialEq)]\nstruct SomeErr;\n\nlet x: Result<Option<i32>, SomeErr> = Ok(Some(5));\nlet y: Option<Result<i32, SomeErr>> = Some(Ok(5));\nassert_eq!(x, y.transpose());
\n
",0,"local_vm::local_vm::Returned"],["
source§

impl<T> FromResidual for Option<T>

source§

fn from_residual(residual: Option<Infallible>) -> Option<T>

🔬This is a nightly-only experimental API. (try_trait_v2)
Constructs the type from a compatible Residual type. Read more
","FromResidual","local_vm::local_vm::Returned"],["
source§

impl<T> FromResidual<Yeet<()>> for Option<T>

source§

fn from_residual(_: Yeet<()>) -> Option<T>

🔬This is a nightly-only experimental API. (try_trait_v2)
Constructs the type from a compatible Residual type. Read more
","FromResidual>","local_vm::local_vm::Returned"],["
source§

impl<T> Try for Option<T>

§

type Output = T

🔬This is a nightly-only experimental API. (try_trait_v2)
The type of the value produced by ? when not short-circuiting.
§

type Residual = Option<Infallible>

🔬This is a nightly-only experimental API. (try_trait_v2)
The type of the value passed to FromResidual::from_residual\nas part of ? when short-circuiting. Read more
source§

fn from_output(output: <Option<T> as Try>::Output) -> Option<T>

🔬This is a nightly-only experimental API. (try_trait_v2)
Constructs the type from its Output type. Read more
source§

fn branch(\n self\n) -> ControlFlow<<Option<T> as Try>::Residual, <Option<T> as Try>::Output>

🔬This is a nightly-only experimental API. (try_trait_v2)
Used in ? to decide whether the operator should produce a value\n(because this returned ControlFlow::Continue)\nor propagate a value back to the caller\n(because this returned ControlFlow::Break). Read more
","Try","local_vm::local_vm::Returned"],["
1.0.0 · source§

impl<A, V> FromIterator<Option<A>> for Option<V>where\n V: FromIterator<A>,

source§

fn from_iter<I>(iter: I) -> Option<V>where\n I: IntoIterator<Item = Option<A>>,

Takes each element in the Iterator: if it is None,\nno further elements are taken, and the None is\nreturned. Should no None occur, a container of type\nV containing the values of each Option is returned.

\n
Examples
\n

Here is an example which increments every integer in a vector.\nWe use the checked variant of add that returns None when the\ncalculation would result in an overflow.

\n\n
let items = vec![0_u16, 1, 2];\n\nlet res: Option<Vec<u16>> = items\n    .iter()\n    .map(|x| x.checked_add(1))\n    .collect();\n\nassert_eq!(res, Some(vec![1, 2, 3]));
\n

As you can see, this will return the expected, valid items.

\n

Here is another example that tries to subtract one from another list\nof integers, this time checking for underflow:

\n\n
let items = vec![2_u16, 1, 0];\n\nlet res: Option<Vec<u16>> = items\n    .iter()\n    .map(|x| x.checked_sub(1))\n    .collect();\n\nassert_eq!(res, None);
\n

Since the last element is zero, it would underflow. Thus, the resulting\nvalue is None.

\n

Here is a variation on the previous example, showing that no\nfurther elements are taken from iter after the first None.

\n\n
let items = vec![3_u16, 2, 1, 10];\n\nlet mut shared = 0;\n\nlet res: Option<Vec<u16>> = items\n    .iter()\n    .map(|x| { shared += x; x.checked_sub(2) })\n    .collect();\n\nassert_eq!(res, None);\nassert_eq!(shared, 6);
\n

Since the third element caused an underflow, no further elements were taken,\nso the final value of shared is 6 (= 3 + 2 + 1), not 16.

\n
","FromIterator>","local_vm::local_vm::Returned"],["
1.0.0 · source§

impl<T> StructuralEq for Option<T>

","StructuralEq","local_vm::local_vm::Returned"],["
1.0.0 · source§

impl<T> Eq for Option<T>where\n T: Eq,

","Eq","local_vm::local_vm::Returned"],["
1.0.0 · source§

impl<T> Ord for Option<T>where\n T: Ord,

source§

fn cmp(&self, other: &Option<T>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Selfwhere\n Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Selfwhere\n Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Selfwhere\n Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
","Ord","local_vm::local_vm::Returned"],["
1.0.0 · source§

impl<T> PartialEq for Option<T>where\n T: PartialEq,

source§

fn eq(&self, other: &Option<T>) -> bool

This method tests for self and other values to be equal, and is used\nby ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
","PartialEq","local_vm::local_vm::Returned"],["
1.0.0 · source§

impl<T> Clone for Option<T>where\n T: Clone,

source§

fn clone(&self) -> Option<T>

Returns a copy of the value. Read more
source§

fn clone_from(&mut self, source: &Option<T>)

Performs copy-assignment from source. Read more
","Clone","local_vm::local_vm::Returned"],["
1.0.0 · source§

impl<T> Hash for Option<T>where\n T: Hash,

source§

fn hash<__H>(&self, state: &mut __H)where\n __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where\n H: Hasher,\n Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
","Hash","local_vm::local_vm::Returned"],["
1.0.0 · source§

impl<T> IntoIterator for Option<T>

source§

fn into_iter(self) -> IntoIter<T>

Returns a consuming iterator over the possibly contained value.

\n
Examples
\n
let x = Some("string");\nlet v: Vec<&str> = x.into_iter().collect();\nassert_eq!(v, ["string"]);\n\nlet x = None;\nlet v: Vec<&str> = x.into_iter().collect();\nassert!(v.is_empty());
\n
§

type Item = T

The type of the elements being iterated over.
§

type IntoIter = IntoIter<T>

Which kind of iterator are we turning this into?
","IntoIterator","local_vm::local_vm::Returned"],["
1.0.0 · source§

impl<T> StructuralPartialEq for Option<T>

","StructuralPartialEq","local_vm::local_vm::Returned"],["
1.37.0 · source§

impl<T, U> Sum<Option<U>> for Option<T>where\n T: Sum<U>,

source§

fn sum<I>(iter: I) -> Option<T>where\n I: Iterator<Item = Option<U>>,

Takes each element in the Iterator: if it is a None, no further\nelements are taken, and the None is returned. Should no None\noccur, the sum of all elements is returned.

\n
Examples
\n

This sums up the position of the character ‘a’ in a vector of strings,\nif a word did not have the character ‘a’ the operation returns None:

\n\n
let words = vec!["have", "a", "great", "day"];\nlet total: Option<usize> = words.iter().map(|w| w.find('a')).sum();\nassert_eq!(total, Some(5));\nlet words = vec!["have", "a", "good", "day"];\nlet total: Option<usize> = words.iter().map(|w| w.find('a')).sum();\nassert_eq!(total, None);
\n
","Sum>","local_vm::local_vm::Returned"],["
1.0.0 · source§

impl<T> Debug for Option<T>where\n T: Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
","Debug","local_vm::local_vm::Returned"],["
1.0.0 · source§

impl<T> PartialOrd for Option<T>where\n T: PartialOrd,

source§

fn partial_cmp(&self, other: &Option<T>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <=\noperator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >=\noperator. Read more
","PartialOrd","local_vm::local_vm::Returned"],["
1.12.0 · source§

impl<T> From<T> for Option<T>

source§

fn from(val: T) -> Option<T>

Moves val into a new Some.

\n
Examples
\n
let o: Option<u8> = Option::from(67);\n\nassert_eq!(Some(67), o);
\n
","From","local_vm::local_vm::Returned"],["
1.0.0 · source§

impl<T> Copy for Option<T>where\n T: Copy,

","Copy","local_vm::local_vm::Returned"],["
1.0.0 · source§

impl<T> Default for Option<T>

source§

fn default() -> Option<T>

Returns None.

\n
Examples
\n
let opt: Option<u32> = Option::default();\nassert!(opt.is_none());
\n
","Default","local_vm::local_vm::Returned"],["
1.37.0 · source§

impl<T, U> Product<Option<U>> for Option<T>where\n T: Product<U>,

source§

fn product<I>(iter: I) -> Option<T>where\n I: Iterator<Item = Option<U>>,

Takes each element in the Iterator: if it is a None, no further\nelements are taken, and the None is returned. Should no None\noccur, the product of all elements is returned.

\n
Examples
\n

This multiplies each number in a vector of strings,\nif a string could not be parsed the operation returns None:

\n\n
let nums = vec!["5", "10", "1", "2"];\nlet total: Option<usize> = nums.iter().map(|w| w.parse::<usize>().ok()).product();\nassert_eq!(total, Some(100));\nlet nums = vec!["5", "10", "one", "2"];\nlet total: Option<usize> = nums.iter().map(|w| w.parse::<usize>().ok()).product();\nassert_eq!(total, None);
\n
","Product>","local_vm::local_vm::Returned"],["
§

impl<T> Value for Option<T>where\n T: Value,

§

fn record(&self, key: &Field, visitor: &mut dyn Visit)

Visits this value with the given Visitor.
","Value","local_vm::local_vm::Returned"],["
source§

impl<T> Serialize for Option<T>where\n T: Serialize,

source§

fn serialize<S>(\n &self,\n serializer: S\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,

Serialize this value into the given Serde serializer. Read more
","Serialize","local_vm::local_vm::Returned"],["
source§

impl<'de, T> Deserialize<'de> for Option<T>where\n T: Deserialize<'de>,

source§

fn deserialize<D>(\n deserializer: D\n) -> Result<Option<T>, <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
","Deserialize<'de>","local_vm::local_vm::Returned"],["
§

impl<'a, T> Parse<'a> for Option<T>where\n T: Peek + Parse<'a>,

§

fn parse(parser: Parser<'a>) -> Result<Option<T>, Error>

Attempts to parse Self from parser, returning an error if it could\nnot be parsed. Read more
","Parse<'a>","local_vm::local_vm::Returned"],["
source§

impl<T> Serialize for Option<T>where\n T: Serialize,

source§

fn serialize<S>(\n &self,\n serializer: S\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,

","Serialize","local_vm::local_vm::Returned"],["
source§

impl<'de, T> Deserialize<'de> for Option<T>where\n T: Deserialize<'de>,

source§

fn deserialize<D>(\n deserializer: D\n) -> Result<Option<T>, <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,

","Deserialize<'de>","local_vm::local_vm::Returned"],["
source§

impl<T> From<CtOption<T>> for Option<T>

source§

fn from(source: CtOption<T>) -> Option<T>

Convert the CtOption<T> wrapper into an Option<T>, depending on whether\nthe underlying is_some Choice was a 0 or a 1 once unwrapped.

\n
Note
\n

This function exists to avoid ending up with ugly, verbose and/or bad handled\nconversions from the CtOption<T> wraps to an Option<T> or Result<T, E>.\nThis implementation doesn’t intend to be constant-time nor try to protect the\nleakage of the T since the Option<T> will do it anyways.

\n
","From>","local_vm::local_vm::Returned"],["
§

impl<Z> ZeroizeOnDrop for Option<Z>where\n Z: ZeroizeOnDrop,

","ZeroizeOnDrop","local_vm::local_vm::Returned"],["
§

impl<Z> Zeroize for Option<Z>where\n Z: Zeroize,

§

fn zeroize(&mut self)

Zero out this object from memory using Rust intrinsics which ensure the\nzeroization operation is not “optimized away” by the compiler.
","Zeroize","local_vm::local_vm::Returned"],["
§

impl<'a, T> DerDecodable<'a> for Option<T>where\n T: DerDecodable<'a>,

§

fn load(object: DerObject<'a>) -> Result<Option<T>, Asn1DerError>

Loads object as Self
§

fn decode(raw: &'a [u8]) -> Result<Self, Asn1DerError>

Decodes an object as Self
§

fn decode_at(raw: &'a [u8], header_start: usize) -> Result<Self, Asn1DerError>

Decodes an object as Self
§

fn decode_from_source<A, B>(\n source: &mut A,\n sink: B\n) -> Result<Self, Asn1DerError>where\n A: Source,\n B: Sink + Into<&'a [u8]>,

Reads an object from source by parsing the length field and copying the necessary bytes\ninto sink and decoding it from sink
","DerDecodable<'a>","local_vm::local_vm::Returned"],["
§

impl<T> DerEncodable for Option<T>where\n T: DerEncodable,

§

fn encode<S>(&self, sink: &mut S) -> Result<(), Asn1DerError>where\n S: Sink,

Encodes self into sink
§

fn der_object<'a, S>(&self, sink: S) -> Result<DerObject<'a>, Asn1DerError>where\n S: Sink + Into<&'a [u8]>,

Creates an DER object from an encodable type
","DerEncodable","local_vm::local_vm::Returned"],["
source§

impl<T> ContextCompat<T> for Option<T>

source§

fn wrap_err<D>(self, msg: D) -> Result<T, Report>where\n D: Display + Send + Sync + 'static,

Compatibility re-export of context for porting from anyhow to eyre
source§

fn wrap_err_with<D, F>(self, msg: F) -> Result<T, Report>where\n D: Display + Send + Sync + 'static,\n F: FnOnce() -> D,

Compatibility re-export of with_context for porting from anyhow to eyre
source§

fn context<D>(self, msg: D) -> Result<T, Report>where\n D: Display + Send + Sync + 'static,

Compatibility version of wrap_err for creating new errors with new source on Option\nwhen porting from anyhow
source§

fn with_context<D, F>(self, msg: F) -> Result<T, Report>where\n D: Display + Send + Sync + 'static,\n F: FnOnce() -> D,

Compatibility version of wrap_err_with for creating new errors with new source on Option\nwhen porting from anyhow
","ContextCompat","local_vm::local_vm::Returned"],["
source§

impl<T> OptionExt<T> for Option<T>

source§

fn ok_or_eyre<M>(self, message: M) -> Result<T, Report>where\n M: Debug + Display + Send + Sync + 'static,

Transform the Option<T> into a Result<T, E>,\nmapping Some(v) to Ok(v)\nand None to Report. Read more
","OptionExt","local_vm::local_vm::Returned"],["
source§

impl<T> Context<T, Infallible> for Option<T>

\n
use anyhow::{Context, Result};\n\nfn maybe_get() -> Option<T> {\n    ...\n}\n\nfn demo() -> Result<()> {\n    let t = maybe_get().context("there is no T")?;\n    ...\n}
\n
source§

fn context<C>(self, context: C) -> Result<T, Error>where\n C: Display + Send + Sync + 'static,

Wrap the error value with additional context.
source§

fn with_context<C, F>(self, context: F) -> Result<T, Error>where\n C: Display + Send + Sync + 'static,\n F: FnOnce() -> C,

Wrap the error value with additional context that is evaluated lazily\nonly once an error does occur.
","Context","local_vm::local_vm::Returned"],["
source§

impl<'de, T, U> DeserializeAs<'de, Option<T>> for Option<U>where\n U: DeserializeAs<'de, T>,

source§

fn deserialize_as<D>(\n deserializer: D\n) -> Result<Option<T>, <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer.
","DeserializeAs<'de, Option>","local_vm::local_vm::Returned"],["
source§

impl<T, U> SerializeAs<Option<T>> for Option<U>where\n U: SerializeAs<T>,

source§

fn serialize_as<S>(\n source: &Option<T>,\n serializer: S\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,

Serialize this value into the given Serde serializer.
","SerializeAs>","local_vm::local_vm::Returned"],["
§

impl<T> Encode for Option<T>where\n T: Encode,

§

fn encode(&self, sink: &mut Vec<u8>)

Encode the type into the given byte sink.
","Encode","local_vm::local_vm::Returned"],["
§

impl<T> Lower for Option<T>where\n T: Lower,

","Lower","local_vm::local_vm::Returned"],["
§

impl<T> ComponentType for Option<T>where\n T: ComponentType,

","ComponentType","local_vm::local_vm::Returned"],["
§

impl<T> Lift for Option<T>where\n T: Lift,

","Lift","local_vm::local_vm::Returned"],["
§

impl<T> Encode for Option<T>where\n T: Encode,

§

fn encode(&self, sink: &mut Vec<u8>)

Encode the type into the given byte sink.
","Encode","local_vm::local_vm::Returned"],["
§

impl<C, T> FromParallelIterator<Option<T>> for Option<C>where\n C: FromParallelIterator<T>,\n T: Send,

Collect an arbitrary Option-wrapped collection.

\n

If any item is None, then all previous items collected are discarded,\nand it returns only None.

\n
§

fn from_par_iter<I>(par_iter: I) -> Option<C>where\n I: IntoParallelIterator<Item = Option<T>>,

Creates an instance of the collection from the parallel iterator par_iter. Read more
","FromParallelIterator>","local_vm::local_vm::Returned"],["
§

impl<T> IntoParallelIterator for Option<T>where\n T: Send,

§

type Item = T

The type of item that the parallel iterator will produce.
§

type Iter = IntoIter<T>

The parallel iterator type that will be created.
§

fn into_par_iter(self) -> <Option<T> as IntoParallelIterator>::Iter

Converts self into a parallel iterator. Read more
","IntoParallelIterator","local_vm::local_vm::Returned"],["
§

impl<'a, A> Arbitrary<'a> for Option<A>where\n A: Arbitrary<'a>,

§

fn arbitrary(u: &mut Unstructured<'a>) -> Result<Option<A>, Error>

Generate an arbitrary value of Self from the given unstructured data. Read more
§

fn size_hint(depth: usize) -> (usize, Option<usize>)

Get a size hint for how many bytes out of an Unstructured this type\nneeds to construct itself. Read more
§

fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>

Generate an arbitrary value of Self from the entirety of the given\nunstructured data. Read more
","Arbitrary<'a>","local_vm::local_vm::Returned"],["
§

impl<'a, T> Parse<'a> for Option<T>where\n T: Peek + Parse<'a>,

§

fn parse(parser: Parser<'a>) -> Result<Option<T>, Error>

Attempts to parse Self from parser, returning an error if it could\nnot be parsed. Read more
","Parse<'a>","local_vm::local_vm::Returned"],["
§

impl<T> Encode for Option<T>where\n T: Encode,

§

fn encode(&self, sink: &mut Vec<u8>)

Encode the type into the given byte sink.
","Encode","local_vm::local_vm::Returned"],["
§

impl<T> EncodeLabelValue for Option<T>where\n T: EncodeLabelValue,

§

fn encode(&self, encoder: &mut LabelValueEncoder<'_>) -> Result<(), Error>

Encode oneself into the given encoder.
","EncodeLabelValue","local_vm::local_vm::Returned"],["
§

impl<T> Encode<DagCborCodec> for Option<T>where\n T: Encode<DagCborCodec>,

§

fn encode<W>(&self, c: DagCborCodec, w: &mut W) -> Result<(), Error>where\n W: Write,

Encodes into a impl Write. Read more
","Encode","local_vm::local_vm::Returned"],["
§

impl<T> Decode<DagCborCodec> for Option<T>where\n T: Decode<DagCborCodec>,

§

fn decode<R>(c: DagCborCodec, r: &mut R) -> Result<Option<T>, Error>where\n R: Read + Seek,

Decode from an impl Read. Read more
","Decode","local_vm::local_vm::Returned"],["
source§

impl<T, U> SerializeAs<Option<T>> for Option<U>where\n U: SerializeAs<T>,

source§

fn serialize_as<S>(\n source: &Option<T>,\n serializer: S\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,

Serialize this value into the given Serde serializer.
","SerializeAs>","local_vm::local_vm::Returned"],["
source§

impl<'de, T, U> DeserializeAs<'de, Option<T>> for Option<U>where\n U: DeserializeAs<'de, T>,

source§

fn deserialize_as<D>(\n deserializer: D\n) -> Result<Option<T>, <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer.
","DeserializeAs<'de, Option>","local_vm::local_vm::Returned"]] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/type.impl/futures_core/future/type.BoxFuture.js b/type.impl/futures_core/future/type.BoxFuture.js new file mode 100644 index 0000000000..b2b396e91d --- /dev/null +++ b/type.impl/futures_core/future/type.BoxFuture.js @@ -0,0 +1,3 @@ +(function() {var type_impls = { +"particle_execution":[] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/type.impl/std/collections/hash/map/struct.HashMap.js b/type.impl/std/collections/hash/map/struct.HashMap.js new file mode 100644 index 0000000000..f716658c6b --- /dev/null +++ b/type.impl/std/collections/hash/map/struct.HashMap.js @@ -0,0 +1,3 @@ +(function() {var type_impls = { +"core_distributor":[["
source§

impl<K, V, S> HashMap<K, V, S>

1.7.0 (const: unstable) · source

pub fn with_hasher(hash_builder: S) -> HashMap<K, V, S>

Creates an empty HashMap which will use the given hash builder to hash\nkeys.

\n

The created map has the default initial capacity.

\n

Warning: hash_builder is normally randomly generated, and\nis designed to allow HashMaps to be resistant to attacks that\ncause many collisions and very poor performance. Setting it\nmanually using this function can expose a DoS attack vector.

\n

The hash_builder passed should implement the BuildHasher trait for\nthe HashMap to be useful, see its documentation for details.

\n
Examples
\n
use std::collections::HashMap;\nuse std::collections::hash_map::RandomState;\n\nlet s = RandomState::new();\nlet mut map = HashMap::with_hasher(s);\nmap.insert(1, 2);
\n
1.7.0 · source

pub fn with_capacity_and_hasher(capacity: usize, hasher: S) -> HashMap<K, V, S>

Creates an empty HashMap with at least the specified capacity, using\nhasher to hash the keys.

\n

The hash map will be able to hold at least capacity elements without\nreallocating. This method is allowed to allocate for more elements than\ncapacity. If capacity is 0, the hash map will not allocate.

\n

Warning: hasher is normally randomly generated, and\nis designed to allow HashMaps to be resistant to attacks that\ncause many collisions and very poor performance. Setting it\nmanually using this function can expose a DoS attack vector.

\n

The hasher passed should implement the BuildHasher trait for\nthe HashMap to be useful, see its documentation for details.

\n
Examples
\n
use std::collections::HashMap;\nuse std::collections::hash_map::RandomState;\n\nlet s = RandomState::new();\nlet mut map = HashMap::with_capacity_and_hasher(10, s);\nmap.insert(1, 2);
\n
1.0.0 · source

pub fn capacity(&self) -> usize

Returns the number of elements the map can hold without reallocating.

\n

This number is a lower bound; the HashMap<K, V> might be able to hold\nmore, but is guaranteed to be able to hold at least this many.

\n
Examples
\n
use std::collections::HashMap;\nlet map: HashMap<i32, i32> = HashMap::with_capacity(100);\nassert!(map.capacity() >= 100);
\n
1.0.0 · source

pub fn keys(&self) -> Keys<'_, K, V>

An iterator visiting all keys in arbitrary order.\nThe iterator element type is &'a K.

\n
Examples
\n
use std::collections::HashMap;\n\nlet map = HashMap::from([\n    ("a", 1),\n    ("b", 2),\n    ("c", 3),\n]);\n\nfor key in map.keys() {\n    println!("{key}");\n}
\n
Performance
\n

In the current implementation, iterating over keys takes O(capacity) time\ninstead of O(len) because it internally visits empty buckets too.

\n
1.54.0 · source

pub fn into_keys(self) -> IntoKeys<K, V>

Creates a consuming iterator visiting all the keys in arbitrary order.\nThe map cannot be used after calling this.\nThe iterator element type is K.

\n
Examples
\n
use std::collections::HashMap;\n\nlet map = HashMap::from([\n    ("a", 1),\n    ("b", 2),\n    ("c", 3),\n]);\n\nlet mut vec: Vec<&str> = map.into_keys().collect();\n// The `IntoKeys` iterator produces keys in arbitrary order, so the\n// keys must be sorted to test them against a sorted array.\nvec.sort_unstable();\nassert_eq!(vec, ["a", "b", "c"]);
\n
Performance
\n

In the current implementation, iterating over keys takes O(capacity) time\ninstead of O(len) because it internally visits empty buckets too.

\n
1.0.0 · source

pub fn values(&self) -> Values<'_, K, V>

An iterator visiting all values in arbitrary order.\nThe iterator element type is &'a V.

\n
Examples
\n
use std::collections::HashMap;\n\nlet map = HashMap::from([\n    ("a", 1),\n    ("b", 2),\n    ("c", 3),\n]);\n\nfor val in map.values() {\n    println!("{val}");\n}
\n
Performance
\n

In the current implementation, iterating over values takes O(capacity) time\ninstead of O(len) because it internally visits empty buckets too.

\n
1.10.0 · source

pub fn values_mut(&mut self) -> ValuesMut<'_, K, V>

An iterator visiting all values mutably in arbitrary order.\nThe iterator element type is &'a mut V.

\n
Examples
\n
use std::collections::HashMap;\n\nlet mut map = HashMap::from([\n    ("a", 1),\n    ("b", 2),\n    ("c", 3),\n]);\n\nfor val in map.values_mut() {\n    *val = *val + 10;\n}\n\nfor val in map.values() {\n    println!("{val}");\n}
\n
Performance
\n

In the current implementation, iterating over values takes O(capacity) time\ninstead of O(len) because it internally visits empty buckets too.

\n
1.54.0 · source

pub fn into_values(self) -> IntoValues<K, V>

Creates a consuming iterator visiting all the values in arbitrary order.\nThe map cannot be used after calling this.\nThe iterator element type is V.

\n
Examples
\n
use std::collections::HashMap;\n\nlet map = HashMap::from([\n    ("a", 1),\n    ("b", 2),\n    ("c", 3),\n]);\n\nlet mut vec: Vec<i32> = map.into_values().collect();\n// The `IntoValues` iterator produces values in arbitrary order, so\n// the values must be sorted to test them against a sorted array.\nvec.sort_unstable();\nassert_eq!(vec, [1, 2, 3]);
\n
Performance
\n

In the current implementation, iterating over values takes O(capacity) time\ninstead of O(len) because it internally visits empty buckets too.

\n
1.0.0 · source

pub fn iter(&self) -> Iter<'_, K, V>

An iterator visiting all key-value pairs in arbitrary order.\nThe iterator element type is (&'a K, &'a V).

\n
Examples
\n
use std::collections::HashMap;\n\nlet map = HashMap::from([\n    ("a", 1),\n    ("b", 2),\n    ("c", 3),\n]);\n\nfor (key, val) in map.iter() {\n    println!("key: {key} val: {val}");\n}
\n
Performance
\n

In the current implementation, iterating over map takes O(capacity) time\ninstead of O(len) because it internally visits empty buckets too.

\n
1.0.0 · source

pub fn iter_mut(&mut self) -> IterMut<'_, K, V>

An iterator visiting all key-value pairs in arbitrary order,\nwith mutable references to the values.\nThe iterator element type is (&'a K, &'a mut V).

\n
Examples
\n
use std::collections::HashMap;\n\nlet mut map = HashMap::from([\n    ("a", 1),\n    ("b", 2),\n    ("c", 3),\n]);\n\n// Update all values\nfor (_, val) in map.iter_mut() {\n    *val *= 2;\n}\n\nfor (key, val) in &map {\n    println!("key: {key} val: {val}");\n}
\n
Performance
\n

In the current implementation, iterating over map takes O(capacity) time\ninstead of O(len) because it internally visits empty buckets too.

\n
1.0.0 · source

pub fn len(&self) -> usize

Returns the number of elements in the map.

\n
Examples
\n
use std::collections::HashMap;\n\nlet mut a = HashMap::new();\nassert_eq!(a.len(), 0);\na.insert(1, "a");\nassert_eq!(a.len(), 1);
\n
1.0.0 · source

pub fn is_empty(&self) -> bool

Returns true if the map contains no elements.

\n
Examples
\n
use std::collections::HashMap;\n\nlet mut a = HashMap::new();\nassert!(a.is_empty());\na.insert(1, "a");\nassert!(!a.is_empty());
\n
1.6.0 · source

pub fn drain(&mut self) -> Drain<'_, K, V>

Clears the map, returning all key-value pairs as an iterator. Keeps the\nallocated memory for reuse.

\n

If the returned iterator is dropped before being fully consumed, it\ndrops the remaining key-value pairs. The returned iterator keeps a\nmutable borrow on the map to optimize its implementation.

\n
Examples
\n
use std::collections::HashMap;\n\nlet mut a = HashMap::new();\na.insert(1, "a");\na.insert(2, "b");\n\nfor (k, v) in a.drain().take(1) {\n    assert!(k == 1 || k == 2);\n    assert!(v == "a" || v == "b");\n}\n\nassert!(a.is_empty());
\n
source

pub fn extract_if<F>(&mut self, pred: F) -> ExtractIf<'_, K, V, F>where\n F: FnMut(&K, &mut V) -> bool,

🔬This is a nightly-only experimental API. (hash_extract_if)

Creates an iterator which uses a closure to determine if an element should be removed.

\n

If the closure returns true, the element is removed from the map and yielded.\nIf the closure returns false, or panics, the element remains in the map and will not be\nyielded.

\n

Note that extract_if lets you mutate every value in the filter closure, regardless of\nwhether you choose to keep or remove it.

\n

If the returned ExtractIf is not exhausted, e.g. because it is dropped without iterating\nor the iteration short-circuits, then the remaining elements will be retained.\nUse retain with a negated predicate if you do not need the returned iterator.

\n
Examples
\n

Splitting a map into even and odd keys, reusing the original map:

\n\n
#![feature(hash_extract_if)]\nuse std::collections::HashMap;\n\nlet mut map: HashMap<i32, i32> = (0..8).map(|x| (x, x)).collect();\nlet extracted: HashMap<i32, i32> = map.extract_if(|k, _v| k % 2 == 0).collect();\n\nlet mut evens = extracted.keys().copied().collect::<Vec<_>>();\nlet mut odds = map.keys().copied().collect::<Vec<_>>();\nevens.sort();\nodds.sort();\n\nassert_eq!(evens, vec![0, 2, 4, 6]);\nassert_eq!(odds, vec![1, 3, 5, 7]);
\n
1.18.0 · source

pub fn retain<F>(&mut self, f: F)where\n F: FnMut(&K, &mut V) -> bool,

Retains only the elements specified by the predicate.

\n

In other words, remove all pairs (k, v) for which f(&k, &mut v) returns false.\nThe elements are visited in unsorted (and unspecified) order.

\n
Examples
\n
use std::collections::HashMap;\n\nlet mut map: HashMap<i32, i32> = (0..8).map(|x| (x, x*10)).collect();\nmap.retain(|&k, _| k % 2 == 0);\nassert_eq!(map.len(), 4);
\n
Performance
\n

In the current implementation, this operation takes O(capacity) time\ninstead of O(len) because it internally visits empty buckets too.

\n
1.0.0 · source

pub fn clear(&mut self)

Clears the map, removing all key-value pairs. Keeps the allocated memory\nfor reuse.

\n
Examples
\n
use std::collections::HashMap;\n\nlet mut a = HashMap::new();\na.insert(1, "a");\na.clear();\nassert!(a.is_empty());
\n
1.9.0 · source

pub fn hasher(&self) -> &S

Returns a reference to the map’s BuildHasher.

\n
Examples
\n
use std::collections::HashMap;\nuse std::collections::hash_map::RandomState;\n\nlet hasher = RandomState::new();\nlet map: HashMap<i32, i32> = HashMap::with_hasher(hasher);\nlet hasher: &RandomState = map.hasher();
\n
",0,"core_distributor::Map"],["
source§

impl<K, V, S> HashMap<K, V, S>where\n K: Eq + Hash,\n S: BuildHasher,

1.0.0 · source

pub fn reserve(&mut self, additional: usize)

Reserves capacity for at least additional more elements to be inserted\nin the HashMap. The collection may reserve more space to speculatively\navoid frequent reallocations. After calling reserve,\ncapacity will be greater than or equal to self.len() + additional.\nDoes nothing if capacity is already sufficient.

\n
Panics
\n

Panics if the new allocation size overflows usize.

\n
Examples
\n
use std::collections::HashMap;\nlet mut map: HashMap<&str, i32> = HashMap::new();\nmap.reserve(10);
\n
1.57.0 · source

pub fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError>

Tries to reserve capacity for at least additional more elements to be inserted\nin the HashMap. The collection may reserve more space to speculatively\navoid frequent reallocations. After calling try_reserve,\ncapacity will be greater than or equal to self.len() + additional if\nit returns Ok(()).\nDoes nothing if capacity is already sufficient.

\n
Errors
\n

If the capacity overflows, or the allocator reports a failure, then an error\nis returned.

\n
Examples
\n
use std::collections::HashMap;\n\nlet mut map: HashMap<&str, isize> = HashMap::new();\nmap.try_reserve(10).expect("why is the test harness OOMing on a handful of bytes?");
\n
1.0.0 · source

pub fn shrink_to_fit(&mut self)

Shrinks the capacity of the map as much as possible. It will drop\ndown as much as possible while maintaining the internal rules\nand possibly leaving some space in accordance with the resize policy.

\n
Examples
\n
use std::collections::HashMap;\n\nlet mut map: HashMap<i32, i32> = HashMap::with_capacity(100);\nmap.insert(1, 2);\nmap.insert(3, 4);\nassert!(map.capacity() >= 100);\nmap.shrink_to_fit();\nassert!(map.capacity() >= 2);
\n
1.56.0 · source

pub fn shrink_to(&mut self, min_capacity: usize)

Shrinks the capacity of the map with a lower limit. It will drop\ndown no lower than the supplied limit while maintaining the internal rules\nand possibly leaving some space in accordance with the resize policy.

\n

If the current capacity is less than the lower limit, this is a no-op.

\n
Examples
\n
use std::collections::HashMap;\n\nlet mut map: HashMap<i32, i32> = HashMap::with_capacity(100);\nmap.insert(1, 2);\nmap.insert(3, 4);\nassert!(map.capacity() >= 100);\nmap.shrink_to(10);\nassert!(map.capacity() >= 10);\nmap.shrink_to(0);\nassert!(map.capacity() >= 2);
\n
1.0.0 · source

pub fn entry(&mut self, key: K) -> Entry<'_, K, V>

Gets the given key’s corresponding entry in the map for in-place manipulation.

\n
Examples
\n
use std::collections::HashMap;\n\nlet mut letters = HashMap::new();\n\nfor ch in "a short treatise on fungi".chars() {\n    letters.entry(ch).and_modify(|counter| *counter += 1).or_insert(1);\n}\n\nassert_eq!(letters[&'s'], 2);\nassert_eq!(letters[&'t'], 3);\nassert_eq!(letters[&'u'], 1);\nassert_eq!(letters.get(&'y'), None);
\n
1.0.0 · source

pub fn get<Q>(&self, k: &Q) -> Option<&V>where\n K: Borrow<Q>,\n Q: Hash + Eq + ?Sized,

Returns a reference to the value corresponding to the key.

\n

The key may be any borrowed form of the map’s key type, but\nHash and Eq on the borrowed form must match those for\nthe key type.

\n
Examples
\n
use std::collections::HashMap;\n\nlet mut map = HashMap::new();\nmap.insert(1, "a");\nassert_eq!(map.get(&1), Some(&"a"));\nassert_eq!(map.get(&2), None);
\n
1.40.0 · source

pub fn get_key_value<Q>(&self, k: &Q) -> Option<(&K, &V)>where\n K: Borrow<Q>,\n Q: Hash + Eq + ?Sized,

Returns the key-value pair corresponding to the supplied key.

\n

The supplied key may be any borrowed form of the map’s key type, but\nHash and Eq on the borrowed form must match those for\nthe key type.

\n
Examples
\n
use std::collections::HashMap;\n\nlet mut map = HashMap::new();\nmap.insert(1, "a");\nassert_eq!(map.get_key_value(&1), Some((&1, &"a")));\nassert_eq!(map.get_key_value(&2), None);
\n
source

pub fn get_many_mut<Q, const N: usize>(\n &mut self,\n ks: [&Q; N]\n) -> Option<[&mut V; N]>where\n K: Borrow<Q>,\n Q: Hash + Eq + ?Sized,

🔬This is a nightly-only experimental API. (map_many_mut)

Attempts to get mutable references to N values in the map at once.

\n

Returns an array of length N with the results of each query. For soundness, at most one\nmutable reference will be returned to any value. None will be returned if any of the\nkeys are duplicates or missing.

\n
Examples
\n
#![feature(map_many_mut)]\nuse std::collections::HashMap;\n\nlet mut libraries = HashMap::new();\nlibraries.insert("Bodleian Library".to_string(), 1602);\nlibraries.insert("Athenæum".to_string(), 1807);\nlibraries.insert("Herzogin-Anna-Amalia-Bibliothek".to_string(), 1691);\nlibraries.insert("Library of Congress".to_string(), 1800);\n\nlet got = libraries.get_many_mut([\n    "Athenæum",\n    "Library of Congress",\n]);\nassert_eq!(\n    got,\n    Some([\n        &mut 1807,\n        &mut 1800,\n    ]),\n);\n\n// Missing keys result in None\nlet got = libraries.get_many_mut([\n    "Athenæum",\n    "New York Public Library",\n]);\nassert_eq!(got, None);\n\n// Duplicate keys result in None\nlet got = libraries.get_many_mut([\n    "Athenæum",\n    "Athenæum",\n]);\nassert_eq!(got, None);
\n
source

pub unsafe fn get_many_unchecked_mut<Q, const N: usize>(\n &mut self,\n ks: [&Q; N]\n) -> Option<[&mut V; N]>where\n K: Borrow<Q>,\n Q: Hash + Eq + ?Sized,

🔬This is a nightly-only experimental API. (map_many_mut)

Attempts to get mutable references to N values in the map at once, without validating that\nthe values are unique.

\n

Returns an array of length N with the results of each query. None will be returned if\nany of the keys are missing.

\n

For a safe alternative see get_many_mut.

\n
Safety
\n

Calling this method with overlapping keys is undefined behavior even if the resulting\nreferences are not used.

\n
Examples
\n
#![feature(map_many_mut)]\nuse std::collections::HashMap;\n\nlet mut libraries = HashMap::new();\nlibraries.insert("Bodleian Library".to_string(), 1602);\nlibraries.insert("Athenæum".to_string(), 1807);\nlibraries.insert("Herzogin-Anna-Amalia-Bibliothek".to_string(), 1691);\nlibraries.insert("Library of Congress".to_string(), 1800);\n\nlet got = libraries.get_many_mut([\n    "Athenæum",\n    "Library of Congress",\n]);\nassert_eq!(\n    got,\n    Some([\n        &mut 1807,\n        &mut 1800,\n    ]),\n);\n\n// Missing keys result in None\nlet got = libraries.get_many_mut([\n    "Athenæum",\n    "New York Public Library",\n]);\nassert_eq!(got, None);
\n
1.0.0 · source

pub fn contains_key<Q>(&self, k: &Q) -> boolwhere\n K: Borrow<Q>,\n Q: Hash + Eq + ?Sized,

Returns true if the map contains a value for the specified key.

\n

The key may be any borrowed form of the map’s key type, but\nHash and Eq on the borrowed form must match those for\nthe key type.

\n
Examples
\n
use std::collections::HashMap;\n\nlet mut map = HashMap::new();\nmap.insert(1, "a");\nassert_eq!(map.contains_key(&1), true);\nassert_eq!(map.contains_key(&2), false);
\n
1.0.0 · source

pub fn get_mut<Q>(&mut self, k: &Q) -> Option<&mut V>where\n K: Borrow<Q>,\n Q: Hash + Eq + ?Sized,

Returns a mutable reference to the value corresponding to the key.

\n

The key may be any borrowed form of the map’s key type, but\nHash and Eq on the borrowed form must match those for\nthe key type.

\n
Examples
\n
use std::collections::HashMap;\n\nlet mut map = HashMap::new();\nmap.insert(1, "a");\nif let Some(x) = map.get_mut(&1) {\n    *x = "b";\n}\nassert_eq!(map[&1], "b");
\n
1.0.0 · source

pub fn insert(&mut self, k: K, v: V) -> Option<V>

Inserts a key-value pair into the map.

\n

If the map did not have this key present, None is returned.

\n

If the map did have this key present, the value is updated, and the old\nvalue is returned. The key is not updated, though; this matters for\ntypes that can be == without being identical. See the module-level\ndocumentation for more.

\n
Examples
\n
use std::collections::HashMap;\n\nlet mut map = HashMap::new();\nassert_eq!(map.insert(37, "a"), None);\nassert_eq!(map.is_empty(), false);\n\nmap.insert(37, "b");\nassert_eq!(map.insert(37, "c"), Some("b"));\nassert_eq!(map[&37], "c");
\n
source

pub fn try_insert(\n &mut self,\n key: K,\n value: V\n) -> Result<&mut V, OccupiedError<'_, K, V>>

🔬This is a nightly-only experimental API. (map_try_insert)

Tries to insert a key-value pair into the map, and returns\na mutable reference to the value in the entry.

\n

If the map already had this key present, nothing is updated, and\nan error containing the occupied entry and the value is returned.

\n
Examples
\n

Basic usage:

\n\n
#![feature(map_try_insert)]\n\nuse std::collections::HashMap;\n\nlet mut map = HashMap::new();\nassert_eq!(map.try_insert(37, "a").unwrap(), &"a");\n\nlet err = map.try_insert(37, "b").unwrap_err();\nassert_eq!(err.entry.key(), &37);\nassert_eq!(err.entry.get(), &"a");\nassert_eq!(err.value, "b");
\n
1.0.0 · source

pub fn remove<Q>(&mut self, k: &Q) -> Option<V>where\n K: Borrow<Q>,\n Q: Hash + Eq + ?Sized,

Removes a key from the map, returning the value at the key if the key\nwas previously in the map.

\n

The key may be any borrowed form of the map’s key type, but\nHash and Eq on the borrowed form must match those for\nthe key type.

\n
Examples
\n
use std::collections::HashMap;\n\nlet mut map = HashMap::new();\nmap.insert(1, "a");\nassert_eq!(map.remove(&1), Some("a"));\nassert_eq!(map.remove(&1), None);
\n
1.27.0 · source

pub fn remove_entry<Q>(&mut self, k: &Q) -> Option<(K, V)>where\n K: Borrow<Q>,\n Q: Hash + Eq + ?Sized,

Removes a key from the map, returning the stored key and value if the\nkey was previously in the map.

\n

The key may be any borrowed form of the map’s key type, but\nHash and Eq on the borrowed form must match those for\nthe key type.

\n
Examples
\n
use std::collections::HashMap;\n\nlet mut map = HashMap::new();\nmap.insert(1, "a");\nassert_eq!(map.remove_entry(&1), Some((1, "a")));\nassert_eq!(map.remove(&1), None);
\n
",0,"core_distributor::Map"],["
source§

impl<K, V, S> HashMap<K, V, S>where\n S: BuildHasher,

source

pub fn raw_entry_mut(&mut self) -> RawEntryBuilderMut<'_, K, V, S>

🔬This is a nightly-only experimental API. (hash_raw_entry)

Creates a raw entry builder for the HashMap.

\n

Raw entries provide the lowest level of control for searching and\nmanipulating a map. They must be manually initialized with a hash and\nthen manually searched. After this, insertions into a vacant entry\nstill require an owned key to be provided.

\n

Raw entries are useful for such exotic situations as:

\n
    \n
  • Hash memoization
  • \n
  • Deferring the creation of an owned key until it is known to be required
  • \n
  • Using a search key that doesn’t work with the Borrow trait
  • \n
  • Using custom comparison logic without newtype wrappers
  • \n
\n

Because raw entries provide much more low-level control, it’s much easier\nto put the HashMap into an inconsistent state which, while memory-safe,\nwill cause the map to produce seemingly random results. Higher-level and\nmore foolproof APIs like entry should be preferred when possible.

\n

In particular, the hash used to initialized the raw entry must still be\nconsistent with the hash of the key that is ultimately stored in the entry.\nThis is because implementations of HashMap may need to recompute hashes\nwhen resizing, at which point only the keys are available.

\n

Raw entries give mutable access to the keys. This must not be used\nto modify how the key would compare or hash, as the map will not re-evaluate\nwhere the key should go, meaning the keys may become “lost” if their\nlocation does not reflect their state. For instance, if you change a key\nso that the map now contains keys which compare equal, search may start\nacting erratically, with two keys randomly masking each other. Implementations\nare free to assume this doesn’t happen (within the limits of memory-safety).

\n
source

pub fn raw_entry(&self) -> RawEntryBuilder<'_, K, V, S>

🔬This is a nightly-only experimental API. (hash_raw_entry)

Creates a raw immutable entry builder for the HashMap.

\n

Raw entries provide the lowest level of control for searching and\nmanipulating a map. They must be manually initialized with a hash and\nthen manually searched.

\n

This is useful for

\n
    \n
  • Hash memoization
  • \n
  • Using a search key that doesn’t work with the Borrow trait
  • \n
  • Using custom comparison logic without newtype wrappers
  • \n
\n

Unless you are in such a situation, higher-level and more foolproof APIs like\nget should be preferred.

\n

Immutable raw entries have very limited use; you might instead want raw_entry_mut.

\n
",0,"core_distributor::Map"],["
1.0.0 · source§

impl<K, Q, V, S> Index<&Q> for HashMap<K, V, S>where\n K: Eq + Hash + Borrow<Q>,\n Q: Eq + Hash + ?Sized,\n S: BuildHasher,

source§

fn index(&self, key: &Q) -> &V

Returns a reference to the value corresponding to the supplied key.

\n
Panics
\n

Panics if the key is not present in the HashMap.

\n
§

type Output = V

The returned type after indexing.
","Index<&Q>","core_distributor::Map"],["
1.4.0 · source§

impl<'a, K, V, S> Extend<(&'a K, &'a V)> for HashMap<K, V, S>where\n K: Eq + Hash + Copy,\n V: Copy,\n S: BuildHasher,

source§

fn extend<T>(&mut self, iter: T)where\n T: IntoIterator<Item = (&'a K, &'a V)>,

Extends a collection with the contents of an iterator. Read more
source§

fn extend_one(&mut self, _: (&'a K, &'a V))

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
","Extend<(&'a K, &'a V)>","core_distributor::Map"],["
1.0.0 · source§

impl<K, V, S> Extend<(K, V)> for HashMap<K, V, S>where\n K: Eq + Hash,\n S: BuildHasher,

Inserts all new key-values from the iterator and replaces values with existing\nkeys with new values returned from the iterator.

\n
source§

fn extend<T>(&mut self, iter: T)where\n T: IntoIterator<Item = (K, V)>,

Extends a collection with the contents of an iterator. Read more
source§

fn extend_one(&mut self, _: (K, V))

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
","Extend<(K, V)>","core_distributor::Map"],["
1.0.0 · source§

impl<K, V, S> PartialEq for HashMap<K, V, S>where\n K: Eq + Hash,\n V: PartialEq,\n S: BuildHasher,

source§

fn eq(&self, other: &HashMap<K, V, S>) -> bool

This method tests for self and other values to be equal, and is used\nby ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
","PartialEq","core_distributor::Map"],["
1.0.0 · source§

impl<K, V, S> Default for HashMap<K, V, S>where\n S: Default,

source§

fn default() -> HashMap<K, V, S>

Creates an empty HashMap<K, V, S>, with the Default value for the hasher.

\n
","Default","core_distributor::Map"],["
1.0.0 · source§

impl<K, V, S> IntoIterator for HashMap<K, V, S>

source§

fn into_iter(self) -> IntoIter<K, V>

Creates a consuming iterator, that is, one that moves each key-value\npair out of the map in arbitrary order. The map cannot be used after\ncalling this.

\n
Examples
\n
use std::collections::HashMap;\n\nlet map = HashMap::from([\n    ("a", 1),\n    ("b", 2),\n    ("c", 3),\n]);\n\n// Not possible with .iter()\nlet vec: Vec<(&str, i32)> = map.into_iter().collect();
\n
§

type Item = (K, V)

The type of the elements being iterated over.
§

type IntoIter = IntoIter<K, V>

Which kind of iterator are we turning this into?
","IntoIterator","core_distributor::Map"],["
1.36.0 · source§

impl<K, V, S> UnwindSafe for HashMap<K, V, S>where\n K: UnwindSafe,\n V: UnwindSafe,\n S: UnwindSafe,

","UnwindSafe","core_distributor::Map"],["
1.0.0 · source§

impl<K, V, S> Eq for HashMap<K, V, S>where\n K: Eq + Hash,\n V: Eq,\n S: BuildHasher,

","Eq","core_distributor::Map"],["
1.0.0 · source§

impl<K, V, S> Debug for HashMap<K, V, S>where\n K: Debug,\n V: Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
","Debug","core_distributor::Map"],["
1.0.0 · source§

impl<K, V, S> Clone for HashMap<K, V, S>where\n K: Clone,\n V: Clone,\n S: Clone,

source§

fn clone(&self) -> HashMap<K, V, S>

Returns a copy of the value. Read more
source§

fn clone_from(&mut self, other: &HashMap<K, V, S>)

Performs copy-assignment from source. Read more
","Clone","core_distributor::Map"],["
1.0.0 · source§

impl<K, V, S> FromIterator<(K, V)> for HashMap<K, V, S>where\n K: Eq + Hash,\n S: BuildHasher + Default,

source§

fn from_iter<T>(iter: T) -> HashMap<K, V, S>where\n T: IntoIterator<Item = (K, V)>,

Creates a value from an iterator. Read more
","FromIterator<(K, V)>","core_distributor::Map"],["
source§

impl<'de, K, V, S, E> IntoDeserializer<'de, E> for HashMap<K, V, S>where\n K: IntoDeserializer<'de, E> + Eq + Hash,\n V: IntoDeserializer<'de, E>,\n S: BuildHasher,\n E: Error,

§

type Deserializer = MapDeserializer<'de, <HashMap<K, V, S> as IntoIterator>::IntoIter, E>

The type of the deserializer being converted into.
source§

fn into_deserializer(\n self\n) -> <HashMap<K, V, S> as IntoDeserializer<'de, E>>::Deserializer

Convert this value into a deserializer.
","IntoDeserializer<'de, E>","core_distributor::Map"],["
source§

impl<K, V, H> Serialize for HashMap<K, V, H>where\n K: Serialize,\n V: Serialize,

source§

fn serialize<S>(\n &self,\n serializer: S\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,

Serialize this value into the given Serde serializer. Read more
","Serialize","core_distributor::Map"],["
source§

impl<'de, K, V, S> Deserialize<'de> for HashMap<K, V, S>where\n K: Deserialize<'de> + Eq + Hash,\n V: Deserialize<'de>,\n S: BuildHasher + Default,

source§

fn deserialize<D>(\n deserializer: D\n) -> Result<HashMap<K, V, S>, <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
","Deserialize<'de>","core_distributor::Map"],["
source§

impl<K, KU, V, VU, H> SerializeAs<HashMap<K, V, H>> for HashMap<KU, VU, H>where\n KU: SerializeAs<K>,\n VU: SerializeAs<V>,

source§

fn serialize_as<S>(\n source: &HashMap<K, V, H>,\n serializer: S\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,

Serialize this value into the given Serde serializer.
","SerializeAs>","core_distributor::Map"],["
source§

impl<'de, K, V, KU, VU, S> DeserializeAs<'de, HashMap<K, V, S>> for HashMap<KU, VU, S>where\n KU: DeserializeAs<'de, K>,\n VU: DeserializeAs<'de, V>,\n K: Eq + Hash,\n S: BuildHasher + Default,

source§

fn deserialize_as<D>(\n deserializer: D\n) -> Result<HashMap<K, V, S>, <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer.
","DeserializeAs<'de, HashMap>","core_distributor::Map"],["
§

impl<K, V, S> Accumulate<(K, V)> for HashMap<K, V, S>where\n K: Eq + Hash,\n S: BuildHasher + Default,

§

fn initial(capacity: Option<usize>) -> HashMap<K, V, S>

Create a new Extend of the correct type
§

fn accumulate(&mut self, _: (K, V))

Accumulate the input into an accumulator
","Accumulate<(K, V)>","core_distributor::Map"]] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/types/all.html b/types/all.html new file mode 100644 index 0000000000..0f005bd466 --- /dev/null +++ b/types/all.html @@ -0,0 +1 @@ +List of all items in this crate
\ No newline at end of file diff --git a/types/deal_id/struct.DealId.html b/types/deal_id/struct.DealId.html new file mode 100644 index 0000000000..89a9b51dea --- /dev/null +++ b/types/deal_id/struct.DealId.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../types/struct.DealId.html...

+ + + \ No newline at end of file diff --git a/types/index.html b/types/index.html new file mode 100644 index 0000000000..62f8cbf454 --- /dev/null +++ b/types/index.html @@ -0,0 +1,2 @@ +types - Rust
\ No newline at end of file diff --git a/types/peer_id/index.html b/types/peer_id/index.html new file mode 100644 index 0000000000..f77ba41d20 --- /dev/null +++ b/types/peer_id/index.html @@ -0,0 +1 @@ +types::peer_id - Rust
\ No newline at end of file diff --git a/types/peer_id/serde/fn.deserialize.html b/types/peer_id/serde/fn.deserialize.html new file mode 100644 index 0000000000..cb8431198a --- /dev/null +++ b/types/peer_id/serde/fn.deserialize.html @@ -0,0 +1,2 @@ +deserialize in types::peer_id::serde - Rust

Function types::peer_id::serde::deserialize

source ·
pub fn deserialize<'de, D>(deserializer: D) -> Result<PeerId, D::Error>where
+    D: Deserializer<'de>,
\ No newline at end of file diff --git a/types/peer_id/serde/fn.serialize.html b/types/peer_id/serde/fn.serialize.html new file mode 100644 index 0000000000..d694755219 --- /dev/null +++ b/types/peer_id/serde/fn.serialize.html @@ -0,0 +1,2 @@ +serialize in types::peer_id::serde - Rust

Function types::peer_id::serde::serialize

source ·
pub fn serialize<S>(value: &PeerId, serializer: S) -> Result<S::Ok, S::Error>where
+    S: Serializer,
\ No newline at end of file diff --git a/types/peer_id/serde/index.html b/types/peer_id/serde/index.html new file mode 100644 index 0000000000..daccf15ddf --- /dev/null +++ b/types/peer_id/serde/index.html @@ -0,0 +1 @@ +types::peer_id::serde - Rust
\ No newline at end of file diff --git a/types/peer_id/serde/sidebar-items.js b/types/peer_id/serde/sidebar-items.js new file mode 100644 index 0000000000..4ed511ecee --- /dev/null +++ b/types/peer_id/serde/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"fn":["deserialize","serialize"]}; \ No newline at end of file diff --git a/types/peer_id/sidebar-items.js b/types/peer_id/sidebar-items.js new file mode 100644 index 0000000000..92d01da89e --- /dev/null +++ b/types/peer_id/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"mod":["serde"]}; \ No newline at end of file diff --git a/types/peer_scope/enum.PeerScope.html b/types/peer_scope/enum.PeerScope.html new file mode 100644 index 0000000000..64a9516f68 --- /dev/null +++ b/types/peer_scope/enum.PeerScope.html @@ -0,0 +1,33 @@ +PeerScope in types::peer_scope - Rust
pub enum PeerScope {
+    WorkerId(WorkerId),
+    Host,
+}

Variants§

§

WorkerId(WorkerId)

§

Host

Trait Implementations§

source§

impl Clone for PeerScope

source§

fn clone(&self) -> PeerScope

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for PeerScope

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for PeerScope

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Hash for PeerScope

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Ord for PeerScope

source§

fn cmp(&self, other: &PeerScope) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Selfwhere + Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Selfwhere + Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Selfwhere + Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for PeerScope

source§

fn eq(&self, other: &PeerScope) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for PeerScope

source§

fn partial_cmp(&self, other: &PeerScope) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

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 more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= +operator. Read more
source§

impl Serialize for PeerScope

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Copy for PeerScope

source§

impl Eq for PeerScope

source§

impl StructuralEq for PeerScope

source§

impl StructuralPartialEq for PeerScope

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
source§

impl<T> DeserializeOwned for Twhere + T: for<'de> Deserialize<'de>,

\ No newline at end of file diff --git a/types/peer_scope/index.html b/types/peer_scope/index.html new file mode 100644 index 0000000000..7a2462c18b --- /dev/null +++ b/types/peer_scope/index.html @@ -0,0 +1 @@ +types::peer_scope - Rust
\ No newline at end of file diff --git a/types/peer_scope/sidebar-items.js b/types/peer_scope/sidebar-items.js new file mode 100644 index 0000000000..b9ecac070e --- /dev/null +++ b/types/peer_scope/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["PeerScope"],"struct":["WorkerId"]}; \ No newline at end of file diff --git a/types/peer_scope/struct.WorkerId.html b/types/peer_scope/struct.WorkerId.html new file mode 100644 index 0000000000..3f371e3256 --- /dev/null +++ b/types/peer_scope/struct.WorkerId.html @@ -0,0 +1,31 @@ +WorkerId in types::peer_scope - Rust

Struct types::peer_scope::WorkerId

source ·
pub struct WorkerId(/* private fields */);

Trait Implementations§

source§

impl Clone for WorkerId

source§

fn clone(&self) -> WorkerId

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for WorkerId

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for WorkerId

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Display for WorkerId

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<PeerId> for WorkerId

source§

fn from(value: PeerId) -> Self

Converts to this type from the input type.
source§

impl From<WorkerId> for PeerId

source§

fn from(value: WorkerId) -> Self

Converts to this type from the input type.
source§

impl Hash for WorkerId

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Ord for WorkerId

source§

fn cmp(&self, other: &WorkerId) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Selfwhere + Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Selfwhere + Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Selfwhere + Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for WorkerId

source§

fn eq(&self, other: &WorkerId) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for WorkerId

source§

fn partial_cmp(&self, other: &WorkerId) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

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 more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= +operator. Read more
source§

impl Serialize for WorkerId

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Copy for WorkerId

source§

impl Eq for WorkerId

source§

impl StructuralEq for WorkerId

source§

impl StructuralPartialEq for WorkerId

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
source§

impl<T> DeserializeOwned for Twhere + T: for<'de> Deserialize<'de>,

\ No newline at end of file diff --git a/types/sidebar-items.js b/types/sidebar-items.js new file mode 100644 index 0000000000..4e26a2d8f5 --- /dev/null +++ b/types/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"mod":["peer_id","peer_scope"],"struct":["DealId"]}; \ No newline at end of file diff --git a/types/struct.DealId.html b/types/struct.DealId.html new file mode 100644 index 0000000000..e9a8e3746b --- /dev/null +++ b/types/struct.DealId.html @@ -0,0 +1,43 @@ +DealId in types - Rust

Struct types::DealId

source ·
pub struct DealId(/* private fields */);

Implementations§

source§

impl DealId

source

pub fn is_valid(&self) -> bool

40 hex chars + 2 for “0x” prefix; Deal ID is EVM contract address;

+
source

pub fn normalize(str: &str) -> String

source

pub fn get_contract_address(&self) -> String

source

pub fn to_address(&self) -> String

source

pub fn as_str(&self) -> &str

Trait Implementations§

source§

impl Clone for DealId

source§

fn clone(&self) -> DealId

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for DealId

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for DealId

source§

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where + D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Display for DealId

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<&DealId> for String

source§

fn from(deal_id: &DealId) -> Self

Converts to this type from the input type.
source§

impl From<&str> for DealId

source§

fn from(deal_id: &str) -> Self

Converts to this type from the input type.
source§

impl From<DealId> for String

source§

fn from(deal_id: DealId) -> Self

Converts to this type from the input type.
source§

impl From<String> for DealId

source§

fn from(deal_id: String) -> Self

Converts to this type from the input type.
source§

impl Hash for DealId

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Ord for DealId

source§

fn cmp(&self, other: &DealId) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Selfwhere + Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Selfwhere + Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Selfwhere + Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq<&str> for &DealId

source§

fn eq(&self, other: &&str) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<&str> for DealId

source§

fn eq(&self, other: &&str) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<String> for &DealId

source§

fn eq(&self, other: &String) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<String> for DealId

source§

fn eq(&self, other: &String) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl PartialEq for DealId

source§

fn eq(&self, other: &DealId) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for DealId

source§

fn partial_cmp(&self, other: &DealId) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

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 more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= +operator. Read more
source§

impl Serialize for DealId

source§

fn serialize<S>( + &self, + s: S +) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where + S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Eq for DealId

source§

impl StructuralEq for DealId

source§

impl StructuralPartialEq for DealId

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
source§

impl<T> DeserializeOwned for Twhere + T: for<'de> Deserialize<'de>,

\ No newline at end of file diff --git a/uuid_utils/all.html b/uuid_utils/all.html new file mode 100644 index 0000000000..160c7d7a95 --- /dev/null +++ b/uuid_utils/all.html @@ -0,0 +1 @@ +List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/uuid_utils/fn.uuid.html b/uuid_utils/fn.uuid.html new file mode 100644 index 0000000000..f0fdc38b98 --- /dev/null +++ b/uuid_utils/fn.uuid.html @@ -0,0 +1 @@ +uuid in uuid_utils - Rust

Function uuid_utils::uuid

source ·
pub fn uuid() -> String
\ No newline at end of file diff --git a/uuid_utils/index.html b/uuid_utils/index.html new file mode 100644 index 0000000000..ce7d780976 --- /dev/null +++ b/uuid_utils/index.html @@ -0,0 +1,2 @@ +uuid_utils - Rust
\ No newline at end of file diff --git a/uuid_utils/sidebar-items.js b/uuid_utils/sidebar-items.js new file mode 100644 index 0000000000..f7e3494971 --- /dev/null +++ b/uuid_utils/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"fn":["uuid"]}; \ No newline at end of file diff --git a/vm_utils/all.html b/vm_utils/all.html new file mode 100644 index 0000000000..f95cf3a4ec --- /dev/null +++ b/vm_utils/all.html @@ -0,0 +1 @@ +List of all items in this crate
\ No newline at end of file diff --git a/vm_utils/enum.VmError.html b/vm_utils/enum.VmError.html new file mode 100644 index 0000000000..b37fcd50af --- /dev/null +++ b/vm_utils/enum.VmError.html @@ -0,0 +1,56 @@ +VmError in vm_utils - Rust

Enum vm_utils::VmError

source ·
pub enum VmError {
+    FailedToConnect {
+        err: Error,
+    },
+    FailedToCreateVMDomain {
+        err: Error,
+    },
+    FailedToRemoveVMDomain {
+        err: Error,
+        name: String,
+    },
+    FailedToStartVM {
+        err: Error,
+        name: String,
+    },
+    VmNotFound {
+        name: String,
+        err: Error,
+    },
+    FailedToStopVM {
+        name: String,
+        err: Error,
+    },
+    FailedToGetVMId {
+        name: String,
+    },
+    FailedToRebootVM {
+        err: Error,
+        name: String,
+    },
+    FailedToResetVM {
+        err: Error,
+        name: String,
+    },
+    FailedToGetInfo {
+        err: Error,
+        name: String,
+    },
+}

Variants§

§

FailedToConnect

Fields

§err: Error
§

FailedToCreateVMDomain

Fields

§err: Error
§

FailedToRemoveVMDomain

Fields

§err: Error
§name: String
§

FailedToStartVM

Fields

§err: Error
§name: String
§

VmNotFound

Fields

§name: String
§err: Error
§

FailedToStopVM

Fields

§name: String
§err: Error
§

FailedToGetVMId

Fields

§name: String
§

FailedToRebootVM

Fields

§err: Error
§name: String
§

FailedToResetVM

Fields

§err: Error
§name: String
§

FailedToGetInfo

Fields

§err: Error
§name: String

Trait Implementations§

source§

impl Debug for VmError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for VmError

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for VmError

source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/vm_utils/enum.VmStatus.html b/vm_utils/enum.VmStatus.html new file mode 100644 index 0000000000..77e2dadef7 --- /dev/null +++ b/vm_utils/enum.VmStatus.html @@ -0,0 +1,28 @@ +VmStatus in vm_utils - Rust

Enum vm_utils::VmStatus

source ·
pub enum VmStatus {
+    NoState,
+    Running,
+    Blocked,
+    Paused,
+    Shutdown,
+    Shutoff,
+    Crashed,
+    PMSuspended,
+    UnknownState(u32),
+}

Variants§

§

NoState

§

Running

§

Blocked

§

Paused

§

Shutdown

§

Shutoff

§

Crashed

§

PMSuspended

§

UnknownState(u32)

Implementations§

source§

impl VmStatus

source

pub fn from_u32(value: u32) -> Self

Trait Implementations§

source§

impl Debug for VmStatus

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for VmStatus

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/vm_utils/fn.create_domain.html b/vm_utils/fn.create_domain.html new file mode 100644 index 0000000000..8488d7aa5c --- /dev/null +++ b/vm_utils/fn.create_domain.html @@ -0,0 +1,4 @@ +create_domain in vm_utils - Rust

Function vm_utils::create_domain

source ·
pub fn create_domain(
+    uri: &str,
+    params: &CreateVMDomainParams
+) -> Result<(), VmError>
\ No newline at end of file diff --git a/vm_utils/fn.reboot_vm.html b/vm_utils/fn.reboot_vm.html new file mode 100644 index 0000000000..8be9f017fa --- /dev/null +++ b/vm_utils/fn.reboot_vm.html @@ -0,0 +1 @@ +reboot_vm in vm_utils - Rust

Function vm_utils::reboot_vm

source ·
pub fn reboot_vm(uri: &str, name: &str) -> Result<(), VmError>
\ No newline at end of file diff --git a/vm_utils/fn.remove_domain.html b/vm_utils/fn.remove_domain.html new file mode 100644 index 0000000000..fa0484131f --- /dev/null +++ b/vm_utils/fn.remove_domain.html @@ -0,0 +1 @@ +remove_domain in vm_utils - Rust

Function vm_utils::remove_domain

source ·
pub fn remove_domain(uri: &str, name: &str) -> Result<(), VmError>
\ No newline at end of file diff --git a/vm_utils/fn.reset_vm.html b/vm_utils/fn.reset_vm.html new file mode 100644 index 0000000000..0c30ae8cf0 --- /dev/null +++ b/vm_utils/fn.reset_vm.html @@ -0,0 +1 @@ +reset_vm in vm_utils - Rust

Function vm_utils::reset_vm

source ·
pub fn reset_vm(uri: &str, name: &str) -> Result<(), VmError>
\ No newline at end of file diff --git a/vm_utils/fn.start_vm.html b/vm_utils/fn.start_vm.html new file mode 100644 index 0000000000..f062e3b452 --- /dev/null +++ b/vm_utils/fn.start_vm.html @@ -0,0 +1 @@ +start_vm in vm_utils - Rust

Function vm_utils::start_vm

source ·
pub fn start_vm(uri: &str, name: &str) -> Result<u32, VmError>
\ No newline at end of file diff --git a/vm_utils/fn.status_vm.html b/vm_utils/fn.status_vm.html new file mode 100644 index 0000000000..d520d06e31 --- /dev/null +++ b/vm_utils/fn.status_vm.html @@ -0,0 +1 @@ +status_vm in vm_utils - Rust

Function vm_utils::status_vm

source ·
pub fn status_vm(uri: &str, name: &str) -> Result<VmStatus, VmError>
\ No newline at end of file diff --git a/vm_utils/fn.stop_vm.html b/vm_utils/fn.stop_vm.html new file mode 100644 index 0000000000..9a31d14621 --- /dev/null +++ b/vm_utils/fn.stop_vm.html @@ -0,0 +1 @@ +stop_vm in vm_utils - Rust

Function vm_utils::stop_vm

source ·
pub fn stop_vm(uri: &str, name: &str) -> Result<(), VmError>
\ No newline at end of file diff --git a/vm_utils/index.html b/vm_utils/index.html new file mode 100644 index 0000000000..5343089897 --- /dev/null +++ b/vm_utils/index.html @@ -0,0 +1,2 @@ +vm_utils - Rust
\ No newline at end of file diff --git a/vm_utils/sidebar-items.js b/vm_utils/sidebar-items.js new file mode 100644 index 0000000000..29290de190 --- /dev/null +++ b/vm_utils/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["VmError","VmStatus"],"fn":["create_domain","reboot_vm","remove_domain","reset_vm","start_vm","status_vm","stop_vm"],"struct":["CreateVMDomainParams","NonEmpty"]}; \ No newline at end of file diff --git a/vm_utils/struct.CreateVMDomainParams.html b/vm_utils/struct.CreateVMDomainParams.html new file mode 100644 index 0000000000..08bbb4ae6f --- /dev/null +++ b/vm_utils/struct.CreateVMDomainParams.html @@ -0,0 +1,22 @@ +CreateVMDomainParams in vm_utils - Rust
pub struct CreateVMDomainParams { /* private fields */ }

Implementations§

source§

impl CreateVMDomainParams

source

pub fn new( + name: String, + image: PathBuf, + cpus: NonEmpty<LogicalCoreId>, + bridge_name: String +) -> Self

Trait Implementations§

source§

impl Debug for CreateVMDomainParams

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/vm_utils/struct.NonEmpty.html b/vm_utils/struct.NonEmpty.html new file mode 100644 index 0000000000..396cf94db4 --- /dev/null +++ b/vm_utils/struct.NonEmpty.html @@ -0,0 +1,414 @@ +NonEmpty in vm_utils - Rust

Struct vm_utils::NonEmpty

pub struct NonEmpty<T> {
+    pub head: T,
+    pub tail: Vec<T>,
+}
Expand description

Non-empty vector.

+

Fields§

§head: T§tail: Vec<T>

Implementations§

§

impl<T> NonEmpty<T>

pub const fn new(e: T) -> NonEmpty<T>

Alias for NonEmpty::singleton.

+

pub fn collect<I>(iter: I) -> Option<NonEmpty<T>>where + I: IntoIterator<Item = T>,

Attempt to convert an iterator into a NonEmpty vector. +Returns None if the iterator was empty.

+

pub const fn singleton(head: T) -> NonEmpty<T>

Create a new non-empty list with an initial element.

+

pub const fn is_empty(&self) -> bool

Always returns false.

+

pub const fn first(&self) -> &T

Get the first element. Never fails.

+

pub fn first_mut(&mut self) -> &mut T

Get the mutable reference to the first element. Never fails.

+
Examples
+
use nonempty::NonEmpty;
+
+let mut non_empty = NonEmpty::new(42);
+let head = non_empty.first_mut();
+*head += 1;
+assert_eq!(non_empty.first(), &43);
+
+let mut non_empty = NonEmpty::from((1, vec![4, 2, 3]));
+let head = non_empty.first_mut();
+*head *= 42;
+assert_eq!(non_empty.first(), &42);
+

pub fn tail(&self) -> &[T]

Get the possibly-empty tail of the list.

+ +
use nonempty::NonEmpty;
+
+let non_empty = NonEmpty::new(42);
+assert_eq!(non_empty.tail(), &[]);
+
+let non_empty = NonEmpty::from((1, vec![4, 2, 3]));
+assert_eq!(non_empty.tail(), &[4, 2, 3]);
+

pub fn push(&mut self, e: T)

Push an element to the end of the list.

+

pub fn pop(&mut self) -> Option<T>

Pop an element from the end of the list.

+

pub fn insert(&mut self, index: usize, element: T)

Inserts an element at position index within the vector, shifting all elements after it to the right.

+
Panics
+

Panics if index > len.

+
Examples
+
use nonempty::NonEmpty;
+
+let mut non_empty = NonEmpty::from((1, vec![2, 3]));
+non_empty.insert(1, 4);
+assert_eq!(non_empty, NonEmpty::from((1, vec![4, 2, 3])));
+non_empty.insert(4, 5);
+assert_eq!(non_empty, NonEmpty::from((1, vec![4, 2, 3, 5])));
+non_empty.insert(0, 42);
+assert_eq!(non_empty, NonEmpty::from((42, vec![1, 4, 2, 3, 5])));
+

pub fn len(&self) -> usize

Get the length of the list.

+

pub fn len_nonzero(&self) -> NonZeroUsize

Gets the length of the list as a NonZeroUsize.

+

pub fn capacity(&self) -> usize

Get the capacity of the list.

+

pub fn last(&self) -> &T

Get the last element. Never fails.

+

pub fn last_mut(&mut self) -> &mut T

Get the last element mutably.

+

pub fn contains(&self, x: &T) -> boolwhere + T: PartialEq,

Check whether an element is contained in the list.

+ +
use nonempty::NonEmpty;
+
+let mut l = NonEmpty::from((42, vec![36, 58]));
+
+assert!(l.contains(&42));
+assert!(!l.contains(&101));
+

pub fn get(&self, index: usize) -> Option<&T>

Get an element by index.

+

pub fn get_mut(&mut self, index: usize) -> Option<&mut T>

Get an element by index, mutably.

+

pub fn truncate(&mut self, len: usize)

Truncate the list to a certain size. Must be greater than 0.

+

pub fn iter(&self) -> Iter<'_, T>

+
use nonempty::NonEmpty;
+
+let mut l = NonEmpty::from((42, vec![36, 58]));
+
+let mut l_iter = l.iter();
+
+assert_eq!(l_iter.len(), 3);
+assert_eq!(l_iter.next(), Some(&42));
+assert_eq!(l_iter.next(), Some(&36));
+assert_eq!(l_iter.next(), Some(&58));
+assert_eq!(l_iter.next(), None);
+

pub fn iter_mut(&mut self) -> impl Iterator<Item = &mut T> + DoubleEndedIterator

+
use nonempty::NonEmpty;
+
+let mut l = NonEmpty::new(42);
+l.push(36);
+l.push(58);
+
+for i in l.iter_mut() {
+    *i *= 10;
+}
+
+let mut l_iter = l.iter();
+
+assert_eq!(l_iter.next(), Some(&420));
+assert_eq!(l_iter.next(), Some(&360));
+assert_eq!(l_iter.next(), Some(&580));
+assert_eq!(l_iter.next(), None);
+

pub fn from_slice(slice: &[T]) -> Option<NonEmpty<T>>where + T: Clone,

Often we have a Vec (or slice &[T]) but want to ensure that it is NonEmpty before +proceeding with a computation. Using from_slice will give us a proof +that we have a NonEmpty in the Some branch, otherwise it allows +the caller to handle the None case.

+
Example Use
+
use nonempty::NonEmpty;
+
+let non_empty_vec = NonEmpty::from_slice(&[1, 2, 3, 4, 5]);
+assert_eq!(non_empty_vec, Some(NonEmpty::from((1, vec![2, 3, 4, 5]))));
+
+let empty_vec: Option<NonEmpty<&u32>> = NonEmpty::from_slice(&[]);
+assert!(empty_vec.is_none());
+

pub fn from_vec(vec: Vec<T>) -> Option<NonEmpty<T>>

Often we have a Vec (or slice &[T]) but want to ensure that it is NonEmpty before +proceeding with a computation. Using from_vec will give us a proof +that we have a NonEmpty in the Some branch, otherwise it allows +the caller to handle the None case.

+

This version will consume the Vec you pass in. If you would rather pass the data as a +slice then use NonEmpty::from_slice.

+
Example Use
+
use nonempty::NonEmpty;
+
+let non_empty_vec = NonEmpty::from_vec(vec![1, 2, 3, 4, 5]);
+assert_eq!(non_empty_vec, Some(NonEmpty::from((1, vec![2, 3, 4, 5]))));
+
+let empty_vec: Option<NonEmpty<&u32>> = NonEmpty::from_vec(vec![]);
+assert!(empty_vec.is_none());
+

pub fn split_first(&self) -> (&T, &[T])

Deconstruct a NonEmpty into its head and tail. +This operation never fails since we are guranteed +to have a head element.

+
Example Use
+
use nonempty::NonEmpty;
+
+let mut non_empty = NonEmpty::from((1, vec![2, 3, 4, 5]));
+
+// Guaranteed to have the head and we also get the tail.
+assert_eq!(non_empty.split_first(), (&1, &[2, 3, 4, 5][..]));
+
+let non_empty = NonEmpty::new(1);
+
+// Guaranteed to have the head element.
+assert_eq!(non_empty.split_first(), (&1, &[][..]));
+

pub fn split(&self) -> (&T, &[T], &T)

Deconstruct a NonEmpty into its first, last, and +middle elements, in that order.

+

If there is only one element then first == last.

+
Example Use
+
use nonempty::NonEmpty;
+
+let mut non_empty = NonEmpty::from((1, vec![2, 3, 4, 5]));
+
+// Guaranteed to have the last element and the elements
+// preceding it.
+assert_eq!(non_empty.split(), (&1, &[2, 3, 4][..], &5));
+
+let non_empty = NonEmpty::new(1);
+
+// Guaranteed to have the last element.
+assert_eq!(non_empty.split(), (&1, &[][..], &1));
+

pub fn append(&mut self, other: &mut Vec<T>)

Append a Vec to the tail of the NonEmpty.

+
Example Use
+
use nonempty::NonEmpty;
+
+let mut non_empty = NonEmpty::new(1);
+let mut vec = vec![2, 3, 4, 5];
+non_empty.append(&mut vec);
+
+let mut expected = NonEmpty::from((1, vec![2, 3, 4, 5]));
+
+assert_eq!(non_empty, expected);
+

pub fn map<U, F>(self, f: F) -> NonEmpty<U>where + F: FnMut(T) -> U,

A structure preserving map. This is useful for when +we wish to keep the NonEmpty structure guaranteeing +that there is at least one element. Otherwise, we can +use nonempty.iter().map(f).

+
Examples
+
use nonempty::NonEmpty;
+
+let non_empty = NonEmpty::from((1, vec![2, 3, 4, 5]));
+
+let squares = non_empty.map(|i| i * i);
+
+let expected = NonEmpty::from((1, vec![4, 9, 16, 25]));
+
+assert_eq!(squares, expected);
+

pub fn try_map<E, U, F>(self, f: F) -> Result<NonEmpty<U>, E>where + F: FnMut(T) -> Result<U, E>,

A structure preserving, fallible mapping function.

+

pub fn flat_map<U, F>(self, f: F) -> NonEmpty<U>where + F: FnMut(T) -> NonEmpty<U>,

When we have a function that goes from some T to a NonEmpty<U>, +we may want to apply it to a NonEmpty<T> but keep the structure flat. +This is where flat_map shines.

+
Examples
+
use nonempty::NonEmpty;
+
+let non_empty = NonEmpty::from((1, vec![2, 3, 4, 5]));
+
+let windows = non_empty.flat_map(|i| {
+    let mut next = NonEmpty::new(i + 5);
+    next.push(i + 6);
+    next
+});
+
+let expected = NonEmpty::from((6, vec![7, 7, 8, 8, 9, 9, 10, 10, 11]));
+
+assert_eq!(windows, expected);
+

pub fn flatten(full: NonEmpty<NonEmpty<T>>) -> NonEmpty<T>

Flatten nested NonEmptys into a single one.

+
Examples
+
use nonempty::NonEmpty;
+
+let non_empty = NonEmpty::from((
+    NonEmpty::from((1, vec![2, 3])),
+    vec![NonEmpty::from((4, vec![5]))],
+));
+
+let expected = NonEmpty::from((1, vec![2, 3, 4, 5]));
+
+assert_eq!(NonEmpty::flatten(non_empty), expected);
+

Binary searches this sorted non-empty vector for a given element.

+

If the value is found then Result::Ok is returned, containing the index of the matching element. +If there are multiple matches, then any one of the matches could be returned.

+

If the value is not found then Result::Err is returned, containing the index where a +matching element could be inserted while maintaining sorted order.

+
Examples
+
use nonempty::NonEmpty;
+
+let non_empty = NonEmpty::from((0, vec![1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55]));
+assert_eq!(non_empty.binary_search(&0),   Ok(0));
+assert_eq!(non_empty.binary_search(&13),  Ok(9));
+assert_eq!(non_empty.binary_search(&4),   Err(7));
+assert_eq!(non_empty.binary_search(&100), Err(13));
+let r = non_empty.binary_search(&1);
+assert!(match r { Ok(1..=4) => true, _ => false, });
+

If you want to insert an item to a sorted non-empty vector, while maintaining sort order:

+ +
use nonempty::NonEmpty;
+
+let mut non_empty = NonEmpty::from((0, vec![1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55]));
+let num = 42;
+let idx = non_empty.binary_search(&num).unwrap_or_else(|x| x);
+non_empty.insert(idx, num);
+assert_eq!(non_empty, NonEmpty::from((0, vec![1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 42, 55])));
+

pub fn binary_search_by<'a, F>(&'a self, f: F) -> Result<usize, usize>where + F: FnMut(&'a T) -> Ordering,

Binary searches this sorted non-empty with a comparator function.

+

The comparator function should implement an order consistent with the sort order of the underlying slice, +returning an order code that indicates whether its argument is Less, Equal or Greater the desired target.

+

If the value is found then Result::Ok is returned, containing the index of the matching element. +If there are multiple matches, then any one of the matches could be returned. +If the value is not found then Result::Err is returned, containing the index where a matching element could be +inserted while maintaining sorted order.

+
Examples
+

Looks up a series of four elements. The first is found, with a uniquely determined +position; the second and third are not found; the fourth could match any position in [1,4].

+ +
use nonempty::NonEmpty;
+
+let non_empty = NonEmpty::from((0, vec![1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55]));
+let seek = 0;
+assert_eq!(non_empty.binary_search_by(|probe| probe.cmp(&seek)), Ok(0));
+let seek = 13;
+assert_eq!(non_empty.binary_search_by(|probe| probe.cmp(&seek)), Ok(9));
+let seek = 4;
+assert_eq!(non_empty.binary_search_by(|probe| probe.cmp(&seek)), Err(7));
+let seek = 100;
+assert_eq!(non_empty.binary_search_by(|probe| probe.cmp(&seek)), Err(13));
+let seek = 1;
+let r = non_empty.binary_search_by(|probe| probe.cmp(&seek));
+assert!(match r { Ok(1..=4) => true, _ => false, });
+

pub fn binary_search_by_key<'a, B, F>( + &'a self, + b: &B, + f: F +) -> Result<usize, usize>where + B: Ord, + F: FnMut(&'a T) -> B,

Binary searches this sorted non-empty vector with a key extraction function.

+

Assumes that the vector is sorted by the key.

+

If the value is found then Result::Ok is returned, containing the index of the matching element. If there are multiple matches, +then any one of the matches could be returned. If the value is not found then Result::Err is returned, +containing the index where a matching element could be inserted while maintaining sorted order.

+
Examples
+

Looks up a series of four elements in a non-empty vector of pairs sorted by their second elements. +The first is found, with a uniquely determined position; the second and third are not found; +the fourth could match any position in [1, 4].

+ +
use nonempty::NonEmpty;
+
+let non_empty = NonEmpty::from((
+    (0, 0),
+    vec![(2, 1), (4, 1), (5, 1), (3, 1),
+         (1, 2), (2, 3), (4, 5), (5, 8), (3, 13),
+         (1, 21), (2, 34), (4, 55)]
+));
+
+assert_eq!(non_empty.binary_search_by_key(&0, |&(a,b)| b),  Ok(0));
+assert_eq!(non_empty.binary_search_by_key(&13, |&(a,b)| b),  Ok(9));
+assert_eq!(non_empty.binary_search_by_key(&4, |&(a,b)| b),   Err(7));
+assert_eq!(non_empty.binary_search_by_key(&100, |&(a,b)| b), Err(13));
+let r = non_empty.binary_search_by_key(&1, |&(a,b)| b);
+assert!(match r { Ok(1..=4) => true, _ => false, });
+

pub fn maximum(&self) -> &Twhere + T: Ord,

Returns the maximum element in the non-empty vector.

+

This will return the first item in the vector if the tail is empty.

+
Examples
+
use nonempty::NonEmpty;
+
+let non_empty = NonEmpty::new(42);
+assert_eq!(non_empty.maximum(), &42);
+
+let non_empty = NonEmpty::from((1, vec![-34, 42, 76, 4, 5]));
+assert_eq!(non_empty.maximum(), &76);
+

pub fn minimum(&self) -> &Twhere + T: Ord,

Returns the minimum element in the non-empty vector.

+

This will return the first item in the vector if the tail is empty.

+
Examples
+
use nonempty::NonEmpty;
+
+let non_empty = NonEmpty::new(42);
+assert_eq!(non_empty.minimum(), &42);
+
+let non_empty = NonEmpty::from((1, vec![-34, 42, 76, 4, 5]));
+assert_eq!(non_empty.minimum(), &-34);
+

pub fn maximum_by<'a, F>(&'a self, compare: F) -> &'a Twhere + F: FnMut(&'a T, &'a T) -> Ordering,

Returns the element that gives the maximum value with respect to the specified comparison function.

+

This will return the first item in the vector if the tail is empty.

+
Examples
+
use nonempty::NonEmpty;
+
+let non_empty = NonEmpty::new((0, 42));
+assert_eq!(non_empty.maximum_by(|(k, _), (l, _)| k.cmp(l)), &(0, 42));
+
+let non_empty = NonEmpty::from(((2, 1), vec![(2, -34), (4, 42), (0, 76), (1, 4), (3, 5)]));
+assert_eq!(non_empty.maximum_by(|(k, _), (l, _)| k.cmp(l)), &(4, 42));
+

pub fn minimum_by<'a, F>(&'a self, compare: F) -> &'a Twhere + F: FnMut(&'a T, &'a T) -> Ordering,

Returns the element that gives the minimum value with respect to the specified comparison function.

+

This will return the first item in the vector if the tail is empty.

+ +
use nonempty::NonEmpty;
+
+let non_empty = NonEmpty::new((0, 42));
+assert_eq!(non_empty.minimum_by(|(k, _), (l, _)| k.cmp(l)), &(0, 42));
+
+let non_empty = NonEmpty::from(((2, 1), vec![(2, -34), (4, 42), (0, 76), (1, 4), (3, 5)]));
+assert_eq!(non_empty.minimum_by(|(k, _), (l, _)| k.cmp(l)), &(0, 76));
+

pub fn maximum_by_key<'a, U, F>(&'a self, f: F) -> &'a Twhere + U: Ord, + F: FnMut(&'a T) -> U,

Returns the element that gives the maximum value with respect to the specified function.

+

This will return the first item in the vector if the tail is empty.

+
Examples
+
use nonempty::NonEmpty;
+
+let non_empty = NonEmpty::new((0, 42));
+assert_eq!(non_empty.maximum_by_key(|(k, _)| k), &(0, 42));
+
+let non_empty = NonEmpty::from(((2, 1), vec![(2, -34), (4, 42), (0, 76), (1, 4), (3, 5)]));
+assert_eq!(non_empty.maximum_by_key(|(k, _)| k), &(4, 42));
+assert_eq!(non_empty.maximum_by_key(|(k, _)| -k), &(0, 76));
+

pub fn minimum_by_key<'a, U, F>(&'a self, f: F) -> &'a Twhere + U: Ord, + F: FnMut(&'a T) -> U,

Returns the element that gives the minimum value with respect to the specified function.

+

This will return the first item in the vector if the tail is empty.

+
Examples
+
use nonempty::NonEmpty;
+
+let non_empty = NonEmpty::new((0, 42));
+assert_eq!(non_empty.minimum_by_key(|(k, _)| k), &(0, 42));
+
+let non_empty = NonEmpty::from(((2, 1), vec![(2, -34), (4, 42), (0, 76), (1, 4), (3, 5)]));
+assert_eq!(non_empty.minimum_by_key(|(k, _)| k), &(0, 76));
+assert_eq!(non_empty.minimum_by_key(|(k, _)| -k), &(4, 42));
+

Trait Implementations§

§

impl<T> Clone for NonEmpty<T>where + T: Clone,

§

fn clone(&self) -> NonEmpty<T>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl<T> Debug for NonEmpty<T>where + T: Debug,

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl<T> Default for NonEmpty<T>where + T: Default,

§

fn default() -> NonEmpty<T>

Returns the “default value” for a type. Read more
§

impl<A> Extend<A> for NonEmpty<A>

§

fn extend<T>(&mut self, iter: T)where + T: IntoIterator<Item = A>,

Extends a collection with the contents of an iterator. Read more
source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
§

impl<T> From<(T, Vec<T>)> for NonEmpty<T>

§

fn from(_: (T, Vec<T>)) -> NonEmpty<T>

Turns a pair of an element and a Vec into +a NonEmpty.

+
§

impl<T> Hash for NonEmpty<T>where + T: Hash,

§

fn hash<__H>(&self, state: &mut __H)where + __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
§

impl<T> Index<usize> for NonEmpty<T>

§

fn index(&self, index: usize) -> &T

+
use nonempty::NonEmpty;
+
+let non_empty = NonEmpty::from((1, vec![2, 3, 4, 5]));
+
+assert_eq!(non_empty[0], 1);
+assert_eq!(non_empty[1], 2);
+assert_eq!(non_empty[3], 4);
+
§

type Output = T

The returned type after indexing.
§

impl<T> IndexMut<usize> for NonEmpty<T>

§

fn index_mut(&mut self, index: usize) -> &mut T

Performs the mutable indexing (container[index]) operation. Read more
§

impl<'a, T> IntoIterator for &'a NonEmpty<T>

§

type Item = &'a T

The type of the elements being iterated over.
§

type IntoIter = Chain<Once<&'a T>, Iter<'a, T>>

Which kind of iterator are we turning this into?
§

fn into_iter(self) -> <&'a NonEmpty<T> as IntoIterator>::IntoIter

Creates an iterator from a value. Read more
§

impl<T> IntoIterator for NonEmpty<T>

§

type Item = T

The type of the elements being iterated over.
§

type IntoIter = Chain<Once<T>, IntoIter<<NonEmpty<T> as IntoIterator>::Item>>

Which kind of iterator are we turning this into?
§

fn into_iter(self) -> <NonEmpty<T> as IntoIterator>::IntoIter

Creates an iterator from a value. Read more
§

impl<T> Ord for NonEmpty<T>where + T: Ord,

§

fn cmp(&self, other: &NonEmpty<T>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Selfwhere + Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Selfwhere + Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Selfwhere + Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
§

impl<T> PartialEq for NonEmpty<T>where + T: PartialEq,

§

fn eq(&self, other: &NonEmpty<T>) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
§

impl<T> PartialOrd for NonEmpty<T>where + T: PartialOrd,

§

fn partial_cmp(&self, other: &NonEmpty<T>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

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 more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= +operator. Read more
§

impl<T> Eq for NonEmpty<T>where + T: Eq,

§

impl<T> StructuralEq for NonEmpty<T>

§

impl<T> StructuralPartialEq for NonEmpty<T>

Auto Trait Implementations§

§

impl<T> RefUnwindSafe for NonEmpty<T>where + T: RefUnwindSafe,

§

impl<T> Send for NonEmpty<T>where + T: Send,

§

impl<T> Sync for NonEmpty<T>where + T: Sync,

§

impl<T> Unpin for NonEmpty<T>where + T: Unpin,

§

impl<T> UnwindSafe for NonEmpty<T>where + T: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/vm_utils/vm_utils/enum.VmError.html b/vm_utils/vm_utils/enum.VmError.html new file mode 100644 index 0000000000..70ec98833a --- /dev/null +++ b/vm_utils/vm_utils/enum.VmError.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../vm_utils/enum.VmError.html...

+ + + \ No newline at end of file diff --git a/vm_utils/vm_utils/enum.VmStatus.html b/vm_utils/vm_utils/enum.VmStatus.html new file mode 100644 index 0000000000..3874f96bb2 --- /dev/null +++ b/vm_utils/vm_utils/enum.VmStatus.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../vm_utils/enum.VmStatus.html...

+ + + \ No newline at end of file diff --git a/vm_utils/vm_utils/fn.create_domain.html b/vm_utils/vm_utils/fn.create_domain.html new file mode 100644 index 0000000000..c0360cb1d6 --- /dev/null +++ b/vm_utils/vm_utils/fn.create_domain.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../vm_utils/fn.create_domain.html...

+ + + \ No newline at end of file diff --git a/vm_utils/vm_utils/fn.reboot_vm.html b/vm_utils/vm_utils/fn.reboot_vm.html new file mode 100644 index 0000000000..a26bce071a --- /dev/null +++ b/vm_utils/vm_utils/fn.reboot_vm.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../vm_utils/fn.reboot_vm.html...

+ + + \ No newline at end of file diff --git a/vm_utils/vm_utils/fn.remove_domain.html b/vm_utils/vm_utils/fn.remove_domain.html new file mode 100644 index 0000000000..fc2becce85 --- /dev/null +++ b/vm_utils/vm_utils/fn.remove_domain.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../vm_utils/fn.remove_domain.html...

+ + + \ No newline at end of file diff --git a/vm_utils/vm_utils/fn.reset_vm.html b/vm_utils/vm_utils/fn.reset_vm.html new file mode 100644 index 0000000000..9280f53f61 --- /dev/null +++ b/vm_utils/vm_utils/fn.reset_vm.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../vm_utils/fn.reset_vm.html...

+ + + \ No newline at end of file diff --git a/vm_utils/vm_utils/fn.start_vm.html b/vm_utils/vm_utils/fn.start_vm.html new file mode 100644 index 0000000000..a7ab74aeb3 --- /dev/null +++ b/vm_utils/vm_utils/fn.start_vm.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../vm_utils/fn.start_vm.html...

+ + + \ No newline at end of file diff --git a/vm_utils/vm_utils/fn.status_vm.html b/vm_utils/vm_utils/fn.status_vm.html new file mode 100644 index 0000000000..0b8f99d3e6 --- /dev/null +++ b/vm_utils/vm_utils/fn.status_vm.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../vm_utils/fn.status_vm.html...

+ + + \ No newline at end of file diff --git a/vm_utils/vm_utils/fn.stop_vm.html b/vm_utils/vm_utils/fn.stop_vm.html new file mode 100644 index 0000000000..f381b90932 --- /dev/null +++ b/vm_utils/vm_utils/fn.stop_vm.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../vm_utils/fn.stop_vm.html...

+ + + \ No newline at end of file diff --git a/vm_utils/vm_utils/struct.CreateVMDomainParams.html b/vm_utils/vm_utils/struct.CreateVMDomainParams.html new file mode 100644 index 0000000000..0e48664647 --- /dev/null +++ b/vm_utils/vm_utils/struct.CreateVMDomainParams.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../vm_utils/struct.CreateVMDomainParams.html...

+ + + \ No newline at end of file diff --git a/workers/all.html b/workers/all.html new file mode 100644 index 0000000000..507f0bdeac --- /dev/null +++ b/workers/all.html @@ -0,0 +1 @@ +List of all items in this crate
\ No newline at end of file diff --git a/workers/enum.Event.html b/workers/enum.Event.html new file mode 100644 index 0000000000..1f1cacf8ad --- /dev/null +++ b/workers/enum.Event.html @@ -0,0 +1,34 @@ +Event in workers - Rust

Enum workers::Event

source ·
pub enum Event {
+    WorkerCreated {
+        worker_id: WorkerId,
+        thread_count: usize,
+    },
+    WorkerRemoved {
+        worker_id: WorkerId,
+    },
+}

Variants§

§

WorkerCreated

Fields

§worker_id: WorkerId
§thread_count: usize
§

WorkerRemoved

Fields

§worker_id: WorkerId

Trait Implementations§

source§

impl Debug for Event

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl RefUnwindSafe for Event

§

impl Send for Event

§

impl Sync for Event

§

impl Unpin for Event

§

impl UnwindSafe for Event

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/workers/enum.KeyStorageError.html b/workers/enum.KeyStorageError.html new file mode 100644 index 0000000000..afbc6023bf --- /dev/null +++ b/workers/enum.KeyStorageError.html @@ -0,0 +1,66 @@ +KeyStorageError in workers - Rust
pub enum KeyStorageError {
+    CannotExtractRSASecretKey,
+    ReadPersistedKeypair {
+        path: PathBuf,
+        err: Error,
+    },
+    DirectoryListError {
+        path: PathBuf,
+        err: Error,
+    },
+    DeserializePersistedKeypair {
+        path: PathBuf,
+        err: Error,
+    },
+    PersistedKeypairDecodingError {
+        path: PathBuf,
+        err: DecodingError,
+    },
+    PersistedKeypairInvalidKeyFormat {
+        path: PathBuf,
+        err: Error,
+    },
+    SerializePersistedKeypair {
+        err: Error,
+    },
+    WriteErrorPersistedKeypair {
+        path: PathBuf,
+        err: Error,
+    },
+    RemoveErrorPersistedKeypair {
+        path: PathBuf,
+        worker_id: WorkerId,
+        err: Error,
+    },
+    CreateKeypairsDir {
+        path: PathBuf,
+        err: Error,
+    },
+    KeypairNotFound(PeerId),
+}

Variants§

§

CannotExtractRSASecretKey

§

ReadPersistedKeypair

Fields

§path: PathBuf
§err: Error
§

DirectoryListError

Fields

§path: PathBuf
§err: Error
§

DeserializePersistedKeypair

Fields

§path: PathBuf
§err: Error
§

PersistedKeypairDecodingError

Fields

§path: PathBuf
§err: DecodingError
§

PersistedKeypairInvalidKeyFormat

Fields

§path: PathBuf
§err: Error
§

SerializePersistedKeypair

Fields

§err: Error
§

WriteErrorPersistedKeypair

Fields

§path: PathBuf
§err: Error
§

RemoveErrorPersistedKeypair

Fields

§path: PathBuf
§worker_id: WorkerId
§err: Error
§

CreateKeypairsDir

Fields

§path: PathBuf
§err: Error
§

KeypairNotFound(PeerId)

Trait Implementations§

source§

impl Debug for KeyStorageError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for KeyStorageError

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for KeyStorageError

source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/workers/enum.WorkersError.html b/workers/enum.WorkersError.html new file mode 100644 index 0000000000..14d1112a3f --- /dev/null +++ b/workers/enum.WorkersError.html @@ -0,0 +1,91 @@ +WorkersError in workers - Rust
pub enum WorkersError {
+
Show 22 variants CreateWorkersDir { + path: PathBuf, + err: Error, + }, + CreateWorkerKeyPair { + err: KeyStorageError, + }, + RemoveWorkerKeyPair { + err: KeyStorageError, + }, + ReadPersistedWorker { + path: PathBuf, + err: Error, + }, + DeserializePersistedWorker { + path: PathBuf, + err: Error, + }, + WorkerAlreadyExists { + deal_id: DealId, + }, + WorkerNotFoundByDeal(DealId), + WorkerNotFound(WorkerId), + SerializePersistedWorker { + err: Error, + }, + WriteErrorPersistedWorker { + path: PathBuf, + err: Error, + }, + WorkerStorageDirectory { + path: PathBuf, + worker_id: WorkerId, + err: Error, + }, + RemoveErrorPersistedWorker { + path: PathBuf, + worker_id: WorkerId, + err: Error, + }, + KeypairNotFound(PeerId), + CreateRuntime { + worker_id: WorkerId, + err: Error, + }, + FailedToAssignCores { + worker_id: WorkerId, + err: AcquireError, + }, + FailedToNotifySubsystem { + worker_id: WorkerId, + }, + FeatureDisabled, + VMImageNotFile { + image: PathBuf, + }, + FailedToCopyVMImage { + image: PathBuf, + err: Error, + }, + WrongAssignment, + VmNotFound(WorkerId), + VmError(VmError), +
}

Variants§

§

CreateWorkersDir

Fields

§path: PathBuf
§err: Error
§

CreateWorkerKeyPair

§

RemoveWorkerKeyPair

§

ReadPersistedWorker

Fields

§path: PathBuf
§err: Error
§

DeserializePersistedWorker

Fields

§path: PathBuf
§err: Error
§

WorkerAlreadyExists

Fields

§deal_id: DealId
§

WorkerNotFoundByDeal(DealId)

§

WorkerNotFound(WorkerId)

§

SerializePersistedWorker

Fields

§err: Error
§

WriteErrorPersistedWorker

Fields

§path: PathBuf
§err: Error
§

WorkerStorageDirectory

Fields

§path: PathBuf
§worker_id: WorkerId
§err: Error
§

RemoveErrorPersistedWorker

Fields

§path: PathBuf
§worker_id: WorkerId
§err: Error
§

KeypairNotFound(PeerId)

§

CreateRuntime

Fields

§worker_id: WorkerId
§err: Error
§

FailedToAssignCores

Fields

§worker_id: WorkerId
§

FailedToNotifySubsystem

Fields

§worker_id: WorkerId
§

FeatureDisabled

§

VMImageNotFile

Fields

§image: PathBuf
§

FailedToCopyVMImage

Fields

§image: PathBuf
§err: Error
§

WrongAssignment

§

VmNotFound(WorkerId)

§

VmError(VmError)

Trait Implementations§

source§

impl Debug for WorkersError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for WorkersError

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for WorkersError

source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl From<VmError> for WorkersError

source§

fn from(source: VmError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/workers/error/enum.KeyStorageError.html b/workers/error/enum.KeyStorageError.html new file mode 100644 index 0000000000..15a8e0e766 --- /dev/null +++ b/workers/error/enum.KeyStorageError.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../workers/enum.KeyStorageError.html...

+ + + \ No newline at end of file diff --git a/workers/error/enum.WorkersError.html b/workers/error/enum.WorkersError.html new file mode 100644 index 0000000000..e1bf81b9da --- /dev/null +++ b/workers/error/enum.WorkersError.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../workers/enum.WorkersError.html...

+ + + \ No newline at end of file diff --git a/workers/index.html b/workers/index.html new file mode 100644 index 0000000000..b7f4ffc972 --- /dev/null +++ b/workers/index.html @@ -0,0 +1,4 @@ +workers - Rust

Crate workers

source ·

Structs

Enums

Traits

\ No newline at end of file diff --git a/workers/key_storage/struct.KeyStorage.html b/workers/key_storage/struct.KeyStorage.html new file mode 100644 index 0000000000..81ff771db8 --- /dev/null +++ b/workers/key_storage/struct.KeyStorage.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../workers/struct.KeyStorage.html...

+ + + \ No newline at end of file diff --git a/workers/scope/struct.PeerScopes.html b/workers/scope/struct.PeerScopes.html new file mode 100644 index 0000000000..38fd05fa61 --- /dev/null +++ b/workers/scope/struct.PeerScopes.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../workers/struct.PeerScopes.html...

+ + + \ No newline at end of file diff --git a/workers/sidebar-items.js b/workers/sidebar-items.js new file mode 100644 index 0000000000..41e11935e6 --- /dev/null +++ b/workers/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["Event","KeyStorageError","WorkersError"],"struct":["CUID","KeyStorage","PeerScopes","PersistentCoreDistributor","Receiver","VmConfig","WorkerId","WorkerParams","Workers","WorkersConfig"],"trait":["CoreDistributor"]}; \ No newline at end of file diff --git a/workers/struct.CUID.html b/workers/struct.CUID.html new file mode 100644 index 0000000000..3a968e00cc --- /dev/null +++ b/workers/struct.CUID.html @@ -0,0 +1,61 @@ +CUID in workers - Rust

Struct workers::CUID

pub struct CUID(/* private fields */);

Implementations§

§

impl CUID

pub const fn new(inner: [u8; 32]) -> CUID

Trait Implementations§

§

impl AsRef<[u8; 32]> for CUID

§

fn as_ref(&self) -> &[u8; 32]

Converts this type into a shared reference of the (usually inferred) input type.
§

impl Clone for CUID

§

fn clone(&self) -> CUID

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for CUID

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Default for CUID

§

fn default() -> CUID

Returns the “default value” for a type. Read more
§

impl<'de> Deserialize<'de> for CUIDwhere + CUID: FromStr, + <CUID as FromStr>::Err: Display,

§

fn deserialize<__D>( + deserializer: __D +) -> Result<CUID, <__D as Deserializer<'de>>::Error>where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
§

impl Display for CUID

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl FromHex for CUID

§

type Error = <[u8; 32] as FromHex>::Error

§

fn from_hex<T>(hex: T) -> Result<CUID, <CUID as FromHex>::Error>where + T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails +with a custom error type. Read more
§

impl FromStr for CUID

§

type Err = FromHexError

The associated error which can be returned from parsing.
§

fn from_str(s: &str) -> Result<CUID, <CUID as FromStr>::Err>

Parses a string s to return a value of this type. Read more
§

impl Hash for CUID

§

fn hash<__H>(&self, state: &mut __H)where + __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
§

impl Ord for CUID

§

fn cmp(&self, other: &CUID) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Selfwhere + Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Selfwhere + Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Selfwhere + Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
§

impl PartialEq for CUID

§

fn eq(&self, other: &CUID) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
§

impl PartialOrd for CUID

§

fn partial_cmp(&self, other: &CUID) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

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 more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= +operator. Read more
§

impl Serialize for CUIDwhere + CUID: Display,

§

fn serialize<__S>( + &self, + serializer: __S +) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more
§

impl ToHex for CUID

§

fn encode_hex<T>(&self) -> Twhere + T: FromIterator<char>,

Encode the hex strict representing self into the result. Lower case +letters are used (e.g. f9b4ca)
§

fn encode_hex_upper<T>(&self) -> Twhere + T: FromIterator<char>,

Encode the hex strict representing self into the result. Upper case +letters are used (e.g. F9B4CA)
§

impl Copy for CUID

§

impl Eq for CUID

§

impl StructuralEq for CUID

§

impl StructuralPartialEq for CUID

Auto Trait Implementations§

§

impl RefUnwindSafe for CUID

§

impl Send for CUID

§

impl Sync for CUID

§

impl Unpin for CUID

§

impl UnwindSafe for CUID

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<Q, K> Comparable<K> for Qwhere + Q: Ord + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
source§

impl<T> DeserializeOwned for Twhere + T: for<'de> Deserialize<'de>,

\ No newline at end of file diff --git a/workers/struct.KeyStorage.html b/workers/struct.KeyStorage.html new file mode 100644 index 0000000000..581de40447 --- /dev/null +++ b/workers/struct.KeyStorage.html @@ -0,0 +1,35 @@ +KeyStorage in workers - Rust

Struct workers::KeyStorage

source ·
pub struct KeyStorage {
+    pub root_key_pair: KeyPair,
+    /* private fields */
+}

Fields§

§root_key_pair: KeyPair

Implementations§

source§

impl KeyStorage

source

pub async fn from_path( + key_pairs_dir: PathBuf, + root_key_pair: KeyPair +) -> Result<Self>

source

pub fn get_keypair(&self, peer_scope: PeerScope) -> Option<KeyPair>

source

pub fn get_worker_key_pair(&self, worker_id: WorkerId) -> Option<KeyPair>

source

pub async fn create_key_pair(&self) -> Result<KeyPair, KeyStorageError>

source

pub async fn remove_key_pair( + &self, + worker_id: WorkerId +) -> Result<(), KeyStorageError>

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/workers/struct.PeerScopes.html b/workers/struct.PeerScopes.html new file mode 100644 index 0000000000..e737cbec2e --- /dev/null +++ b/workers/struct.PeerScopes.html @@ -0,0 +1,33 @@ +PeerScopes in workers - Rust

Struct workers::PeerScopes

source ·
pub struct PeerScopes { /* private fields */ }
Expand description

Represents information about various peer IDs.

+

Implementations§

source§

impl PeerScopes

source

pub fn new( + host_peer_id: PeerId, + management_peer_id: PeerId, + builtins_management_peer_id: PeerId, + key_storage: Arc<KeyStorage> +) -> Self

source

pub fn scope(&self, peer_id: PeerId) -> Result<PeerScope, ScopeNotFound>

source

pub fn is_host(&self, peer_id: PeerId) -> bool

source

pub fn is_management(&self, peer_id: PeerId) -> bool

source

pub fn get_host_peer_id(&self) -> PeerId

source

pub fn to_peer_id(&self, peer_scope: PeerScope) -> PeerId

Trait Implementations§

source§

impl Clone for PeerScopes

source§

fn clone(&self) -> PeerScopes

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for PeerScopes

source§

fn fmt(&self, __f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/workers/struct.PersistentCoreDistributor.html b/workers/struct.PersistentCoreDistributor.html new file mode 100644 index 0000000000..1d399dede7 --- /dev/null +++ b/workers/struct.PersistentCoreDistributor.html @@ -0,0 +1,39 @@ +PersistentCoreDistributor in workers - Rust
pub struct PersistentCoreDistributor { /* private fields */ }
Expand description

PersistentCoreDistributor is a CPU core distributor responsible for allocating and releasing CPU cores +based on workload requirements. It maintains the state of core allocations, persists +the state to disk, and provides methods for acquiring and releasing cores.

+

Implementations§

source§

impl PersistentCoreDistributor

source

pub fn from_path( + file_path: PathBuf, + system_cpu_count: usize, + core_range: CoreRange, + acquire_strategy: AcquireStrategy, + cpu_topology: &dyn CPUTopology +) -> Result<(Arc<PersistentCoreDistributor>, PersistenceTask), LoadingError>

Loads the state from file_name if exists. If not creates a new empty state

+

Trait Implementations§

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/workers/struct.Receiver.html b/workers/struct.Receiver.html new file mode 100644 index 0000000000..540667d398 --- /dev/null +++ b/workers/struct.Receiver.html @@ -0,0 +1,313 @@ +Receiver in workers - Rust

Struct workers::Receiver

pub struct Receiver<T> { /* private fields */ }
Expand description

Receives values from the associated Sender.

+

Instances are created by the [channel] function.

+

This receiver can be turned into a Stream using ReceiverStream.

+

Implementations§

§

impl<T> Receiver<T>

pub async fn recv(&mut self) -> Option<T>

Receives the next value for this receiver.

+

This method returns None if the channel has been closed and there are +no remaining messages in the channel’s buffer. This indicates that no +further values can ever be received from this Receiver. The channel is +closed when all senders have been dropped, or when close is called.

+

If there are no messages in the channel’s buffer, but the channel has +not yet been closed, this method will sleep until a message is sent or +the channel is closed. Note that if close is called, but there are +still outstanding Permits from before it was closed, the channel is +not considered closed by recv until the permits are released.

+
Cancel safety
+

This method is cancel safe. If recv is used as the event in a +tokio::select! statement and some other branch +completes first, it is guaranteed that no messages were received on this +channel.

+
Examples
+
use tokio::sync::mpsc;
+
+#[tokio::main]
+async fn main() {
+    let (tx, mut rx) = mpsc::channel(100);
+
+    tokio::spawn(async move {
+        tx.send("hello").await.unwrap();
+    });
+
+    assert_eq!(Some("hello"), rx.recv().await);
+    assert_eq!(None, rx.recv().await);
+}
+

Values are buffered:

+ +
use tokio::sync::mpsc;
+
+#[tokio::main]
+async fn main() {
+    let (tx, mut rx) = mpsc::channel(100);
+
+    tx.send("hello").await.unwrap();
+    tx.send("world").await.unwrap();
+
+    assert_eq!(Some("hello"), rx.recv().await);
+    assert_eq!(Some("world"), rx.recv().await);
+}
+

pub async fn recv_many(&mut self, buffer: &mut Vec<T>, limit: usize) -> usize

Receives the next values for this receiver and extends buffer.

+

This method extends buffer by no more than a fixed number of values +as specified by limit. If limit is zero, the function immediately +returns 0. The return value is the number of values added to buffer.

+

For limit > 0, if there are no messages in the channel’s queue, but +the channel has not yet been closed, this method will sleep until a +message is sent or the channel is closed. Note that if close is +called, but there are still outstanding Permits from before it was +closed, the channel is not considered closed by recv_many until the +permits are released.

+

For non-zero values of limit, this method will never return 0 unless +the channel has been closed and there are no remaining messages in the +channel’s queue. This indicates that no further values can ever be +received from this Receiver. The channel is closed when all senders +have been dropped, or when close is called.

+

The capacity of buffer is increased as needed.

+
Cancel safety
+

This method is cancel safe. If recv_many is used as the event in a +tokio::select! statement and some other branch +completes first, it is guaranteed that no messages were received on this +channel.

+
Examples
+
use tokio::sync::mpsc;
+
+#[tokio::main]
+async fn main() {
+    let mut buffer: Vec<&str> = Vec::with_capacity(2);
+    let limit = 2;
+    let (tx, mut rx) = mpsc::channel(100);
+    let tx2 = tx.clone();
+    tx2.send("first").await.unwrap();
+    tx2.send("second").await.unwrap();
+    tx2.send("third").await.unwrap();
+
+    // Call `recv_many` to receive up to `limit` (2) values.
+    assert_eq!(2, rx.recv_many(&mut buffer, limit).await);
+    assert_eq!(vec!["first", "second"], buffer);
+
+    // If the buffer is full, the next call to `recv_many`
+    // reserves additional capacity.
+    assert_eq!(1, rx.recv_many(&mut buffer, 1).await);
+
+    tokio::spawn(async move {
+        tx.send("fourth").await.unwrap();
+    });
+
+    // 'tx' is dropped, but `recv_many`
+    // is guaranteed not to return 0 as the channel
+    // is not yet closed.
+    assert_eq!(1, rx.recv_many(&mut buffer, 1).await);
+    assert_eq!(vec!["first", "second", "third", "fourth"], buffer);
+
+    // Once the last sender is dropped, the channel is
+    // closed and `recv_many` returns 0, capacity unchanged.
+    drop(tx2);
+    assert_eq!(0, rx.recv_many(&mut buffer, limit).await);
+    assert_eq!(vec!["first", "second", "third", "fourth"], buffer);
+}
+

pub fn try_recv(&mut self) -> Result<T, TryRecvError>

Tries to receive the next value for this receiver.

+

This method returns the Empty error if the channel is currently +empty, but there are still outstanding senders or permits.

+

This method returns the Disconnected error if the channel is +currently empty, and there are no outstanding senders or permits.

+

Unlike the poll_recv method, this method will never return an +Empty error spuriously.

+
Examples
+
use tokio::sync::mpsc;
+use tokio::sync::mpsc::error::TryRecvError;
+
+#[tokio::main]
+async fn main() {
+    let (tx, mut rx) = mpsc::channel(100);
+
+    tx.send("hello").await.unwrap();
+
+    assert_eq!(Ok("hello"), rx.try_recv());
+    assert_eq!(Err(TryRecvError::Empty), rx.try_recv());
+
+    tx.send("hello").await.unwrap();
+    // Drop the last sender, closing the channel.
+    drop(tx);
+
+    assert_eq!(Ok("hello"), rx.try_recv());
+    assert_eq!(Err(TryRecvError::Disconnected), rx.try_recv());
+}
+

pub fn blocking_recv(&mut self) -> Option<T>

Blocking receive to call outside of asynchronous contexts.

+

This method returns None if the channel has been closed and there are +no remaining messages in the channel’s buffer. This indicates that no +further values can ever be received from this Receiver. The channel is +closed when all senders have been dropped, or when close is called.

+

If there are no messages in the channel’s buffer, but the channel has +not yet been closed, this method will block until a message is sent or +the channel is closed.

+

This method is intended for use cases where you are sending from +asynchronous code to synchronous code, and will work even if the sender +is not using blocking_send to send the message.

+

Note that if close is called, but there are still outstanding +Permits from before it was closed, the channel is not considered +closed by blocking_recv until the permits are released.

+
Panics
+

This function panics if called within an asynchronous execution +context.

+
Examples
+
use std::thread;
+use tokio::runtime::Runtime;
+use tokio::sync::mpsc;
+
+fn main() {
+    let (tx, mut rx) = mpsc::channel::<u8>(10);
+
+    let sync_code = thread::spawn(move || {
+        assert_eq!(Some(10), rx.blocking_recv());
+    });
+
+    Runtime::new()
+        .unwrap()
+        .block_on(async move {
+            let _ = tx.send(10).await;
+        });
+    sync_code.join().unwrap()
+}
+

pub fn close(&mut self)

Closes the receiving half of a channel without dropping it.

+

This prevents any further messages from being sent on the channel while +still enabling the receiver to drain messages that are buffered. Any +outstanding Permit values will still be able to send messages.

+

To guarantee that no messages are dropped, after calling close(), +recv() must be called until None is returned. If there are +outstanding Permit or OwnedPermit values, the recv method will +not return None until those are released.

+
Examples
+
use tokio::sync::mpsc;
+
+#[tokio::main]
+async fn main() {
+    let (tx, mut rx) = mpsc::channel(20);
+
+    tokio::spawn(async move {
+        let mut i = 0;
+        while let Ok(permit) = tx.reserve().await {
+            permit.send(i);
+            i += 1;
+        }
+    });
+
+    rx.close();
+
+    while let Some(msg) = rx.recv().await {
+        println!("got {}", msg);
+    }
+
+    // Channel closed and no messages are lost.
+}
+

pub fn poll_recv(&mut self, cx: &mut Context<'_>) -> Poll<Option<T>>

Polls to receive the next message on this channel.

+

This method returns:

+
    +
  • Poll::Pending if no messages are available but the channel is not +closed, or if a spurious failure happens.
  • +
  • Poll::Ready(Some(message)) if a message is available.
  • +
  • Poll::Ready(None) if the channel has been closed and all messages +sent before it was closed have been received.
  • +
+

When the method returns Poll::Pending, the Waker in the provided +Context is scheduled to receive a wakeup when a message is sent on any +receiver, or when the channel is closed. Note that on multiple calls to +poll_recv or poll_recv_many, only the Waker from the Context +passed to the most recent call is scheduled to receive a wakeup.

+

If this method returns Poll::Pending due to a spurious failure, then +the Waker will be notified when the situation causing the spurious +failure has been resolved. Note that receiving such a wakeup does not +guarantee that the next call will succeed — it could fail with another +spurious failure.

+

pub fn poll_recv_many( + &mut self, + cx: &mut Context<'_>, + buffer: &mut Vec<T>, + limit: usize +) -> Poll<usize>

Polls to receive multiple messages on this channel, extending the provided buffer.

+

This method returns:

+
    +
  • Poll::Pending if no messages are available but the channel is not closed, or if a +spurious failure happens.
  • +
  • Poll::Ready(count) where count is the number of messages successfully received and +stored in buffer. This can be less than, or equal to, limit.
  • +
  • Poll::Ready(0) if limit is set to zero or when the channel is closed.
  • +
+

When the method returns Poll::Pending, the Waker in the provided +Context is scheduled to receive a wakeup when a message is sent on any +receiver, or when the channel is closed. Note that on multiple calls to +poll_recv or poll_recv_many, only the Waker from the Context +passed to the most recent call is scheduled to receive a wakeup.

+

Note that this method does not guarantee that exactly limit messages +are received. Rather, if at least one message is available, it returns +as many messages as it can up to the given limit. This method returns +zero only if the channel is closed (or if limit is zero).

+
Examples
+
use std::task::{Context, Poll};
+use std::pin::Pin;
+use tokio::sync::mpsc;
+use futures::Future;
+
+struct MyReceiverFuture<'a> {
+    receiver: mpsc::Receiver<i32>,
+    buffer: &'a mut Vec<i32>,
+    limit: usize,
+}
+
+impl<'a> Future for MyReceiverFuture<'a> {
+    type Output = usize; // Number of messages received
+
+    fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
+        let MyReceiverFuture { receiver, buffer, limit } = &mut *self;
+
+        // Now `receiver` and `buffer` are mutable references, and `limit` is copied
+        match receiver.poll_recv_many(cx, *buffer, *limit) {
+            Poll::Pending => Poll::Pending,
+            Poll::Ready(count) => Poll::Ready(count),
+        }
+    }
+}
+
+#[tokio::main]
+async fn main() {
+    let (tx, rx) = mpsc::channel(32);
+    let mut buffer = Vec::new();
+
+    let my_receiver_future = MyReceiverFuture {
+        receiver: rx,
+        buffer: &mut buffer,
+        limit: 3,
+    };
+
+    for i in 0..10 {
+        tx.send(i).await.unwrap();
+    }
+
+    let count = my_receiver_future.await;
+    assert_eq!(count, 3);
+    assert_eq!(buffer, vec![0,1,2])
+}
+

Trait Implementations§

§

impl<T> Debug for Receiver<T>

§

fn fmt(&self, fmt: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl<T> Unpin for Receiver<T>

Auto Trait Implementations§

§

impl<T> !RefUnwindSafe for Receiver<T>

§

impl<T> Send for Receiver<T>where + T: Send,

§

impl<T> Sync for Receiver<T>where + T: Send,

§

impl<T> !UnwindSafe for Receiver<T>

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/workers/struct.VmConfig.html b/workers/struct.VmConfig.html new file mode 100644 index 0000000000..7da0ff846f --- /dev/null +++ b/workers/struct.VmConfig.html @@ -0,0 +1,26 @@ +VmConfig in workers - Rust

Struct workers::VmConfig

source ·
pub struct VmConfig { /* private fields */ }

Implementations§

source§

impl VmConfig

source

pub fn new(libvirt_uri: String, bridge_name: String) -> Self

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/workers/struct.WorkerId.html b/workers/struct.WorkerId.html new file mode 100644 index 0000000000..40e00b10ce --- /dev/null +++ b/workers/struct.WorkerId.html @@ -0,0 +1,52 @@ +WorkerId in workers - Rust

Struct workers::WorkerId

pub struct WorkerId(/* private fields */);

Trait Implementations§

§

impl Clone for WorkerId

§

fn clone(&self) -> WorkerId

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for WorkerId

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl<'de> Deserialize<'de> for WorkerId

§

fn deserialize<__D>( + __deserializer: __D +) -> Result<WorkerId, <__D as Deserializer<'de>>::Error>where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
§

impl Display for WorkerId

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl From<PeerId> for WorkerId

§

fn from(value: PeerId) -> WorkerId

Converts to this type from the input type.
§

impl Hash for WorkerId

§

fn hash<__H>(&self, state: &mut __H)where + __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
§

impl Ord for WorkerId

§

fn cmp(&self, other: &WorkerId) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Selfwhere + Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Selfwhere + Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Selfwhere + Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
§

impl PartialEq for WorkerId

§

fn eq(&self, other: &WorkerId) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
§

impl PartialOrd for WorkerId

§

fn partial_cmp(&self, other: &WorkerId) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

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 more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= +operator. Read more
§

impl Serialize for WorkerId

§

fn serialize<__S>( + &self, + __serializer: __S +) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more
§

impl Copy for WorkerId

§

impl Eq for WorkerId

§

impl StructuralEq for WorkerId

§

impl StructuralPartialEq for WorkerId

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<Q, K> Comparable<K> for Qwhere + Q: Ord + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
source§

impl<T> DeserializeOwned for Twhere + T: for<'de> Deserialize<'de>,

\ No newline at end of file diff --git a/workers/struct.WorkerParams.html b/workers/struct.WorkerParams.html new file mode 100644 index 0000000000..88ff859f0b --- /dev/null +++ b/workers/struct.WorkerParams.html @@ -0,0 +1,26 @@ +WorkerParams in workers - Rust

Struct workers::WorkerParams

source ·
pub struct WorkerParams { /* private fields */ }

Implementations§

source§

impl WorkerParams

source

pub fn new(deal_id: DealId, creator: PeerId, cu_ids: Vec<CUID>) -> Self

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/workers/struct.Workers.html b/workers/struct.Workers.html new file mode 100644 index 0000000000..9800d7a735 --- /dev/null +++ b/workers/struct.Workers.html @@ -0,0 +1,177 @@ +Workers in workers - Rust

Struct workers::Workers

source ·
pub struct Workers { /* private fields */ }
Expand description

Manages a collection of workers.

+

Implementations§

source§

impl Workers

source

pub async fn from_path( + config: WorkersConfig, + workers_dir: PathBuf, + key_storage: Arc<KeyStorage>, + core_distributor: Arc<dyn CoreDistributor>, + thread_pinner: Arc<dyn ThreadPinner> +) -> Result<(Self, Receiver<Event>)>

Creates a Workers instance by loading persisted worker data from the specified directory.

+
Arguments
+
    +
  • workers_dir - The path to the directory containing persisted worker data.
  • +
  • key_storage - An Arc<KeyStorage> instance for managing worker key pairs.
  • +
  • scope - A Scope instance used to determine the host and manage key pairs.
  • +
+
Returns
+

Returns Result<Self, eyre::Error> where:

+
    +
  • Ok(workers) if the Workers instance is successfully created.
  • +
  • Err(eyre::Error) if an error occurs during the creation process.
  • +
+
source

pub fn get_deal_id(&self, worker_id: WorkerId) -> Result<DealId, WorkersError>

Retrieves the deal ID associated with the specified worker ID.

+
Arguments
+
    +
  • worker_id - The PeerId of the worker for which the deal ID is requested.
  • +
+
Returns
+

Returns Result<DealId, WorkersError> where:

+
    +
  • Ok(deal_id) if the deal ID is successfully retrieved.
  • +
  • Err(WorkersError) if an error occurs, such as the worker not found.
  • +
+
source

pub async fn create_worker( + &self, + params: WorkerParams +) -> Result<WorkerId, WorkersError>

Creates a new worker with the given deal_id and initial peer ID.

+
Arguments
+
    +
  • deal_id - A String representing the unique identifier for the deal associated with the worker.
  • +
  • init_peer_id - The initial PeerId of the worker.
  • +
+
Returns
+

Returns Result<PeerId, WorkersError> where:

+
    +
  • Ok(worker_id) if the worker is successfully created, returning the ID of the created worker.
  • +
  • Err(WorkersError) if an error occurs, such as the worker already existing or key pair creation failure.
  • +
+
source

pub async fn remove_worker( + &self, + worker_id: WorkerId +) -> Result<(), WorkersError>

Removes a worker with the specified worker_id.

+
Arguments
+
    +
  • worker_id - The PeerId of the worker to be removed.
  • +
+
Returns
+

Returns Result<(), WorkersError> where:

+
    +
  • Ok(()) if the worker is successfully removed.
  • +
  • Err(WorkersError) if an error occurs, such as the worker not found or key pair removal failure.
  • +
+
source

pub async fn activate_worker( + &self, + worker_id: WorkerId +) -> Result<(), WorkersError>

Activates the worker with the specified worker_id.

+

The activation process sets the worker’s status to true, indicating that the worker +is active. The updated status is persisted, and internal data structures are updated.

+
Arguments
+
    +
  • worker_id - The PeerId of the worker to be activated.
  • +
+
Returns
+

Returns Result<(), WorkersError> where:

+
    +
  • Ok(()) if the activation is successful.
  • +
  • Err(WorkersError) if an error occurs during the activation process.
  • +
+
source

pub async fn deactivate_worker( + &self, + worker_id: WorkerId +) -> Result<(), WorkersError>

Deactivates the worker with the specified worker_id.

+

The deactivation process sets the worker’s status to false, indicating that the worker +is not active. The updated status is persisted, and internal data structures are updated.

+
Arguments
+
    +
  • worker_id - The PeerId of the worker to be deactivated.
  • +
+
Returns
+

Returns Result<(), WorkersError> where:

+
    +
  • Ok(()) if the deactivation is successful.
  • +
  • Err(WorkersError) if an error occurs during the deactivation process.
  • +
+
source

pub fn get_runtime_handle(&self, worker_id: WorkerId) -> Option<Handle>

source

pub fn get_worker_creator( + &self, + worker_id: WorkerId +) -> Result<PeerId, WorkersError>

Retrieves the creator PeerId associated with the specified worker PeerId.

+

If the provided worker_id belongs to the host, the host’s PeerId is returned. +Otherwise, the creator’s PeerId associated with the worker is retrieved.

+
Arguments
+
    +
  • worker_id - The PeerId of the worker for which the creator PeerId is requested.
  • +
+
Returns
+

Returns Result<PeerId, WorkersError> where:

+
    +
  • Ok(creator_peer_id) if the creator PeerId is successfully retrieved.
  • +
  • Err(WorkersError) if an error occurs, such as the worker not found.
  • +
+
source

pub fn get_worker_id(&self, deal_id: DealId) -> Result<WorkerId, WorkersError>

Retrieves the worker ID associated with the specified deal_id.

+
Arguments
+
    +
  • deal_id - The unique identifier (String) of the deal associated with the worker.
  • +
+
Returns
+

Returns Result<PeerId, WorkersError> where:

+
    +
  • Ok(worker_id) if the worker ID is successfully retrieved.
  • +
  • Err(WorkersError) if an error occurs, such as the worker not found.
  • +
+
source

pub fn is_worker_active(&self, worker_id: WorkerId) -> bool

Checks the activation status of the worker with the specified worker_id.

+

The activation status indicates whether the worker is currently active or not. If the +worker is the host, it is always considered active. Otherwise, the method checks the +internal data structures to determine the worker’s status.

+
Arguments
+
    +
  • worker_id - The PeerId of the worker to check for activation status.
  • +
+
Returns
+

Returns true if the worker is active, and false otherwise. If the worker with the +specified worker_id is not found, a warning is logged, and false is returned.

+
source

pub fn list_workers(&self) -> Vec<WorkerId>

Retrieves a list of all worker IDs.

+
Returns
+

Returns a Vec<WorkerId> representing a list of all worker IDs currently registered.

+
source

pub fn shutdown(&self)

source

pub async fn create_vm( + &self, + worker_id: WorkerId, + image: &Path +) -> Result<String, WorkersError>

source

pub fn start_vm(&self, worker_id: WorkerId) -> Result<(), WorkersError>

source

pub fn stop_vm(&self, worker_id: WorkerId) -> Result<(), WorkersError>

source

pub fn reboot_vm(&self, worker_id: WorkerId) -> Result<(), WorkersError>

source

pub fn reset_vm(&self, worker_id: WorkerId) -> Result<(), WorkersError>

source

pub fn status_vm(&self, worker_id: WorkerId) -> Result<VmStatus, WorkersError>

source

pub fn get_worker_assignment( + &self, + worker_id: WorkerId +) -> Result<Assignment, WorkersError>

Retrieves the assignment associated with the specified worker PeerId.

+
Arguments
+
    +
  • worker_id - The PeerId of the worker for which the creator PeerId is requested.
  • +
+
Returns
+

Returns Result<Assignment, WorkersError> where:

+
    +
  • Ok(assignment) if the creator PeerId is successfully retrieved.
  • +
  • Err(WorkersError) if an error occurs, such as the worker not found.
  • +
+

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/workers/struct.WorkersConfig.html b/workers/struct.WorkersConfig.html new file mode 100644 index 0000000000..7b7aeda59e --- /dev/null +++ b/workers/struct.WorkersConfig.html @@ -0,0 +1,26 @@ +WorkersConfig in workers - Rust

Struct workers::WorkersConfig

source ·
pub struct WorkersConfig { /* private fields */ }

Implementations§

source§

impl WorkersConfig

source

pub fn new(channel_size: usize, vm: Option<VmConfig>) -> Self

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an +Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where + F: FnOnce(&Self) -> bool,

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
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where + S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
\ No newline at end of file diff --git a/workers/trait.CoreDistributor.html b/workers/trait.CoreDistributor.html new file mode 100644 index 0000000000..b303b3dd8e --- /dev/null +++ b/workers/trait.CoreDistributor.html @@ -0,0 +1,12 @@ +CoreDistributor in workers - Rust
pub trait CoreDistributor: Send + Sync {
+    // Required methods
+    fn acquire_worker_cores(
+        &self,
+        acquire_request: AcquireRequest
+    ) -> Result<Assignment, AcquireError>;
+    fn release_worker_cores(&self, unit_ids: &[CUID]);
+    fn get_system_cpu_assignment(&self) -> SystemAssignment;
+}

Required Methods§

Implementors§

\ No newline at end of file diff --git a/workers/workers/enum.Event.html b/workers/workers/enum.Event.html new file mode 100644 index 0000000000..d26947039f --- /dev/null +++ b/workers/workers/enum.Event.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../workers/enum.Event.html...

+ + + \ No newline at end of file diff --git a/workers/workers/struct.VmConfig.html b/workers/workers/struct.VmConfig.html new file mode 100644 index 0000000000..a1cae1e6cf --- /dev/null +++ b/workers/workers/struct.VmConfig.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../workers/struct.VmConfig.html...

+ + + \ No newline at end of file diff --git a/workers/workers/struct.WorkerParams.html b/workers/workers/struct.WorkerParams.html new file mode 100644 index 0000000000..2f2f529a79 --- /dev/null +++ b/workers/workers/struct.WorkerParams.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../workers/struct.WorkerParams.html...

+ + + \ No newline at end of file diff --git a/workers/workers/struct.Workers.html b/workers/workers/struct.Workers.html new file mode 100644 index 0000000000..46d9dec31c --- /dev/null +++ b/workers/workers/struct.Workers.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../workers/struct.Workers.html...

+ + + \ No newline at end of file diff --git a/workers/workers/struct.WorkersConfig.html b/workers/workers/struct.WorkersConfig.html new file mode 100644 index 0000000000..09bb0b73a7 --- /dev/null +++ b/workers/workers/struct.WorkersConfig.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../workers/struct.WorkersConfig.html...

+ + + \ No newline at end of file