You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// This method writes out the header of a property and returns a reference to the space, so the property values can be written.
196
-
pubfninit<'c,G: ?Sized,A:Atom<'a,'c>>(
210
+
///
211
+
/// Properties also have a context URID internally, which is rarely used. If you want to add one, use [`init_with_context`](#method.init_with_context).
Copy file name to clipboardExpand all lines: state/src/raw.rs
+14-9Lines changed: 14 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -34,7 +34,8 @@ impl<'a> StoreHandle<'a> {
34
34
/// This will return a new handle to create a property. Once the property is completely written, you can commit it by calling [`commit`](#method.commit) or [`commit_all`](#method.commit_all). Then, and only then, it will be saved by the host.
35
35
///
36
36
/// If you began to write a property and don't want the written things to be stored, you can discard it with [`discard`](#method.discard) or [`discard_all`](#method.discard_all).
let store_fn = store_fn.ok_or(StateErr::BadCallback)?;
@@ -83,7 +84,8 @@ impl<'a> StoreHandle<'a> {
83
84
/// Commit one specific property.
84
85
///
85
86
/// This method returns `None` if the requested property was not marked for commit, `Some(Ok(()))` if the property was stored and `Some(Err(_))` if an error occured while storing the property.
/// If no property with the given key was drafted before, this is a no-op.
99
-
pubfndiscard(&mutself,key:URID){
100
-
self.properties.remove(&key);
101
+
pubfndiscard<K: ?Sized>(&mutself,key:URID<K>){
102
+
self.properties.remove(&key.into_general());
101
103
}
102
104
}
103
105
@@ -158,7 +160,7 @@ impl<'a> RetrieveHandle<'a> {
158
160
/// Try to retrieve a property from the host.
159
161
///
160
162
/// This method calls the internal retrieve callback with the given URID. If there's no property with the given URID, `Err(StateErr::NoProperty)` is returned. Otherwise, a reading handle is returned that contains the type and the data of the property and can interpret it as an atom.
0 commit comments