pub enum ChangeOrigin {
Local,
Remote {
peer_id: String,
},
}Expand description
Where a document change came from — a local write vs. a remote peer’s sync.
This is the substrate-level signal a consumer needs to decide whether a
change is worth surfacing to the user (e.g. a local notification). A
remote change is something another node did and may warrant alerting;
a local change is the user’s own edit and usually is not. peat stays
domain-agnostic: it reports origin, collection, and doc id — the consumer
owns the notability policy and the notification text. Mirrors peat-mesh’s
internal ChangeOrigin (which isn’t UniFFI-decorated) at the FFI boundary.
Variants§
Local
The change originated from a local write on this node.
Remote
The change arrived from a remote peer via sync. peer_id is that peer’s
stable identifier (hex node id for the iroh transport; the store keeps it
transport-agnostic so BLE/Lite peers populate the same field).
Trait Implementations§
Source§impl Clone for ChangeOrigin
impl Clone for ChangeOrigin
Source§fn clone(&self) -> ChangeOrigin
fn clone(&self) -> ChangeOrigin
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<UT> ConvertError<UT> for ChangeOrigin
impl<UT> ConvertError<UT> for ChangeOrigin
fn try_convert_unexpected_callback_error( e: UnexpectedUniFFICallbackError, ) -> Result<Self>
Source§impl Debug for ChangeOrigin
impl Debug for ChangeOrigin
Source§impl<UT> FfiConverter<UT> for ChangeOrigin
impl<UT> FfiConverter<UT> for ChangeOrigin
Source§const TYPE_ID_META: MetadataBuffer
const TYPE_ID_META: MetadataBuffer
Source§type FfiType = RustBuffer
type FfiType = RustBuffer
Source§fn lower(v: Self) -> RustBuffer
fn lower(v: Self) -> RustBuffer
Source§fn try_lift(buf: RustBuffer) -> Result<Self>
fn try_lift(buf: RustBuffer) -> Result<Self>
Source§impl From<ChangeOrigin> for ChangeOrigin
Available on crate feature sync only.
impl From<ChangeOrigin> for ChangeOrigin
sync only.Source§fn from(o: _PeatMeshChangeOrigin) -> Self
fn from(o: _PeatMeshChangeOrigin) -> Self
Source§impl<UT> Lift<UT> for ChangeOrigin
impl<UT> Lift<UT> for ChangeOrigin
Source§impl<UT> LiftRef<UT> for ChangeOrigin
impl<UT> LiftRef<UT> for ChangeOrigin
type LiftType = ChangeOrigin
Source§impl<UT> LiftReturn<UT> for ChangeOrigin
impl<UT> LiftReturn<UT> for ChangeOrigin
Source§type ReturnType = <ChangeOrigin as Lift<UT>>::FfiType
type ReturnType = <ChangeOrigin as Lift<UT>>::FfiType
Source§fn try_lift_successful_return(v: Self::ReturnType) -> Result<Self>
fn try_lift_successful_return(v: Self::ReturnType) -> Result<Self>
Source§fn lift_foreign_return(
ffi_return: Self::ReturnType,
call_status: RustCallStatus,
) -> Self
fn lift_foreign_return( ffi_return: Self::ReturnType, call_status: RustCallStatus, ) -> Self
Source§fn lift_error(_buf: RustBuffer) -> Self
fn lift_error(_buf: RustBuffer) -> Self
Source§fn handle_callback_unexpected_error(e: UnexpectedUniFFICallbackError) -> Self
fn handle_callback_unexpected_error(e: UnexpectedUniFFICallbackError) -> Self
Source§impl<UT> Lower<UT> for ChangeOrigin
impl<UT> Lower<UT> for ChangeOrigin
type FfiType = <ChangeOrigin as FfiConverter<UT>>::FfiType
fn lower(obj: Self) -> Self::FfiType
fn write(obj: Self, buf: &mut Vec<u8>)
Source§fn lower_into_rust_buffer(obj: Self) -> RustBuffer
fn lower_into_rust_buffer(obj: Self) -> RustBuffer
Source§impl<UT> LowerError<UT> for ChangeOrigin
impl<UT> LowerError<UT> for ChangeOrigin
Source§fn lower_error(obj: Self) -> RustBuffer
fn lower_error(obj: Self) -> RustBuffer
Source§impl<UT> LowerReturn<UT> for ChangeOrigin
impl<UT> LowerReturn<UT> for ChangeOrigin
Source§type ReturnType = <ChangeOrigin as Lower<UT>>::FfiType
type ReturnType = <ChangeOrigin as Lower<UT>>::FfiType
Source§fn lower_return(v: Self) -> Result<Self::ReturnType, RustCallError>
fn lower_return(v: Self) -> Result<Self::ReturnType, RustCallError>
Source§fn handle_failed_lift(
error: LiftArgsError,
) -> Result<Self::ReturnType, RustCallError>
fn handle_failed_lift( error: LiftArgsError, ) -> Result<Self::ReturnType, RustCallError>
Source§impl<UT> TypeId<UT> for ChangeOrigin
impl<UT> TypeId<UT> for ChangeOrigin
Auto Trait Implementations§
impl Freeze for ChangeOrigin
impl RefUnwindSafe for ChangeOrigin
impl Send for ChangeOrigin
impl Sync for ChangeOrigin
impl Unpin for ChangeOrigin
impl UnsafeUnpin for ChangeOrigin
impl UnwindSafe for ChangeOrigin
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
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