Struct scabbard::service::Scabbard [−][src]
pub struct Scabbard { /* fields omitted */ }
A service for running Sawtooth Sabre smart contracts with two-phase commit consensus.
Implementations
impl Scabbard
[src]
impl Scabbard
[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]
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.
pub fn get_state_at_address(
&self,
address: &str
) -> Result<Option<Vec<u8>>, ScabbardError>
[src]
pub fn get_state_at_address(
&self,
address: &str
) -> Result<Option<Vec<u8>>, ScabbardError>
[src]Fetch the value at the given address
in the scabbard service’s state. Returns None
if
the address
is not set.
pub fn get_state_with_prefix(
&self,
prefix: Option<&str>
) -> Result<StateIter, ScabbardError>
[src]
pub fn get_state_with_prefix(
&self,
prefix: Option<&str>
) -> Result<StateIter, ScabbardError>
[src]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.
pub fn get_current_state_root(&self) -> Result<String, ScabbardError>
[src]
pub fn get_current_state_root(&self) -> Result<String, ScabbardError>
[src]Get the current state root hash of the scabbard service’s state.
pub fn add_batches(
&self,
batches: Vec<BatchPair>
) -> Result<Option<String>, ScabbardError>
[src]
&self,
batches: Vec<BatchPair>
) -> Result<Option<String>, ScabbardError>
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 get_events_since(
&self,
event_id: Option<String>
) -> Result<Events, ScabbardError>
[src]
&self,
event_id: Option<String>
) -> Result<Events, ScabbardError>
pub fn add_state_subscriber(
&self,
subscriber: Box<dyn StateSubscriber>
) -> Result<(), ScabbardError>
[src]
&self,
subscriber: Box<dyn StateSubscriber>
) -> Result<(), ScabbardError>
Trait Implementations
impl Service for Scabbard
[src]
impl Service for Scabbard
[src]fn service_id(&self) -> &str
[src]
fn service_id(&self) -> &str
[src]This service’s ID Read more
fn service_type(&self) -> &str
[src]
fn service_type(&self) -> &str
[src]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
fn destroy(self: Box<Self>) -> Result<(), ServiceDestroyError>
[src]
fn destroy(self: Box<Self>) -> Result<(), ServiceDestroyError>
[src]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
fn purge(&mut self) -> Result<(), InternalError>
[src]
fn purge(&mut self) -> Result<(), InternalError>
[src]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 Send for Scabbard
impl Sync for Scabbard
impl Unpin for Scabbard
impl UnwindSafe for Scabbard
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<'a, T> DefaultFeatures<'a> for T where
T: 'a + Send + Sync + Clone,
impl<'a, T> DefaultFeatures<'a> for T where
T: 'a + Send + Sync + Clone,
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<P, N> IntoBytes<P> for N where
P: Message + FromNative<N>,
[src]
impl<P, N> IntoBytes<P> for N where
P: Message + FromNative<N>,
[src]pub fn into_bytes(Self) -> Result<Vec<u8, Global>, ProtoConversionError>
[src]
impl<P, N> IntoBytes<P> for N where
P: Message + FromNative<N>,
[src]
impl<P, N> IntoBytes<P> for N where
P: Message + FromNative<N>,
[src]pub fn into_bytes(self) -> Result<Vec<u8, Global>, ProtoConversionError>
[src]
impl<N, P> IntoNative<N> for P where
N: FromProto<P>,
[src]
impl<N, P> IntoNative<N> for P where
N: FromProto<P>,
[src]pub fn into_native(Self) -> Result<N, ProtoConversionError>
[src]
impl<N, P> IntoNative<N> for P where
N: FromProto<P>,
[src]
impl<N, P> IntoNative<N> for P where
N: FromProto<P>,
[src]pub fn into_native(self) -> Result<N, ProtoConversionError>
[src]
impl<N, P> IntoProto<P> for N where
P: FromNative<N>,
[src]
impl<N, P> IntoProto<P> for N where
P: FromNative<N>,
[src]pub fn into_proto(Self) -> Result<P, ProtoConversionError>
[src]
impl<N, P> IntoProto<P> for N where
P: FromNative<N>,
[src]
impl<N, P> IntoProto<P> for N where
P: FromNative<N>,
[src]pub fn into_proto(self) -> Result<P, ProtoConversionError>
[src]
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
impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,