pub struct FriendList {
    pub total_count: i16,
    pub online_count: i16,
    /* private fields */
}
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§

遍历好友信息的迭代器。

参考 Friend

Examples
friend_list = await client.get_friend_list()
for friend in friend_list.friends():
    print(friend.nickname)
Python
def friends(self) -> Iterator[Friend]:

查找指定的好友。

参考 Friend

Examples
friend_list = await client.get_friend_list()
friend = friend_list.find_friend(12345678)
if friend:
    print(friend.nickname)
else:
    print("未找到好友 12345678")
Python
def find_friend(self, uin: int) -> Friend | None:

获取所有好友分组信息。

参考 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]:

查找好友分组。

参考 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§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Performs the conversion.
Whether the pyclass is frozen. Read more
Class doc string
#[pyclass(subclass)]
#[pyclass(extends=…)]
#[pyclass(mapping)]
#[pyclass(sequence)]
Layout
Base class
This handles following two situations: Read more
Immutable or mutable
Specify this class has #[pyclass(dict)] or not.
Specify this class has #[pyclass(weakref)] or not.
The closest native ancestor. This is PyAny by default, and when you declare #[pyclass(extends=PyDict)], it’s PyDict.
Utility type to make Py::as_ref work.
Class name.
Module name, if any.
Returns the PyTypeObject instance for this type.
Returns the safe abstraction over the type object.
Checks if object is an instance of this type or a subclass of this type.
Checks if object is an instance of this type.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Extracts Self from the source PyObject.
Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
Arguments for exception
Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more