mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-25 02:58:02 +02:00
Fixed Console.Readline, added Console.KeyAvailable
This commit is contained in:
parent
e71cb928a6
commit
037cb39240
5 changed files with 92 additions and 10 deletions
|
@ -60,6 +60,20 @@ namespace System.IO
|
|||
}
|
||||
|
||||
public abstract Result<int> TryRead(Span<uint8> data);
|
||||
public virtual Result<int, FileError> TryRead(Span<uint8> data, int timeout)
|
||||
{
|
||||
if (timeout == -1)
|
||||
{
|
||||
switch (TryRead(data))
|
||||
{
|
||||
case .Ok(var i):
|
||||
return i;
|
||||
case .Err:
|
||||
return .Err(.ReadError(.Unknown));
|
||||
}
|
||||
}
|
||||
return .Err(.ReadError(.Unknown));
|
||||
}
|
||||
public abstract Result<int> TryWrite(Span<uint8> data);
|
||||
public abstract Result<void> Close();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue