Struct db_dump::DbDump

source ·
#[non_exhaustive]
pub struct DbDump {
Show 14 fields pub badges: Vec<Row>, pub categories: Vec<Row>, pub crate_owners: Vec<Row>, pub crates: Vec<Row>, pub crates_categories: Vec<Row>, pub crates_keywords: Vec<Row>, pub dependencies: Vec<Row>, pub keywords: Vec<Row>, pub metadata: Row, pub reserved_crate_names: Vec<Row>, pub teams: Vec<Row>, pub users: Vec<Row>, pub version_downloads: Vec<Row>, pub versions: Vec<Row>,
}
Expand description

A crates.io DB dump with everything deserialized into memory. Use Loader to load only parts of a dump, which is more efficient.

One of these full dumps can be loaded via db_dump::load_all.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§badges: Vec<Row>
badges.csv crate_id badge_type attributes
§categories: Vec<Row>
categories.csv id category slug description crates_cnt created_at path
§crate_owners: Vec<Row>
crate_owners.csv crate_id owner_id created_at created_by owner_kind
§crates: Vec<Row>
crates.csv id name updated_at created_at downloads description homepage documentation readme repository max_upload_size
§crates_categories: Vec<Row>
crates_categories.csv crate_id category_id
§crates_keywords: Vec<Row>
crates_keywords.csv crate_id keyword_id
§dependencies: Vec<Row>
dependencies.csv id version_id crate_id req optional default_features features target kind explicit_name
§keywords: Vec<Row>
keywords.csv id keyword crates_cnt created_at
§metadata: Row
metadata.csv total_downloads
§reserved_crate_names: Vec<Row>
reserved_crate_names.csv name
§teams: Vec<Row>
teams.csv id login github_id name avatar org_id
§users: Vec<Row>
users.csv id gh_login name gh_avatar gh_id
§version_downloads: Vec<Row>
version_downloads.csv version_id downloads date
§versions: Vec<Row>
versions.csv id crate_id num updated_at created_at downloads features yanked license crate_size published_by checksum links rust_version

Implementations§

source§

impl DbDump

source

pub fn index<'a>(&'a self) -> Index<'a>

Create a lazy index of those tables that have a unique ID column as primary key.

This call does no work up front. Each index is built lazily upon first access through one of the Index struct’s methods.

Trait Implementations§

source§

impl Default for DbDump

source§

fn default() -> DbDump

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.