Skip to main content

Web2PptConfig

Struct Web2PptConfig 

Source
pub struct Web2PptConfig {
    pub max_slides: usize,
    pub max_bullets_per_slide: usize,
    pub include_images: bool,
    pub include_tables: bool,
    pub include_code: bool,
    pub user_agent: String,
    pub timeout_secs: u64,
    pub title_font_size: u32,
    pub content_font_size: u32,
    pub extract_links: bool,
    pub group_by_headings: bool,
}
Expand description

Configuration options for web2ppt conversion

Fields§

§max_slides: usize

Maximum number of slides to generate

§max_bullets_per_slide: usize

Maximum bullets per slide

§include_images: bool

Include images from the webpage

§include_tables: bool

Include tables from the webpage

§include_code: bool

Include code blocks

§user_agent: String

User agent for HTTP requests

§timeout_secs: u64

Request timeout in seconds

§title_font_size: u32

Title font size

§content_font_size: u32

Content font size

§extract_links: bool

Extract links as hyperlinks

§group_by_headings: bool

Group content by headings

Implementations§

Source§

impl Web2PptConfig

Source

pub fn new() -> Self

Create a new config with defaults

Examples found in repository?
examples/web2ppt_demo.rs (line 74)
6fn main() -> Result<(), Box<dyn std::error::Error>> {
7    use ppt_rs::{
8        html_to_pptx, html_to_pptx_with_options,
9        Web2PptConfig, ConversionOptions,
10    };
11
12    println!("=== Web2PPT Demo ===\n");
13
14    // Example 1: Convert HTML string to PPTX
15    println!("📄 Example 1: HTML to PPTX");
16    
17    let html = r#"
18        <!DOCTYPE html>
19        <html>
20        <head>
21            <title>Rust Programming Language</title>
22            <meta name="description" content="A systems programming language focused on safety and performance">
23        </head>
24        <body>
25            <main>
26                <h1>Rust Programming Language</h1>
27                <p>Rust is a multi-paradigm, general-purpose programming language that emphasizes performance, type safety, and concurrency.</p>
28                
29                <h2>Key Features</h2>
30                <ul>
31                    <li>Memory safety without garbage collection</li>
32                    <li>Concurrency without data races</li>
33                    <li>Zero-cost abstractions</li>
34                    <li>Minimal runtime</li>
35                    <li>Efficient C bindings</li>
36                </ul>
37                
38                <h2>Getting Started</h2>
39                <p>Install Rust using rustup, the official Rust toolchain installer. It manages Rust versions and associated tools.</p>
40                
41                <pre><code>curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh</code></pre>
42                
43                <h2>Hello World</h2>
44                <p>Create your first Rust program with a simple hello world example that demonstrates the basic syntax.</p>
45                
46                <pre><code>fn main() {
47    println!("Hello, world!");
48}</code></pre>
49                
50                <h2>Cargo</h2>
51                <p>Cargo is Rust's build system and package manager. It handles downloading dependencies, compiling code, and more.</p>
52                <ul>
53                    <li>cargo new - Create a new project</li>
54                    <li>cargo build - Build your project</li>
55                    <li>cargo run - Run your project</li>
56                    <li>cargo test - Run tests</li>
57                </ul>
58                
59                <h2>Community</h2>
60                <p>Rust has a welcoming and helpful community. Join the official forums, Discord, or Reddit to connect with other Rustaceans.</p>
61            </main>
62        </body>
63        </html>
64    "#;
65
66    let pptx = html_to_pptx(html, "https://rust-lang.org")?;
67    std::fs::create_dir_all("examples/output")?;
68    std::fs::write("examples/output/rust_intro.pptx", &pptx)?;
69    println!("   ✅ Created rust_intro.pptx ({} bytes)\n", pptx.len());
70
71    // Example 2: With custom options
72    println!("📄 Example 2: Custom options");
73    
74    let config = Web2PptConfig::new()
75        .max_slides(5)
76        .max_bullets(4)
77        .with_code(true);
78
79    let options = ConversionOptions::new()
80        .title("Rust Quick Start")
81        .author("ppt-rs")
82        .with_source_url(true);
83
84    let pptx = html_to_pptx_with_options(html, "https://rust-lang.org", config, options)?;
85    std::fs::write("examples/output/rust_quick.pptx", &pptx)?;
86    println!("   ✅ Created rust_quick.pptx ({} bytes)\n", pptx.len());
87
88    // Example 3: Technical documentation style
89    println!("📄 Example 3: Technical documentation");
90    
91    let tech_html = r#"
92        <!DOCTYPE html>
93        <html>
94        <head><title>API Documentation</title></head>
95        <body>
96            <main>
97                <h1>REST API Reference</h1>
98                <p>This document describes the REST API endpoints available for integration with our platform.</p>
99                
100                <h2>Authentication</h2>
101                <p>All API requests require authentication using Bearer tokens in the Authorization header.</p>
102                <pre><code>Authorization: Bearer YOUR_API_KEY</code></pre>
103                
104                <h2>Endpoints</h2>
105                
106                <h3>GET /users</h3>
107                <p>Retrieve a list of all users in the system with pagination support.</p>
108                <ul>
109                    <li>page - Page number (default: 1)</li>
110                    <li>limit - Items per page (default: 20)</li>
111                    <li>sort - Sort field (name, email, created_at)</li>
112                </ul>
113                
114                <h3>POST /users</h3>
115                <p>Create a new user account with the specified details and permissions.</p>
116                <pre><code>{
117  "name": "John Doe",
118  "email": "john@example.com",
119  "role": "user"
120}</code></pre>
121                
122                <h3>GET /users/{id}</h3>
123                <p>Retrieve details for a specific user by their unique identifier.</p>
124                
125                <h2>Error Handling</h2>
126                <p>The API uses standard HTTP status codes to indicate success or failure of requests.</p>
127                <ul>
128                    <li>200 - Success</li>
129                    <li>400 - Bad Request</li>
130                    <li>401 - Unauthorized</li>
131                    <li>404 - Not Found</li>
132                    <li>500 - Server Error</li>
133                </ul>
134                
135                <h2>Rate Limiting</h2>
136                <p>API requests are limited to 100 requests per minute per API key to ensure fair usage.</p>
137            </main>
138        </body>
139        </html>
140    "#;
141
142    let pptx = html_to_pptx(tech_html, "https://api.example.com/docs")?;
143    std::fs::write("examples/output/api_docs.pptx", &pptx)?;
144    println!("   ✅ Created api_docs.pptx ({} bytes)\n", pptx.len());
145
146    println!("=== Demo Complete ===");
147    println!("\nGenerated files in examples/output/:");
148    println!("  - rust_intro.pptx");
149    println!("  - rust_quick.pptx");
150    println!("  - api_docs.pptx");
151
152    Ok(())
153}
Source

