refactor: update meta plugins to use MetaPluginResponse
Co-authored-by: aider (openai/andrew/openrouter/mistralai/mistral-medium-3.1) <aider@aider.chat>
This commit is contained in:
@@ -169,7 +169,7 @@ impl MetaPlugin for ReadTimeMetaPlugin {
|
|||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
|
||||||
fn finalize(&mut self) -> Result<PluginResponse> {
|
fn finalize(&mut self) -> Result<MetaPluginResponse> {
|
||||||
let mut metadata = Vec::new();
|
let mut metadata = Vec::new();
|
||||||
|
|
||||||
if let Some(start_time) = self.start_time {
|
if let Some(start_time) = self.start_time {
|
||||||
@@ -183,17 +183,17 @@ impl MetaPlugin for ReadTimeMetaPlugin {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(PluginResponse {
|
Ok(MetaPluginResponse {
|
||||||
metadata: Some(metadata),
|
metadata: Some(metadata),
|
||||||
is_finalized: true,
|
is_finalized: true,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
fn update(&mut self, _data: &[u8]) -> Result<PluginResponse> {
|
fn update(&mut self, _data: &[u8]) -> Result<MetaPluginResponse> {
|
||||||
if self.start_time.is_none() {
|
if self.start_time.is_none() {
|
||||||
self.start_time = Some(Instant::now());
|
self.start_time = Some(Instant::now());
|
||||||
}
|
}
|
||||||
Ok(PluginResponse::default())
|
Ok(MetaPluginResponse::default())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn meta_name(&self) -> String {
|
fn meta_name(&self) -> String {
|
||||||
@@ -278,7 +278,7 @@ impl MetaPlugin for ReadRateMetaPlugin {
|
|||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
|
||||||
fn finalize(&mut self) -> Result<PluginResponse> {
|
fn finalize(&mut self) -> Result<MetaPluginResponse> {
|
||||||
let mut metadata = Vec::new();
|
let mut metadata = Vec::new();
|
||||||
|
|
||||||
if let Some(start_time) = self.start_time {
|
if let Some(start_time) = self.start_time {
|
||||||
@@ -296,18 +296,18 @@ impl MetaPlugin for ReadRateMetaPlugin {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(PluginResponse {
|
Ok(MetaPluginResponse {
|
||||||
metadata: Some(metadata),
|
metadata: Some(metadata),
|
||||||
is_finalized: true,
|
is_finalized: true,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
fn update(&mut self, data: &[u8]) -> Result<PluginResponse> {
|
fn update(&mut self, data: &[u8]) -> Result<MetaPluginResponse> {
|
||||||
if self.start_time.is_none() {
|
if self.start_time.is_none() {
|
||||||
self.start_time = Some(Instant::now());
|
self.start_time = Some(Instant::now());
|
||||||
}
|
}
|
||||||
self.bytes_read += data.len() as u64;
|
self.bytes_read += data.len() as u64;
|
||||||
Ok(PluginResponse::default())
|
Ok(MetaPluginResponse::default())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn meta_name(&self) -> String {
|
fn meta_name(&self) -> String {
|
||||||
|
|||||||
Reference in New Issue
Block a user