mirror of
https://github.com/alfg/mp4-rust.git
synced 2025-01-07 02:35:26 +00:00
chore(Mp4Box): use a trait function for to_json
This commit is contained in:
parent
ff9e75922b
commit
0fdd2d16b4
45 changed files with 7 additions and 197 deletions
|
@ -67,10 +67,6 @@ impl Mp4Box for Avc1Box {
|
|||
self.get_size()
|
||||
}
|
||||
|
||||
fn to_json(&self) -> Result<String> {
|
||||
serde_json::to_string(&self).map_err(|e| crate::error::Error::IoError(e.into()))
|
||||
}
|
||||
|
||||
fn summary(&self) -> Result<String> {
|
||||
let s = format!(
|
||||
"data_reference_index={} width={} height={} frame_count={}",
|
||||
|
@ -199,10 +195,6 @@ impl Mp4Box for AvcCBox {
|
|||
size
|
||||
}
|
||||
|
||||
fn to_json(&self) -> Result<String> {
|
||||
serde_json::to_string(&self).map_err(|e| crate::error::Error::IoError(e.into()))
|
||||
}
|
||||
|
||||
fn summary(&self) -> Result<String> {
|
||||
let s = format!("avc_profile_indication={}", self.avc_profile_indication);
|
||||
Ok(s)
|
||||
|
|
|
@ -33,10 +33,6 @@ impl Mp4Box for Co64Box {
|
|||
self.get_size()
|
||||
}
|
||||
|
||||
fn to_json(&self) -> Result<String> {
|
||||
serde_json::to_string(&self).map_err(|e| crate::error::Error::IoError(e.into()))
|
||||
}
|
||||
|
||||
fn summary(&self) -> Result<String> {
|
||||
let s = format!("entries_count={}", self.entries.len());
|
||||
Ok(s)
|
||||
|
|
|
@ -39,10 +39,6 @@ impl Mp4Box for CttsBox {
|
|||
self.get_size()
|
||||
}
|
||||
|
||||
fn to_json(&self) -> Result<String> {
|
||||
serde_json::to_string(&self).map_err(|e| crate::error::Error::IoError(e.into()))
|
||||
}
|
||||
|
||||
fn summary(&self) -> Result<String> {
|
||||
let s = format!("entries_count={}", self.entries.len());
|
||||
Ok(s)
|
||||
|
|
|
@ -36,10 +36,6 @@ impl Mp4Box for DataBox {
|
|||
self.get_size()
|
||||
}
|
||||
|
||||
fn to_json(&self) -> Result<String> {
|
||||
serde_json::to_string(&self).map_err(|e| crate::error::Error::IoError(e.into()))
|
||||
}
|
||||
|
||||
fn summary(&self) -> Result<String> {
|
||||
let s = format!("type={:?} len={}", self.data_type, self.data.len());
|
||||
Ok(s)
|
||||
|
|
|
@ -27,10 +27,6 @@ impl Mp4Box for DinfBox {
|
|||
self.get_size()
|
||||
}
|
||||
|
||||
fn to_json(&self) -> Result<String> {
|
||||
serde_json::to_string(&self).map_err(|e| crate::error::Error::IoError(e.into()))
|
||||
}
|
||||
|
||||
fn summary(&self) -> Result<String> {
|
||||
let s = String::new();
|
||||
Ok(s)
|
||||
|
@ -131,10 +127,6 @@ impl Mp4Box for DrefBox {
|
|||
self.get_size()
|
||||
}
|
||||
|
||||
fn to_json(&self) -> Result<String> {
|
||||
serde_json::to_string(&self).map_err(|e| crate::error::Error::IoError(e.into()))
|
||||
}
|
||||
|
||||
fn summary(&self) -> Result<String> {
|
||||
let s = String::new();
|
||||
Ok(s)
|
||||
|
@ -248,10 +240,6 @@ impl Mp4Box for UrlBox {
|
|||
self.get_size()
|
||||
}
|
||||
|
||||
fn to_json(&self) -> Result<String> {
|
||||
serde_json::to_string(&self).map_err(|e| crate::error::Error::IoError(e.into()))
|
||||
}
|
||||
|
||||
fn summary(&self) -> Result<String> {
|
||||
let s = format!("location={}", self.location);
|
||||
Ok(s)
|
||||
|
|
|
@ -36,10 +36,6 @@ impl Mp4Box for EdtsBox {
|
|||
self.get_size()
|
||||
}
|
||||
|
||||
fn to_json(&self) -> Result<String> {
|
||||
serde_json::to_string(&self).map_err(|e| crate::error::Error::IoError(e.into()))
|
||||
}
|
||||
|
||||
fn summary(&self) -> Result<String> {
|
||||
let s = String::new();
|
||||
Ok(s)
|
||||
|
|
|
@ -47,10 +47,6 @@ impl Mp4Box for ElstBox {
|
|||
self.get_size()
|
||||
}
|
||||
|
||||
fn to_json(&self) -> Result<String> {
|
||||
serde_json::to_string(&self).map_err(|e| crate::error::Error::IoError(e.into()))
|
||||
}
|
||||
|
||||
fn summary(&self) -> Result<String> {
|
||||
let s = format!("elst_entries={}", self.entries.len());
|
||||
Ok(s)
|
||||
|
|
|
@ -48,10 +48,6 @@ impl Mp4Box for EmsgBox {
|
|||
+ self.message_data.len() as u64
|
||||
}
|
||||
|
||||
fn to_json(&self) -> Result<String> {
|
||||
serde_json::to_string(&self).map_err(|e| crate::error::Error::IoError(e.into()))
|
||||
}
|
||||
|
||||
fn summary(&self) -> Result<String> {
|
||||
let s = format!("id={} value={}", self.id, self.value);
|
||||
Ok(s)
|
||||
|
|
|
@ -30,10 +30,6 @@ impl Mp4Box for FtypBox {
|
|||
self.get_size()
|
||||
}
|
||||
|
||||
fn to_json(&self) -> Result<String> {
|
||||
serde_json::to_string(&self).map_err(|e| crate::error::Error::IoError(e.into()))
|
||||
}
|
||||
|
||||
fn summary(&self) -> Result<String> {
|
||||
let mut compatible_brands = Vec::new();
|
||||
for brand in self.compatible_brands.iter() {
|
||||
|
|
|
@ -31,10 +31,6 @@ impl Mp4Box for HdlrBox {
|
|||
self.get_size()
|
||||
}
|
||||
|
||||
fn to_json(&self) -> Result<String> {
|
||||
serde_json::to_string(&self).map_err(|e| crate::error::Error::IoError(e.into()))
|
||||
}
|
||||
|
||||
fn summary(&self) -> Result<String> {
|
||||
let s = format!("handler_type={} name={}", self.handler_type, self.name);
|
||||
Ok(s)
|
||||
|
|
|
@ -67,10 +67,6 @@ impl Mp4Box for Hev1Box {
|
|||
self.get_size()
|
||||
}
|
||||
|
||||
fn to_json(&self) -> Result<String> {
|
||||
serde_json::to_string(&self).map_err(|e| crate::error::Error::IoError(e.into()))
|
||||
}
|
||||
|
||||
fn summary(&self) -> Result<String> {
|
||||
let s = format!(
|
||||
"data_reference_index={} width={} height={} frame_count={}",
|
||||
|
@ -180,10 +176,6 @@ impl Mp4Box for HvcCBox {
|
|||
HEADER_SIZE + 1
|
||||
}
|
||||
|
||||
fn to_json(&self) -> Result<String> {
|
||||
serde_json::to_string(&self).map_err(|e| crate::error::Error::IoError(e.into()))
|
||||
}
|
||||
|
||||
fn summary(&self) -> Result<String> {
|
||||
let s = format!("configuration_version={}", self.configuration_version);
|
||||
Ok(s)
|
||||
|
|
|
@ -36,10 +36,6 @@ impl Mp4Box for IlstBox {
|
|||
self.get_size()
|
||||
}
|
||||
|
||||
fn to_json(&self) -> Result<String> {
|
||||
serde_json::to_string(&self).map_err(|e| crate::error::Error::IoError(e.into()))
|
||||
}
|
||||
|
||||
fn summary(&self) -> Result<String> {
|
||||
let s = format!("item_count={}", self.items.len());
|
||||
Ok(s)
|
||||
|
|
|
@ -57,10 +57,6 @@ impl Mp4Box for MdhdBox {
|
|||
self.get_size()
|
||||
}
|
||||
|
||||
fn to_json(&self) -> Result<String> {
|
||||
serde_json::to_string(&self).map_err(|e| crate::error::Error::IoError(e.into()))
|
||||
}
|
||||
|
||||
fn summary(&self) -> Result<String> {
|
||||
let s = format!(
|
||||
"creation_time={} timescale={} duration={} language={}",
|
||||
|
|
|
@ -30,10 +30,6 @@ impl Mp4Box for MdiaBox {
|
|||
self.get_size()
|
||||
}
|
||||
|
||||
fn to_json(&self) -> Result<String> {
|
||||
serde_json::to_string(&self).map_err(|e| crate::error::Error::IoError(e.into()))
|
||||
}
|
||||
|
||||
fn summary(&self) -> Result<String> {
|
||||
let s = String::new();
|
||||
Ok(s)
|
||||
|
|
|
@ -37,10 +37,6 @@ impl Mp4Box for MehdBox {
|
|||
self.get_size()
|
||||
}
|
||||
|
||||
fn to_json(&self) -> Result<String> {
|
||||
serde_json::to_string(&self).map_err(|e| crate::error::Error::IoError(e.into()))
|
||||
}
|
||||
|
||||
fn summary(&self) -> Result<String> {
|
||||
let s = format!("fragment_duration={}", self.fragment_duration);
|
||||
Ok(s)
|
||||
|
|
|
@ -56,10 +56,6 @@ impl Mp4Box for MetaBox {
|
|||
self.get_size()
|
||||
}
|
||||
|
||||
fn to_json(&self) -> Result<String> {
|
||||
serde_json::to_string(&self).map_err(|e| crate::error::Error::IoError(e.into()))
|
||||
}
|
||||
|
||||
fn summary(&self) -> Result<String> {
|
||||
let s = match self {
|
||||
Self::Mdir { .. } => "hdlr=ilst".to_string(),
|
||||
|
|
|
@ -40,10 +40,6 @@ impl Mp4Box for MfhdBox {
|
|||
self.get_size()
|
||||
}
|
||||
|
||||
fn to_json(&self) -> Result<String> {
|
||||
serde_json::to_string(&self).map_err(|e| crate::error::Error::IoError(e.into()))
|
||||
}
|
||||
|
||||
fn summary(&self) -> Result<String> {
|
||||
let s = format!("sequence_number={}", self.sequence_number);
|
||||
Ok(s)
|
||||
|
|
|
@ -44,10 +44,6 @@ impl Mp4Box for MinfBox {
|
|||
self.get_size()
|
||||
}
|
||||
|
||||
fn to_json(&self) -> Result<String> {
|
||||
serde_json::to_string(&self).map_err(|e| crate::error::Error::IoError(e.into()))
|
||||
}
|
||||
|
||||
fn summary(&self) -> Result<String> {
|
||||
let s = String::new();
|
||||
Ok(s)
|
||||
|
|
|
@ -57,6 +57,7 @@
|
|||
//!
|
||||
|
||||
use byteorder::{BigEndian, ReadBytesExt, WriteBytesExt};
|
||||
use serde::Serialize;
|
||||
use std::convert::TryInto;
|
||||
use std::io::{Read, Seek, SeekFrom, Write};
|
||||
|
||||
|
@ -206,7 +207,12 @@ boxtype! {
|
|||
pub trait Mp4Box: Sized {
|
||||
fn box_type(&self) -> BoxType;
|
||||
fn box_size(&self) -> u64;
|
||||
fn to_json(&self) -> Result<String>;
|
||||
fn to_json(&self) -> Result<String>
|
||||
where
|
||||
Self: Serialize,
|
||||
{
|
||||
serde_json::to_string(&self).map_err(|e| crate::error::Error::IoError(e.into()))
|
||||
}
|
||||
fn summary(&self) -> Result<String>;
|
||||
}
|
||||
|
||||
|
|
|
@ -35,10 +35,6 @@ impl Mp4Box for MoofBox {
|
|||
self.get_size()
|
||||
}
|
||||
|
||||
fn to_json(&self) -> Result<String> {
|
||||
serde_json::to_string(&self).map_err(|e| crate::error::Error::IoError(e.into()))
|
||||
}
|
||||
|
||||
fn summary(&self) -> Result<String> {
|
||||
let s = format!("trafs={}", self.trafs.len());
|
||||
Ok(s)
|
||||
|
|
|
@ -51,10 +51,6 @@ impl Mp4Box for MoovBox {
|
|||
self.get_size()
|
||||
}
|
||||
|
||||
fn to_json(&self) -> Result<String> {
|
||||
serde_json::to_string(&self).map_err(|e| crate::error::Error::IoError(e.into()))
|
||||
}
|
||||
|
||||
fn summary(&self) -> Result<String> {
|
||||
let s = format!("traks={}", self.traks.len());
|
||||
Ok(s)
|
||||
|
|
|
@ -60,10 +60,6 @@ impl Mp4Box for Mp4aBox {
|
|||
self.get_size()
|
||||
}
|
||||
|
||||
fn to_json(&self) -> Result<String> {
|
||||
serde_json::to_string(&self).map_err(|e| crate::error::Error::IoError(e.into()))
|
||||
}
|
||||
|
||||
fn summary(&self) -> Result<String> {
|
||||
let s = format!(
|
||||
"channel_count={} sample_size={} sample_rate={}",
|
||||
|
@ -169,10 +165,6 @@ impl Mp4Box for EsdsBox {
|
|||
+ ESDescriptor::desc_size() as u64
|
||||
}
|
||||
|
||||
fn to_json(&self) -> Result<String> {
|
||||
serde_json::to_string(&self).map_err(|e| crate::error::Error::IoError(e.into()))
|
||||
}
|
||||
|
||||
fn summary(&self) -> Result<String> {
|
||||
Ok(String::new())
|
||||
}
|
||||
|
|
|
@ -29,10 +29,6 @@ impl Mp4Box for MvexBox {
|
|||
self.get_size()
|
||||
}
|
||||
|
||||
fn to_json(&self) -> Result<String> {
|
||||
serde_json::to_string(&self).map_err(|e| crate::error::Error::IoError(e.into()))
|
||||
}
|
||||
|
||||
fn summary(&self) -> Result<String> {
|
||||
let s = String::new();
|
||||
Ok(s)
|
||||
|
|
|
@ -66,10 +66,6 @@ impl Mp4Box for MvhdBox {
|
|||
self.get_size()
|
||||
}
|
||||
|
||||
fn to_json(&self) -> Result<String> {
|
||||
serde_json::to_string(&self).map_err(|e| crate::error::Error::IoError(e.into()))
|
||||
}
|
||||
|
||||
fn summary(&self) -> Result<String> {
|
||||
let s = format!(
|
||||
"creation_time={} timescale={} duration={} rate={} volume={}, matrix={}, next_track_id={}",
|
||||
|
|
|
@ -42,10 +42,6 @@ impl Mp4Box for SmhdBox {
|
|||
self.get_size()
|
||||
}
|
||||
|
||||
fn to_json(&self) -> Result<String> {
|
||||
serde_json::to_string(&self).map_err(|e| crate::error::Error::IoError(e.into()))
|
||||
}
|
||||
|
||||
fn summary(&self) -> Result<String> {
|
||||
let s = format!("balance={}", self.balance.value());
|
||||
Ok(s)
|
||||
|
|
|
@ -22,10 +22,6 @@ impl Mp4Box for SounBox {
|
|||
todo!()
|
||||
}
|
||||
|
||||
fn to_json(&self) -> Result<String> {
|
||||
serde_json::to_string(&self).map_err(|e| crate::error::Error::IoError(e.into()))
|
||||
}
|
||||
|
||||
fn summary(&self) -> Result<String> {
|
||||
todo!()
|
||||
}
|
||||
|
|
|
@ -63,10 +63,6 @@ impl Mp4Box for StblBox {
|
|||
self.get_size()
|
||||
}
|
||||
|
||||
fn to_json(&self) -> Result<String> {
|
||||
serde_json::to_string(&self).map_err(|e| crate::error::Error::IoError(e.into()))
|
||||
}
|
||||
|
||||
fn summary(&self) -> Result<String> {
|
||||
let s = String::new();
|
||||
Ok(s)
|
||||
|
|
|
@ -33,10 +33,6 @@ impl Mp4Box for StcoBox {
|
|||
self.get_size()
|
||||
}
|
||||
|
||||
fn to_json(&self) -> Result<String> {
|
||||
serde_json::to_string(&self).map_err(|e| crate::error::Error::IoError(e.into()))
|
||||
}
|
||||
|
||||
fn summary(&self) -> Result<String> {
|
||||
let s = format!("entries={}", self.entries.len());
|
||||
Ok(s)
|
||||
|
|
|
@ -41,10 +41,6 @@ impl Mp4Box for StscBox {
|
|||
self.get_size()
|
||||
}
|
||||
|
||||
fn to_json(&self) -> Result<String> {
|
||||
serde_json::to_string(&self).map_err(|e| crate::error::Error::IoError(e.into()))
|
||||
}
|
||||
|
||||
fn summary(&self) -> Result<String> {
|
||||
let s = format!("entries={}", self.entries.len());
|
||||
Ok(s)
|
||||
|
|
|
@ -58,10 +58,6 @@ impl Mp4Box for StsdBox {
|
|||
self.get_size()
|
||||
}
|
||||
|
||||
fn to_json(&self) -> Result<String> {
|
||||
serde_json::to_string(&self).map_err(|e| crate::error::Error::IoError(e.into()))
|
||||
}
|
||||
|
||||
fn summary(&self) -> Result<String> {
|
||||
let s = String::new();
|
||||
Ok(s)
|
||||
|
|
|
@ -33,10 +33,6 @@ impl Mp4Box for StssBox {
|
|||
self.get_size()
|
||||
}
|
||||
|
||||
fn to_json(&self) -> Result<String> {
|
||||
serde_json::to_string(&self).map_err(|e| crate::error::Error::IoError(e.into()))
|
||||
}
|
||||
|
||||
fn summary(&self) -> Result<String> {
|
||||
let s = format!("entries={}", self.entries.len());
|
||||
Ok(s)
|
||||
|
|
|
@ -35,10 +35,6 @@ impl Mp4Box for StszBox {
|
|||
self.get_size()
|
||||
}
|
||||
|
||||
fn to_json(&self) -> Result<String> {
|
||||
serde_json::to_string(&self).map_err(|e| crate::error::Error::IoError(e.into()))
|
||||
}
|
||||
|
||||
fn summary(&self) -> Result<String> {
|
||||
let s = format!(
|
||||
"sample_size={} sample_count={} sample_sizes={}",
|
||||
|
|
|
@ -39,10 +39,6 @@ impl Mp4Box for SttsBox {
|
|||
self.get_size()
|
||||
}
|
||||
|
||||
fn to_json(&self) -> Result<String> {
|
||||
serde_json::to_string(&self).map_err(|e| crate::error::Error::IoError(e.into()))
|
||||
}
|
||||
|
||||
fn summary(&self) -> Result<String> {
|
||||
let s = format!("entries={}", self.entries.len());
|
||||
Ok(s)
|
||||
|
|
|
@ -36,10 +36,6 @@ impl Mp4Box for TfdtBox {
|
|||
self.get_size()
|
||||
}
|
||||
|
||||
fn to_json(&self) -> Result<String> {
|
||||
serde_json::to_string(&self).map_err(|e| crate::error::Error::IoError(e.into()))
|
||||
}
|
||||
|
||||
fn summary(&self) -> Result<String> {
|
||||
let s = format!("base_media_decode_time={}", self.base_media_decode_time);
|
||||
Ok(s)
|
||||
|
|
|
@ -57,10 +57,6 @@ impl Mp4Box for TfhdBox {
|
|||
self.get_size()
|
||||
}
|
||||
|
||||
fn to_json(&self) -> Result<String> {
|
||||
serde_json::to_string(&self).map_err(|e| crate::error::Error::IoError(e.into()))
|
||||
}
|
||||
|
||||
fn summary(&self) -> Result<String> {
|
||||
let s = format!("track_id={}", self.track_id);
|
||||
Ok(s)
|
||||
|
|
|
@ -125,10 +125,6 @@ impl Mp4Box for TkhdBox {
|
|||
self.get_size()
|
||||
}
|
||||
|
||||
fn to_json(&self) -> Result<String> {
|
||||
serde_json::to_string(&self).map_err(|e| crate::error::Error::IoError(e.into()))
|
||||
}
|
||||
|
||||
fn summary(&self) -> Result<String> {
|
||||
let s = format!(
|
||||
"creation_time={} track_id={} duration={} layer={} volume={} matrix={} width={} height={}",
|
||||
|
|
|
@ -35,10 +35,6 @@ impl Mp4Box for TrafBox {
|
|||
self.get_size()
|
||||
}
|
||||
|
||||
fn to_json(&self) -> Result<String> {
|
||||
serde_json::to_string(&self).map_err(|e| crate::error::Error::IoError(e.into()))
|
||||
}
|
||||
|
||||
fn summary(&self) -> Result<String> {
|
||||
let s = String::new();
|
||||
Ok(s)
|
||||
|
|
|
@ -43,10 +43,6 @@ impl Mp4Box for TrakBox {
|
|||
self.get_size()
|
||||
}
|
||||
|
||||
fn to_json(&self) -> Result<String> {
|
||||
serde_json::to_string(&self).map_err(|e| crate::error::Error::IoError(e.into()))
|
||||
}
|
||||
|
||||
fn summary(&self) -> Result<String> {
|
||||
let s = String::new();
|
||||
Ok(s)
|
||||
|
|
|
@ -34,10 +34,6 @@ impl Mp4Box for TrexBox {
|
|||
self.get_size()
|
||||
}
|
||||
|
||||
fn to_json(&self) -> Result<String> {
|
||||
serde_json::to_string(&self).map_err(|e| crate::error::Error::IoError(e.into()))
|
||||
}
|
||||
|
||||
fn summary(&self) -> Result<String> {
|
||||
let s = format!(
|
||||
"track_id={} default_sample_duration={}",
|
||||
|
|
|
@ -68,10 +68,6 @@ impl Mp4Box for TrunBox {
|
|||
self.get_size()
|
||||
}
|
||||
|
||||
fn to_json(&self) -> Result<String> {
|
||||
serde_json::to_string(&self).map_err(|e| crate::error::Error::IoError(e.into()))
|
||||
}
|
||||
|
||||
fn summary(&self) -> Result<String> {
|
||||
let s = format!("sample_size={}", self.sample_count);
|
||||
Ok(s)
|
||||
|
|
|
@ -61,10 +61,6 @@ impl Mp4Box for Tx3gBox {
|
|||
self.get_size()
|
||||
}
|
||||
|
||||
fn to_json(&self) -> Result<String> {
|
||||
serde_json::to_string(&self).map_err(|e| crate::error::Error::IoError(e.into()))
|
||||
}
|
||||
|
||||
fn summary(&self) -> Result<String> {
|
||||
let s = format!("data_reference_index={} horizontal_justification={} vertical_justification={} rgba={}{}{}{}",
|
||||
self.data_reference_index, self.horizontal_justification,
|
||||
|
|
|
@ -34,10 +34,6 @@ impl Mp4Box for UdtaBox {
|
|||
self.get_size()
|
||||
}
|
||||
|
||||
fn to_json(&self) -> Result<String> {
|
||||
serde_json::to_string(&self).map_err(|e| crate::error::Error::IoError(e.into()))
|
||||
}
|
||||
|
||||
fn summary(&self) -> Result<String> {
|
||||
Ok(String::new())
|
||||
}
|
||||
|
|
|
@ -38,10 +38,6 @@ impl Mp4Box for VmhdBox {
|
|||
self.get_size()
|
||||
}
|
||||
|
||||
fn to_json(&self) -> Result<String> {
|
||||
serde_json::to_string(&self).map_err(|e| crate::error::Error::IoError(e.into()))
|
||||
}
|
||||
|
||||
fn summary(&self) -> Result<String> {
|
||||
let s = format!(
|
||||
"graphics_mode={} op_color={}{}{}",
|
||||
|
|
|
@ -74,10 +74,6 @@ impl Mp4Box for Vp09Box {
|
|||
0x6A
|
||||
}
|
||||
|
||||
fn to_json(&self) -> Result<String> {
|
||||
serde_json::to_string(&self).map_err(|e| crate::error::Error::IoError(e.into()))
|
||||
}
|
||||
|
||||
fn summary(&self) -> Result<String> {
|
||||
Ok(format!("{self:?}"))
|
||||
}
|
||||
|
|
|
@ -31,10 +31,6 @@ impl Mp4Box for VpccBox {
|
|||
HEADER_SIZE + HEADER_EXT_SIZE + 8
|
||||
}
|
||||
|
||||
fn to_json(&self) -> Result<String> {
|
||||
serde_json::to_string(&self).map_err(|e| crate::error::Error::IoError(e.into()))
|
||||
}
|
||||
|
||||
fn summary(&self) -> Result<String> {
|
||||
Ok(format!("{self:?}"))
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue