pub struct PickleDbListExtender<'a> { /* fields omitted */ }
A struct for extending PickleDB lists and adding more items to them
Add a single item to an existing list.
As mentioned before, the lists are heterogeneous, meaning a single list can contain
items of different types. That means that the item can be of any type that is serializable.
That includes all primitive types, vectors, tuples and every struct that has the
#[derive(Serialize, Deserialize)
attribute.
The method returns another PickleDbListExtender
object that enables to continue adding
items to the list.
value
- a reference of the item to add to the list
db.lcreate("list1")
.ladd(&100)
.ladd(&String::from("my string"))
.ladd(&vec!["aa", "bb", "cc"]);
Add multiple items to an existing list.
As mentioned before, the lists are heterogeneous, meaning a single list can contain
items of different types. That means that the item can be of any type that is serializable.
That includes all primitive types, vectors, tuples and every struct that has the
#[derive(Serialize, Deserialize)
attribute.
This method adds multiple items to the list, but since they're in a vector that means all
of them are of the same type. Of course it doesn't mean that the list cannot contain items
of other types as well, as you can see in the example below.
The method returns another PickleDbListExtender
object that enables to continue adding
items to the list.
seq
- a vector containing the new items to add to the list
db.lcreate("list1");
db.lextends("list1", &vec![100, 200, 300])
.lextends(&vec!["aa", "bb", "cc"]);
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Mutably borrows from an owned value. Read more