pub struct Update<W = EntryRateWeight> {
pub author: HoloHash<Agent>,
pub timestamp: Timestamp,
pub action_seq: u32,
pub prev_action: HoloHash<Action>,
pub original_action_address: HoloHash<Action>,
pub original_entry_address: HoloHash<Entry>,
pub entry_type: EntryType,
pub entry_hash: HoloHash<Entry>,
pub weight: W,
}
Expand description
An action which specifies that some new Entry content is intended to be an update to some old Entry.
This action semantically updates an entry to a new entry. It has the following effects:
- Create a new Entry
- This is the action of that new entry
- Create a metadata relationship between the original entry and this new action
The original action is required to prevent update loops: If you update entry A to B and B back to A, and only track the original entry, then you have a loop of references. Every update introduces a new action, so there can only be a linear history of action updates, even if the entry history experiences repeats.
Fields§
§timestamp: Timestamp
§action_seq: u32
§prev_action: HoloHash<Action>
§original_action_address: HoloHash<Action>
§original_entry_address: HoloHash<Entry>
§entry_type: EntryType
§entry_hash: HoloHash<Entry>
§weight: W
Trait Implementations§
Source§impl ActionUnweighed for Update<()>
impl ActionUnweighed for Update<()>
Source§impl ActionWeighed for Update
impl ActionWeighed for Update
type Unweighed = Update<()>
type Weight = EntryRateWeight
Source§fn into_action(self) -> Action
fn into_action(self) -> Action
Construct the full Action enum with this variant.
Source§fn unweighed(self) -> Update<()>
fn unweighed(self) -> Update<()>
Erase the rate limiting weight info, creating an “unweighed” version
of this action. This is used primarily by validators who need to run the
weigh
callback on an action they received, and want to make sure their
callback is not using the predefined weight to influence the result.Source§impl<'de, W> Deserialize<'de> for Update<W>where
W: Deserialize<'de>,
impl<'de, W> Deserialize<'de> for Update<W>where
W: Deserialize<'de>,
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Update<W>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Update<W>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<Update> for EntryCreationAction
impl From<Update> for EntryCreationAction
Source§fn from(u: Update) -> EntryCreationAction
fn from(u: Update) -> EntryCreationAction
Converts to this type from the input type.
Source§impl HashableContent for Update
impl HashableContent for Update
Source§fn hash_type(&self) -> <Update as HashableContent>::HashType
fn hash_type(&self) -> <Update as HashableContent>::HashType
The HashType which this content will be hashed to
Source§fn hashable_content(&self) -> HashableContentBytes
fn hashable_content(&self) -> HashableContentBytes
Return a subset of the content, either as SerializedBytes “content”,
which will be used to compute the hash, or as an already precomputed
hash which will be used directly
Source§impl<W> Serialize for Update<W>where
W: Serialize,
impl<W> Serialize for Update<W>where
W: Serialize,
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Source§impl TryFrom<&Update> for SerializedBytes
impl TryFrom<&Update> for SerializedBytes
Source§type Error = SerializedBytesError
type Error = SerializedBytesError
The type returned in the event of a conversion error.
Source§fn try_from(t: &Update) -> Result<SerializedBytes, SerializedBytesError>
fn try_from(t: &Update) -> Result<SerializedBytes, SerializedBytesError>
Performs the conversion.
Source§impl TryFrom<SerializedBytes> for Update
impl TryFrom<SerializedBytes> for Update
Source§type Error = SerializedBytesError
type Error = SerializedBytesError
The type returned in the event of a conversion error.
Source§fn try_from(sb: SerializedBytes) -> Result<Update, SerializedBytesError>
fn try_from(sb: SerializedBytes) -> Result<Update, SerializedBytesError>
Performs the conversion.
Source§impl TryFrom<Update> for SerializedBytes
impl TryFrom<Update> for SerializedBytes
Source§type Error = SerializedBytesError
type Error = SerializedBytesError
The type returned in the event of a conversion error.
Source§fn try_from(t: Update) -> Result<SerializedBytes, SerializedBytesError>
fn try_from(t: Update) -> Result<SerializedBytes, SerializedBytesError>
Performs the conversion.
impl<W> Eq for Update<W>where
W: Eq,
impl<W> StructuralPartialEq for Update<W>
Auto Trait Implementations§
impl<W> Freeze for Update<W>where
W: Freeze,
impl<W> RefUnwindSafe for Update<W>where
W: RefUnwindSafe,
impl<W> Send for Update<W>where
W: Send,
impl<W> Sync for Update<W>where
W: Sync,
impl<W> Unpin for Update<W>where
W: Unpin,
impl<W> UnwindSafe for Update<W>where
W: UnwindSafe,
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.