Struct scabbard::service::Scabbard [−][src]
pub struct Scabbard { /* fields omitted */ }
Expand description
A service for running Sawtooth Sabre smart contracts with two-phase commit consensus.
Implementations
pub fn new(
service_id: String,
circuit_id: &str,
version: ScabbardVersion,
peer_services: HashSet<String>,
state_db_dir: &Path,
state_db_size: usize,
receipt_db_dir: &Path,
receipt_db_size: usize,
signature_verifier: Box<dyn SignatureVerifier>,
admin_keys: Vec<String>,
coordinator_timeout: Option<Duration>
) -> Result<Self, ScabbardError>
[src]
pub fn new(
service_id: String,
circuit_id: &str,
version: ScabbardVersion,
peer_services: HashSet<String>,
state_db_dir: &Path,
state_db_size: usize,
receipt_db_dir: &Path,
receipt_db_size: usize,
signature_verifier: Box<dyn SignatureVerifier>,
admin_keys: Vec<String>,
coordinator_timeout: Option<Duration>
) -> Result<Self, ScabbardError>
[src]Generate a new Scabbard service.
Fetch the value at the given address
in the scabbard service’s state. Returns None
if
the address
is not set.
Fetch a list of entries in the scabbard service’s state. If a prefix
is provided, only
return entries whose addresses are under the given address prefix. If no prefix
is
provided, return all state entries.
Get the current state root hash of the scabbard service’s state.
pub fn get_batch_info(
&self,
ids: HashSet<String>,
wait: Option<Duration>
) -> Result<BatchInfoIter, ScabbardError>
[src]
pub fn get_batch_info(
&self,
ids: HashSet<String>,
wait: Option<Duration>
) -> Result<BatchInfoIter, ScabbardError>
[src]Get the BatchInfo
for each specified batch.
Arguments
ids
: List of batch IDs to get info onwait
: IfSome
, wait up to the given time for all requested batches to complete (statuses will be eitherCommitted
orInvalid
); if the timeout expires, anErr
result will be given by the returned iterator. IfNone
, return theBatchInfo
s to complete.
pub fn add_state_subscriber(
&self,
subscriber: Box<dyn StateSubscriber>
) -> Result<(), ScabbardError>
[src]Trait Implementations
This service’s ID Read more
This service’s type Read more
fn start(
&mut self,
service_registry: &dyn ServiceNetworkRegistry
) -> Result<(), ServiceStartError>
[src]
fn start(
&mut self,
service_registry: &dyn ServiceNetworkRegistry
) -> Result<(), ServiceStartError>
[src]Starts the service Read more
fn stop(
&mut self,
service_registry: &dyn ServiceNetworkRegistry
) -> Result<(), ServiceStopError>
[src]
fn stop(
&mut self,
service_registry: &dyn ServiceNetworkRegistry
) -> Result<(), ServiceStopError>
[src]Stops Starts the service Read more
Clean-up any resources before the service is removed. Consumes the service (which, given the use of dyn traits, this must take a boxed Service instance). Read more
Purge any persistent state maintained by this service.
fn handle_message(
&self,
message_bytes: &[u8],
_message_context: &ServiceMessageContext
) -> Result<(), ServiceError>
[src]
fn handle_message(
&self,
message_bytes: &[u8],
_message_context: &ServiceMessageContext
) -> Result<(), ServiceError>
[src]Handle any incoming message intended for this service instance. Read more
Auto Trait Implementations
impl RefUnwindSafe for Scabbard
impl UnwindSafe for Scabbard
Blanket Implementations
Mutably borrows from an owned value. Read more
pub fn clone_boxed(&self) -> Box<dyn DefaultFeatures<'a> + 'a, Global>
pub fn clone_boxed(&self) -> Box<dyn DefaultFeatures<'a> + 'a, Global>
Clone this value, and then immediately put it into a Box
behind a trait object of this trait. Read more
pub fn self_address_mut(&mut self) -> *mut ()
pub fn self_address_mut(&mut self) -> *mut ()
Returns the address of self
. Read more
impl<'a, T> NonSyncFeatures<'a> for T where
T: 'a + Clone,
impl<'a, T> NonSyncFeatures<'a> for T where
T: 'a + Clone,
pub fn clone_boxed(&self) -> Box<dyn NonSyncFeatures<'a> + 'a, Global>
pub fn clone_boxed(&self) -> Box<dyn NonSyncFeatures<'a> + 'a, Global>
Clone this value, and then immediately put it into a Box
behind a trait object of this trait. Read more
pub fn self_address_mut(&mut self) -> *mut ()
pub fn self_address_mut(&mut self) -> *mut ()
Returns the address of self
. Read more
impl<T> SafeBorrow<T> for T where
T: ?Sized,
impl<T> SafeBorrow<T> for T where
T: ?Sized,
pub fn borrow_replacement(ptr: &T) -> &T
pub fn borrow_replacement(ptr: &T) -> &T
Given ptr
, which was obtained from a prior call to Self::borrow()
,
return a value with the same nominal lifetime which is guaranteed to
survive mutations to Self
. Read more
type Output = T
type Output = T
Should always be Self
pub fn vzip(self) -> V