pub struct PointerService { /* private fields */ }Expand description
Handles pointer requests against a PointerStore.
Implementations§
Source§impl PointerService
impl PointerService
Sourcepub fn new(store: PointerStore) -> Self
pub fn new(store: PointerStore) -> Self
Build a service over store.
Sourcepub fn attach_p2p_node(&self, p2p_node: Arc<P2PNode>)
pub fn attach_p2p_node(&self, p2p_node: Arc<P2PNode>)
Apply the self-closeness gate, so a pointer PUT is admitted only where the node is actually responsible.
Without it one valid proof can be replayed to every node on the network, each of which would store the record and trigger replication for an address it has no business holding.
Sourcepub fn with_chunk_store(self, chunks: Arc<ChunkStore>) -> Self
pub fn with_chunk_store(self, chunks: Arc<ChunkStore>) -> Self
Consult chunks before storing, so a cross-kind address collision is
refused rather than resolved by whichever kind arrived last.
Sourcepub fn with_payments(self, payments: Arc<PaymentVerifier>) -> Self
pub fn with_payments(self, payments: Arc<PaymentVerifier>) -> Self
Require payment, verified against each record’s state_id.
Sourcepub fn attach_fresh_writes(&self, writes: UnboundedSender<PointerFreshWrite>)
pub fn attach_fresh_writes(&self, writes: UnboundedSender<PointerFreshWrite>)
Hand every newly stored paid state to replication on writes.
Sourcepub fn attach_final_state_witness(&self, witness: Arc<dyn FinalStateWitness>)
pub fn attach_final_state_witness(&self, witness: Arc<dyn FinalStateWitness>)
Ask witness before taking a final state this node does not hold.
Sourcepub const fn store(&self) -> &PointerStore
pub const fn store(&self) -> &PointerStore
The store this service fronts.
Sourcepub async fn handle_put(&self, request: PointerPutRequest) -> PointerPutResponse
pub async fn handle_put(&self, request: PointerPutRequest) -> PointerPutResponse
Handle a pointer PUT.
Never returns Err: a rejection is a response the peer should see, so
every failure is mapped onto PointerPutResponse.
Sourcepub async fn handle_get(&self, request: PointerGetRequest) -> PointerGetResponse
pub async fn handle_get(&self, request: PointerGetRequest) -> PointerGetResponse
Handle a pointer GET.
Trait Implementations§
Source§impl Clone for PointerService
impl Clone for PointerService
Auto Trait Implementations§
impl !RefUnwindSafe for PointerService
impl !UnwindSafe for PointerService
impl Freeze for PointerService
impl Send for PointerService
impl Sync for PointerService
impl Unpin for PointerService
impl UnsafeUnpin for PointerService
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more