pub struct BlossomClient { /* private fields */ }Expand description
Minimal client. Holds a long-lived reqwest::Client, the target
Blossom server URL, and the Nostr Keys used to sign auth
events. One client per (server, identity) pair.
Implementations§
Source§impl BlossomClient
impl BlossomClient
pub fn new(server: impl Into<String>, keys: Keys) -> Self
Sourcepub fn with_auth_ttl(self, secs: u64) -> Self
pub fn with_auth_ttl(self, secs: u64) -> Self
Override the auth-event TTL. Most callers don’t need this.
Sourcepub async fn put(&self, bytes: Vec<u8>) -> Result<UploadResponse>
pub async fn put(&self, bytes: Vec<u8>) -> Result<UploadResponse>
Upload bytes (already-encrypted ciphertext). Returns the
server’s response; the sha256 field is what callers should
persist as the checkpoint’s content address.
Auto Trait Implementations§
impl !Freeze for BlossomClient
impl !RefUnwindSafe for BlossomClient
impl Send for BlossomClient
impl Sync for BlossomClient
impl Unpin for BlossomClient
impl UnsafeUnpin for BlossomClient
impl !UnwindSafe for BlossomClient
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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