Closed holmofy closed 1 year ago
The methods are public. It appears the issue you're running into is the second part of that error message: items from traits can only be used if the trait is in scope
.
In account_user.rs
, you've imported ormlite::model::*
, which contains the Model (& other) traits, so you have access to those methods. In user.rs
, you haven't.
In fact, while trait (pub trait $NAME
) can be tagged as public or not, methods within them do not take visibility modifiers. You can think of all methods as being public.
If I misunderstood, please reply with additional detail and I'll re-open the issue.
I ran into this with "No method named _id
found for ..." and changing to
use ormlite::model::*
Fixed it! Thank you.
Maybe we could add this to the docs?
Happy to add that. Would you mind making a PR for where it should be included?
insert
andupdate_partial
are not public, and this method will not be found when called under another package.The error is as follows:
I can find this method by calling it in the same file as
account_user.rs
, so I guess the method generated by the macro is not public