Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

insert_all method not found in noria::table::Table #164

Closed
anandijain opened this issue Jun 5, 2020 · 7 comments
Closed

insert_all method not found in noria::table::Table #164

anandijain opened this issue Jun 5, 2020 · 7 comments

Comments

@anandijain
Copy link

anandijain commented Jun 5, 2020

I am probably doing something dumb, but I am trying to use the insert_all function, but it doesn't seem to exist.

// schema not needed for mre //
let mut votes = db.table("votes").await.unwrap();
let noria_recs: Vec<Vec<DataType>> = ...
votes.insert_all(noria_recs).await.unwrap();

gives: no method named insert_all found for struct noria::table::Table in the current scope: method not found in noria::table::Table

The definition for insert_all is

pub fn insert_all<I, V>(&mut self, i: I) -> Result<(), TableError> 
where    
I: IntoIterator<Item = V>,   
V: Into<Vec<DataType>>, 

which I believe a Vec impls IntoIterator.

I think a code snippet in the docs would be helpful

-- versions --
My Cargo.toml has noria = "0.5.0"
rustc 1.45.0-nightly (47c3158c3 2020-06-04)

@jonhoo
Copy link
Contributor

jonhoo commented Jun 5, 2020

Ah, you are looking at some very outdated documentation. If that's still linked from somewhere, we should remove that. Unfortunately, docs.rs also can't build the docs at the moment (see #153), so to see the actual docs you'll want to clone the git repository and then do:

$ cargo doc --lib -p noria

@anandijain
Copy link
Author

thank you, I need to get better at reading docs w cargo.
I just pulled and cargo doc --lib -p noria but I get:

 Documenting noria v0.5.0 (/home//programming/clones/noria/noria)
error[E0432]: unresolved import `tokio::task_local`
   --> noria/src/lib.rs:229:5
    |
229 | use tokio::task_local;
    |     ^^^^^^^^^^^^^^^^^ no `task_local` in the root

error: cannot determine resolution for the macro `task_local`
   --> noria/src/lib.rs:250:1
    |
250 | task_local! {
    | ^^^^^^^^^^

@jonhoo
Copy link
Contributor

jonhoo commented Jun 5, 2020

Huh, interesting. Can you try a cargo update?

@anandijain
Copy link
Author

anandijain commented Jun 5, 2020

after cargo update and rerunning cargo doc --lib -p noria gives:

...
Documenting tower-limit v0.3.1
   Checking mysql_common v0.22.1
error[E0277]: the trait bound `(): core::future::future::Future` is not satisfied
  --> /home//.cargo/git/checkouts/tokio-tower-98a883543a8cb142/346858d/src/multiplex/client.rs:96:5
   |
96 |     type Future = impl Future<Output = Result<Self::Response, Self::Error>> + Send;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `core::future::future::Future` is not implemented for `()`
   |
   = note: the return type of a function must have a statically known size
...
3 more futures errors
...
error: Could not document `tokio-tower`.

@jonhoo
Copy link
Contributor

jonhoo commented Jun 5, 2020

Ah, man, yeah, that's #153, which in turn is rust-lang/rust#65863. Unfortunately not much I can do about that. I think for now you're stuck with having to look at noria/src/table.rs yourself and look at the public methods then :'(

@anandijain
Copy link
Author

idk why i didn't think of that,
ty

@anandijain
Copy link
Author

perform_all makes a lot of sense, rather than having a separate function for each TableOperation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants