# ReadScope

# ReadScope

Artifact:[androidx.datastore:datastore-core](https://developer.android.com/jetpack/androidx/releases/datastore)  
[View Source](https://cs.android.com/search?q=file:androidx/datastore/core/StorageConnection.kt+class:androidx.datastore.core.ReadScope)  
Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/datastore#1.1.0)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/datastore/core/ReadScope "View this page in Java")
Common/AllAndroid/JVMNative/C/iOSJavaScript
  - Cmn  

  ```
  interface ReadScope<T : Any?> : Closeable
```  
Known direct subclasses  
[WriteScope](https://developer.android.com/reference/kotlin/androidx/datastore/core/WriteScope)  

|-------------------------------------------------------------------------------------------------|-----------------------------------------|
| [WriteScope](https://developer.android.com/reference/kotlin/androidx/datastore/core/WriteScope) | The scope used for a write transaction. |

*** ** * ** ***

The scope used for a read transaction.

## Summary

| ### Public functions |
|----------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------|-----|
| `suspend T`          | [readData](https://developer.android.com/reference/kotlin/androidx/datastore/core/ReadScope#readData())`()` Read the datafrom the underlying storage. | Cmn |

|                                                                                                                                                                                                                                                                                 ### Inherited functions                                                                                                                                                                                                                                                                                 |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| From[androidx.datastore.core.Closeable](https://developer.android.com/reference/kotlin/androidx/datastore/core/Closeable) |-------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------|-----| | [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [close](https://developer.android.com/reference/kotlin/androidx/datastore/core/Closeable#close())`()` Closes the specified resource. | Cmn | |

## Public functions

### readData

Cmn  

```
suspend fun readData(): T
```

Read the datafrom the underlying storage.