Struct Builder

Source
pub struct Builder {
    pub url: Url,
    pub headers: HeaderMap,
    pub client: Client,
    pub method: Method,
    pub body: Option<BodyType>,
}

Fieldsยง

ยงurl: Urlยงheaders: HeaderMapยงclient: Clientยงmethod: Methodยงbody: Option<BodyType>

Implementationsยง

Sourceยง

impl Builder

Source

pub fn get_buckets(self) -> Executor

retrieve all buckets

ยงReturns
  • Executor - The constructed Executor instance for executing the request.
ยงExample
use supabase_storage::{
    Storage,
    config::SupabaseConfig,
};
use dotenv::dotenv;

dotenv().ok();
let config = SupabaseConfig::default();
let storage = Storage::new_with_config(config)
    .from()
    .get_buckets()
    .execute();
Source

pub fn create_bucket(self, body: &str) -> Executor

create a new bucket

ยงArguments
  • body - The request body as a string.
ยงReturns
  • Executor - The constructed Executor instance for executing the request.
ยงExample
use supabase_storage::{
    Storage,
    config::SupabaseConfig,
};
use dotenv::dotenv;

dotenv().ok();
let config = SupabaseConfig::default();
let storage = Storage::new_with_config(config)
    .from()
    .create_bucket("thefux")
    .execute();
Source

pub fn create_bucket_from(self, body: NewBucket) -> Executor

create a new bucket using a struct

ยงArguments
  • body - The NewBucket struct containing the request body.
ยงReturns
  • Executor - The constructed Executor instance for executing the request.
ยงExample
use supabase_storage::{
    Storage,
    config::SupabaseConfig,
    model::bucket::NewBucket,
};
use dotenv::dotenv;

dotenv().ok();
let config = SupabaseConfig::default();
let storage = Storage::new_with_config(config)
    .from()
    .create_bucket_from(NewBucket::new("thefux".to_string()))
    .execute();
Source

pub fn empty_bucket(self, bucket_id: &str) -> Executor

empty the bucket

ยงArguments
  • bucket_id - The identifier of the bucket to empty.
ยงReturns
  • Executor - The constructed Executor instance for executing the request.
ยงExample
use supabase_storage::{
    Storage,
    config::SupabaseConfig,
};
use dotenv::dotenv;

dotenv().ok();
let config = SupabaseConfig::default();
let storage = Storage::new_with_config(config)
    .from()
    .empty_bucket("thefux")
    .execute();
Source

pub fn get_bucket_details(self, bucket_id: &str) -> Executor

get bucket details

ยงArguments
  • bucket_id - The identifier of the bucket to empty.
ยงReturns
  • Executor - The constructed Executor instance for executing the request.
ยงExample
use supabase_storage::{
    Storage,
    config::SupabaseConfig,
};
use dotenv::dotenv;

dotenv().ok();
let config = SupabaseConfig::default();
let storage = Storage::new_with_config(config)
    .from()
    .get_bucket_details("thefux")
    .execute();
Source

pub fn update_bucket(self, bucket_id: &str, body: &str) -> Executor

update the bucket

ยงArguments
  • bucket_id - The identifier of the bucket to empty.
ยงReturns
  • Executor - The constructed Executor instance for executing the request.
ยงExample
use supabase_storage::{
    Storage,
    config::SupabaseConfig,
};
use dotenv::dotenv;

