Struct awr::client::friend_list::FriendList
source · Expand description
好友列表。
Python
class FriendList:
@property
def total_count(self) -> int: ...
@property
def online_count(self) -> int: ...
Fields§
§total_count: i16
好友数量。
online_count: i16
在线好友数量。
Implementations§
source§impl FriendList
impl FriendList
sourcepub fn find_friend(&self, uin: i64) -> Option<Friend>
pub fn find_friend(&self, uin: i64) -> Option<Friend>
sourcepub fn friend_groups<'py>(&self, py: Python<'py>) -> PyResult<&'py PyList>
pub fn friend_groups<'py>(&self, py: Python<'py>) -> PyResult<&'py PyList>
获取所有好友分组信息。
参考 FriendGroup
。
Examples
friend_list = await client.get_friend_list()
for group in friend_list.friend_groups():
print(group.name)
Python
def friend_groups(self) -> list[FriendGroup]:
sourcepub fn find_friend_group(&self, group_id: u8) -> Option<FriendGroup>
pub fn find_friend_group(&self, group_id: u8) -> Option<FriendGroup>
查找好友分组。
参考 FriendGroup
。
Examples
friend_list = await client.get_friend_list()
friend = friend_list.find_friend(12345678)
if friend:
group = friend_list.find_friend_group(friend.group_id)
if group:
print("好友 12345678 位于分组", group.name)
Python
def find_friend_group(self, group_id: int) -> FriendGroup | None:
Trait Implementations§
source§impl Clone for FriendList
impl Clone for FriendList
source§fn clone(&self) -> FriendList
fn clone(&self) -> FriendList
Returns a copy 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 IntoPy<Py<PyAny>> for FriendList
impl IntoPy<Py<PyAny>> for FriendList
source§impl PyClassImpl for FriendList
impl PyClassImpl for FriendList
source§const IS_BASETYPE: bool = false
const IS_BASETYPE: bool = false
#[pyclass(subclass)]
source§const IS_SUBCLASS: bool = false
const IS_SUBCLASS: bool = false
#[pyclass(extends=…)]
source§const IS_MAPPING: bool = false
const IS_MAPPING: bool = false
#[pyclass(mapping)]
source§const IS_SEQUENCE: bool = false
const IS_SEQUENCE: bool = false
#[pyclass(sequence)]
§type Layout = PyCell<FriendList>
type Layout = PyCell<FriendList>
Layout
§type ThreadChecker = ThreadCheckerStub<FriendList>
type ThreadChecker = ThreadCheckerStub<FriendList>
This handles following two situations: Read more
§type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
Immutable or mutable
§type BaseNativeType = PyAny
type BaseNativeType = PyAny
The closest native ancestor. This is
PyAny
by default, and when you declare
#[pyclass(extends=PyDict)]
, it’s PyDict
.fn items_iter() -> PyClassItemsIter
fn dict_offset() -> Option<isize>
fn weaklist_offset() -> Option<isize>
source§impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a FriendList
impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a FriendList
source§impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a mut FriendList
impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a mut FriendList
source§impl PyMethods<FriendList> for PyClassImplCollector<FriendList>
impl PyMethods<FriendList> for PyClassImplCollector<FriendList>
fn py_methods(self) -> &'static PyClassItems
source§impl PyTypeInfo for FriendList
impl PyTypeInfo for FriendList
§type AsRefTarget = PyCell<FriendList>
type AsRefTarget = PyCell<FriendList>
Utility type to make Py::as_ref work.
source§fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
Returns the PyTypeObject instance for this type.
§fn type_object(py: Python<'_>) -> &PyType
fn type_object(py: Python<'_>) -> &PyType
Returns the safe abstraction over the type object.
§fn is_type_of(object: &PyAny) -> bool
fn is_type_of(object: &PyAny) -> bool
Checks if
object
is an instance of this type or a subclass of this type.§fn is_exact_type_of(object: &PyAny) -> bool
fn is_exact_type_of(object: &PyAny) -> bool
Checks if
object
is an instance of this type.