pub struct Http {
pub authority: String,
pub rest_address: String,
pub rest_address_versionless: String,
pub headers: HeaderMap,
pub request_client: Arc<Client<HttpsConnector<HttpConnector>, Full<Bytes>>>,
}Fields§
§rest_address: String§rest_address_versionless: String§headers: HeaderMap§request_client: Arc<Client<HttpsConnector<HttpConnector>, Full<Bytes>>>Implementations§
Source§impl Http
impl Http
Sourcepub async fn request<R: DeserializeOwned, T: Serialize + ?Sized, U>(
&self,
method: Method,
uri: U,
data: Option<&T>,
) -> LavalinkResult<R>
pub async fn request<R: DeserializeOwned, T: Serialize + ?Sized, U>( &self, method: Method, uri: U, data: Option<&T>, ) -> LavalinkResult<R>
Makes an HTTP/1.1 request using Hyper to endpoints that return deserializable data.
Sourcepub async fn raw_request<T: Serialize + ?Sized, U>(
&self,
method: Method,
uri: U,
data: Option<&T>,
) -> LavalinkResult<String>
pub async fn raw_request<T: Serialize + ?Sized, U>( &self, method: Method, uri: U, data: Option<&T>, ) -> LavalinkResult<String>
Makes an HTTP/1.1 request using Hyper to endpoints that return text data.
Sourcepub fn path_to_uri(
&self,
path: &str,
with_version: bool,
) -> Result<Uri, InvalidUri>
pub fn path_to_uri( &self, path: &str, with_version: bool, ) -> Result<Uri, InvalidUri>
Convert a path and query to a uri that points to the lavalink server.
Sourcepub async fn delete_player(
&self,
guild_id: impl Into<GuildId>,
session_id: &str,
) -> LavalinkResult<()>
pub async fn delete_player( &self, guild_id: impl Into<GuildId>, session_id: &str, ) -> LavalinkResult<()>
Destroys the player for this guild in this session.
Sourcepub async fn update_player(
&self,
guild_id: impl Into<GuildId>,
session_id: &str,
data: &UpdatePlayer,
no_replace: bool,
) -> LavalinkResult<Player>
pub async fn update_player( &self, guild_id: impl Into<GuildId>, session_id: &str, data: &UpdatePlayer, no_replace: bool, ) -> LavalinkResult<Player>
Updates or creates the player for this guild.
Sourcepub async fn set_resuming_state(
&self,
session_id: &str,
resuming_state: &ResumingState,
) -> LavalinkResult<ResumingState>
pub async fn set_resuming_state( &self, session_id: &str, resuming_state: &ResumingState, ) -> LavalinkResult<ResumingState>
Updates the session with the resuming state and timeout.
Sourcepub async fn load_tracks(&self, identifier: &str) -> LavalinkResult<Track>
pub async fn load_tracks(&self, identifier: &str) -> LavalinkResult<Track>
Resolves audio tracks for use with the update_player endpoint.
§Parameters
identifier: A track identifier.- Can be a url: “https://youtu.be/watch?v=DrM2lo6B04I”
- A unique identifier: “DrM2lo6B04I”
- A search: “ytsearch:Ne Obliviscaris - Forget Not”
Sourcepub async fn version(&self) -> LavalinkResult<String>
pub async fn version(&self) -> LavalinkResult<String>
Request Lavalink server version.
Sourcepub async fn stats(&self) -> LavalinkResult<Stats>
pub async fn stats(&self) -> LavalinkResult<Stats>
Request Lavalink statistics.
NOTE: The frame stats will never be returned.
Sourcepub async fn info(&self) -> LavalinkResult<Info>
pub async fn info(&self) -> LavalinkResult<Info>
Request Lavalink server information.
Sourcepub async fn decode_track(&self, track: &str) -> LavalinkResult<TrackData>
pub async fn decode_track(&self, track: &str) -> LavalinkResult<TrackData>
Sourcepub async fn decode_tracks(
&self,
tracks: &[String],
) -> LavalinkResult<Vec<TrackData>>
pub async fn decode_tracks( &self, tracks: &[String], ) -> LavalinkResult<Vec<TrackData>>
Sourcepub async fn get_player(
&self,
guild_id: impl Into<GuildId>,
session_id: &str,
) -> LavalinkResult<Player>
pub async fn get_player( &self, guild_id: impl Into<GuildId>, session_id: &str, ) -> LavalinkResult<Player>
Returns the player for this guild in this session.
Sourcepub async fn get_players(&self, session_id: &str) -> LavalinkResult<Vec<Player>>
pub async fn get_players(&self, session_id: &str) -> LavalinkResult<Vec<Player>>
Returns a list of players in this specific session.
Trait Implementations§
impl DerefToPyAny for Http
Source§impl<'py> IntoPyObject<'py> for Http
impl<'py> IntoPyObject<'py> for Http
Source§type Output = Bound<'py, <Http as IntoPyObject<'py>>::Target>
type Output = Bound<'py, <Http as IntoPyObject<'py>>::Target>
Source§fn into_pyobject(
self,
py: Python<'py>,
) -> Result<<Self as IntoPyObject<'_>>::Output, <Self as IntoPyObject<'_>>::Error>
fn into_pyobject( self, py: Python<'py>, ) -> Result<<Self as IntoPyObject<'_>>::Output, <Self as IntoPyObject<'_>>::Error>
Source§impl PyClassImpl for Http
impl PyClassImpl for Http
Source§const IS_BASETYPE: bool = false
const IS_BASETYPE: bool = false
Source§const IS_SUBCLASS: bool = false
const IS_SUBCLASS: bool = false
Source§const IS_MAPPING: bool = false
const IS_MAPPING: bool = false
Source§const IS_SEQUENCE: bool = false
const IS_SEQUENCE: bool = false
Source§type ThreadChecker = SendablePyClass<Http>
type ThreadChecker = SendablePyClass<Http>
Source§type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
Source§type BaseNativeType = PyAny
type BaseNativeType = PyAny
PyAny by default, and when you declare
#[pyclass(extends=PyDict)], it’s PyDict.fn items_iter() -> PyClassItemsIter
fn lazy_type_object() -> &'static LazyTypeObject<Self>
fn dict_offset() -> Option<isize>
fn weaklist_offset() -> Option<isize>
Source§impl PyTypeInfo for Http
impl PyTypeInfo for Http
Source§fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
Source§fn type_object(py: Python<'_>) -> Bound<'_, PyType>
fn type_object(py: Python<'_>) -> Bound<'_, PyType>
Source§fn type_object_bound(py: Python<'_>) -> Bound<'_, PyType>
fn type_object_bound(py: Python<'_>) -> Bound<'_, PyType>
renamed to PyTypeInfo::type_object
PyTypeInfo::type_object.Source§fn is_type_of(object: &Bound<'_, PyAny>) -> bool
fn is_type_of(object: &Bound<'_, PyAny>) -> bool
object is an instance of this type or a subclass of this type.Source§fn is_type_of_bound(object: &Bound<'_, PyAny>) -> bool
fn is_type_of_bound(object: &Bound<'_, PyAny>) -> bool
renamed to PyTypeInfo::is_type_of
PyTypeInfo::is_type_of.Source§fn is_exact_type_of(object: &Bound<'_, PyAny>) -> bool
fn is_exact_type_of(object: &Bound<'_, PyAny>) -> bool
object is an instance of this type.Source§fn is_exact_type_of_bound(object: &Bound<'_, PyAny>) -> bool
fn is_exact_type_of_bound(object: &Bound<'_, PyAny>) -> bool
renamed to PyTypeInfo::is_exact_type_of
PyTypeInfo::is_exact_type_of.Auto Trait Implementations§
impl !RefUnwindSafe for Http
impl !UnwindSafe for Http
impl Freeze for Http
impl Send for Http
impl Sync for Http
impl Unpin for Http
impl UnsafeUnpin for Http
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FromPyObject<'_> for T
impl<T> FromPyObject<'_> for T
Source§impl<'py, T> FromPyObjectBound<'_, 'py> for Twhere
T: FromPyObject<'py>,
impl<'py, T> FromPyObjectBound<'_, 'py> for Twhere
T: FromPyObject<'py>,
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<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
Source§fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
self into an owned Python object, dropping type information.