pub fn max_slides(self, max: usize) -> Self

Set maximum slides

Examples found in repository?
examples/web2ppt_demo.rs (line 75)
6fn main() -> Result<(), Box<dyn std::error::Error>> {
7    use ppt_rs::{
8        html_to_pptx, html_to_pptx_with_options,
9        Web2PptConfig, ConversionOptions,
10    };
11
12    println!("=== Web2PPT Demo ===\n");
13
14    // Example 1: Convert HTML string to PPTX
15    println!("📄 Example 1: HTML to PPTX");
16    
17    let html = r#"
18        <!DOCTYPE html>
19        <html>
20        <head>
21            <title>Rust Programming Language</title>
22            <meta name="description" content="A systems programming language focused on safety and performance">
23        </head>
24        <body>
25            <main>
26                <h1>Rust Programming Language</h1>
27                <p>Rust is a multi-paradigm, general-purpose programming language that emphasizes performance, type safety, and concurrency.</p>
28                
29                <h2>Key Features</h2>
30                <ul>
31                    <li>Memory safety without garbage collection</li>
32                    <li>Concurrency without data races</li>
33                    <li>Zero-cost abstractions</li>
34                    <li>Minimal runtime</li>
35                    <li>Efficient C bindings</li>
36                </ul>
37                
38                <h2>Getting Started</h2>
39                <p>Install Rust using rustup, the official Rust toolchain installer. It manages Rust versions and associated tools.</p>
40                
41                <pre><code>curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh</code></pre>
42                
43                <h2>Hello World</h2>
44                <p>Create your first Rust program with a simple hello world example that demonstrates the basic syntax.</p>
45                
46                <pre><code>fn main() {
47    println!("Hello, world!");
48}</code></pre>
49                
50                <h2>Cargo</h2>
51                <p>Cargo is Rust's build system and package manager. It handles downloading dependencies, compiling code, and more.</p>
52                <ul>
53                    <li>cargo new - Create a new project</li>
54                    <li>cargo build - Build your project</li>
55                    <li>cargo run - Run your project</li>
56                    <li>cargo test - Run tests</li>
57                </ul>
58                
59                <h2>Community</h2>
60                <p>Rust has a welcoming and helpful community. Join the official forums, Discord, or Reddit to connect with other Rustaceans.</p>
61            </main>
62        </body>
63        </html>
64    "#;
65
66    let pptx = html_to_pptx(html, "https://rust-lang.org")?;
67    std::fs::create_dir_all("examples/output")?;
68    std::fs::write("examples/output/rust_intro.pptx", &pptx)?;
69    println!("   ✅ Created rust_intro.pptx ({} bytes)\n", pptx.len());
70
71    // Example 2: With custom options
72    println!("📄 Example 2: Custom options");
73    
74    let config = Web2PptConfig::new()
75        .max_slides(5)
76        .max_bullets(4)
77        .with_code(true);
78
79    let options = ConversionOptions::new()
80        .title("Rust Quick Start")
81        .author("ppt-rs")
82        .with_source_url(true);
83
84    let pptx = html_to_pptx_with_options(html, "https://rust-lang.org", config, options)?;
85    std::fs::write("examples/output/rust_quick.pptx", &pptx)?;
86    println!("   ✅ Created rust_quick.pptx ({} bytes)\n", pptx.len());
87
88    // Example 3: Technical documentation style
89    println!("📄 Example 3: Technical documentation");
90    
91    let tech_html = r#"
92        <!DOCTYPE html>
93        <html>
94        <head><title>API Documentation</title></head>
95        <body>
96            <main>
97                <h1>REST API Reference</h1>
98                <p>This document describes the REST API endpoints available for integration with our platform.</p>
99                
100                <h2>Authentication</h2>
101                <p>All API requests require authentication using Bearer tokens in the Authorization header.</p>
102                <pre><code>Authorization: Bearer YOUR_API_KEY</code></pre>
103                
104                <h2>Endpoints</h2>
105                
106                <h3>GET /users</h3>
107                <p>Retrieve a list of all users in the system with pagination support.</p>
108                <ul>
109                    <li>page - Page number (default: 1)</li>
110                    <li>limit - Items per page (default: 20)</li>
111                    <li>sort - Sort field (name, email, created_at)</li>
112                </ul>
113                
114                <h3>POST /users</h3>
115                <p>Create a new user account with the specified details and permissions.</p>
116                <pre><code>{
117  "name": "John Doe",
118  "email": "john@example.com",
119  "role": "user"
120}</code></pre>
121                
122                <h3>GET /users/{id}</h3>
123                <p>Retrieve details for a specific user by their unique identifier.</p>
124                
125                <h2>Error Handling</h2>
126                <p>The API uses standard HTTP status codes to indicate success or failure of requests.</p>
127                <ul>
128                    <li>200 - Success</li>
129                    <li>400 - Bad Request</li>
130                    <li>401 - Unauthorized</li>
131                    <li>404 - Not Found</li>
132                    <li>500 - Server Error</li>
133                </ul>
134                
135                <h2>Rate Limiting</h2>
136                <p>API requests are limited to 100 requests per minute per API key to ensure fair usage.</p>
137            </main>
138        </body>
139        </html>
140    "#;
141
142    let pptx = html_to_pptx(tech_html, "https://api.example.com/docs")?;
143    std::fs::write("examples/output/api_docs.pptx", &pptx)?;
144    println!("   ✅ Created api_docs.pptx ({} bytes)\n", pptx.len());
145
146    println!("=== Demo Complete ===");
147    println!("\nGenerated files in examples/output/:");
148    println!("  - rust_intro.pptx");
149    println!("  - rust_quick.pptx");
150    println!("  - api_docs.pptx");
151
152    Ok(())
153}
Source

