pub struct SqlIdentityBuilder { /* private fields */ }

Implementations§

Creates a new SqlIdentityBuilder that constructs a SqlIdentityPolicy

Arguments
  • uri - Database connection string
Example

use actix_web::App;
use actix_web::middleware::identity::IdentityService;
use actix_web_sql_identity::SqlIdentityBuilder;

// Create the identity policy
let policy = SqlIdentityBuilder::new("postgres://user:pass@host/database")
                .pool_size(5)
                .response_header("X-MY-RESPONSE")
                .finish()
                .expect("failed to open database");

let app = App::new().middleware(IdentityService::new(
    policy
));

Change the response header when an identity is remembered

Arguments
  • hdr - Response header name to use

Change how many SQL connections are in each pool

Arguments
  • count - Number of connections per pool

Finish building this SQL identity policy. This will attempt to construct the a pool of connections to the database specified. The type of database is determined by the uri set. On success, a new SqlIdentityPolicy is returned, on failure an error is returned.

Forces a SQLite identity policy to be created. This function does not normally need to be used, new will automatically determine the appropriate variant by parsing the connection string. This function exists if the parsing fails

Forces a MySQL identity policy to be created. This function does not normally need to be used, new will automatically determine the appropriate variant by parsing the connection string. This function exists if the parsing fails

Forces a PostgreSQL identity policy to be created. This function does not normally need to be used, new will automatically determine the appropriate variant by parsing the connection string. This function exists if the parsing fails

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

Convert self to an expression for Diesel’s query builder. Read more
Convert &self to an expression for Diesel’s query builder. Read more
Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.