pub struct ResourceInfoBuilder {
pub description: String,
pub mime_type: String,
pub url: Option<String>,
}Available on crate feature
server only.Expand description
Builder for resource information that can be used with both V1 and V2 protocols.
Fields§
§description: StringDescription of the protected resource
mime_type: StringMIME type of the protected resource
url: Option<String>Optional explicit URL of the protected resource
Implementations§
Source§impl ResourceInfoBuilder
impl ResourceInfoBuilder
Sourcepub fn as_resource_info(
&self,
base_url: Option<&Url>,
req: &Request,
) -> ResourceInfo
pub fn as_resource_info( &self, base_url: Option<&Url>, req: &Request, ) -> ResourceInfo
Determines the resource URL (static or dynamic).
If url is set, returns it directly. Otherwise, constructs a URL by combining
the base URL with the request URI’s path and query.
§Panics
Panics if internal URL construction fails (should not happen in practice).
Trait Implementations§
Source§impl Clone for ResourceInfoBuilder
impl Clone for ResourceInfoBuilder
Source§fn clone(&self) -> ResourceInfoBuilder
fn clone(&self) -> ResourceInfoBuilder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ResourceInfoBuilder
impl Debug for ResourceInfoBuilder
Auto Trait Implementations§
impl Freeze for ResourceInfoBuilder
impl RefUnwindSafe for ResourceInfoBuilder
impl Send for ResourceInfoBuilder
impl Sync for ResourceInfoBuilder
impl Unpin for ResourceInfoBuilder
impl UnwindSafe for ResourceInfoBuilder
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
Mutably borrows from an owned value. Read more