pub struct MethodPlan {Show 13 fields
pub metadata: MethodMetadata,
pub handler_function_name: String,
pub http_pattern: HttpPattern,
pub http_method: String,
pub parameters: Vec<RequestParam>,
pub has_response: bool,
pub request_type: RequestType,
pub output_resource_type: Option<String>,
pub has_request_body: bool,
pub needs_request_parts: bool,
pub scoped_verb: Option<String>,
pub shape: MethodShape,
pub has_http_route: bool,
}Expand description
Plan for generating code for a single method
Fields§
§metadata: MethodMetadataOriginal method metadata
handler_function_name: StringRust function name for the handler method
http_pattern: HttpPatternPre-parsed HTTP URL pattern
http_method: StringHTTP method string for routing (e.g., “GET”, “POST”)
parameters: Vec<RequestParam>Parameters passed to the method (path, query, and body)
has_response: boolWhether this method returns a response body
request_type: RequestTypeRequest type for this method
output_resource_type: Option<String>The resource type name returned by this method (if any)
has_request_body: boolWhether the HTTP request carries a JSON body (create / update / custom POST·PATCH).
Derived once from RequestType so the client emitter doesn’t re-match the enum to
decide whether to attach .json(request).
needs_request_parts: boolWhether the Axum server extractor reads from request parts (path/query only) rather
than the body — i.e. this is a FromRequestParts method, not FromRequest.
Derived once from RequestType so the server emitter (extractor selection and the
RequestPartsExt import) doesn’t re-match the enum.
scoped_verb: Option<String>The verb name to call on a resource-scoped client (get / update / delete), or
None for methods that are not standard instance verbs.
Derived once from RequestType; the scoped binding call uses this instead of
re-deciding the verb from the enum (see MethodPlan::resource_client_method).
shape: MethodShapeWhere this method sits relative to a resource (collection / instance / unbound).
Assigned in analyze_service once the owning service’s managed resources are known, so it
reflects both the method’s verb/name shape and whether the service is resource-scoped.
has_http_route: boolWhether this method has a google.api.http route.
Analysis is protocol-agnostic: every method gets a plan. A method without an HTTP
annotation still produces a plan (with all request fields as body, no path/query) so the
ConnectRPC emitter can use it — but it has no REST route, so the REST client/handler
emitters skip it. true for methods with an HTTP annotation, false otherwise.
Implementations§
Source§impl MethodPlan
impl MethodPlan
pub fn path_parameters(&self) -> impl Iterator<Item = &PathParam>
Sourcepub fn formats_path_values(&self) -> bool
pub fn formats_path_values(&self) -> bool
Whether the REST client formats path parameters into the URL.
pub fn query_parameters(&self) -> impl Iterator<Item = &QueryParam>
pub fn body_fields(&self) -> impl Iterator<Item = &BodyField>
Trait Implementations§
Source§impl Clone for MethodPlan
impl Clone for MethodPlan
Auto Trait Implementations§
impl Freeze for MethodPlan
impl RefUnwindSafe for MethodPlan
impl Send for MethodPlan
impl Sync for MethodPlan
impl Unpin for MethodPlan
impl UnsafeUnpin for MethodPlan
impl UnwindSafe for MethodPlan
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<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