pub struct PhotoRequestBuilder { /* private fields */ }
Implementations§
Source§impl PhotoRequestBuilder
impl PhotoRequestBuilder
Sourcepub async fn get_info(
&self,
id: &String,
secret: Option<&String>,
) -> Result<PhotoInfo, Box<dyn Error>>
pub async fn get_info( &self, id: &String, secret: Option<&String>, ) -> Result<PhotoInfo, Box<dyn Error>>
flickr.photos.getInfo endpoint. Returns information associated with the photo of the given ID.
secret
allows bypassing the permission checks if given. Does not require authentication but
will authenticate the user if given the token.
Source§impl PhotoRequestBuilder
impl PhotoRequestBuilder
Sourcepub async fn get_sizes(
&self,
id: &String,
) -> Result<Vec<FlickrSize>, Box<dyn Error>>
pub async fn get_sizes( &self, id: &String, ) -> Result<Vec<FlickrSize>, Box<dyn Error>>
flickr.photos.getSizes endpoint. Returns the available sizes for the photo of the given ID.
Source§impl PhotoRequestBuilder
impl PhotoRequestBuilder
Sourcepub async fn upload_from_path(
&self,
path: &Path,
) -> Result<String, Box<dyn Error>>
pub async fn upload_from_path( &self, path: &Path, ) -> Result<String, Box<dyn Error>>
Access the “special” upload API and upload a photo from a given path
Examples found in repository?
examples/upload.rs (line 39)
27async fn main() -> Result<(), Box<dyn Error>> {
28 let arg = env::args().nth(1).unwrap();
29 let path = Path::new(&arg);
30 println!("Uploading {path:?}");
31
32 let client = FlickrAPI::new(ApiKey {
33 key: prompt("API key: "),
34 secret: prompt("API secret: "),
35 })
36 .login()
37 .await?;
38
39 let id = client.photos().upload_from_path(&path).await?;
40 println!("Uploaded {path:?} and was given {id}");
41
42 Ok(())
43}
Auto Trait Implementations§
impl Freeze for PhotoRequestBuilder
impl !RefUnwindSafe for PhotoRequestBuilder
impl !Send for PhotoRequestBuilder
impl !Sync for PhotoRequestBuilder
impl Unpin for PhotoRequestBuilder
impl !UnwindSafe for PhotoRequestBuilder
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more