Comments (5)
Yes, I don't think there's any reason to not take ownership of account and token.
from azure-sdk-for-rust.
Hi spektom,
client::with_bearer_token()
allows borrowing and taking ownership while both client::with_access_key
and client::with_azure_sas
only allow borrowing. See:
and
While client::with_bearer_token()
allows both borrowing and taking ownership.
azure-sdk-for-rust/sdk/storage/src/core/client.rs
Lines 229 to 232 in c4455a2
So they should behave just the same (with client::with_bearer_token()
being more flexible).
For example, this borrows:
azure-sdk-for-rust/sdk/storage/examples/blob_00.rs
Lines 17 to 24 in c4455a2
This example takes ownership:
azure-sdk-for-rust/sdk/storage/examples/blob_02_bearer_token.rs
Lines 13 to 26 in c4455a2
But the latter works just the same if you borrow instead:
let client = client::with_bearer_token(&account, &bearer_token);
--
Can you please provide a repro of your problem?
from azure-sdk-for-rust.
Thanks, and sorry for bothering.
from azure-sdk-for-rust.
Thanks, and sorry for bothering.
Don't worry, you correctly pointed out that we have uneven builders: the all should allow both borrowing and owning 👍 !
from azure-sdk-for-rust.
I somewhat disagree. I don't think allowing for the flexibility of taking either a reference or an owned value is really worth the complexity. Taking these as String
instead of Cow<'a, str>
would simplify the API considerably at only a very minimal potential runtime cost.
from azure-sdk-for-rust.
Related Issues (20)
- HTTP Client DNS resolver override HOT 3
- Redact Debug printing? HOT 3
- Make sure all public APIs are documented
- Consider sccache for improving build performance
- IMDS probe requests should throw CredentialUnavailableException for any response that is not valid json
- `azure_mgmt_containerservice` is not built anymore using the current rest specs
- Consider using `async-std` over direct `tokio` when possible
- remove-dependency: pin-project
- Trim dependencies
- Remove source with incompatible copyrights
- Hash is not include in `PutBlockBuilder.into_future()`
- Allow client methods to dictate what HTTP status codes are errors or otherwise unexpected
- Add public getters to ClientOptions and ClientMethodOptions
- CI command changes
- Replace AsClientOptions, AsClientMethodOptions with derive macro-defined functions
- Azure Workload Identity - Expired token HOT 1
- Pass `--all-features` to any commands that use it, typically, e.g., linting.
- Make TelemetryOptions optional and generic, but default to the standard Azure User-Agent format for azure_core HOT 5
- Cache bearer tokens based on the authority HOT 1
- Need to allow customization of when and how auth tokens are fetched
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from azure-sdk-for-rust.