pub fn max_bullets(self, max: usize) -> Self

Set maximum bullets per slide

Examples found in repository?
examples/web2ppt_demo.rs (line 76)
6fn main() -> Result<(), Box<dyn std::error::Error>> {
7    use ppt_rs::{
8        html_to_pptx, html_to_pptx_with_options,
9        Web2PptConfig, ConversionOptions,
10    };
11
12    println!("=== Web2PPT Demo ===\n");
13
14    // Example 1: Convert HTML string to PPTX
15    println!("📄 Example 1: HTML to PPTX");
16    
17    let html = r#"
18        <!DOCTYPE html>
19        <html>
20        <head>
21            <title>Rust Programming Language</title>
22            <meta name="description" content="A systems programming language focused on safety and performance">
23        </head>
24        <body>
25            <main>
26                <h1>Rust Programming Language</h1>
27                <p>Rust is a multi-paradigm, general-purpose programming language that emphasizes performance, type safety, and concurrency.</p>
28                
29                <h2>Key Features</h2>
30                <ul>
31                    <li>Memory safety without garbage collection</li>
32                    <li>Concurrency without data races</li>
33                    <li>Zero-cost abstractions</li>
34                    <li>Minimal runtime</li>
35                    <li>Efficient C bindings</li>
36                </ul>
37                
38                <h2>Getting Started</h2>
39                <p>Install Rust using rustup, the official Rust toolchain installer. It manages Rust versions and associated tools.</p>
40                
41                <pre><code>curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh</code></pre>
42                
43                <h2>Hello World</h2>
44                <p>Create your first Rust program with a simple hello world example that demonstrates the basic syntax.</p>
45                
46                <pre><code>fn main() {
47    println!("Hello, world!");
48}</code></pre>
49                
50                <h2>Cargo</h2>
51                <p>Cargo is Rust's build system and package manager. It handles downloading dependencies, compiling code, and more.</p>
52                <ul>
53                    <li>cargo new - Create a new project</li>
54                    <li>cargo build - Build your project</li>
55                    <li>cargo run - Run your project</li>
56                    <li>cargo test - Run tests</li>
57                </ul>
58                
59                <h2>Community</h2>
60                <p>Rust has a welcoming and helpful community. Join the official forums, Discord, or Reddit to connect with other Rustaceans.</p>
61            </main>
62        </body>
63        </html>
64    "#;
65
66    let pptx = html_to_pptx(html, "https://rust-lang.org")?;
67    std::fs::create_dir_all("examples/output")?;
68    std::fs::write("examples/output/rust_intro.pptx", &pptx)?;
69    println!("   ✅ Created rust_intro.pptx ({} bytes)\n", pptx.len());
70
71    // Example 2: With custom options
72    println!("📄 Example 2: Custom options");
73    
74    let config = Web2PptConfig::new()
75        .max_slides(5)
76        .max_bullets(4)
77        .with_code(true);
78
79    let options = ConversionOptions::new()
80        .title("Rust Quick Start")
81        .author("ppt-rs")
82        .with_source_url(true);
83
84    let pptx = html_to_pptx_with_options(html, "https://rust-lang.org", config, options)?;
85    std::fs::write("examples/output/rust_quick.pptx", &pptx)?;
86    println!("   ✅ Created rust_quick.pptx ({} bytes)\n", pptx.len());
87
88    // Example 3: Technical documentation style
89    println!("📄 Example 3: Technical documentation");
90    
91    let tech_html = r#"
92        <!DOCTYPE html>
93        <html>
94        <head><title>API Documentation</title></head>
95        <body>
96            <main>
97                <h1>REST API Reference</h1>
98                <p>This document describes the REST API endpoints available for integration with our platform.</p>
99                
100                <h2>Authentication</h2>
101                <p>All API requests require authentication using Bearer tokens in the Authorization header.</p>
102                <pre><code>Authorization: Bearer YOUR_API_KEY</code></pre>
103                
104                <h2>Endpoints</h2>
105                
106                <h3>GET /users</h3>
107                <p>Retrieve a list of all users in the system with pagination support.</p>
108                <ul>
109                    <li>page - Page number (default: 1)</li>
110                    <li>limit - Items per page (default: 20)</li>
111                    <li>sort - Sort field (name, email, created_at)</li>
112                </ul>
113                
114                <h3>POST /users</h3>
115                <p>Create a new user account with the specified details and permissions.</p>
116                <pre><code>{
117  "name": "John Doe",
118  "email": "john@example.com",
119  "role": "user"
120}</code></pre>
121                
122                <h3>GET /users/{id}</h3>
123                <p>Retrieve details for a specific user by their unique identifier.</p>
124                
125                <h2>Error Handling</h2>
126                <p>The API uses standard HTTP status codes to indicate success or failure of requests.</p>
127                <ul>
128                    <li>200 - Success</li>
129                    <li>400 - Bad Request</li>
130                    <li>401 - Unauthorized</li>
131                    <li>404 - Not Found</li>
132                    <li>500 - Server Error</li>
133                </ul>
134                
135                <h2>Rate Limiting</h2>
136                <p>API requests are limited to 100 requests per minute per API key to ensure fair usage.</p>
137            </main>
138        </body>
139        </html>
140    "#;
141
142    let pptx = html_to_pptx(tech_html, "https://api.example.com/docs")?;
143    std::fs::write("examples/output/api_docs.pptx", &pptx)?;
144    println!("   ✅ Created api_docs.pptx ({} bytes)\n", pptx.len());
145
146    println!("=== Demo Complete ===");
147    println!("\nGenerated files in examples/output/:");
148    println!("  - rust_intro.pptx");
149    println!("  - rust_quick.pptx");
150    println!("  - api_docs.pptx");
151
152    Ok(())
153}
Source

pub fn with_images(self, include: bool) -> Self

Enable/disable images

Source

pub fn with_tables(self, include: bool) -> Self

Enable/disable tables

Source

pub fn with_code(self, include: bool) -> Self

Enable/disable code blocks

Examples found in repository?
examples/web2ppt_demo.rs (line 77)
6fn main() -> Result<(), Box<dyn std::error::Error>> {
7    use ppt_rs::{
8        html_to_pptx, html_to_pptx_with_options,
9        Web2PptConfig, ConversionOptions,
10    };
11
12    println!("=== Web2PPT Demo ===\n");
13
14    // Example 1: Convert HTML string to PPTX
15    println!("📄 Example 1: HTML to PPTX");
16    
17    let html = r#"
18        <!DOCTYPE html>
19        <html>
20        <head>
21            <title>Rust Programming Language</title>
22            <meta name="description" content="A systems programming language focused on safety and performance">
23        </head>
24        <body>
25            <main>
26                <h1>Rust Programming Language</h1>
27                <p>Rust is a multi-paradigm, general-purpose programming language that emphasizes performance, type safety, and concurrency.</p>
28                
29                <h2>Key Features</h2>
30                <ul>
31                    <li>Memory safety without garbage collection</li>
32                    <li>Concurrency without data races</li>
33                    <li>Zero-cost abstractions</li>
34                    <li>Minimal runtime</li>
35                    <li>Efficient C bindings</li>
36                </ul>
37                
38                <h2>Getting Started</h2>
39                <p>Install Rust using rustup, the official Rust toolchain installer. It manages Rust versions and associated tools.</p>
40                
41                <pre><code>curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh</code></pre>
42                
43                <h2>Hello World</h2>
44                <p>Create your first Rust program with a simple hello world example that demonstrates the basic syntax.</p>
45                
46                <pre><code>fn main() {
47    println!("Hello, world!");
48}</code></pre>
49                
50                <h2>Cargo</h2>
51                <p>Cargo is Rust's build system and package manager. It handles downloading dependencies, compiling code, and more.</p>
52                <ul>
53                    <li>cargo new - Create a new project</li>
54                    <li>cargo build - Build your project</li>
55                    <li>cargo run - Run your project</li>
56                    <li>cargo test - Run tests</li>
57                </ul>
58                
59                <h2>Community</h2>
60                <p>Rust has a welcoming and helpful community. Join the official forums, Discord, or Reddit to connect with other Rustaceans.</p>
61            </main>
62        </body>
63        </html>
64    "#;
65
66    let pptx = html_to_pptx(html, "https://rust-lang.org")?;
67    std::fs::create_dir_all("examples/output")?;
68    std::fs::write("examples/output/rust_intro.pptx", &pptx)?;
69    println!("   ✅ Created rust_intro.pptx ({} bytes)\n", pptx.len());
70
71    // Example 2: With custom options
72    println!("📄 Example 2: Custom options");
73    
74    let config = Web2PptConfig::new()
75        .max_slides(5)
76        .max_bullets(4)
77        .with_code(true);
78
79    let options = ConversionOptions::new()
80        .title("Rust Quick Start")
81        .author("ppt-rs")
82        .with_source_url(true);
83
84    let pptx = html_to_pptx_with_options(html, "https://rust-lang.org", config, options)?;
85    std::fs::write("examples/output/rust_quick.pptx", &pptx)?;
86    println!("   ✅ Created rust_quick.pptx ({} bytes)\n", pptx.len());
87
88    // Example 3: Technical documentation style
89    println!("📄 Example 3: Technical documentation");
90    
91    let tech_html = r#"
92        <!DOCTYPE html>
93        <html>
94        <head><title>API Documentation</title></head>
95        <body>
96            <main>
97                <h1>REST API Reference</h1>
98                <p>This document describes the REST API endpoints available for integration with our platform.</p>
99                
100                <h2>Authentication</h2>
101                <p>All API requests require authentication using Bearer tokens in the Authorization header.</p>
102                <pre><code>Authorization: Bearer YOUR_API_KEY</code></pre>
103                
104                <h2>Endpoints</h2>
105                
106                <h3>GET /users</h3>
107                <p>Retrieve a list of all users in the system with pagination support.</p>
108                <ul>
109                    <li>page - Page number (default: 1)</li>
110                    <li>limit - Items per page (default: 20)</li>
111                    <li>sort - Sort field (name, email, created_at)</li>
112                </ul>
113                
114                <h3>POST /users</h3>
115                <p>Create a new user account with the specified details and permissions.</p>
116                <pre><code>{
117  "name": "John Doe",
118  "email": "john@example.com",
119  "role": "user"
120}</code></pre>
121                
122                <h3>GET /users/{id}</h3>
123                <p>Retrieve details for a specific user by their unique identifier.</p>
124                
125                <h2>Error Handling</h2>
126                <p>The API uses standard HTTP status codes to indicate success or failure of requests.</p>
127                <ul>
128                    <li>200 - Success</li>
129                    <li>400 - Bad Request</li>
130                    <li>401 - Unauthorized</li>
131                    <li>404 - Not Found</li>
132                    <li>500 - Server Error</li>
133                </ul>
134                
135                <h2>Rate Limiting</h2>
136                <p>API requests are limited to 100 requests per minute per API key to ensure fair usage.</p>
137            </main>
138        </body>
139        </html>
140    "#;
141
142    let pptx = html_to_pptx(tech_html, "https://api.example.com/docs")?;
143    std::fs::write("examples/output/api_docs.pptx", &pptx)?;
144    println!("   ✅ Created api_docs.pptx ({} bytes)\n", pptx.len());
145
146    println!("=== Demo Complete ===");
147    println!("\nGenerated files in examples/output/:");
148    println!("  - rust_intro.pptx");
149    println!("  - rust_quick.pptx");
150    println!("  - api_docs.pptx");
151
152    Ok(())
153}
Source

pub fn user_agent(self, ua: &str) -> Self

Set custom user agent

Source

pub fn timeout(self, secs: u64) -> Self

Set request timeout

Source

pub fn title_size(self, size: u32) -> Self

Set title font size

Source

pub fn content_size(self, size: u32) -> Self

Set content font size

Enable/disable link extraction

Source

pub fn group_by_headings(self, group: bool) -> Self

Enable/disable grouping by headings

Trait Implementations§

Source§

impl Clone for Web2PptConfig

Source§

fn clone(&self) -> Web2PptConfig

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Web2PptConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Web2PptConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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