pub struct Postgrest { /* private fields */ }
Implementations§
source§impl Postgrest
impl Postgrest
sourcepub fn new<T>(url: T) -> Selfwhere
T: Into<String>,
pub fn new<T>(url: T) -> Selfwhere T: Into<String>,
Creates a Postgrest client.
Example
use postgrest::Postgrest;
let client = Postgrest::new("http://your.postgrest.endpoint");
sourcepub fn insert_header(
self,
header_name: impl IntoHeaderName,
header_value: impl AsRef<str>
) -> Self
pub fn insert_header( self, header_name: impl IntoHeaderName, header_value: impl AsRef<str> ) -> Self
Add arbitrary headers to the request. For instance when you may want to connect through an API gateway that needs an API key header.
Example
use postgrest::Postgrest;
let client = Postgrest::new("https://your.postgrest.endpoint")
.insert_header("apikey", "super.secret.key")
.from("table");
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Postgrest
impl Send for Postgrest
impl Sync for Postgrest
impl Unpin for Postgrest
impl !UnwindSafe for Postgrest
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