Struct redmine_api::api::Redmine
source · [−]pub struct Redmine { /* private fields */ }
Expand description
main API client object
Implementations
sourceimpl Redmine
impl Redmine
sourcepub fn impersonate_user(&mut self, id: u64)
pub fn impersonate_user(&mut self, id: u64)
Sets the user id of a user to impersonate in all future API calls
this requires Redmine admin privileges
sourcepub fn issue_url(&self, issue_id: u64) -> Url
pub fn issue_url(&self, issue_id: u64) -> Url
returns the issue URL for a given issue id
this is mostly for convenience since we are already storing the redmine URL and it works entirely on the client
sourcepub fn ignore_response_body<E>(&self, endpoint: &E) -> Result<(), Error> where
E: Endpoint,
pub fn ignore_response_body<E>(&self, endpoint: &E) -> Result<(), Error> where
E: Endpoint,
use this with endpoints that have no response body, e.g. those just deleting a Redmine object
Errors
This can return an error if the endpoint returns an error when creating the request body or when the web request fails
sourcepub fn json_response_body<E, R>(&self, endpoint: &E) -> Result<R, Error> where
E: Endpoint + ReturnsJsonResponse,
R: DeserializeOwned + Debug,
pub fn json_response_body<E, R>(&self, endpoint: &E) -> Result<R, Error> where
E: Endpoint + ReturnsJsonResponse,
R: DeserializeOwned + Debug,
use this with endpoints which return a JSON response but do not support pagination
you can use it with those that support pagination but they will only return the first page
Errors
This can return an error if the endpoint returns an error when creating the request body, when the web request fails or when the response can not be parsed as a JSON object into the result type
sourcepub fn json_response_body_page<E, R>(
&self,
endpoint: &E,
offset: u64,
limit: u64
) -> Result<ResponsePage<R>, Error> where
E: Endpoint + ReturnsJsonResponse + Pageable,
R: DeserializeOwned + Debug,
pub fn json_response_body_page<E, R>(
&self,
endpoint: &E,
offset: u64,
limit: u64
) -> Result<ResponsePage<R>, Error> where
E: Endpoint + ReturnsJsonResponse + Pageable,
R: DeserializeOwned + Debug,
use this to get a single page of a paginated JSON response
Errors
This can return an error if the endpoint returns an error when creating the request body, when the web request fails, when the response can not be parsed as a JSON object, when any of the pagination keys or the value key are missing in the JSON object or when the values can not be parsed as the result type.
sourcepub fn json_response_body_all_pages<E, R>(
&self,
endpoint: &E
) -> Result<Vec<R>, Error> where
E: Endpoint + ReturnsJsonResponse + Pageable,
R: DeserializeOwned + Debug,
pub fn json_response_body_all_pages<E, R>(
&self,
endpoint: &E
) -> Result<Vec<R>, Error> where
E: Endpoint + ReturnsJsonResponse + Pageable,
R: DeserializeOwned + Debug,
use this to get the results for all pages of a paginated JSON response
Errors
This can return an error if the endpoint returns an error when creating the request body, when any of the web requests fails, when the response can not be parsed as a JSON object, when any of the pagination keys or the value key are missing in the JSON object or when the values can not be parsed as the result type.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Redmine
impl Send for Redmine
impl Sync for Redmine
impl Unpin for Redmine
impl !UnwindSafe for Redmine
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
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
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more