MCPcopy Create free account
hub / github.com/Rustixir/darkbird / subscribe

Method subscribe

src/darkbird/database.rs:150–171  ·  view source on GitHub ↗
(&self, sender: Sender<Event<K, Doc>>)

Source from the content-addressed store, hash-verified

148
149 #[inline]
150 pub async fn subscribe<K, Doc>(&self, sender: Sender<Event<K, Doc>>) -> Result<(), SessionResult>
151 where
152 Doc: Serialize + DeserializeOwned + Clone + Send + 'static + Document,
153 K: Serialize
154 + DeserializeOwned
155 + PartialOrd
156 + Ord
157 + PartialEq
158 + Eq
159 + Hash
160 + Clone
161 + Send
162 + Sync
163 + 'static
164 {
165 match self.datastores.get::<Storage<K, Doc>>() {
166 None => Err(SessionResult::DataStoreNotFound),
167 Some(datastore) => {
168 datastore.subscribe(sender).await
169 }
170 }
171 }
172
173 #[inline]
174 pub async fn insert<K, Doc>(&self, key: K, doc: Doc) -> Result<(), SessionResult>

Callers 1

vec_subscribeMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected