bitfl0wer
2fd1a7e7f4
Remove unused import
2023-08-15 20:30:30 +02:00
bitfl0wer
c03b250248
Clean up test
2023-08-15 20:20:58 +02:00
bitfl0wer
ff77e5a61d
Add `Composite` derive to all entities which require it
2023-08-15 20:19:52 +02:00
bitfl0wer
bdeaa476e2
Add `Composite<T>` bound to automatically call `watch_whole()` on caller object.
2023-08-15 20:19:16 +02:00
bitfl0wer
32fd918a43
Remove `Send` bound
2023-08-15 20:18:11 +02:00
bitfl0wer
c3be91667b
Try calling new method to see if it panics
2023-08-15 17:54:48 +02:00
bitfl0wer
7de3204f59
Make trait pub
2023-08-15 17:54:36 +02:00
bitfl0wer
20baada605
Add Composite to some types
2023-08-15 17:38:53 +02:00
bitfl0wer
5ac680b64d
Remove superfluous nesting
2023-08-15 17:08:27 +02:00
bitfl0wer
509ab578d6
Implement trait methods
2023-08-15 16:58:20 +02:00
bitfl0wer
37d976cd0d
Try out new macro
2023-08-15 16:58:06 +02:00
bitfl0wer
d66807ed20
Add observe_and_get method
2023-08-15 16:57:54 +02:00
bitfl0wer
28ea95f4a4
Use async trait where needed
2023-08-15 16:57:35 +02:00
bitfl0wer
ad508153e5
Add async-trait
2023-08-15 16:57:08 +02:00
bitfl0wer
d0cc1b5a71
Update syn dependency
2023-08-15 12:36:53 +02:00
bitfl0wer
b2a1122f4a
todo
2023-08-15 12:14:03 +02:00
bitfl0wer
623c070671
Add macro and attributes for automatic watching of Composite structs and their components
2023-08-15 12:13:49 +02:00
bitfl0wer
f49fefb400
derive Updateable for Guild
2023-08-14 17:18:53 +02:00
bitfl0wer
2329cc2243
Add Composite trait
2023-08-14 17:18:44 +02:00
bitfl0wer
6dd9f84573
Remove unused import
2023-08-14 00:04:58 +02:00
bitfl0wer
02be1e786d
Remove stupid comment from me
2023-08-14 00:04:53 +02:00
bitfl0wer
45d68b4da4
Rename get to get_user
2023-08-14 00:02:30 +02:00
bitfl0wer
614c7bb2b2
Change UserMeta::get() to take self instead of Self
2023-08-14 00:02:03 +02:00
bitfl0wer
0f00d5d283
Change UpdateMessage<T> to write into RwLock
2023-08-13 16:46:57 +02:00
bitfl0wer
33357db291
Change observe() again, pass Arc<RwLock<T>> into message.update(), Add comment explaining closure
2023-08-13 16:46:21 +02:00
bitfl0wer
c0c873d460
Update test to match code changes
2023-08-13 16:44:58 +02:00
bitfl0wer
f9c3f55d95
Remove channel_id argument from modify. WHY WAS IT THERE TO BEGIN WITH LOL
2023-08-13 15:54:25 +02:00
bitfl0wer
20cd457c04
Change tests to deal with `Arc<RwLock<T>>`'s
2023-08-13 15:54:07 +02:00
bitfl0wer
73cc139e78
Moddify observe to still store T internally
2023-08-13 15:52:16 +02:00
fowb
29d4ef23a2
Change T: Updateable to Arc<RwLock<T>>
2023-08-12 22:40:40 +02:00
fowb
63a4141bde
Add fixme comment
2023-08-12 22:40:07 +02:00
fowb
a0c9f6fb14
Change observe() to take Arc<RwLock<T>>
2023-08-12 19:47:11 +02:00
fowb
ff47965e99
Change Mutex<T> to RwLock<T>
2023-08-12 19:31:31 +02:00
fowb
7071de8412
Merge branch 'main' into enhancement/improved-auto-updating-structs
2023-08-12 19:04:25 +02:00
kozabrada123
e0d7df417c
Fix trailing /s ( #180 )
2023-08-12 16:48:33 +02:00
kozabrada123
1801d22273
Minor snowflake updates ( #179 )
...
* Make snowflake fully public
* Simple into for snowflake
2023-08-07 20:34:58 +02:00
Flori
2d7fe96eda
Fix unwrap panic on trying to access rate limits ( #178 )
2023-08-07 14:56:32 +02:00
bitfl0wer
07818b2cd6
Fix unwrap panic on trying to access rate limits
2023-08-07 14:56:10 +02:00
kozabrada123
1cc29540d0
Minor improvements to message events ( #177 )
2023-08-07 14:15:23 +02:00
Flori
1aa8bcc6d2
Components and Composites ( #175 )
...
As described in #165 , Gateway induced changes of entity structs do not
get propagated to other structs holding the "same" object which got
updated. This is bad because it means that structs still hold
potentially outdated info.
My proposed solution is to create components and composites. A component
is an object with information which is supposed to be the same in at
least 2 structs, such as a Channel object ("channels" field in Guild
struct and lone Channel object for example). These components should be
shared instead of cloned, to make sure that an update to this shared
structs fields is reflected everywhere the struct is being used.
We can do this by using `Arc<Mutex<T>>`. Mutex can be the
std::sync::Mutex, as long as locks on the components themselves are not
being held across .await points. ~~This draft is not yet finished, but~~
all instances of components in composite entity structs have been
replaced with their `Arc<Mutex<T>>` counterparts already.
2023-08-04 15:55:47 +02:00
Flori
1bdcc198da
Merge pull request #1 from kozabrada123/prototype/component-and-composites
...
Re-add derives to structs where possible
2023-08-04 15:48:34 +02:00
kozabrada123
47246cabad
Re-add derives to structs where possible
2023-08-04 15:33:46 +02:00
bitfl0wer
98188eadc4
Fix deadlock on test_get_mutual_relationships
2023-08-04 11:42:28 +02:00
bitfl0wer
420c2f7727
Fix deadlock in test_get_relationships
2023-08-04 11:34:03 +02:00
bitfl0wer
fb792f8356
Integrate component behaviour everywhere
2023-08-04 11:19:23 +02:00
bitfl0wer
94eac6eba9
Make components be Arc<Mutex<T>>
2023-08-02 23:08:53 +02:00
bitfl0wer
a36d691fea
Add PartialEq, Eq, Hash to Enums
2023-08-02 20:23:50 +02:00
bitfl0wer
9f69f57635
Start component-izing entities, remove PartialEq wherever needed (because PartialEq isn't implemented for Mutex)
2023-08-02 20:18:16 +02:00
bitfl0wer
917f1cfb0d
Add rc feature to serde
2023-08-02 20:17:36 +02:00
bitfl0wer
2739a7479b
Exclude all Target dirs
2023-08-01 21:21:00 +02:00