pub struct FetchOptions { /* private fields */ }Expand description
Contains all information needed for a call to the GitLab API.
Create a new instance with FetchOptions::new().
Implementations§
Source§impl FetchOptions
impl FetchOptions
Sourcepub fn new(url: &str, token: Option<String>) -> Result<Self, FetchOptionsError>
pub fn new(url: &str, token: Option<String>) -> Result<Self, FetchOptionsError>
Creates a new FetchOption instance. Takes the full URL to a GitLab repository and a
access token, if needed.
let access_token = "MyAccessToken".to_string();
let options_result = FetchOptions::new("https://gitlab.com/gitlab-org/gitlab", Some(access_token));
// Check for errors
let Ok(option) = options_result else {
panic!("Error happened when creating FetchOption: {:?}", options_result.unwrap_err());
};
println!("{:?}", option);§Errors
The function returns an Err if the URL path component does not contain two /, i.e. https://gitlab.com/gitlab-org
Trait Implementations§
Source§impl Clone for FetchOptions
impl Clone for FetchOptions
Source§fn clone(&self) -> FetchOptions
fn clone(&self) -> FetchOptions
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FetchOptions
impl Debug for FetchOptions
Source§impl Default for FetchOptions
impl Default for FetchOptions
Source§fn default() -> FetchOptions
fn default() -> FetchOptions
Returns the “default value” for a type. Read more
Source§impl PartialEq for FetchOptions
impl PartialEq for FetchOptions
impl StructuralPartialEq for FetchOptions
Auto Trait Implementations§
impl Freeze for FetchOptions
impl RefUnwindSafe for FetchOptions
impl Send for FetchOptions
impl Sync for FetchOptions
impl Unpin for FetchOptions
impl UnwindSafe for FetchOptions
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