Review our APIs against the Rust API guidelines checklist #1541
Labels
type: feature request
‘Nice-to-have’ improvement, new feature or different behavior or design.
Milestone
Uh oh!
There was an error while loading. Please reload this page.
We should compare our APIs against the Rust API Guidelines Checklist and:
Document any deviations that we do not want to fix and why
Serialize
,Deserialize
(C-SERDE)ClientConfig
does not seem that useful. And if we do it, we would have to think about backwards compatibility for the serialization/deserialization. ew.Project
which knows its name is"projects/<project>"
.Document any deviations we want to fix and result in breaking changes
as_
,to_
,into_
conventions (C-CONV)to_stream
methods should beinto_stream
because they are cheap. They consume the object, without copying.get_token()
,get_headers()
,get_universe_domain()
might want to drop theget_
prefix.other inconsistencies:
ClientConfig
setters #1622Paginator
a trait #1623impl
s that are inevitably public, but irrelevant.Document any deviations we want to fix, but won't result in breaking changes (e.g. things that are purely additions to the APIs, or samples)
google-cloud-rust
, as a whole. They do not relate to individual crates.google-cloud-foo v1.0
andgoogle-cloud-foo v1.1
. It would be nice to attach this information to the crategoogle-cloud-foo
somehow.google-cloud-rust
)'svX
and the crate (google-cloud-foo
)'svY
could be more apparent.ItemPaginator
#1961ItemPaginator
might want to return the current page token (so streams can be restarted). Exposing the current page is probably good enough.Debug
(C-DEBUG)Copy
,Clone
,Eq
,PartialEq
,Ord
,PartialOrd
,Hash
,Debug
,Display
,Default
DONE
rustc
linters +cargo clippy -- --deny warnings
should catch these.Methods on collections that produce iterators followiter
,iter_mut
,into_iter
(C-ITER)Iterator type names match the methods that produce them (C-ITER-TY)Binary number types provideHex
,Octal
,Binary
formatting (C-NUM-FMT)Generic reader/writer functions takeR: Read
andW: Write
by value (C-RW-VALUE)Collections implementFromIterator
andExtend
(C-COLLECT)Send
andSync
where possible (C-SEND-SYNC)From
,AsRef
,AsMut
(C-CONV-TRAITS)wkt::Duration
is integrated withchrono
, andtime
types.i32
.Macros (crate presents well-behaved macros)Documentation (crate is abundantly documented)
?
, nottry!
, notunwrap
(C-QUESTION-MARK)cargo doc
, so I think that build would likely fail if we ever panic inappropriately instead of erroring.Cargo.toml
includes all common metadata (C-METADATA)authors, description, license, homepage, documentation, repository, keywords, categories
Arc<>
internally, so applications do not need to wrap them).Smart pointers do not add inherent methods (C-SMART-PTR)Operator overloads are unsurprising (C-OVERLOAD)Only smart pointers implementDeref
andDerefMut
(C-DEREF)Into<T>
s.Types for a set of flags arebitflags
, not enums (C-BITFLAG)bool
orOption
(C-CUSTOM-TYPE)tracing_enabled()
should be a more complicated type? Then we would sayset_tracing(TracingConfig)
, and not have to add an API later for fine-grained tracing.Destructors never fail (C-DTOR-FAIL)Destructors that may block have alternatives (C-DTOR-BLOCK)Debug
representation is never empty (C-DEBUG-NONEMPTY)wkt
implementations.Data structures do not duplicate derived trait bounds (C-STRUCT-BOUNDS)RequestBuilder<R: Default>
, but I think that is different.The text was updated successfully, but these errors were encountered: