pub struct CountersigningWorkspace { /* private fields */ }
Expand description
A cheaply clonable, thread safe and in-memory store for active countersigning sessions.
Implementations§
source§impl CountersigningWorkspace
impl CountersigningWorkspace
sourcepub fn new() -> CountersigningWorkspace
pub fn new() -> CountersigningWorkspace
Create a new empty countersigning workspace.
Examples found in repository?
More examples
src/conductor/space.rs (line 690)
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
fn new(
dna_hash: Arc<DnaHash>,
root_db_dir: &DatabaseRootPath,
db_sync_strategy: DbSyncStrategy,
) -> ConductorResult<Self> {
use holochain_p2p::DnaHashExt;
let space = dna_hash.to_kitsune();
let db_sync_level = match db_sync_strategy {
DbSyncStrategy::Fast => DbSyncLevel::Off,
DbSyncStrategy::Resilient => DbSyncLevel::Normal,
};
let cache = DbWrite::open_with_sync_level(
root_db_dir.as_ref(),
DbKindCache(dna_hash.clone()),
db_sync_level,
)?;
let authored_db = DbWrite::open_with_sync_level(
root_db_dir.as_ref(),
DbKindAuthored(dna_hash.clone()),
DbSyncLevel::Normal,
)?;
let dht_db = DbWrite::open_with_sync_level(
root_db_dir.as_ref(),
DbKindDht(dna_hash.clone()),
db_sync_level,
)?;
let p2p_agents_db = DbWrite::open_with_sync_level(
root_db_dir.as_ref(),
DbKindP2pAgents(space.clone()),
db_sync_level,
)?;
let p2p_metrics_db = DbWrite::open_with_sync_level(
root_db_dir.as_ref(),
DbKindP2pMetrics(space),
db_sync_level,
)?;
let conductor_db: DbWrite<DbKindConductor> =
DbWrite::open_with_sync_level(root_db_dir.as_ref(), DbKindConductor, db_sync_level)?;
let (tx, rx) = tokio::sync::mpsc::channel(100);
tokio::spawn(p2p_agent_store::p2p_put_all_batch(
p2p_agents_db.clone(),
rx,
));
let p2p_batch_sender = tx;
let countersigning_workspace = CountersigningWorkspace::new();
let incoming_op_hashes = IncomingOpHashes::default();
let incoming_ops_batch = IncomingOpsBatch::default();
let dht_query_cache = DhtDbQueryCache::new(dht_db.clone().into());
let r = Self {
dna_hash,
cache_db: cache,
authored_db,
dht_db,
p2p_agents_db,
p2p_metrics_db,
p2p_batch_sender,
countersigning_workspace,
incoming_op_hashes,
incoming_ops_batch,
dht_query_cache,
conductor_db,
};
Ok(r)
}
Trait Implementations§
source§impl Clone for CountersigningWorkspace
impl Clone for CountersigningWorkspace
source§fn clone(&self) -> CountersigningWorkspace
fn clone(&self) -> CountersigningWorkspace
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for CountersigningWorkspace
impl Send for CountersigningWorkspace
impl Sync for CountersigningWorkspace
impl Unpin for CountersigningWorkspace
impl !UnwindSafe for CountersigningWorkspace
Blanket Implementations§
§impl<T> Any for Twhere
T: Any + ?Sized,
impl<T> Any for Twhere
T: Any + ?Sized,
§fn type_id_compat(&self) -> TypeId
fn type_id_compat(&self) -> TypeId
TODO: once 1.33.0 is the minimum supported compiler version, remove
Any::type_id_compat and use StdAny::type_id instead.
https://github.com/rust-lang/rust/issues/27745
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
§impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
§fn deserialize(
&self,
deserializer: &mut D
) -> Result<With<T, W>, <D as Fallible>::Error>
fn deserialize(
&self,
deserializer: &mut D
) -> Result<With<T, W>, <D as Fallible>::Error>
Deserializes using the given deserializer
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.§impl<T> Upcastable for Twhere
T: 'static + Any + Send + Sync,
impl<T> Upcastable for Twhere
T: 'static + Any + Send + Sync,
§fn upcast_any_ref(&self) -> &(dyn Any + 'static)
fn upcast_any_ref(&self) -> &(dyn Any + 'static)
upcast ref
§fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)
upcast mut ref