pub struct DbBuilder {
tokens: Option<Vec<ApiTokenData>>,
proposals: Option<Vec<FullProposalInfo>>,
funds: Option<Vec<Fund>>,
challenges: Option<Vec<Challenge>>,
advisor_reviews: Option<Vec<AdvisorReview>>,
}
Fields§
§tokens: Option<Vec<ApiTokenData>>
§proposals: Option<Vec<FullProposalInfo>>
§funds: Option<Vec<Fund>>
§challenges: Option<Vec<Challenge>>
§advisor_reviews: Option<Vec<AdvisorReview>>
Implementations§
source§impl DbBuilder
impl DbBuilder
pub fn new() -> Self
pub fn with_tokens(&mut self, tokens: Vec<ApiTokenData>) -> &mut Self
pub fn with_token(&mut self, token: ApiTokenData) -> &mut Self
pub fn with_proposals(&mut self, proposals: Vec<FullProposalInfo>) -> &mut Self
pub fn with_challenges(&mut self, challenges: Vec<Challenge>) -> &mut Self
pub fn with_snapshot(&mut self, snapshot: &Snapshot) -> &mut Self
pub fn with_funds(&mut self, funds: Vec<Fund>) -> &mut Self
pub fn with_advisor_reviews(&mut self, reviews: Vec<AdvisorReview>) -> &mut Self
fn try_insert_tokens( &self, connection: &DbConnection ) -> Result<(), DbBuilderError>
fn try_insert_funds( &self, connection: &DbConnection ) -> Result<(), DbBuilderError>
fn try_insert_challenges( &self, connection: &DbConnection ) -> Result<(), DbBuilderError>
fn try_insert_vote_plans( &self, connection: &DbConnection ) -> Result<(), DbBuilderError>
fn try_insert_proposals( &self, connection: &DbConnection ) -> Result<(), DbBuilderError>
fn try_insert_reviews( &self, connection: &DbConnection ) -> Result<(), DbBuilderError>
pub fn build(&self) -> Result<String, DbBuilderError>
pub async fn build_async(&self) -> Result<String, DbBuilderError>
fn create_database(&self) -> Result<(String, DbConnectionPool), DbBuilderError>
fn insert_all(&self, connection: &DbConnection) -> Result<(), DbBuilderError>
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for DbBuilder
impl Send for DbBuilder
impl Sync for DbBuilder
impl Unpin for DbBuilder
impl UnwindSafe for DbBuilder
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