JavaScript is disabled, refresh for a better experience. ambee/giterated

ambee/giterated

Git repository hosting, collaboration, and discovery for the Fediverse.

Beginning of `stack-next` refactor

-Refactoring the protocol stack into something similar to a runtime. -Handles merging handler builders which is placing the ground work for plugins in. - Increased metadata generation during compilation enables less ser/de during execution. - Goal is to have an O(1) time from incoming operation to calling handlers. - Decreased penalty for using the statically typed API from within your code, now avoids some allocation. # Changes - Added `GiteratedRuntime` which is to replace the current unified stack - Added `RuntimeBuilder` which does what the current `OperationHandlers` struct does, but much better. - Added `RuntimeMetadata` to store type metadata for new `Any` based internals - Refactored serde_json out of the internal operation handling

Amber - ⁨2⁩ years ago

parent: tbd commit: ⁨708dea4

⁨giterated-models/src/settings/mod.rs⁩ - ⁨388⁩ bytes
Raw
1 mod operations;
2
3 pub use operations::*;
4 use serde::{de::DeserializeOwned, Deserialize, Serialize};
5 use serde_json::Value;
6
7 pub trait Setting: Serialize + DeserializeOwned + Send + Sync {
8 fn name() -> &'static str;
9 }
10
11 #[derive(Debug, Clone, Serialize, Deserialize)]
12 pub struct AnySetting(pub Value);
13
14 impl Setting for AnySetting {
15 fn name() -> &'static str {
16 "any"
17 }
18 }
19