fix: controller with 1 generic

This commit is contained in:
əlemi 2024-08-06 23:00:45 +02:00
parent e85833a40f
commit 05a4c88967
Signed by: alemi
GPG key ID: A4895B84D311642C
3 changed files with 1 additions and 8 deletions

View file

@ -25,14 +25,11 @@ pub(crate) trait ControllerWorker<T : Sized + Send + Sync> {
/// * if async is not feasible a [Controller::poll]/[Controller::try_recv] approach is possible
#[async_trait::async_trait]
pub trait Controller<T : Sized + Send + Sync> : Sized + Send + Sync {
/// type of upstream values, used in [Self::send]
type Input;
/// enqueue a new value to be sent to all other users
///
/// success or failure of this function does not imply validity of sent operation,
/// because it's integrated asynchronously on the background worker
fn send(&self, x: Self::Input) -> Result<()>;
fn send(&self, x: T) -> Result<()>;
/// get next value from other users, blocking until one is available
///

View file

@ -77,8 +77,6 @@ impl Drop for StopOnDrop {
#[async_trait]
impl Controller<TextChange> for BufferController {
type Input = TextChange;
/// block until a text change is available
/// this returns immediately if one is already available
async fn poll(&self) -> crate::Result<()> {

View file

@ -67,8 +67,6 @@ impl CursorController {
#[async_trait]
impl Controller<Cursor> for CursorController {
type Input = Cursor;
/// enqueue a cursor event to be broadcast to current workspace
/// will automatically invert cursor start/end if they are inverted
fn send(&self, mut cursor: Cursor) -> crate::Result<()> {