Trait identity_iota::core::diff::Diff
[−]pub trait Diff: Clone + Debug + PartialEq<Self> {
type Type: Sized + Clone + Debug + PartialEq<Self::Type> + for<'de> Deserialize<'de> + Serialize;
fn diff(&self, other: &Self) -> Result<Self::Type, Error>;
fn merge(&self, diff: Self::Type) -> Result<Self, Error>;
fn from_diff(diff: Self::Type) -> Result<Self, Error>;
fn into_diff(self) -> Result<Self::Type, Error>;
}
diff chain features are slated for removal
Expand description
The primary Diff
Trait type.
Required Associated Types
Required Methods
diff chain features are slated for removal
Finds the difference between two types; self
and other
and returns Self::Type
diff chain features are slated for removal
Merges a Self::Type
with Self
diff chain features are slated for removal
Converts a diff
of type Self::Type
to a Self
.
Implementations on Foreign Types
impl Diff for u128
impl Diff for u128
type Type = Diffu128
type Type = Diffu128
diff chain features are slated for removal
fn diff(&self, other: &u128) -> Result<<u128 as Diff>::Type, Error>
fn diff(&self, other: &u128) -> Result<<u128 as Diff>::Type, Error>
diff chain features are slated for removal
fn merge(&self, diff: <u128 as Diff>::Type) -> Result<u128, Error>
fn merge(&self, diff: <u128 as Diff>::Type) -> Result<u128, Error>
diff chain features are slated for removal
impl Diff for i128
impl Diff for i128
type Type = Diffi128
type Type = Diffi128
diff chain features are slated for removal
fn diff(&self, other: &i128) -> Result<<i128 as Diff>::Type, Error>
fn diff(&self, other: &i128) -> Result<<i128 as Diff>::Type, Error>
diff chain features are slated for removal
fn merge(&self, diff: <i128 as Diff>::Type) -> Result<i128, Error>
fn merge(&self, diff: <i128 as Diff>::Type) -> Result<i128, Error>
diff chain features are slated for removal
impl Diff for i16
impl Diff for i16
type Type = Diffi16
type Type = Diffi16
diff chain features are slated for removal
fn diff(&self, other: &i16) -> Result<<i16 as Diff>::Type, Error>
fn diff(&self, other: &i16) -> Result<<i16 as Diff>::Type, Error>
diff chain features are slated for removal
fn merge(&self, diff: <i16 as Diff>::Type) -> Result<i16, Error>
fn merge(&self, diff: <i16 as Diff>::Type) -> Result<i16, Error>
diff chain features are slated for removal
impl<K, V> Diff for HashMap<K, V, RandomState> where
K: Clone + Debug + PartialEq<K> + Eq + Hash + Diff + for<'de> Deserialize<'de> + Serialize,
V: Clone + Debug + PartialEq<V> + Diff + for<'de> Deserialize<'de> + Serialize,
impl<K, V> Diff for HashMap<K, V, RandomState> where
K: Clone + Debug + PartialEq<K> + Eq + Hash + Diff + for<'de> Deserialize<'de> + Serialize,
V: Clone + Debug + PartialEq<V> + Diff + for<'de> Deserialize<'de> + Serialize,
Diff Implementation on a HashMap<K, V>
type Type = DiffHashMap<K, V>
👎 Deprecated since 0.5.0: diff chain features are slated for removal
type Type = DiffHashMap<K, V>
diff chain features are slated for removal
the Diff type of the HashMap<K, V>
fn diff(
&self,
other: &HashMap<K, V, RandomState>
) -> Result<<HashMap<K, V, RandomState> as Diff>::Type, Error>
👎 Deprecated since 0.5.0: diff chain features are slated for removal
fn diff(
&self,
other: &HashMap<K, V, RandomState>
) -> Result<<HashMap<K, V, RandomState> as Diff>::Type, Error>
diff chain features are slated for removal
Diffs two HashMaps
; self
and other
and creates a DiffHashMap<K, V>
fn merge(
&self,
diff: <HashMap<K, V, RandomState> as Diff>::Type
) -> Result<HashMap<K, V, RandomState>, Error>
👎 Deprecated since 0.5.0: diff chain features are slated for removal
fn merge(
&self,
diff: <HashMap<K, V, RandomState> as Diff>::Type
) -> Result<HashMap<K, V, RandomState>, Error>
diff chain features are slated for removal
Merges the changes in a DiffHashMap<K, V>
, diff
with a HashMap<K, V>
, self
.
fn from_diff(
diff: <HashMap<K, V, RandomState> as Diff>::Type
) -> Result<HashMap<K, V, RandomState>, Error>
👎 Deprecated since 0.5.0: diff chain features are slated for removal
fn from_diff(
diff: <HashMap<K, V, RandomState> as Diff>::Type
) -> Result<HashMap<K, V, RandomState>, Error>
diff chain features are slated for removal
Converts a DiffHashMap<K, V>
, diff
into a HashMap<K, V>
.
impl Diff for i64
impl Diff for i64
type Type = Diffi64
type Type = Diffi64
diff chain features are slated for removal
fn diff(&self, other: &i64) -> Result<<i64 as Diff>::Type, Error>
fn diff(&self, other: &i64) -> Result<<i64 as Diff>::Type, Error>
diff chain features are slated for removal
fn merge(&self, diff: <i64 as Diff>::Type) -> Result<i64, Error>
fn merge(&self, diff: <i64 as Diff>::Type) -> Result<i64, Error>
diff chain features are slated for removal
impl Diff for f32
impl Diff for f32
type Type = DiffF32
type Type = DiffF32
diff chain features are slated for removal
fn diff(&self, other: &f32) -> Result<<f32 as Diff>::Type, Error>
fn diff(&self, other: &f32) -> Result<<f32 as Diff>::Type, Error>
diff chain features are slated for removal
fn merge(&self, diff: <f32 as Diff>::Type) -> Result<f32, Error>
fn merge(&self, diff: <f32 as Diff>::Type) -> Result<f32, Error>
diff chain features are slated for removal
impl<T> Diff for HashSet<T, RandomState> where
T: Debug + Clone + PartialEq<T> + Eq + Diff + Hash + for<'de> Deserialize<'de> + Serialize,
impl<T> Diff for HashSet<T, RandomState> where
T: Debug + Clone + PartialEq<T> + Eq + Diff + Hash + for<'de> Deserialize<'de> + Serialize,
type Type = DiffHashSet<T>
type Type = DiffHashSet<T>
diff chain features are slated for removal
fn diff(
&self,
other: &HashSet<T, RandomState>
) -> Result<<HashSet<T, RandomState> as Diff>::Type, Error>
fn diff(
&self,
other: &HashSet<T, RandomState>
) -> Result<<HashSet<T, RandomState> as Diff>::Type, Error>
diff chain features are slated for removal
fn merge(
&self,
diff: <HashSet<T, RandomState> as Diff>::Type
) -> Result<HashSet<T, RandomState>, Error>
fn merge(
&self,
diff: <HashSet<T, RandomState> as Diff>::Type
) -> Result<HashSet<T, RandomState>, Error>
diff chain features are slated for removal
fn into_diff(self) -> Result<<HashSet<T, RandomState> as Diff>::Type, Error>
fn into_diff(self) -> Result<<HashSet<T, RandomState> as Diff>::Type, Error>
diff chain features are slated for removal
fn from_diff(
diff: <HashSet<T, RandomState> as Diff>::Type
) -> Result<HashSet<T, RandomState>, Error>
fn from_diff(
diff: <HashSet<T, RandomState> as Diff>::Type
) -> Result<HashSet<T, RandomState>, Error>
diff chain features are slated for removal
impl Diff for i8
impl Diff for i8
type Type = Diffi8
type Type = Diffi8
diff chain features are slated for removal
fn diff(&self, other: &i8) -> Result<<i8 as Diff>::Type, Error>
fn diff(&self, other: &i8) -> Result<<i8 as Diff>::Type, Error>
diff chain features are slated for removal
fn merge(&self, diff: <i8 as Diff>::Type) -> Result<i8, Error>
fn merge(&self, diff: <i8 as Diff>::Type) -> Result<i8, Error>
diff chain features are slated for removal
impl Diff for f64
impl Diff for f64
type Type = DiffF64
type Type = DiffF64
diff chain features are slated for removal
fn diff(&self, other: &f64) -> Result<<f64 as Diff>::Type, Error>
fn diff(&self, other: &f64) -> Result<<f64 as Diff>::Type, Error>
diff chain features are slated for removal
fn merge(&self, diff: <f64 as Diff>::Type) -> Result<f64, Error>
fn merge(&self, diff: <f64 as Diff>::Type) -> Result<f64, Error>
diff chain features are slated for removal
impl<T> Diff for Option<T> where
T: Diff + Clone + Debug + PartialEq<T> + Default + for<'de> Deserialize<'de> + Serialize,
impl<T> Diff for Option<T> where
T: Diff + Clone + Debug + PartialEq<T> + Default + for<'de> Deserialize<'de> + Serialize,
Diff
Implementation for Option<T>
type Type = DiffOption<T>
👎 Deprecated since 0.5.0: diff chain features are slated for removal
type Type = DiffOption<T>
diff chain features are slated for removal
The Corresponding Diff type for Option<T>
fn diff(&self, other: &Option<T>) -> Result<<Option<T> as Diff>::Type, Error>
👎 Deprecated since 0.5.0: diff chain features are slated for removal
fn diff(&self, other: &Option<T>) -> Result<<Option<T> as Diff>::Type, Error>
diff chain features are slated for removal
Compares two Option<T>
types; self
and other
and finds the Difference between them, returning a
DiffOption<T>
type.
fn merge(&self, diff: <Option<T> as Diff>::Type) -> Result<Option<T>, Error>
👎 Deprecated since 0.5.0: diff chain features are slated for removal
fn merge(&self, diff: <Option<T> as Diff>::Type) -> Result<Option<T>, Error>
diff chain features are slated for removal
Merges a DiffOption<T>
; diff
type with an Option<T>
type; self
.
impl Diff for isize
impl Diff for isize
type Type = DiffiSize
type Type = DiffiSize
diff chain features are slated for removal
fn diff(&self, other: &isize) -> Result<<isize as Diff>::Type, Error>
fn diff(&self, other: &isize) -> Result<<isize as Diff>::Type, Error>
diff chain features are slated for removal
fn merge(&self, diff: <isize as Diff>::Type) -> Result<isize, Error>
fn merge(&self, diff: <isize as Diff>::Type) -> Result<isize, Error>
diff chain features are slated for removal
impl Diff for char
impl Diff for char
type Type = Diffchar
type Type = Diffchar
diff chain features are slated for removal
fn diff(&self, other: &char) -> Result<<char as Diff>::Type, Error>
fn diff(&self, other: &char) -> Result<<char as Diff>::Type, Error>
diff chain features are slated for removal
fn merge(&self, diff: <char as Diff>::Type) -> Result<char, Error>
fn merge(&self, diff: <char as Diff>::Type) -> Result<char, Error>
diff chain features are slated for removal
impl Diff for i32
impl Diff for i32
type Type = Diffi32
type Type = Diffi32
diff chain features are slated for removal
fn diff(&self, other: &i32) -> Result<<i32 as Diff>::Type, Error>
fn diff(&self, other: &i32) -> Result<<i32 as Diff>::Type, Error>
diff chain features are slated for removal
fn merge(&self, diff: <i32 as Diff>::Type) -> Result<i32, Error>
fn merge(&self, diff: <i32 as Diff>::Type) -> Result<i32, Error>
diff chain features are slated for removal
impl Diff for u64
impl Diff for u64
type Type = Diffu64
type Type = Diffu64
diff chain features are slated for removal
fn diff(&self, other: &u64) -> Result<<u64 as Diff>::Type, Error>
fn diff(&self, other: &u64) -> Result<<u64 as Diff>::Type, Error>
diff chain features are slated for removal
fn merge(&self, diff: <u64 as Diff>::Type) -> Result<u64, Error>
fn merge(&self, diff: <u64 as Diff>::Type) -> Result<u64, Error>
diff chain features are slated for removal
impl Diff for String
impl Diff for String
Diff
trait implementation for String
.
type Type = DiffString
👎 Deprecated since 0.5.0: diff chain features are slated for removal
type Type = DiffString
diff chain features are slated for removal
Diff type for String
fn diff(&self, other: &String) -> Result<<String as Diff>::Type, Error>
👎 Deprecated since 0.5.0: diff chain features are slated for removal
fn diff(&self, other: &String) -> Result<<String as Diff>::Type, Error>
diff chain features are slated for removal
compares two String
types; self
, other
and returns a DiffString
type.
fn merge(&self, diff: <String as Diff>::Type) -> Result<String, Error>
👎 Deprecated since 0.5.0: diff chain features are slated for removal
fn merge(&self, diff: <String as Diff>::Type) -> Result<String, Error>
diff chain features are slated for removal
Merges a DiffString
; diff
with a String
; self
.
impl Diff for u16
impl Diff for u16
type Type = Diffu16
type Type = Diffu16
diff chain features are slated for removal
fn diff(&self, other: &u16) -> Result<<u16 as Diff>::Type, Error>
fn diff(&self, other: &u16) -> Result<<u16 as Diff>::Type, Error>
diff chain features are slated for removal
fn merge(&self, diff: <u16 as Diff>::Type) -> Result<u16, Error>
fn merge(&self, diff: <u16 as Diff>::Type) -> Result<u16, Error>
diff chain features are slated for removal
impl Diff for BTreeMap<String, Value, Global>
impl Diff for BTreeMap<String, Value, Global>
type Type = DiffHashMap<String, Value>
type Type = DiffHashMap<String, Value>
diff chain features are slated for removal
fn diff(
&self,
other: &BTreeMap<String, Value, Global>
) -> Result<<BTreeMap<String, Value, Global> as Diff>::Type, Error>
fn diff(
&self,
other: &BTreeMap<String, Value, Global>
) -> Result<<BTreeMap<String, Value, Global> as Diff>::Type, Error>
diff chain features are slated for removal
fn merge(
&self,
diff: <BTreeMap<String, Value, Global> as Diff>::Type
) -> Result<BTreeMap<String, Value, Global>, Error>
fn merge(
&self,
diff: <BTreeMap<String, Value, Global> as Diff>::Type
) -> Result<BTreeMap<String, Value, Global>, Error>
diff chain features are slated for removal
impl Diff for u8
impl Diff for u8
type Type = Diffu8
type Type = Diffu8
diff chain features are slated for removal
fn diff(&self, other: &u8) -> Result<<u8 as Diff>::Type, Error>
fn diff(&self, other: &u8) -> Result<<u8 as Diff>::Type, Error>
diff chain features are slated for removal
fn merge(&self, diff: <u8 as Diff>::Type) -> Result<u8, Error>
fn merge(&self, diff: <u8 as Diff>::Type) -> Result<u8, Error>
diff chain features are slated for removal
impl Diff for u32
impl Diff for u32
type Type = Diffu32
type Type = Diffu32
diff chain features are slated for removal
fn diff(&self, other: &u32) -> Result<<u32 as Diff>::Type, Error>
fn diff(&self, other: &u32) -> Result<<u32 as Diff>::Type, Error>
diff chain features are slated for removal
fn merge(&self, diff: <u32 as Diff>::Type) -> Result<u32, Error>
fn merge(&self, diff: <u32 as Diff>::Type) -> Result<u32, Error>
diff chain features are slated for removal
impl<T> Diff for Vec<T, Global> where
T: Clone + Debug + PartialEq<T> + Diff + for<'de> Deserialize<'de> + Serialize,
impl<T> Diff for Vec<T, Global> where
T: Clone + Debug + PartialEq<T> + Diff + for<'de> Deserialize<'de> + Serialize,
Diff
trait implementation for Vec<T>
type Type = DiffVec<T>
👎 Deprecated since 0.5.0: diff chain features are slated for removal
type Type = DiffVec<T>
diff chain features are slated for removal
Corresponding Diff Type for Vec<T>
fn diff(
&self,
other: &Vec<T, Global>
) -> Result<<Vec<T, Global> as Diff>::Type, Error>
👎 Deprecated since 0.5.0: diff chain features are slated for removal
fn diff(
&self,
other: &Vec<T, Global>
) -> Result<<Vec<T, Global> as Diff>::Type, Error>
diff chain features are slated for removal
Compares two Vec<T>
types; self
, other
and returns a DiffVec<T>
type.
fn merge(
&self,
diff: <Vec<T, Global> as Diff>::Type
) -> Result<Vec<T, Global>, Error>
👎 Deprecated since 0.5.0: diff chain features are slated for removal
fn merge(
&self,
diff: <Vec<T, Global> as Diff>::Type
) -> Result<Vec<T, Global>, Error>
diff chain features are slated for removal
Merges a DiffVec<T>
; diff
with self
; a Vec<T>
to create a new Vec<T>
.
impl Diff for ()
impl Diff for ()
type Type = Diffunit
type Type = Diffunit
diff chain features are slated for removal
fn diff(&self, other: &()) -> Result<<() as Diff>::Type, Error>
fn diff(&self, other: &()) -> Result<<() as Diff>::Type, Error>
diff chain features are slated for removal
fn merge(&self, diff: <() as Diff>::Type) -> Result<(), Error>
fn merge(&self, diff: <() as Diff>::Type) -> Result<(), Error>
diff chain features are slated for removal
impl Diff for usize
impl Diff for usize
type Type = DiffuSize
type Type = DiffuSize
diff chain features are slated for removal
fn diff(&self, other: &usize) -> Result<<usize as Diff>::Type, Error>
fn diff(&self, other: &usize) -> Result<<usize as Diff>::Type, Error>
diff chain features are slated for removal
fn merge(&self, diff: <usize as Diff>::Type) -> Result<usize, Error>
fn merge(&self, diff: <usize as Diff>::Type) -> Result<usize, Error>
diff chain features are slated for removal
impl Diff for bool
impl Diff for bool
type Type = Diffbool
type Type = Diffbool
diff chain features are slated for removal
fn diff(&self, other: &bool) -> Result<<bool as Diff>::Type, Error>
fn diff(&self, other: &bool) -> Result<<bool as Diff>::Type, Error>
diff chain features are slated for removal
fn merge(&self, diff: <bool as Diff>::Type) -> Result<bool, Error>
fn merge(&self, diff: <bool as Diff>::Type) -> Result<bool, Error>
diff chain features are slated for removal
Implementors
sourceimpl Diff for MethodData
impl Diff for MethodData
type Type = DiffMethodData
sourceimpl Diff for MethodType
impl Diff for MethodType
type Type = MethodType
sourceimpl Diff for ServiceEndpoint
impl Diff for ServiceEndpoint
type Type = ServiceEndpoint
sourceimpl Diff for CoreDID
impl Diff for CoreDID
type Type = DiffString
sourceimpl Diff for IotaDID
impl Diff for IotaDID
type Type = DiffString
sourceimpl Diff for IotaDocumentMetadata
impl Diff for IotaDocumentMetadata
type Type = DiffIotaDocumentMetadata
sourceimpl Diff for IotaDocument
impl Diff for IotaDocument
type Type = DiffIotaDocument
sourceimpl Diff for Timestamp
impl Diff for Timestamp
type Type = DiffString
sourceimpl Diff for Url
impl Diff for Url
type Type = DiffString
sourceimpl<D, T> Diff for MethodRef<D, T> where
D: Diff + DID + Serialize + for<'de> Deserialize<'de>,
T: Diff + Serialize + for<'de> Deserialize<'de> + Default,
impl<D, T> Diff for MethodRef<D, T> where
D: Diff + DID + Serialize + for<'de> Deserialize<'de>,
T: Diff + Serialize + for<'de> Deserialize<'de> + Default,
type Type = DiffMethodRef<D, T>
sourceimpl<D, T> Diff for Service<D, T> where
D: Diff + DID + Serialize + for<'de> Deserialize<'de>,
T: Diff + Serialize + for<'de> Deserialize<'de> + Default,
impl<D, T> Diff for Service<D, T> where
D: Diff + DID + Serialize + for<'de> Deserialize<'de>,
T: Diff + Serialize + for<'de> Deserialize<'de> + Default,
type Type = DiffService<D, T>
sourceimpl<D, T> Diff for VerificationMethod<D, T> where
D: Diff + DID + Serialize + for<'de> Deserialize<'de>,
T: Diff + Serialize + for<'de> Deserialize<'de> + Default,
impl<D, T> Diff for VerificationMethod<D, T> where
D: Diff + DID + Serialize + for<'de> Deserialize<'de>,
T: Diff + Serialize + for<'de> Deserialize<'de> + Default,
type Type = DiffMethod<D, T>
sourceimpl<D, T, U, V> Diff for CoreDocument<D, T, U, V> where
D: DID + KeyComparable + Diff + Serialize + for<'de> Deserialize<'de>,
T: Diff + Serialize + for<'de> Deserialize<'de> + Default,
U: Diff + Serialize + for<'de> Deserialize<'de> + Default,
V: Diff + Serialize + for<'de> Deserialize<'de> + Default,
impl<D, T, U, V> Diff for CoreDocument<D, T, U, V> where
D: DID + KeyComparable + Diff + Serialize + for<'de> Deserialize<'de>,
T: Diff + Serialize + for<'de> Deserialize<'de> + Default,
U: Diff + Serialize + for<'de> Deserialize<'de> + Default,
V: Diff + Serialize + for<'de> Deserialize<'de> + Default,
type Type = DiffDocument<D, T, U, V>
sourceimpl<T> Diff for VerifiableProperties<T> where
T: Diff,
impl<T> Diff for VerifiableProperties<T> where
T: Diff,
NOTE: excludes the proof
Signature from the diff to save space on the Tangle and because
a merged signature will be invalid in general.