Let's say I have a structure which only sends a request over the network. It has some fields but they can't be changed since initialization because the structure's implementation has no methods which take a mutable reference to the object but has one method which does it by move:
pub struct Client {
client: reqwest::Client,
keys: (String, String, String),
oauth_token: Mutex<RefCell<AccessToken>>,
}
impl Client {
fn (&self) -> Result<Object, Error>;
// .... other methods like above
fn (mut self) -> Self;
}
So, questions:
- Is this structure
Send
andSync
? - Should I implement
Send
andSync
manually for them by usingunsafe impl
or they are derived automatically if the structure can be such?