dotenv().ok();
let config = SupabaseConfig::default();
let storage = Storage::new_with_config(config)
    .from()
    .update_bucket("thefux", r#"{ "public": true }"#)
    .execute();
Source

pub fn update_bucket_from(self, bucket_id: &str, body: BucketUpdate) -> Executor

update bucket using a struct

ยงArguments
  • bucket_id - The identifier of the bucket to empty.
ยงReturns
  • Executor - The constructed Executor instance for executing the request.
ยงExample
use supabase_storage::{
    Storage,
    config::SupabaseConfig,
    model::bucket::BucketUpdate,
};
use dotenv::dotenv;

dotenv().ok();
let config = SupabaseConfig::default();
let storage = Storage::new_with_config(config)
    .from()
    .update_bucket_from("thefux", BucketUpdate {
        public: false,
        file_size_limit: Some(0),
        allowed_mime_types: Some(vec!["application/pdf".to_string()]),
    })
    .execute();
Source

pub fn delete_bucket(self, bucket_id: &str) -> Executor

delete a bucket

ยงArguments
  • bucket_id - The identifier of the bucket to empty.
ยงReturns
  • Executor - The constructed Executor instance for executing the request.
ยงExample
use supabase_storage::{
    Storage,
    config::SupabaseConfig,
};
use dotenv::dotenv;

dotenv().ok();
let config = SupabaseConfig::default();
let storage = Storage::new_with_config(config)
    .from()
    .delete_bucket("thefux")
    .execute();
Sourceยง

impl Builder

Source

pub fn new(url: Url, headers: HeaderMap, client: Client) -> Self

Creates a new Builder instance.

ยงArguments
  • url - The URL for the request.
  • headers - The HeaderMap containing the headers for the request.
  • client - The Client to use for making the request.
ยงExample
use supabase_storage::build::builder::Builder;
use reqwest::header::{HeaderMap, HeaderValue};
use reqwest::Client;
use url::Url;

let url = Url::parse("http://localhost").unwrap();
let builder = Builder::new(url, HeaderMap::new(), Client::new());
Source

pub fn build(self) -> RequestBuilder

Constructs and returns a RequestBuilder instance based on the current Builder configuration.

ยงReturns
  • RequestBuilder - The constructed RequestBuilder instance.
Source

pub fn header(self, key: impl IntoHeaderName, value: HeaderValue) -> Self

Adds a new header to the request.

ยงArguments
  • key - The header name, implementors of IntoHeaderName are accepted.
  • value - The header value as a string.
ยงReturns
  • Self - The updated Builder instance with the new header added.
ยงExample
use supabase_storage::build::builder::Builder;
use reqwest::header::{HeaderMap, HeaderValue};
use reqwest::Client;
use url::Url;

let url = Url::parse("http://localhost").unwrap();

let _ = Builder::new(url, HeaderMap::new(), Client::new())
    .header("Authorization", HeaderValue::from_static("Bearer <token>"));
Source

pub async fn run(self) -> Result<Response, Error>

Executes the constructed HTTP request and returns the response as a Result.

ยงReturns
  • Result<Response, Error> - The result of the executed request.
ยงExample
use supabase_storage::build::builder::Builder;
use reqwest::header::{HeaderMap, HeaderValue};
use reqwest::Client;
use url::Url;

#[tokio::main]
async fn main() {
    let url = Url::parse("http://localhost").unwrap();
    let mut headers = HeaderMap::new();
    headers.insert("Authorization", HeaderValue::from_static("Bearer YOUR_ACCESS_TOKEN"));

    let builder = Builder::new(url, headers, Client::new())
        .header("Authorization", HeaderValue::from_static("Bearer <token>"));

    // Execute the request and handle the response
    let response = builder.run().await;
    match response {
        Ok(response) => {
            let body = response.text().await.unwrap();
            println!("Response body: {:?}", body);
        }
        Err(error) => {
            eprintln!("Error occurred: {:?}", error);
        }
    }
}
Source

pub fn create_executor(self) -> Executor

Creates a new Executor instance based on the current Builder configuration.

ยงReturns
  • Executor - The created Executor instance.
Sourceยง

impl Builder

Source

pub fn list_objects(self, bucket_id: &str, body: &str) -> Executor

list all files within a bucket

ยงArguments
  • bucket_id - bucket id
  • body - request body
ยงReturns
  • Executor - The constructed Executor instance for executing the request.
ยงExample
use supabase_storage::{
    Storage,
    config::SupabaseConfig,
    model::bucket::NewBucket,
};
use dotenv::dotenv;

#[tokio::main]
async fn main() {
    dotenv().ok();
    let config = SupabaseConfig::default();
    let response = Storage::new_with_config(config)
        .from()
        .list_objects("thefux", r#"
            {
                "prefix": "bitcoin.pdf",
                "limit": 100,
                "offset": 0,
                "sortBy": {
                    "column": "name",
                    "order": "asc",
                },
            }"#)
        .execute()
        .await
        .unwrap();
}
Sourceยง

impl Builder

Source

pub fn move_object(self, bucket_id: &str, from: &str, to: &str) -> Executor

move an object

ยงArguments
  • bucket_id - bucket id
  • from - object soruce
  • to - object destination
ยงReturns
  • Executor - The constructed Executor instance for executing the request.
ยงExample
use supabase_storage::{
    Storage,
    config::SupabaseConfig,
    model::bucket::NewBucket,
};
use dotenv::dotenv;

#[tokio::main]
async fn main() {
    dotenv().ok();
    let config = SupabaseConfig::default();
    let response = Storage::new_with_config(config)
        .from()
        .move_object("thefux", "from", "to")
        .execute()
        .await
        .unwrap();
}
Source

pub fn move_object_from(self, obj: MoveCopyObject) -> Executor

move an object

ยงArguments
  • bucket_id - bucket id
  • from - object soruce
  • to - object destination
ยงReturns
  • Executor - The constructed Executor instance for executing the request.
ยงExample
use supabase_storage::{
    Storage,
    config::SupabaseConfig,
    model::bucket::NewBucket,
    model::object::MoveCopyObject,
};
use dotenv::dotenv;

#[tokio::main]
async fn main() {
    dotenv().ok();
    let config = SupabaseConfig::default();
    let move_obj = MoveCopyObject {
        bucket_id: "thefux".to_string(),
        source_key: "from".to_string(),
        destination_key: "to".to_string(),
    };
    let response = Storage::new_with_config(config)
        .from()
        .move_object_from(move_obj)
        .execute()
        .await
        .unwrap();
}
Source

pub fn copy_object(self, bucket_id: &str, from: &str, to: &str) -> Executor

copy an object

ยงArguments
  • bucket_id - bucket id
  • from - object soruce
  • to - object destination
ยงReturns
  • Executor - The constructed Executor instance for executing the request.
ยงExample
use supabase_storage::{
    Storage,
    config::SupabaseConfig,
    model::bucket::NewBucket,
};
use dotenv::dotenv;

#[tokio::main]
async fn main() {
    dotenv().ok();
    let config = SupabaseConfig::default();
    let response = Storage::new_with_config(config)
        .from()
        .copy_object("thefux", "from", "to")
        .execute()
        .await
        .unwrap();
}
Source

pub fn copy_object_from(self, obj: MoveCopyObject) -> Executor

copy an object

ยงArguments
  • bucket_id - bucket id
  • from - object soruce
  • to - object destination
ยงReturns
  • Executor - The constructed Executor instance for executing the request.
ยงExample
use supabase_storage::{
    Storage,
    config::SupabaseConfig,
    model::bucket::NewBucket,
    model::object::MoveCopyObject,
};
use dotenv::dotenv;

#[tokio::main]
async fn main() {
    dotenv().ok();
    let config = SupabaseConfig::default();
    let move_obj = MoveCopyObject {
        bucket_id: "thefux".to_string(),
        source_key: "from".to_string(),
        destination_key: "to".to_string(),
    };
    let response = Storage::new_with_config(config)
        .from()
        .copy_object_from(move_obj)
        .execute()
        .await
        .unwrap();
}
Sourceยง

impl Builder

Source

pub fn get_public_object(self, bucket_id: &str, object: &str) -> Executor

get public object from the storage

ยงArguments
  • bucket_id - bucket id
  • object - a wildcard
ยงReturns
  • Executor - The constructed Executor instance for executing the request.
ยงExample
use supabase_storage::{
    Storage,
    config::SupabaseConfig,
    model::bucket::NewBucket,
};
use dotenv::dotenv;

#[tokio::main]
async fn main() {
    dotenv().ok();
    let config = SupabaseConfig::default();
    let response = Storage::new_with_config(config)
        .from()
        .get_public_object("thefux", "file_name.pdf")
        .execute()
        .await
        .unwrap();
}
Source

pub fn get_public_object_info(self, bucket_id: &str, object: &str) -> Executor

get public object info

ยงArguments
  • bucket_id - bucket id
  • object - a wildcard
ยงReturns
  • Executor - The constructed Executor instance for executing the request.
ยงExample
use supabase_storage::{
    Storage,
    config::SupabaseConfig,
    model::bucket::NewBucket,
};
use dotenv::dotenv;

#[tokio::main]
async fn main() {
    dotenv().ok();
    let config = SupabaseConfig::default();
    let response = Storage::new_with_config(config)
        .from()
        .get_public_object_info("thefux", "file_name.pdf")
        .execute()
        .await
        .unwrap();
}
Sourceยง

impl Builder

Source

pub fn get_object_with_transform( self, bucket_id: &str, object: &str, transform: Transform, ) -> Executor

get public object from the storage

ยงArguments
  • bucket_id - bucket id
  • object - object name/path
  • transform - tranformation options to transform before serving it to client
ยงReturns
  • Executor - The constructed Executor instance for executing the request.
ยงExample
use supabase_storage::{
    Storage,
    config::SupabaseConfig,
    model::bucket::NewBucket,
    model::options::{Transform, Format, Resize}
};
use dotenv::dotenv;

#[tokio::main]
async fn main() {
    dotenv().ok();
    let config = SupabaseConfig::default();
    let response = Storage::new_with_config(config)
        .from()
        .get_object_with_transform("thefux", "test.png", Transform {
            format: Some(Format::Origin),
            height: Some(0),
            quality: Some(0),
            resize: Some(Resize::Cover),
            width: Some(0),
        })
        .execute()
        .await
        .unwrap();
}
Sourceยง

impl Builder

Source

pub fn create_signed_url( self, bucket_name: &str, object: &str, body: &str, ) -> Executor

generate presigned url to retrieve an object

ยงArguments
  • bucket_name - bucket name
  • object - object name
ยงReturns
  • Executor - The constructed Executor instance for executing the request.
ยงExample
use supabase_storage::{
    Storage,
    config::SupabaseConfig,
    model::bucket::NewBucket,
};
use dotenv::dotenv;

#[tokio::main]
async fn main() {
    dotenv().ok();
    let config = SupabaseConfig::default();
    let response = Storage::new_with_config(config)
        .from()
        .create_signed_url("thefux", "bitcoin.pdf", r#"
            {
                "expiresIn": 3600,
                "transform": {
                    "height": 0,
                    "width": 0,
                    "resize": "cover",
                    "format": "origin",
                    "quality": 100
                }
            }"#)
        .execute()
        .await
        .unwrap();
}
Source

pub fn create_signed_urls(self, bucket_name: &str, body: &str) -> Executor

generate presigned urls to retrieve objects

ยงArguments
  • bucket_name - bucket name
  • object - object name
ยงReturns
  • Executor - The constructed Executor instance for executing the request.
ยงExample
use supabase_storage::{
    Storage,
    config::SupabaseConfig,
    model::bucket::NewBucket,
};
use dotenv::dotenv;

#[tokio::main]
async fn main() {
    dotenv().ok();
    let config = SupabaseConfig::default();
    let response = Storage::new_with_config(config)
        .from()
        .create_signed_urls("thefux", r#"{"expiresIn": 3600, "paths": ["hello.pdf", "test.pdf"]}"#)
        .execute()
        .await
        .unwrap();
}
Source

pub fn get_object_with_pre_assigned_url( self, bucket_name: &str, object: &str, token: &str, ) -> Executor

get object via pre-signed url

ยงArguments
  • bucket_name - bucket name
  • object - object name
  • token - sign token
  • file - file object
ยงReturns
  • Executor - The constructed Executor instance for executing the request.
ยงExample
use supabase_storage::{
    Storage,
    config::SupabaseConfig,
    model::bucket::NewBucket,
};
use dotenv::dotenv;
use tokio::fs::File;

#[tokio::main]
async fn main() {
    dotenv().ok();
    let config = SupabaseConfig::default();
    let response = Storage::new_with_config(config)
        .from()
        .get_object_with_pre_assigned_url("thefux", "btc.pdf", "<token>")
        .execute()
        .await
        .unwrap();
}
Sourceยง

impl Builder

Source

pub fn create_signed_upload_url(self, bucket_id: &str, object: &str) -> Executor

generate pre-signed url to upload an object

ยงArguments
  • bucket_id - bucket id
  • object - object name
ยงReturns
  • Executor - The constructed Executor instance for executing the request.
ยงExample
use supabase_storage::{
    Storage,
    config::SupabaseConfig,
    model::bucket::NewBucket,
};
use dotenv::dotenv;

#[tokio::main]
async fn main() {
    dotenv().ok();
    let config = SupabaseConfig::default();
    let response = Storage::new_with_config(config)
        .from()
        .create_signed_upload_url("thefux", "bitcoin.pdf")
        .execute()
        .await
        .unwrap();
}
Source

pub async fn upload_to_signed_url_async( self, bucket_id: &str, object: &str, token: &str, file_path: &str, file_options: FileOptions, ) -> Executor

upload object via pre-signed url

ยงArguments
  • bucket_id - bucket id
  • object - object name
  • token - sign token
  • file_path - file path
  • file_options - file options
ยงReturns
  • Executor - The constructed Executor instance for executing the request.
ยงExample
use supabase_storage::{
    Storage,
    config::SupabaseConfig,
    model::bucket::NewBucket,
    model::options::FileOptions,
};
use dotenv::dotenv;

#[tokio::main]
async fn main() {
    dotenv().ok();
    let config = SupabaseConfig::default();
    let response = Storage::new_with_config(config)
        .from()
        .upload_to_signed_url_async("thefux", "btc.pdf", "<token>", "out/test.pdf", FileOptions {
            cache_control: None,
            content_type: Some("application/pdf".to_string()),
            upsert: Some(true),
        })
        .await
        .execute()
        .await
        .unwrap();
}
Source

pub async fn upload_to_signed_url_no_options_async( self, bucket_id: &str, object: &str, token: &str, file_path: &str, ) -> Executor

upload object via pre-signed url with auto detecting content-type

ยงArguments
  • bucket_id - bucket id
  • object - object name
  • token - sign token
  • file_path - file path
ยงReturns
  • Executor - The constructed Executor instance for executing the request.
ยงExample
use supabase_storage::{
    Storage,
    config::SupabaseConfig,
    model::bucket::NewBucket,
};
use dotenv::dotenv;

#[tokio::main]
async fn main() {
    dotenv().ok();
    let config = SupabaseConfig::default();
    let response = Storage::new_with_config(config)
        .from()
        .upload_to_signed_url_no_options_async("thefux", "btc.pdf", "<token>", "out/test.pdf")
        .await
        .execute()
        .await
        .unwrap();
}
Source

pub fn upload_from_file_with_pre_assigned_url( self, bucket_id: &str, object: &str, token: &str, file: File, file_options: FileOptions, ) -> Executor

upload object via pre-signed url

ยงArguments
  • bucket_id - bucket id
  • object - object name
  • token - sign token
  • file - file object
ยงReturns
  • Executor - The constructed Executor instance for executing the request.
ยงExample
use supabase_storage::{
    Storage,
    config::SupabaseConfig,
    model::bucket::NewBucket,
    model::options::FileOptions,
};
use dotenv::dotenv;
use tokio::fs::File;

#[tokio::main]
async fn main() {
    dotenv().ok();
    let config = SupabaseConfig::default();
    let response = Storage::new_with_config(config)
        .from()
        .upload_from_file_with_pre_assigned_url("thefux", "btc.pdf", "<token>",
            File::open("out/test.pdf").await.unwrap(),
            FileOptions {
                cache_control: None,
                content_type: None,
                upsert: None,
            })
        .execute()
        .await
        .unwrap();
}
Sourceยง

impl Builder

Source

pub fn delete_object(self, bucket_id: &str, object: &str) -> Executor

delete an object, could be any kind of data stored in the given storage

ยงArguments
  • bucket_id - bucket id
  • object - a wildcard
ยงReturns
  • Executor - The constructed Executor instance for executing the request.
ยงExample
use supabase_storage::{
    Storage,
    config::SupabaseConfig,
    model::bucket::NewBucket,
};
use dotenv::dotenv;

#[tokio::main]
async fn main() {
    dotenv().ok();
    let config = SupabaseConfig::default();
    let response = Storage::new_with_config(config)
        .from()
        .delete_object("thefux", "file_name.pdf")
        .execute()
        .await
        .unwrap();
}
Source

pub fn delete_objects(self, bucket_id: &str, body: &str) -> Executor

delete multiple objects

ยงArguments
  • bucket_id - bucket id
  • body - json object with list of perfixes
ยงReturns
  • Executor - The constructed Executor instance for executing the request.
ยงExample
use supabase_storage::{
    Storage,
    config::SupabaseConfig,
    model::bucket::NewBucket,
};
use dotenv::dotenv;

#[tokio::main]
async fn main() {
    dotenv().ok();
    let config = SupabaseConfig::default();
    let response = Storage::new_with_config(config)
        .from()
        .delete_objects("thefux", r#"{ "prefixes" : [ "file_name.pdf" ]}"#)
        .execute()
        .await
        .unwrap();
}
Source

pub fn get_object(self, bucket_name: &str, object: &str) -> Executor

get an object from the storage

ยงArguments
  • bucket_name - bucket name
  • object - a wildcard
ยงReturns
  • Executor - The constructed Executor instance for executing the request.
ยงExample
use supabase_storage::{
    Storage,
    config::SupabaseConfig,
    model::bucket::NewBucket,
};
use dotenv::dotenv;

#[tokio::main]
async fn main() {
    dotenv().ok();
    let config = SupabaseConfig::default();
    let response = Storage::new_with_config(config)
        .from()
        .delete_object("thefux", "file_name.pdf")
        .execute()
        .await
        .unwrap();
}
Examples found in repository?
examples/get_object.rs (line 17)
6async fn main() {
7    dotenv().ok();
8
9    let config = SupabaseConfig::default();
10    let storage = Storage::new_with_config(config);
11
12    let bucket_name = "thefux";
13    let object = "btc.pdf";
14
15    let response = storage
16        .from()
17        .get_object(bucket_name, object)
18        .execute()
19        .await
20        .unwrap();
21
22    println!("{:?}", response);
23}
Source

pub async fn update_object_async( self, bucket_name: &str, object: &str, file_path: &str, ) -> Executor

update an object

ยงArguments
  • bucket_name - bucket name
  • object - a wildcard
ยงReturns
  • Executor - The constructed Executor instance for executing the request.
ยงExample
use supabase_storage::{
    Storage,
    config::SupabaseConfig,
    model::bucket::NewBucket,
};
use dotenv::dotenv;

#[tokio::main]
async fn main() {
    dotenv().ok();
    let config = SupabaseConfig::default();
    let response = Storage::new_with_config(config)
        .from()
        .update_object_async("thefux", "file_name.pdf", "out/test.pdf")
        .await
        .execute()
        .await
        .unwrap();
}
Source

pub async fn upload_object( self, bucket_name: &str, object: &str, file_path: &str, ) -> Executor

upload an object

ยงArguments
  • bucket_name - bucket name
  • object - object name
ยงReturns
  • Executor - The constructed Executor instance for executing the request.
ยงExample
use supabase_storage::{
    Storage,
    config::SupabaseConfig,
    model::bucket::NewBucket,
};
use dotenv::dotenv;

#[tokio::main]
async fn main() {
    dotenv().ok();
    let config = SupabaseConfig::default();
    let response = Storage::new_with_config(config)
        .from()
        .upload_object("thefux", "file_name.pdf", "out/test.pdf")
        .await
        .execute()
        .await
        .unwrap();
}
Source

pub fn download_object(self, bucket_id: &str) -> Executor

download object

ยงArguments
  • bucket_id - bucket id
  • body - request body
ยงReturns
  • Executor - The constructed Executor instance for executing the request.
ยงExample
use supabase_storage::{
    Storage,
    config::SupabaseConfig,
    model::bucket::NewBucket,
};
use dotenv::dotenv;

#[tokio::main]
async fn main() {
    dotenv().ok();
    let config = SupabaseConfig::default();
    let response = Storage::new_with_config(config)
        .from()
        .download_object("thefux")
        .execute()
        .await
        .unwrap();
}

Auto Trait Implementationsยง

Blanket Implementationsยง

Sourceยง

impl<T> Any for T
where T: 'static + ?Sized,

Sourceยง

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Sourceยง

impl<T> Borrow<T> for T
where T: ?Sized,

Sourceยง

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Sourceยง

impl<T> BorrowMut<T> for T
where T: ?Sized,

Sourceยง

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Sourceยง

impl<T> From<T> for T

Sourceยง

fn from(t: T) -> T

Returns the argument unchanged.

Sourceยง

impl<T> Instrument for T

Sourceยง

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Sourceยง

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Sourceยง

impl<T, U> Into<U> for T
where U: From<T>,

Sourceยง

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Sourceยง

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Sourceยง

type Error = Infallible

The type returned in the event of a conversion error.
Sourceยง

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Sourceยง

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Sourceยง

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Sourceยง

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Sourceยง

impl<T> WithSubscriber for T

Sourceยง

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Sourceยง

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Sourceยง

impl<T> ErasedDestructor for T
where T: 'static,