Struct agde::sync::ResponseBuilder
source · pub struct ResponseBuilder<'a> { /* private fields */ }
Expand description
Implementations§
source§impl<'a> ResponseBuilder<'a>
impl<'a> ResponseBuilder<'a>
sourcepub fn next_signature(
&mut self
) -> Option<(&str, &Signature, Option<&mut Unwinder<'a>>)>
pub fn next_signature( &mut self ) -> Option<(&str, &Signature, Option<&mut Unwinder<'a>>)>
Use this in a while let Some((resource, signature)) = response_builder.next_signature()
loop to add all the returned values to Self::add_diff
.
If you don’t have a resource, just don’t call Self::add_diff
. Agde will then automatically
send a delete event then.
sourcepub fn unwinder(&mut self) -> Option<&mut Unwinder<'a>>
pub fn unwinder(&mut self) -> Option<&mut Unwinder<'a>>
Returns the unwinder (if any) to use for the resource
before adding it.
sourcepub fn add_diff(&mut self, resource: String, diff: Difference) -> &mut Self
pub fn add_diff(&mut self, resource: String, diff: Difference) -> &mut Self
Tell the requester their resource
needs to apply diff
to get our data.
You have to unwind resource
before getting the diff
if Self::unwinder
returns
Some
.
Panics
Panics if you’ve called this with the same resource
before.