pub struct VersionInfo {
pub packages: Vec<Package>,
}
Expand description
Dependency tree embedded in the binary.
Implements Serialize
and Deserialize
traits from serde
, so you can use
all the usual methods from serde-json
to read and write it.
from_str()
that parses JSON is also implemented for your convenience:
use auditable_serde::VersionInfo;
use std::str::FromStr;
let json_str = r#"{"packages":[{
"name":"adler",
"version":"0.2.3",
"source":"registry"
}]}"#;
let info = VersionInfo::from_str(json_str).unwrap();
assert_eq!(&info.packages[0].name, "adler");
If deserialization succeeds, it is guaranteed that there is only one root package, and that are no cyclic dependencies.
Fields§
§packages: Vec<Package>
Trait Implementations§
Source§impl Clone for VersionInfo
impl Clone for VersionInfo
Source§fn clone(&self) -> VersionInfo
fn clone(&self) -> VersionInfo
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for VersionInfo
impl Debug for VersionInfo
Source§impl<'de> Deserialize<'de> for VersionInfo
impl<'de> Deserialize<'de> for VersionInfo
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl FromStr for VersionInfo
impl FromStr for VersionInfo
Source§impl JsonSchema for VersionInfo
impl JsonSchema for VersionInfo
Source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref
keyword. Read moreSource§impl Ord for VersionInfo
impl Ord for VersionInfo
Source§fn cmp(&self, other: &VersionInfo) -> Ordering
fn cmp(&self, other: &VersionInfo) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for VersionInfo
impl PartialEq for VersionInfo
Source§impl PartialOrd for VersionInfo
impl PartialOrd for VersionInfo
Source§impl Serialize for VersionInfo
impl Serialize for VersionInfo
impl Eq for VersionInfo
impl StructuralPartialEq for VersionInfo
Auto Trait Implementations§
impl Freeze for VersionInfo
impl RefUnwindSafe for VersionInfo
impl Send for VersionInfo
impl Sync for VersionInfo
impl Unpin for VersionInfo
impl UnwindSafe for VersionInfo
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)