-
Notifications
You must be signed in to change notification settings - Fork 525
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
[sdk] Improve API & internal state #7414
Conversation
c7bd01b
to
ec895e8
Compare
tuta-sdk/rust/sdk/src/lib.rs
Outdated
let entity_client = Arc::new(EntityClient::new( | ||
self.rest_client.clone(), | ||
self.json_serializer.clone(), | ||
self.base_url.clone(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps pass this by reference?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be great! but we would need to define the lifetime relationship between Sdk
and EntityClient
and I think Uniffi types are not allowed to have lifetimes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes are an improvement for sure! I am curious whether we could pass String
s by reference more often.
c763e8c
to
def698a
Compare
Co-authored-by: jat <[email protected]>
We changed the point at which the credentials are fixed in the sdk. Now they are passed in to login() method and not when creating SDK. This makes for a cleaner separation of a stateless, shared SDK and stateful, account-bound LoggedInSDK. Rest resources are now always bound to a session which allows for parallel logins and prevents accidental bugs
We changed the point at which the credentials are fixed in the sdk. Now they are passed in to login() method and not when creating SDK. This makes for a cleaner separation of a stateless, shared SDK and stateful, account-bound LoggedInSDK. Rest resources are now always bound to a session which allows for parallel logins and prevents accidental bugs