rust

package
v0.0.0-...-dd7c980 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 30, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteOldLogs

func DeleteOldLogs(prefix string)

func NewRustClient

func NewRustClient(t ct.TestLike, opts api.ClientCreationOpts) (api.Client, error)

func SetupLogs

func SetupLogs(prefix string)

Types

type DynamicSlice

type DynamicSlice[T any] struct {
	Slice []T
}

This is a recurring pattern in the FFI bindings where a room list or timeline has delta updates sent to it. Rather than reimplementing all the functions over and over, define it once here.

func (*DynamicSlice[T]) Append

func (s *DynamicSlice[T]) Append(vals ...T)

Append items to the end of the slice.

func (*DynamicSlice[T]) Clear

func (s *DynamicSlice[T]) Clear()

func (*DynamicSlice[T]) Insert

func (s *DynamicSlice[T]) Insert(i int, val T)

Insert the item, shifting anything in this place up by one.

func (*DynamicSlice[T]) PopBack

func (s *DynamicSlice[T]) PopBack()

func (*DynamicSlice[T]) PopFront

func (s *DynamicSlice[T]) PopFront()

func (*DynamicSlice[T]) PushBack

func (s *DynamicSlice[T]) PushBack(val T)

func (*DynamicSlice[T]) PushFront

func (s *DynamicSlice[T]) PushFront(val T)

func (*DynamicSlice[T]) Remove

func (s *DynamicSlice[T]) Remove(i int)

Remove the item, shifting anything above this down by one.

func (*DynamicSlice[T]) Reset

func (s *DynamicSlice[T]) Reset(vals []T)

func (*DynamicSlice[T]) Set

func (s *DynamicSlice[T]) Set(i int, val T)

Set the item at i to val, does not shift anything.

func (*DynamicSlice[T]) Truncate

func (s *DynamicSlice[T]) Truncate(length int)

type MemoryClientSessionDelegate

type MemoryClientSessionDelegate struct {
	// contains filtered or unexported fields
}

func NewMemoryClientSessionDelegate

func NewMemoryClientSessionDelegate() *MemoryClientSessionDelegate

func (*MemoryClientSessionDelegate) RetrieveSessionFromKeychain

func (d *MemoryClientSessionDelegate) RetrieveSessionFromKeychain(userID string) (matrix_sdk_ffi.Session, *matrix_sdk_ffi.ClientError)

func (*MemoryClientSessionDelegate) SaveSessionInKeychain

func (d *MemoryClientSessionDelegate) SaveSessionInKeychain(session matrix_sdk_ffi.Session)

type RoomsListener

type RoomsListener struct {
	// contains filtered or unexported fields
}

This is a more ergonomic way to listen for updates from the FFI layer, as it will allow you to listen for non-existing rooms without crashing.

func NewRoomsListener

func NewRoomsListener() *RoomsListener

func (*RoomsListener) AddListener

func (l *RoomsListener) AddListener(callback func(broadcastRoomID string) (cancel bool)) (cancel func())

AddListener registers the given callback, which will be invoked for every call to BroadcastUpdateForRoom.

func (*RoomsListener) BroadcastUpdateForRoom

func (l *RoomsListener) BroadcastUpdateForRoom(roomID string)

BroadcastUpdateForRoom informs all attached listeners that something has happened in relation to this room ID. This could be a new event, or the room appearing in all_rooms, or something else entirely. It is up to the listener to decide what to do upon receipt of the poke.

type RustClient

type RustClient struct {
	FFIClient *matrix_sdk_ffi.Client
	// contains filtered or unexported fields
}

func (*RustClient) Close

func (c *RustClient) Close(t ct.TestLike)

func (*RustClient) CurrentAccessToken

func (c *RustClient) CurrentAccessToken(t ct.TestLike) string

func (*RustClient) DeletePersistentStorage

func (c *RustClient) DeletePersistentStorage(t ct.TestLike)

func (*RustClient) ForceClose

func (c *RustClient) ForceClose(t ct.TestLike)

func (*RustClient) GetNotification

func (c *RustClient) GetNotification(t ct.TestLike, roomID, eventID string) (*api.Notification, error)

func (*RustClient) IsRoomEncrypted

func (c *RustClient) IsRoomEncrypted(t ct.TestLike, roomID string) (bool, error)

IsRoomEncrypted returns true if the room is encrypted. May return an error e.g if you provide a bogus room ID.

func (*RustClient) LoadBackup

func (c *RustClient) LoadBackup(t ct.TestLike, recoveryKey string) error

func (*RustClient) Logf

func (c *RustClient) Logf(t ct.TestLike, format string, args ...interface{})

func (*RustClient) Login

func (c *RustClient) Login(t ct.TestLike, opts api.ClientCreationOpts) error

func (*RustClient) MustBackpaginate

func (c *RustClient) MustBackpaginate(t ct.TestLike, roomID string, count int)

func (*RustClient) MustBackupKeys

func (c *RustClient) MustBackupKeys(t ct.TestLike) (recoveryKey string)

func (*RustClient) MustGetEvent

func (c *RustClient) MustGetEvent(t ct.TestLike, roomID, eventID string) api.Event

func (*RustClient) MustLoadBackup

func (c *RustClient) MustLoadBackup(t ct.TestLike, recoveryKey string)

func (*RustClient) MustStartSyncing

func (c *RustClient) MustStartSyncing(t ct.TestLike) (stopSyncing func())

func (*RustClient) Opts

func (c *RustClient) Opts() api.ClientCreationOpts

func (*RustClient) SendMessage

func (c *RustClient) SendMessage(t ct.TestLike, roomID, text string) (eventID string)

SendMessage sends the given text as an m.room.message with msgtype:m.text into the given room. Returns the event ID of the sent event.

func (*RustClient) StartSyncing

func (c *RustClient) StartSyncing(t ct.TestLike) (stopSyncing func(), err error)

StartSyncing to begin syncing from sync v2 / sliding sync. Tests should call stopSyncing() at the end of the test.

func (*RustClient) TrySendMessage

func (c *RustClient) TrySendMessage(t ct.TestLike, roomID, text string) (eventID string, err error)

func (*RustClient) Type

func (c *RustClient) Type() api.ClientTypeLang

func (*RustClient) UserID

func (c *RustClient) UserID() string

func (*RustClient) WaitUntilEventInRoom

func (c *RustClient) WaitUntilEventInRoom(t ct.TestLike, roomID string, checker func(api.Event) bool) api.Waiter

type RustRoomInfo

type RustRoomInfo struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL