pub struct Upstreams { /* private fields */ }Implementations§
Source§impl Upstreams
impl Upstreams
pub fn new(cfg: Config, cache: Cache, config_hash: u64) -> Upstreams
pub fn server_names(&self) -> Vec<String>
pub fn status(&self, name: &str) -> &'static str
pub fn instructions(&self, name: &str) -> Option<String>
pub async fn refresh(&self, name: &str) -> Result<()>
Sourcepub fn cached_tools(&self, name: &str) -> Vec<ToolInfo>
pub fn cached_tools(&self, name: &str) -> Vec<ToolInfo>
In-memory index only, never connects. Empty for cold servers.
pub async fn tools(&self, name: &str) -> Result<Vec<ToolInfo>>
pub async fn call( &self, name: &str, tool: &str, args: Option<Map<String, Value>>, ) -> Result<CallToolResult>
Sourcepub async fn oauth_begin(&self, name: &str) -> Result<Option<String>>
pub async fn oauth_begin(&self, name: &str) -> Result<Option<String>>
Begin (or re-report) OAuth authorization for a server. Ok(None) = already authorized, Ok(Some) = URL the user must open.
Sourcepub async fn oauth_complete(&self, name: &str, pasted: &str) -> Result<()>
pub async fn oauth_complete(&self, name: &str, pasted: &str) -> Result<()>
Complete a headless OAuth flow from the pasted redirect URL.
pub async fn save_cache(&self)
Auto Trait Implementations§
impl !Freeze for Upstreams
impl !RefUnwindSafe for Upstreams
impl !UnwindSafe for Upstreams
impl Send for Upstreams
impl Sync for Upstreams
impl Unpin for Upstreams
impl UnsafeUnpin for Upstreams
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