B:BD[
5.567504] → [
4.53082:53161]
∅:D[
3.16215] → [
5.567580:567726]
∅:D[
4.53161] → [
5.567580:567726]
B:BD[
5.567580] → [
5.567580:567726]
B:BD[
5.567726] → [
2.90650:90732]
∅:D[
2.90732] → [
5.567915:567992]
B:BD[
5.567915] → [
5.567915:567992]
fn drop_channel(&mut self, name: &str) -> Result<bool, Self::GraphError> {
let name = SmallString::from_str(name);
self.open_channels.borrow_mut().remove(&name);
debug!("drop_channel {:?}", name);
let result = btree::del(&mut self.txn, &mut self.channels, &name, None)?;
debug!("/drop_channel {:?}: {:?}", name, result);
Ok(result)
fn drop_channel(&mut self, name0: &str) -> Result<bool, Self::GraphError> {
let name = SmallString::from_str(name0);
let channel = if let Some(channel) = self.open_channels.borrow_mut().remove(&name) {
let channel = Rc::try_unwrap(channel.r)
.map_err(|_| SanakirjaError::ChannelRc { c: name0.to_string() })?
.into_inner();
Some((
channel.graph,
channel.changes,
channel.revchanges,
channel.states,
))
} else if let Some((name_, chan)) = btree::get(&self.txn, &self.channels, &name, None)? {
if name_ == name.as_ref() {
Some((
Db::from_page(chan.0[0].into()),
Db::from_page(chan.0[1].into()),
UDb::from_page(chan.0[2].into()),
UDb::from_page(chan.0[3].into()),
))
} else {
None
}
} else {
None
};
if let Some((a, b, c, d)) = channel {
btree::drop(&mut self.txn, a)?;
btree::drop(&mut self.txn, b)?;
btree::drop(&mut self.txn, c)?;
btree::drop(&mut self.txn, d)?;
}
Ok(btree::del(&mut self.txn, &mut self.channels, &name, None)?)