pub enum MethodShape {
CollectionScoped,
InstanceScoped,
Unbound,
}Expand description
Where a method sits relative to a resource, independent of its CRUD verb.
Computed once during analysis from the method’s RequestType, name, and whether the owning
service manages a google.api.resource. This makes the scoped/flat and collection/instance
decisions explicit on the IR, so emitters don’t re-derive them.
The three cases map onto the binding layout:
MethodShape::CollectionScopedandMethodShape::InstanceScopedboth belong to a resource-scoped service; collection methods live on the root client, instance methods on the per-resource scoped client.MethodShape::Unboundbelongs to a resource-less service; every method lives on the root client and passes all params (the “flat” lowering).
Variants§
CollectionScoped
Collection-style operation on a resource service (list / create / factory RPC). Lives on the root/aggregate client and passes every param.
InstanceScoped
Instance operation on a resource service (get / update / delete / resource-targeted custom). Lives on the per-resource scoped client, which already holds the path params.
Unbound
Method of a resource-less (“flat”) service. Lives on the root client and passes every param, including path params.
Trait Implementations§
Source§impl Clone for MethodShape
impl Clone for MethodShape
impl Copy for MethodShape
Source§impl Debug for MethodShape
impl Debug for MethodShape
impl Eq for MethodShape
Source§impl PartialEq for MethodShape
impl PartialEq for MethodShape
impl StructuralPartialEq for MethodShape
Auto Trait Implementations§
impl Freeze for MethodShape
impl RefUnwindSafe for MethodShape
impl Send for MethodShape
impl Sync for MethodShape
impl Unpin for MethodShape
impl UnsafeUnpin for MethodShape
impl UnwindSafe for MethodShape
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more