Skip to main content

Remote

Struct Remote 

Source
pub struct Remote<T: RpcTransport<Error = Error>> {
    pub api: Client<T>,
    pub description: DescribeEndpointResponse,
}
Expand description

One authenticated source. A combined Thread retains one source per endpoint; a hosted action is sent directly to the Weft source, never via a device.

Fields§

§api: Client<T>§description: DescribeEndpointResponse

Implementations§

Source§

impl<T: RpcTransport<Error = Error>> Remote<T>

Source

pub async fn read_blobs( &self, thread: ThreadRef, revision: RevisionRef, sources: Vec<BlobSource>, ) -> Result<Vec<Blob>, Error>

One request for any mixture of paths and missing object hashes. The The selected Thread and revision pin content and authorization without a mutable Thread-tip lookup.

Source§

impl<T: RpcTransport<Error = Error>> Remote<T>

Source

pub async fn start_thread( &self, creation: &ThreadCreation, ) -> Result<ThreadMutationResponse, ClientError<Error>>

One command returns its receipt and resulting overview. Bind subsequent calls with remote.thread(creation.reference().clone()), without lookup.

Source§

impl<T: RpcTransport<Error = Error>> Remote<T>

Source

pub async fn begin_provider_fetch( &self, open: FetchOpen, limits: Limits, ) -> Result<ProviderFetch<T::Writer, T::Reader>, Error>

Source§

impl<T: RpcTransport<Error = Error>> Remote<T>

Source

pub async fn fetch_content( &self, open: FetchOpen, limits: Limits, ) -> Result<Download<T::Reader>, Error>

A single exact Thread/revision request returns clone admission, immutable operations, and bounded source artifacts. No reference update is implied.

Source§

impl<T: RpcTransport<Error = Error>> Remote<T>

Source

pub async fn publish_content<R: AsyncRead + Unpin + Send>( &self, opening: &PublishContentClientFrame, originals: &PublicationOriginals, artifacts: [R; 2], ) -> Result<PublicationReceipt, Error>

Publish original source proofs and exact source in one exchange. Inputs are the native pack and its index in opening order; neither is buffered in full. The caller retains the operation ID and opening to retry after an interrupted call. A receipt is returned only after verifying its exact publication scope.

Source§

impl<T: RpcTransport<Error = Error>> Remote<T>

Source

pub async fn discover( transport: T, endpoint_key: [u8; 32], kind: EndpointKind, ) -> Result<Self, ClientError<Error>>

The caller supplies the Iroh-authenticated endpoint key and intended kind. Describe is the only bootstrap exception to implemented-method discovery.

Source

pub async fn observe<M>( &self, request: M::Request, resume: Option<Resume>, ) -> Result<Observation<T::Reader, M::Response>, Error>

Observe any contract view as atomic bounded batches. The bookmark binds the exact method and projection as well as the authenticated endpoint.

Source

pub async fn observe_analysis( &self, request: ObserveAnalysisRequest, resume: Option<Resume>, ) -> Result<AnalysisObservation<T::Reader>, Error>

Source-backed analysis uses the same committed view protocol as identity, collaboration, checkouts and Thread observations.

Source

pub fn thread(&self, thread: ThreadRef) -> Thread<'_, T>

Binding a Thread is local and costs no RPC. Persist this stable reference when discovering/creating the Thread; its display name is never its key.

Auto Trait Implementations§

§

impl<T> Freeze for Remote<T>
where Client<T>: Freeze,

§

impl<T> RefUnwindSafe for Remote<T>

§

impl<T> Send for Remote<T>
where Client<T>: Send,

§

impl<T> Sync for Remote<T>
where Client<T>: Sync,

§

impl<T> Unpin for Remote<T>
where Client<T>: Unpin,

§

impl<T> UnsafeUnpin for Remote<T>
where Client<T>: UnsafeUnpin,

§

impl<T> UnwindSafe for Remote<T>
where Client<T>: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more