Skip to content

Commit 8e83e4b

Browse files
committed
Rename blocking SPI trait methods try_*
1 parent 436908e commit 8e83e4b

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/blocking/spi.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ pub trait Transfer<W> {
66
type Error;
77

88
/// Sends `words` to the slave. Returns the `words` received from the slave
9-
fn transfer<'w>(&mut self, words: &'w mut [W]) -> Result<&'w [W], Self::Error>;
9+
fn try_transfer<'w>(&mut self, words: &'w mut [W]) -> Result<&'w [W], Self::Error>;
1010
}
1111

1212
/// Blocking write
@@ -15,7 +15,7 @@ pub trait Write<W> {
1515
type Error;
1616

1717
/// Sends `words` to the slave, ignoring all the incoming words
18-
fn write(&mut self, words: &[W]) -> Result<(), Self::Error>;
18+
fn try_write(&mut self, words: &[W]) -> Result<(), Self::Error>;
1919
}
2020

2121
/// Blocking write (iterator version)
@@ -25,7 +25,7 @@ pub trait WriteIter<W> {
2525
type Error;
2626

2727
/// Sends `words` to the slave, ignoring all the incoming words
28-
fn write_iter<WI>(&mut self, words: WI) -> Result<(), Self::Error>
28+
fn try_write_iter<WI>(&mut self, words: WI) -> Result<(), Self::Error>
2929
where
3030
WI: IntoIterator<Item = W>;
3131
}
@@ -43,7 +43,7 @@ pub mod transfer {
4343
{
4444
type Error = S::Error;
4545

46-
fn transfer<'w>(&mut self, words: &'w mut [W]) -> Result<&'w [W], S::Error> {
46+
fn try_transfer<'w>(&mut self, words: &'w mut [W]) -> Result<&'w [W], S::Error> {
4747
for word in words.iter_mut() {
4848
block!(self.send(word.clone()))?;
4949
*word = block!(self.read())?;
@@ -66,7 +66,7 @@ pub mod write {
6666
{
6767
type Error = S::Error;
6868

69-
fn write(&mut self, words: &[W]) -> Result<(), S::Error> {
69+
fn try_write(&mut self, words: &[W]) -> Result<(), S::Error> {
7070
for word in words {
7171
block!(self.send(word.clone()))?;
7272
block!(self.read())?;
@@ -91,7 +91,7 @@ pub mod write_iter {
9191
{
9292
type Error = S::Error;
9393

94-
fn write_iter<WI>(&mut self, words: WI) -> Result<(), S::Error>
94+
fn try_write_iter<WI>(&mut self, words: WI) -> Result<(), S::Error>
9595
where
9696
WI: IntoIterator<Item = W>,
9797
{

0 commit comments

Comments
 (0)