pub struct Hashiverse { /* private fields */ }Expand description
A configured Hashiverse client. Deref into a
hashiverse_lib::client::hashiverse_client::HashiverseClient for the full API.
Implementations§
Source§impl Hashiverse
impl Hashiverse
Sourcepub fn client(&self) -> &Arc<HashiverseClient>
pub fn client(&self) -> &Arc<HashiverseClient>
Direct access to the underlying Arc<HashiverseClient>. Use this when
you need to share the client between tasks; for one-shot calls you can
rely on the Deref impl and call methods on &Hashiverse directly.
Methods from Deref<Target = HashiverseClient>§
pub fn client_id(&self) -> &ClientId
pub fn active_pow_jobs(&self) -> Vec<PowJobStatus>
Sourcepub fn is_pow_busy(&self, within_millis: i64) -> bool
pub fn is_pow_busy(&self, within_millis: i64) -> bool
Whether there is background PoW work happening now, or within the last within_millis.
Drives the GUI “busy” indicator.
pub async fn client_storage_reset(&self) -> Result<(), Error>
pub async fn submit_post( &self, post: &str, ) -> Result<(Vec<SubmitPostCommitTokenV1>, (EncodedPostV1, Bytes)), Error>
Sourcepub async fn submit_post_with_wait(
&self,
post: &str,
wait_for_all_submissions: bool,
) -> Result<(Vec<SubmitPostCommitTokenV1>, (EncodedPostV1, Bytes)), Error>
pub async fn submit_post_with_wait( &self, post: &str, wait_for_all_submissions: bool, ) -> Result<(Vec<SubmitPostCommitTokenV1>, (EncodedPostV1, Bytes)), Error>
Submit a post, choosing whether to wait for the full fan-out. With wait_for_all_submissions == false this returns as soon as the mandatory User-bucket post secures its first commit and
completes the remaining redundancy and secondary buckets on a background task.
pub fn meta_post_manager(&self) -> &MetaPostManager
pub async fn submit_meta_post(&self) -> Result<(), Error>
pub async fn ensure_meta_post_in_current_bucket(&self) -> Result<(), Error>
pub async fn submit_feedback( &self, bucket_location: BucketLocation, post_id: Id, feedback_type: u8, ) -> Result<(), Error>
pub async fn get_post( &self, bucket_location: BucketLocation, post_id: &Id, ) -> Result<(BucketLocation, EncodedPostV1, Bytes, bool), Error>
pub async fn get_post_feedbacks( &self, bucket_location: BucketLocation, post_id: Id, ) -> Result<[u64; 256], Error>
pub async fn single_timeline_reset(&self) -> Result<(), Error>
pub async fn single_timeline_lock( &self, bucket_type: BucketType, base_id: &Id, ) -> Result<RwLockWriteGuard<'_, Option<SingleTimeline>>, Error>
pub async fn single_timeline_get_more( &self, bucket_type: BucketType, base_id: &Id, ) -> Result<(Vec<(BucketLocation, EncodedPostV1, Bytes, bool)>, TimeMillis), Error>
pub async fn multiple_timeline_reset(&self) -> Result<(), Error>
pub async fn multiple_timeline_lock( &self, bucket_type: BucketType, base_ids: &Vec<Id>, ) -> Result<RwLockWriteGuard<'_, Option<MultipleTimeline>>, Error>
pub async fn multiple_timeline_get_more( &self, bucket_type: BucketType, base_ids: &Vec<Id>, ) -> Result<(Vec<(BucketLocation, EncodedPostV1, Bytes, bool)>, TimeMillis), Error>
pub async fn get_all_known_peers(&self) -> Vec<Peer>
pub async fn fetch_url_preview( &self, url: &str, ) -> Result<FetchUrlPreviewResponseV1, Error>
Sourcepub async fn fetch_peer_stats(&self, peer_id: &Id) -> Result<Value, Error>
pub async fn fetch_peer_stats(&self, peer_id: &Id) -> Result<Value, Error>
Issue a PeerStatsRequestV1 to the peer identified by peer_id and return
the verified, decompressed stats document.
The signature is verified against the response’s own peer field — callers
receive either a verified serde_json::Value or an error. The doc’s schema
is open-ended; the server decides what fields to include and at what nesting.
pub async fn dispatch_command(&self, command: &String) -> Result<(), Error>
Trait Implementations§
Source§impl Deref for Hashiverse
impl Deref for Hashiverse
Source§type Target = HashiverseClient
type Target = HashiverseClient
Source§fn deref(&self) -> &HashiverseClient
fn deref(&self) -> &HashiverseClient
Auto Trait Implementations§
impl Freeze for Hashiverse
impl !RefUnwindSafe for Hashiverse
impl Send for Hashiverse
impl Sync for Hashiverse
impl Unpin for Hashiverse
impl UnsafeUnpin for Hashiverse
impl !UnwindSafe for Hashiverse
Blanket Implementations§
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<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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