pub struct Http { /* private fields */ }Expand description
HTTP Read-only service support like Nginx and Caddy.
§Capabilities
Depending on its configuration and the backing system, this service can expose:
-
create_dir - stat
- read
-
write -
delete -
list -
copy -
rename -
presign
Inspect the effective capability set with opendal_core::Operator::info and
opendal_core::OperatorInfo::capability after building an operator.
§Notes
Only read and stat are supported. We can use this service to visit any
HTTP Server like nginx, caddy.
§Configuration
Use crate::HttpConfig for serializable configuration and this builder’s
methods for direct construction. The field and method documentation defines
accepted values, defaults, and environment interaction.
§Example
§Via Builder
use opendal_core::Operator;
use opendal_core::Result;
use opendal_service_http::Http;
#[tokio::main]
async fn main() -> Result<()> {
// create http backend builder
let mut builder = Http::default().endpoint("127.0.0.1");
let op: Operator = Operator::new(builder)?;
Ok(())
}Implementations§
Source§impl HttpBuilder
impl HttpBuilder
Sourcepub fn endpoint(self, endpoint: &str) -> Self
pub fn endpoint(self, endpoint: &str) -> Self
Set endpoint for http backend.
For example: https://example.com
Sourcepub fn username(self, username: &str) -> Self
pub fn username(self, username: &str) -> Self
set username for http backend
default: no username
Sourcepub fn password(self, password: &str) -> Self
pub fn password(self, password: &str) -> Self
set password for http backend
default: no password
Trait Implementations§
Source§impl Builder for HttpBuilder
impl Builder for HttpBuilder
Source§impl Debug for HttpBuilder
impl Debug for HttpBuilder
Source§impl Default for HttpBuilder
impl Default for HttpBuilder
Source§fn default() -> HttpBuilder
fn default() -> HttpBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for HttpBuilder
impl RefUnwindSafe for HttpBuilder
impl Send for HttpBuilder
impl Sync for HttpBuilder
impl Unpin for HttpBuilder
impl UnsafeUnpin for HttpBuilder
impl UnwindSafe for HttpBuilder
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