Struct Automerge
pub struct Automerge { /* private fields */ }Expand description
An automerge document which does not manage transactions for you.
§Creating, loading, merging and forking documents
A new document can be created with Self::new(), which will create a document with a random
ActorId. Existing documents can be loaded with Self::load(), or Self::load_with().
If you have two documents and you want to merge the changes from one into the other you can use
Self::merge() or Self::merge_and_log_patches().
If you have a document you want to split into two concurrent threads of execution you can use
Self::fork(). If you want to split a document from ealier in its history you can use
Self::fork_at().
§Reading values
Self implements ReadDoc, which provides methods for reading values from the document.
§Modifying a document (Transactions)
Automerge provides an interface for viewing and modifying automerge documents which does
not manage transactions for you. To create changes you use either Automerge::transaction() or
Automerge::transact() (or the _with variants).
§Sync
This type implements crate::sync::SyncDoc
§Authors and Actors
It’s often useful to be able to know who made some change. For this purpose Automerge has the concept of an “author ID”. An author ID is an opaque byte array which can be associated with a change. This author ID will become part of the document history so you can later examine the changes in a document and see which author made the change.
Author IDs are set on document construction. If you don’t set an author then changes produced
by the document will have no author (Change::author will return None).
§Example
let author = Author::from(vec![1,2,3]);
let mut doc = Automerge::new().with_author(Some(author.clone()));
doc.transact(|tx| {
tx.put(ROOT, "foo", "bar")?;
Ok::<_, AutomergeError>(())
}).unwrap();
let change = doc.get_last_local_change().unwrap();
assert_eq!(change.author().unwrap(), author);§Relationship to Actor IDs
Every automerge commit has an “actor ID”, which represents a sequential execution. Actor IDs should be considered a low level implementation detail and as much as possible should be left to automerge to manage.
Prior to the introduction of author IDs, actor IDs were often used in applications to determine
authorship. New code should migrate to using author IDs. If you do need to map from an actor ID
to an author ID you can use Automerge::get_author_for_actor.
Implementations§
§impl Automerge
impl Automerge
pub fn anonymize(&self) -> Result<Automerge, AnonymizeError>
pub fn anonymize(&self) -> Result<Automerge, AnonymizeError>
Return a copy of this document with its data anonymized using a fresh random seed.
pub fn init_from_hydrate(&mut self, value: &Map) -> Result<(), AutomergeError>
pub fn init_from_hydrate(&mut self, value: &Map) -> Result<(), AutomergeError>
Overwrite the keys of the root object with the values from value
This is useful to initialize an empty document with a large initial
value. Note that existing keys which are not in value are left as is
pub fn new_with_encoding(encoding: TextEncoding) -> Automerge
pub fn with_actor(self, actor: ActorId) -> Automerge
pub fn with_actor(self, actor: ActorId) -> Automerge
Set the actor id for this document.
Set the actor id for this document.
Set the author for this document.
The Author is only changed, if author differs from
Automerge::get_author. If the author does change then a new
ActorId is generated for that author. Notably, this could be a
different ActorId compared to previous edits for the same author.
If you are using authors never manually manage the ActorId.
Get the current author of this document.
pub fn transaction(&mut self) -> Transaction<'_>
pub fn transaction(&mut self) -> Transaction<'_>
Start a transaction.
pub fn transaction_log_patches(
&mut self,
patch_log: PatchLog,
) -> Result<Transaction<'_>, PatchLogMismatch>
pub fn transaction_log_patches( &mut self, patch_log: PatchLog, ) -> Result<Transaction<'_>, PatchLogMismatch>
Start a transaction which records changes in a PatchLog
Returns PatchLogMismatch if patch_log does not belong to
this document. This probably means a patch log created for one document was reused with
another document.
pub fn transaction_at(
&mut self,
patch_log: PatchLog,
heads: &[ChangeHash],
) -> Result<Transaction<'_>, PatchLogMismatch>
pub fn transaction_at( &mut self, patch_log: PatchLog, heads: &[ChangeHash], ) -> Result<Transaction<'_>, PatchLogMismatch>
Start a transaction isolated at a given heads
Returns PatchLogMismatch if patch_log does not belong to
this document. This probably means a patch log created for one document was reused with
another document.
pub fn into_transaction(
self,
patch_log: Option<PatchLog>,
heads: Option<&[ChangeHash]>,
) -> Result<OwnedTransaction, PatchLogMismatch>
pub fn into_transaction( self, patch_log: Option<PatchLog>, heads: Option<&[ChangeHash]>, ) -> Result<OwnedTransaction, PatchLogMismatch>
Start a transaction that owns the document, consuming self.
This is useful when the transaction must be 'static (e.g. storing across an FFI
boundary or in a struct that requires 'static). The document is returned when the
transaction is committed or rolled back.
§Arguments
patch_log- An optionalPatchLogto log the changes in this transaction toheads- An optional set of heads to isolate this transaction at, orNoneto use the current heads of the document
Returns PatchLogMismatch if patch_log does not belong to
this document. This probably means a patch log created for one document was reused with
another document.
pub fn transact<F, O, E>(&mut self, f: F) -> Result<Success<O>, Failure<E>>
pub fn transact<F, O, E>(&mut self, f: F) -> Result<Success<O>, Failure<E>>
Run a transaction on this document in a closure, automatically handling commit or rollback afterwards.
pub fn transact_with<F, O, E, C>(
&mut self,
c: C,
f: F,
) -> Result<Success<O>, Failure<E>>
pub fn transact_with<F, O, E, C>( &mut self, c: C, f: F, ) -> Result<Success<O>, Failure<E>>
Like Self::transact() but with a function for generating the commit options.
pub fn transact_and_log_patches<F, O, E>(
&mut self,
f: F,
) -> Result<Success<O>, Failure<E>>
pub fn transact_and_log_patches<F, O, E>( &mut self, f: F, ) -> Result<Success<O>, Failure<E>>
Run a transaction on this document in a closure, collecting patches, automatically handling commit or rollback afterwards.
The collected patches are available in the return value of Transaction::commit()
pub fn transact_and_log_patches_with<F, O, E, C>(
&mut self,
c: C,
f: F,
) -> Result<Success<O>, Failure<E>>
pub fn transact_and_log_patches_with<F, O, E, C>( &mut self, c: C, f: F, ) -> Result<Success<O>, Failure<E>>
Like Self::transact_and_log_patches() but with a function for generating the commit options
pub fn empty_commit(&mut self, opts: CommitOptions) -> ChangeHash
pub fn empty_commit(&mut self, opts: CommitOptions) -> ChangeHash
Generate an empty change
The main reason to do this is if you want to create a “merge commit”, which is a change that has all the current heads of the document as dependencies.
pub fn fork(&self) -> Automerge
pub fn fork(&self) -> Automerge
Fork this document at the current point for use by a different actor.
This will create a new actor ID for the forked document
pub fn fork_at(&self, heads: &[ChangeHash]) -> Result<Automerge, AutomergeError>
pub fn fork_at(&self, heads: &[ChangeHash]) -> Result<Automerge, AutomergeError>
Fork this document at the given heads
This will create a new actor ID for the forked document
pub fn diff_opset(&self, other: &Automerge) -> Result<(), AutomergeError>
pub fn load(data: &[u8]) -> Result<Automerge, AutomergeError>
pub fn load(data: &[u8]) -> Result<Automerge, AutomergeError>
Load a document.
pub fn load_unverified_heads(data: &[u8]) -> Result<Automerge, AutomergeError>
pub fn load_unverified_heads(data: &[u8]) -> Result<Automerge, AutomergeError>
Load a document without verifying the head hashes
This is useful for debugging as it allows you to examine a corrupted document.
pub fn load_with(
data: &[u8],
on_error: OnPartialLoad,
mode: VerificationMode,
patch_log: &mut PatchLog,
) -> Result<Automerge, AutomergeError>
👎Deprecated since 0.5.2: Use load_with_options instead
pub fn load_with( data: &[u8], on_error: OnPartialLoad, mode: VerificationMode, patch_log: &mut PatchLog, ) -> Result<Automerge, AutomergeError>
Use load_with_options instead
Load a document, with options
§Arguments
data- The data to loadon_error- What to do if the document is only partially loaded. This can happen if some prefix ofdatacontains valid data.mode- Whether to verify the head hashes after loadingpatch_log- APatchLogto log the changes required to materialize the current state of the document once loaded
pub fn load_with_options(
data: &[u8],
options: LoadOptions<'_>,
) -> Result<Automerge, AutomergeError>
pub fn load_with_options( data: &[u8], options: LoadOptions<'_>, ) -> Result<Automerge, AutomergeError>
Load a document, with options
§Arguments
data- The data to loadoptions- The options to use when loading
pub fn rescue(data: &[u8]) -> Result<Value, AutomergeError>
pub fn rescue(data: &[u8]) -> Result<Value, AutomergeError>
Best-effort rescue for documents which fail strict loading.
This returns only the current hydrated value and does not preserve the original change graph.
pub fn make_patches(&self, patch_log: &mut PatchLog) -> Vec<Patch>
pub fn make_patches(&self, patch_log: &mut PatchLog) -> Vec<Patch>
pub fn current_state(&self) -> Vec<Patch>
pub fn current_state(&self) -> Vec<Patch>
Get a set of Patches which materialize the current state of the document
This is a convienence method for doc.diff(&[], current_heads)
pub fn parse_changes(data: &[u8]) -> Result<Vec<Change>, AutomergeError>
pub fn parse_changes(data: &[u8]) -> Result<Vec<Change>, AutomergeError>
The changes in data (what [Self::save_incremental] writes: one
or more concatenated change chunks), parsed and checksummed but
applied to no document, so a receiver can read each change’s hash,
message and dependencies before deciding whether to merge it.
§Errors
Returns the first chunk that does not parse.
pub fn load_incremental(&mut self, data: &[u8]) -> Result<usize, AutomergeError>
pub fn load_incremental(&mut self, data: &[u8]) -> Result<usize, AutomergeError>
Load an incremental save of a document.
Unlike Self::load() this imports changes into an existing document. It will work with
both the output of Self::save() and Self::save_after()
The return value is the number of ops which were applied, this is not useful and will change in future.
pub fn load_incremental_log_patches(
&mut self,
data: &[u8],
patch_log: &mut PatchLog,
) -> Result<usize, AutomergeError>
pub fn load_incremental_log_patches( &mut self, data: &[u8], patch_log: &mut PatchLog, ) -> Result<usize, AutomergeError>
Like Self::load_incremental() but log the changes to the current state of the document
to PatchLog
pub fn apply_changes(
&mut self,
changes: impl IntoIterator<Item = Change> + Clone,
) -> Result<(), AutomergeError>
pub fn apply_changes( &mut self, changes: impl IntoIterator<Item = Change> + Clone, ) -> Result<(), AutomergeError>
Apply changes to this document.
This is idempotent in the sense that if a change has already been applied it will be ignored.
pub fn apply_changes_log_patches<I>(
&mut self,
changes: I,
patch_log: &mut PatchLog,
) -> Result<(), AutomergeError>
pub fn apply_changes_log_patches<I>( &mut self, changes: I, patch_log: &mut PatchLog, ) -> Result<(), AutomergeError>
Like Self::apply_changes() but log the resulting changes to the current state of the
document to patch_log
pub fn merge(
&mut self,
other: &mut Automerge,
) -> Result<Vec<ChangeHash>, AutomergeError>
pub fn merge( &mut self, other: &mut Automerge, ) -> Result<Vec<ChangeHash>, AutomergeError>
Takes all the changes in other which are not in self and applies them
pub fn merge_and_log_patches(
&mut self,
other: &mut Automerge,
patch_log: &mut PatchLog,
) -> Result<Vec<ChangeHash>, AutomergeError>
pub fn merge_and_log_patches( &mut self, other: &mut Automerge, patch_log: &mut PatchLog, ) -> Result<Vec<ChangeHash>, AutomergeError>
Takes all the changes in other which are not in self and applies them whilst logging
the resulting changes to the current state of the document to patch_log
pub fn bundle<I>(&self, hashes: I) -> Result<Bundle, AutomergeError>where
I: IntoIterator<Item = ChangeHash>,
pub fn bundle<I>(&self, hashes: I) -> Result<Bundle, AutomergeError>where
I: IntoIterator<Item = ChangeHash>,
EXPERIMENTAL: Write the set of changes in hashes to a “bundle”
A “bundle” is a compact representation of a set of changes which uses
the same compression tricks as the document encoding we use in
Automerge::save.
This is an experimental API, the bundle format is still subject to change and so should not be used in production just yet.
pub fn save_with_options(&self, options: SaveOptions) -> Vec<u8> ⓘ
pub fn save_with_options(&self, options: SaveOptions) -> Vec<u8> ⓘ
Save the entirety of this document in a compact form.
pub fn save_and_verify(&self) -> Result<Vec<u8>, AutomergeError>
pub fn save_and_verify(&self) -> Result<Vec<u8>, AutomergeError>
Save the document and attempt to load it before returning - slow!
pub fn save_nocompress(&self) -> Vec<u8> ⓘ
pub fn save_nocompress(&self) -> Vec<u8> ⓘ
Save this document, but don’t run it through DEFLATE afterwards
pub fn save_after(&self, heads: &[ChangeHash]) -> Vec<u8> ⓘ
pub fn save_after(&self, heads: &[ChangeHash]) -> Vec<u8> ⓘ
Save the changes since the given heads
The output of this will not be a compressed document format, but a series of individual
changes. This is useful if you know you have only made a small change since the last
Self::save() and you want to immediately send it somewhere (e.g. you’ve inserted a
single character in a text object).
pub fn get_last_local_change(&self) -> Option<Change>
pub fn get_last_local_change(&self) -> Option<Change>
Get the last change this actor made to the document.
pub fn dump(&self)
pub fn diff(
&self,
before_heads: &[ChangeHash],
after_heads: &[ChangeHash],
) -> Vec<Patch>
pub fn diff( &self, before_heads: &[ChangeHash], after_heads: &[ChangeHash], ) -> Vec<Patch>
Create patches representing the change in the current state of the document between the
before and after heads. If the arguments are reverse it will observe the same changes
in the opposite order.
pub fn diff_obj(
&self,
obj: &ExId,
before_heads: &[ChangeHash],
after_heads: &[ChangeHash],
recursive: bool,
) -> Result<Vec<Patch>, AutomergeError>
pub fn diff_obj( &self, obj: &ExId, before_heads: &[ChangeHash], after_heads: &[ChangeHash], recursive: bool, ) -> Result<Vec<Patch>, AutomergeError>
Create patches representing the change in the current state of an object
in the document between the before_heads and after_heads heads. If
the arguments are reverse it will observe the same changes in the
opposite order.
§Arguments
obj- The object to start the diff at.before_heads- heads fromSelf::get_heads()at beginning point in the documents historyafter_heads- heads fromSelf::get_heads()at ending point in the documents history.recursive- if false, do not also diff child objects
Note: before_heads and after_heads do not have to be chronological.
Document state can move backward.
pub fn get_heads(&self) -> Vec<ChangeHash>
pub fn get_heads(&self) -> Vec<ChangeHash>
Get the heads of this document.
pub fn change_hashes(&self) -> &[ChangeHash]
pub fn change_hashes(&self) -> &[ChangeHash]
Every change’s hash, in the order Self::get_changes lists them
for &[]: the order the changes were added to this document. Adding
changes only appends to it, so a reader that read a prefix of the log
can tell, without rebuilding any change, whether it still is one.
pub fn get_changes(&self, have_deps: &[ChangeHash]) -> Vec<Change>
pub fn get_changes_meta( &self, have_deps: &[ChangeHash], ) -> Vec<ChangeMetadata<'_>>
pub fn get_change_meta_by_hash( &self, hash: &ChangeHash, ) -> Option<ChangeMetadata<'_>>
pub fn get_changes_added(&self, other: &Automerge) -> Vec<Change>
pub fn get_changes_added(&self, other: &Automerge) -> Vec<Change>
Get changes in other that are not in self
pub fn hash_for_opid(&self, exid: &ExId) -> Option<ChangeHash>
pub fn hash_for_opid(&self, exid: &ExId) -> Option<ChangeHash>
Get the hash of the change that contains the given opid.
Returns None if the opid:
- is the root object id
- does not exist in this document
pub fn hydrate(&self, heads: Option<&[ChangeHash]>) -> Value
pub fn has_our_changes(&self, other: &State) -> bool
pub fn has_our_changes(&self, other: &State) -> bool
Whether the peer represented by other has all the changes we have
pub fn text_encoding(&self) -> TextEncoding
§impl Automerge
impl Automerge
pub fn apply_changes_batch( &mut self, changes: impl IntoIterator<Item = Change> + Clone, ) -> Result<(), AutomergeError>
pub fn apply_changes_batch_log_patches<I>(
&mut self,
changes: I,
log: &mut PatchLog,
) -> Result<(), AutomergeError>where
I: IntoIterator<Item = Change>,
Trait Implementations§
§impl ReadDoc for Automerge
impl ReadDoc for Automerge
§fn parents<O>(&self, obj: O) -> Result<Parents<'_>, AutomergeError>
fn parents<O>(&self, obj: O) -> Result<Parents<'_>, AutomergeError>
§fn parents_at<O>(
&self,
obj: O,
heads: &[ChangeHash],
) -> Result<Parents<'_>, AutomergeError>
fn parents_at<O>( &self, obj: O, heads: &[ChangeHash], ) -> Result<Parents<'_>, AutomergeError>
§fn keys_at<O>(&self, obj: O, heads: &[ChangeHash]) -> Keys<'_> ⓘ
fn keys_at<O>(&self, obj: O, heads: &[ChangeHash]) -> Keys<'_> ⓘ
§fn map_range<'a, O, R>(&'a self, obj: O, range: R) -> MapRange<'a> ⓘ
fn map_range<'a, O, R>(&'a self, obj: O, range: R) -> MapRange<'a> ⓘ
obj in the given range. Read more§fn map_range_at<'a, O, R>(
&'a self,
obj: O,
range: R,
heads: &[ChangeHash],
) -> MapRange<'a> ⓘ
fn map_range_at<'a, O, R>( &'a self, obj: O, range: R, heads: &[ChangeHash], ) -> MapRange<'a> ⓘ
§fn list_range<O, R>(&self, obj: O, range: R) -> ListRange<'_> ⓘ
fn list_range<O, R>(&self, obj: O, range: R) -> ListRange<'_> ⓘ
obj in the given range. Read more§fn list_range_at<O, R>(
&self,
obj: O,
range: R,
heads: &[ChangeHash],
) -> ListRange<'_> ⓘ
fn list_range_at<O, R>( &self, obj: O, range: R, heads: &[ChangeHash], ) -> ListRange<'_> ⓘ
obj in the given range as at heads Read more§fn values<O>(&self, obj: O) -> Values<'_> ⓘ
fn values<O>(&self, obj: O) -> Values<'_> ⓘ
§fn values_at<O>(&self, obj: O, heads: &[ChangeHash]) -> Values<'_> ⓘ
fn values_at<O>(&self, obj: O, heads: &[ChangeHash]) -> Values<'_> ⓘ
heads Read more§fn length_at<O>(&self, obj: O, heads: &[ChangeHash]) -> usize
fn length_at<O>(&self, obj: O, heads: &[ChangeHash]) -> usize
heads Read more§fn text<O>(&self, obj: O) -> Result<String, AutomergeError>
fn text<O>(&self, obj: O) -> Result<String, AutomergeError>
§fn spans<O>(&self, obj: O) -> Result<Spans<'_>, AutomergeError>
fn spans<O>(&self, obj: O) -> Result<Spans<'_>, AutomergeError>
obj§fn spans_at<O>(
&self,
obj: O,
heads: &[ChangeHash],
) -> Result<Spans<'_>, AutomergeError>
fn spans_at<O>( &self, obj: O, heads: &[ChangeHash], ) -> Result<Spans<'_>, AutomergeError>
obj as at heads§fn get_cursor<O, I>(
&self,
obj: O,
position: I,
at: Option<&[ChangeHash]>,
) -> Result<Cursor, AutomergeError>
fn get_cursor<O, I>( &self, obj: O, position: I, at: Option<&[ChangeHash]>, ) -> Result<Cursor, AutomergeError>
usize position in a Sequence (either ObjType::List or ObjType::Text). Read more§fn get_cursor_moving<O, I>(
&self,
obj: O,
position: I,
at: Option<&[ChangeHash]>,
move_cursor: MoveCursor,
) -> Result<Cursor, AutomergeError>
fn get_cursor_moving<O, I>( &self, obj: O, position: I, at: Option<&[ChangeHash]>, move_cursor: MoveCursor, ) -> Result<Cursor, AutomergeError>
usize position in a Sequence (either ObjType::List or ObjType::Text). Read more§fn get_cursor_position<O>(
&self,
obj: O,
cursor: &Cursor,
at: Option<&[ChangeHash]>,
) -> Result<usize, AutomergeError>
fn get_cursor_position<O>( &self, obj: O, cursor: &Cursor, at: Option<&[ChangeHash]>, ) -> Result<usize, AutomergeError>
§fn text_at<O>(
&self,
obj: O,
heads: &[ChangeHash],
) -> Result<String, AutomergeError>
fn text_at<O>( &self, obj: O, heads: &[ChangeHash], ) -> Result<String, AutomergeError>
heads, see
Self::text()§fn marks_at<O>(
&self,
obj: O,
heads: &[ChangeHash],
) -> Result<Vec<Mark>, AutomergeError>
fn marks_at<O>( &self, obj: O, heads: &[ChangeHash], ) -> Result<Vec<Mark>, AutomergeError>
fn hydrate<O>( &self, obj: O, heads: Option<&[ChangeHash]>, ) -> Result<Value, AutomergeError>
fn get_marks<O>( &self, obj: O, index: usize, heads: Option<&[ChangeHash]>, ) -> Result<MarkSet, AutomergeError>
§fn get<O, P>(
&self,
obj: O,
prop: P,
) -> Result<Option<(Value<'_>, ExId)>, AutomergeError>
fn get<O, P>( &self, obj: O, prop: P, ) -> Result<Option<(Value<'_>, ExId)>, AutomergeError>
§fn get_at<O, P>(
&self,
obj: O,
prop: P,
heads: &[ChangeHash],
) -> Result<Option<(Value<'_>, ExId)>, AutomergeError>
fn get_at<O, P>( &self, obj: O, prop: P, heads: &[ChangeHash], ) -> Result<Option<(Value<'_>, ExId)>, AutomergeError>
heads, see Self::get()§fn get_all<O, P>(
&self,
obj: O,
prop: P,
) -> Result<Vec<(Value<'_>, ExId)>, AutomergeError>
fn get_all<O, P>( &self, obj: O, prop: P, ) -> Result<Vec<(Value<'_>, ExId)>, AutomergeError>
§fn get_all_at<O, P>(
&self,
obj: O,
prop: P,
heads: &[ChangeHash],
) -> Result<Vec<(Value<'_>, ExId)>, AutomergeError>
fn get_all_at<O, P>( &self, obj: O, prop: P, heads: &[ChangeHash], ) -> Result<Vec<(Value<'_>, ExId)>, AutomergeError>
heads Read more§fn object_type<O>(&self, obj: O) -> Result<ObjType, AutomergeError>
fn object_type<O>(&self, obj: O) -> Result<ObjType, AutomergeError>
§fn get_missing_deps(&self, heads: &[ChangeHash]) -> Vec<ChangeHash>
fn get_missing_deps(&self, heads: &[ChangeHash]) -> Vec<ChangeHash>
heads.§fn get_change_by_hash(&self, hash: &ChangeHash) -> Option<Change>
fn get_change_by_hash(&self, hash: &ChangeHash) -> Option<Change>
fn text_encoding(&self) -> TextEncoding
§impl SyncDoc for Automerge
impl SyncDoc for Automerge
§fn generate_sync_message(&self, sync_state: &mut State) -> Option<Message>
fn generate_sync_message(&self, sync_state: &mut State) -> Option<Message>
sync_state Read more§fn receive_sync_message(
&mut self,
sync_state: &mut State,
message: Message,
) -> Result<(), AutomergeError>
fn receive_sync_message( &mut self, sync_state: &mut State, message: Message, ) -> Result<(), AutomergeError>
sync_state§fn receive_sync_message_log_patches(
&mut self,
sync_state: &mut State,
message: Message,
patch_log: &mut PatchLog,
) -> Result<(), AutomergeError>
fn receive_sync_message_log_patches( &mut self, sync_state: &mut State, message: Message, patch_log: &mut PatchLog, ) -> Result<(), AutomergeError>
sync_state, logging any changes that
are made to patch_log Read moreAuto Trait Implementations§
impl Freeze for Automerge
impl RefUnwindSafe for Automerge
impl Send for Automerge
impl Sync for Automerge
impl Unpin for Automerge
impl UnsafeUnpin for Automerge
impl UnwindSafe for Automerge
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,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> ReadTyped for T
impl<T> ReadTyped for T
§fn int_at(&self, obj: &ExId, prop: impl Into<Prop>) -> Option<i64>
fn int_at(&self, obj: &ExId, prop: impl Into<Prop>) -> Option<i64>
prop of obj, when it fits an i64.§fn uint_at(&self, obj: &ExId, prop: impl Into<Prop>) -> Option<u64>
fn uint_at(&self, obj: &ExId, prop: impl Into<Prop>) -> Option<u64>
prop of obj, when it fits a u64.