pub struct Session { /* private fields */ }
Expand description
A handle representing a Scoop session.
Implementations§
Source§impl Session
impl Session
Sourcepub fn new() -> Session
pub fn new() -> Session
Create a new session.
The default config path will be used to locate the config file for the session.
§Returns
A new session.
Sourcepub fn config(&self) -> Ref<'_, Config>
pub fn config(&self) -> Ref<'_, Config>
Get an immutable reference to the config held by the session.
This method is primarily used for doing a fine-grained read to the
config aside from reading it as a whole via config_list
. Caller
of this method may not be able to perform some operations
, which
will internally alter the config, before the reference is dropped.
Sourcepub fn set_user_agent(&self, user_agent: &str) -> Result<(), Error>
pub fn set_user_agent(&self, user_agent: &str) -> Result<(), Error>
Set the user agent for the session.
User agent is used when performing network related operations such as
downloading packages. User agent for a session can only be set once.
If not set, the default user agent will be used. The default user agent
is Scoop/1.0 (+http://scoop.sh/)
.
§Errors
This method will return an error if the user agent has already been set.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Session
impl !RefUnwindSafe for Session
impl Send for Session
impl !Sync for Session
impl Unpin for Session
impl UnwindSafe for Session
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
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>
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>
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